';
-
+
// Param
$label = $langs->trans($key);
print ' | ';
-
+
// Value
print '';
print '';
@@ -118,11 +139,11 @@ print ' ';
print '\n";
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index f94557ce0b0..973086e95b9 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -100,9 +100,11 @@ if (! empty($search_accountancy_code_end)) {
$options .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
}
+
/*
* Action
*/
+
if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$journal = 'bookkepping';
@@ -157,14 +159,26 @@ else {
print '';
print '';
- print '';
- print $langs->trans('DateStart') . ': ';
- print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
- print $langs->trans('DateEnd') . ': ';
- print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
- print ' ';
+ $moreforfilter='';
+
+ $moreforfilter.='';
+ $moreforfilter.=$langs->trans('DateStart') . ': ';
+ $moreforfilter.=$form->select_date($search_date_start, 'date_start', 0, 0, 1, '', 1, 0, 1);
+ $moreforfilter.=$langs->trans('DateEnd') . ': ';
+ $moreforfilter.=$form->select_date($search_date_end, 'date_end', 0, 0, 1, '', 1, 0, 1);
+ $moreforfilter.=' ';
- print '';
+ if (! empty($moreforfilter))
+ {
+ print '';
+ print $moreforfilter;
+ $parameters=array();
+ $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ print ' ';
+ }
+
+ print '';
print '';
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index f287c0ad9dd..6100e54c9a3 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -87,24 +87,8 @@ $formventilation = new FormVentilation($db);
$formother = new FormOther($db);
$form = new Form($db);
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
-{
- $search_mvt_num = '';
- $search_doc_type = '';
- $search_doc_ref = '';
- $search_doc_date = '';
- $search_accountancy_code = '';
- $search_accountancy_code_start = '';
- $search_accountancy_code_end = '';
- $search_accountancy_aux_code = '';
- $search_accountancy_aux_code_start = '';
- $search_accountancy_aux_code_end = '';
- $search_mvt_label = '';
- $search_direction = '';
- $search_ledger_code = '';
- $search_date_start = '';
- $search_date_end = '';
-}
+
+
if (empty($search_date_start)) {
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
@@ -178,9 +162,30 @@ if (! empty($search_mvt_num)) {
$options .= '&search_mvt_num=' . $search_mvt_num;
}
+
/*
* Action
*/
+
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+{
+ $search_mvt_num = '';
+ $search_doc_type = '';
+ $search_doc_ref = '';
+ $search_doc_date = '';
+ $search_accountancy_code = '';
+ $search_accountancy_code_start = '';
+ $search_accountancy_code_end = '';
+ $search_accountancy_aux_code = '';
+ $search_accountancy_aux_code_start = '';
+ $search_accountancy_aux_code_end = '';
+ $search_mvt_label = '';
+ $search_direction = '';
+ $search_ledger_code = '';
+ $search_date_start = '';
+ $search_date_end = '';
+}
+
if ($action == 'delbookkeeping') {
$import_key = GETPOST('importkey', 'alpha');
@@ -193,7 +198,8 @@ if ($action == 'delbookkeeping') {
Header("Location: list.php");
exit();
}
-} elseif ($action == 'delbookkeepingyearconfirm') {
+}
+if ($action == 'delbookkeepingyearconfirm') {
$delyear = GETPOST('delyear', 'int');
@@ -205,7 +211,8 @@ if ($action == 'delbookkeeping') {
Header("Location: list.php");
exit();
}
-} elseif ($action == 'delmouvconfirm') {
+}
+if ($action == 'delmouvconfirm') {
$mvt_num = GETPOST('mvt_num', 'int');
@@ -217,7 +224,8 @@ if ($action == 'delbookkeeping') {
Header("Location: list.php");
exit();
}
-} elseif ($action == 'export_csv') {
+}
+if ($action == 'export_csv') {
include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
@@ -311,168 +319,166 @@ if ($action == 'delbookkeeping') {
print "\n";
}
}
+
+ exit;
}
/*
* View
*/
-else {
- $title_page = $langs->trans("Bookkeeping") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
+$title_page = $langs->trans("Bookkeeping") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
- llxHeader('', $title_page);
+llxHeader('', $title_page);
- /*
- * List
- */
+// List
- $nbtotalofrecords = 0;
- if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
- $nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
- if ($nbtotalofrecords < 0) {
- setEventMessages($object->error, $object->errors, 'errors');
- }
- }
-
- $result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter);
- if ($result < 0) {
+$nbtotalofrecords = 0;
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
+ $nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
+ if ($nbtotalofrecords < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
-
- if ($action == 'delmouv') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1);
- print $formconfirm;
- }
- if ($action == 'delbookkeepingyear') {
-
- $form_question = array ();
- $delyear = GETPOST('delyear');
-
- if (empty($delyear)) {
- $delyear = dol_print_date(dol_now(), '%Y');
- }
- $year_array = $formventilation->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
-
- $form_question['delyear'] = array (
- 'name' => 'delyear',
- 'type' => 'select',
- 'label' => $langs->trans('DelYear'),
- 'values' => $year_array,
- 'default' => $delyear
- );
-
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
- print $formconfirm;
- }
-
- print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords);
-
- print '';
-
- llxFooter();
}
+$result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter);
+if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+}
+
+if ($action == 'delmouv') {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1);
+ print $formconfirm;
+}
+if ($action == 'delbookkeepingyear') {
+
+ $form_question = array ();
+ $delyear = GETPOST('delyear');
+
+ if (empty($delyear)) {
+ $delyear = dol_print_date(dol_now(), '%Y');
+ }
+ $year_array = $formventilation->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
+
+ $form_question['delyear'] = array (
+ 'name' => 'delyear',
+ 'type' => 'select',
+ 'label' => $langs->trans('DelYear'),
+ 'values' => $year_array,
+ 'default' => $delyear
+ );
+
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
+ print $formconfirm;
+}
+
+print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords);
+
+print '';
+
+llxFooter();
+
+
$db->close();
\ No newline at end of file
diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php
index 37f843ec5a6..e3ae592a47f 100644
--- a/htdocs/accountancy/class/html.formventilation.class.php
+++ b/htdocs/accountancy/class/html.formventilation.class.php
@@ -123,7 +123,7 @@ class FormVentilation extends Form
$options[$select_value_out] = $label;
}
- $out .= Form::selectarray($htmlname, $options, $selected, $showempty);
+ $out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
$this->db->free($resql);
return $out;
}
@@ -264,7 +264,7 @@ class FormVentilation extends Form
// Build select
$out = ajax_combobox($htmlname, $event);
- $out .= Form::selectarray($htmlname, $aux_account, $selectid, $showempty);
+ $out .= Form::selectarray($htmlname, $aux_account, $selectid, $showempty, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
return $out;
}
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index 3a5b54519a8..4a892f909e5 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -59,7 +59,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index 31290318742..1f597ffeddc 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -308,7 +308,7 @@ if ($resql)
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("ActionsOwnedBy"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre("");
print " \n";
diff --git a/htdocs/core/js/select2_locale.js.php b/htdocs/core/js/select2_locale.js.php
index 660b41820df..31c6a91bc74 100644
--- a/htdocs/core/js/select2_locale.js.php
+++ b/htdocs/core/js/select2_locale.js.php
@@ -52,7 +52,10 @@ else header('Cache-Control: no-cache');
$.fn.select2.locales['xx'] = {
formatMatches: function (matches) { return matches + " trans("Select2ResultFoundUseArrows")); ?>"; },
formatNoMatches: function () { return "trans("Select2NotFound")); ?>"; },
- formatInputTooShort: function (input, min) { var n = min - input.length; return "trans("Select2Enter")); ?> " + n + " trans("Select2MoreCharacters")); ?>"; },
+ formatInputTooShort: function (input, min) { var n = min - input.length;
+ if (n > 1) return "trans("Select2Enter")); ?> " + n + " trans("Select2MoreCharacters")); ?>";
+ else return "trans("Select2Enter")); ?> " + n + " trans("Select2MoreCharacter")); ?>"
+ },
formatLoadMore: function (pageNumber) { return "trans("Select2LoadingMoreResults")); ?>"; },
formatSearching: function () { return "trans("Select2SearchInProgress")); ?>"; }
};
diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php
index 7a73861e71f..773e68913f9 100644
--- a/htdocs/core/lib/accounting.lib.php
+++ b/htdocs/core/lib/accounting.lib.php
@@ -37,26 +37,26 @@ function admin_accounting_prepare_head(AccountingAccount $object=null)
$head = array ();
$head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1);
- $head[$h][1] = $langs->trans("Configuration");
+ $head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h ++;
- // Show more tabs from modules
- // Entries must be declared in modules descriptor with line
- // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
- // $this->tabs = array('entity:-tabname); to remove a tab
- complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
-
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/journal.php';
$head[$h][1] = $langs->trans("Journaux");
$head[$h][2] = 'journal';
$h ++;
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/export.php';
- $head[$h][1] = $langs->trans("Export");
+ $head[$h][1] = $langs->trans("ExportOptions");
$head[$h][2] = 'export';
$h ++;
+ // Show more tabs from modules
+ // Entries must be declared in modules descriptor with line
+ // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
+
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove');
return $head;
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index d103bcf84df..98b281d04dd 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -26,7 +26,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup" && $conf->accounting->enabled', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
@@ -235,6 +234,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__);
-- Admin
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'home', '', 2400__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy', 'Chartofaccounts', 1, 'admin', '$user->rights->accounting->chartofaccount', '', 0, 25, __ENTITY__);
+ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup" && $conf->accounting->enabled', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 4, __ENTITY__);
-- Rapports compta simple
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 2fc166e7625..1ce08a25bba 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -526,11 +526,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1);
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1);
- if (! empty($conf->accounting->enabled))
- {
- $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=home", $langs->trans("Fiscalyear"),1);
- }
-
$newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
$newmenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"),1);
$newmenu->add("/admin/delais.php?mainmenu=home",$langs->trans("Alerts"),1);
@@ -1007,8 +1002,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// Admin
$langs->load("admin");
- if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Fiscalyear"),1,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount');
+ if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Fiscalyear"),1,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
}
// Accountancy (simple)
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index f20cf663b2c..03b450aa275 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Alexandre Spangaro
* Copyright (C) 2014 Ari Elbaz (elarifr)
* Copyright (C) 2014 Florian Henry
+ * Copyright (C) 2016 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,7 +51,7 @@ class modAccounting extends DolibarrModules
$this->description = "Advanced accounting management";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'development';
+ $this->version = 'experimental';
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
$this->special = 0;
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index a01e0c6c412..d4b651b46b5 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -8,6 +8,7 @@ Calendar=Calendar
Calendars=Calendars
LocalAgenda=Internal calendar
ActionsOwnedBy=Event owned by
+ActionsOwnedByShort=Owner
AffectedTo=Assigned to
DoneBy=Done by
Event=Event
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 90ccde2474a..75023bf9184 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -784,6 +784,7 @@ SetRef=Set ref
Select2ResultFoundUseArrows=
Select2NotFound=No result found
Select2Enter=Enter
+Select2MoreCharacter=or more character
Select2MoreCharacters=or more characters
Select2LoadingMoreResults=Loading more results...
Select2SearchInProgress=Search in progress...
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index ce941a680c7..b1c69268325 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -84,14 +84,14 @@ if (empty($reshook))
if ($action == 'close')
{
$object->status = Opensurveysondage::STATUS_CLOSED;
- $object->update();
+ $object->update($user);
}
// Reopend
if ($action == 'reopen')
{
$object->status = Opensurveysondage::STATUS_VALIDATED;
- $object->update();
+ $object->update($user);
}
// Update
diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php
index fecb7904a9c..02952f4bf75 100644
--- a/htdocs/opensurvey/class/opensurveysondage.class.php
+++ b/htdocs/opensurvey/class/opensurveysondage.class.php
@@ -275,7 +275,7 @@ class Opensurveysondage extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=null, $notrigger=0)
+ function update($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 86a11f57541..e8b32f978cb 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -2897,7 +2897,7 @@ class Product extends CommonObject
}
/**
- * reconstruit l'arborescence des categories sous la forme d'un tableau
+ * reconstruit l'arborescence des produits sous la forme d'un tableau
*
* @param int $multiply Because each sublevel must be multiplicated by parent nb
* @return array $this->res
@@ -2940,7 +2940,6 @@ class Product extends CommonObject
* Return all Father products fo current product
*
* @return array Array of product
- * @see getParent
*/
function getFather()
{
@@ -2985,6 +2984,8 @@ class Product extends CommonObject
*/
function getChildsArbo($id, $firstlevelonly=0, $level=1)
{
+ global $alreadyfound;
+
$sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type, pa.incdec";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= ", ".MAIN_DB_PREFIX."product_association as pa";
@@ -2994,6 +2995,7 @@ class Product extends CommonObject
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level, LOG_DEBUG);
+ if ($level == 1) $alreadyfound=array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly
// Protection against infinite loop
if ($level > 30) return array();
@@ -3003,9 +3005,14 @@ class Product extends CommonObject
$prods = array();
while ($rec = $this->db->fetch_array($res))
{
- // TODO Add check to not add ne record if already added
+ if (! empty($alreadyfound[$rec['rowid']]))
+ {
+ dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING);
+ continue;
+ }
+ $alreadyfound[$rec['rowid']]=1;
$prods[$rec['rowid']]= array(
- 0=>$rec['id'],
+ 0=>$rec['rowid'],
1=>$rec['qty'],
2=>$rec['fk_product_type'],
3=>$this->db->escape($rec['label']),
@@ -3015,7 +3022,7 @@ class Product extends CommonObject
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']);
if (empty($firstlevelonly))
{
- $listofchilds=$this->getChildsArbo($rec['id'], 0, $level + 1);
+ $listofchilds=$this->getChildsArbo($rec['rowid'], 0, $level + 1);
foreach($listofchilds as $keyChild => $valueChild)
{
$prods[$rec['rowid']]['childs'][$keyChild] = $valueChild;
@@ -3040,16 +3047,11 @@ class Product extends CommonObject
*/
function get_sousproduits_arbo()
{
- //$parent = $this->getParent();
$parent=array();
- $parent[$this->label]=array(0 => $this->id);
- foreach($parent as $key => $value) // key=label, value[0]=id
+ foreach($this->getChildsArbo($this->id) as $keyChild => $valueChild) // Warning. getChildsArbo can call getChildsArbo recursively. Starting point is $value[0]=id of product
{
- foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) // Warning. getChildsArbo can gell getChildsArbo recursively.
- {
- $parent[$key][$keyChild] = $valueChild;
- }
+ $parent[$this->label][$keyChild] = $valueChild;
}
foreach($parent as $key => $value) // key=label, value is array of childs
{
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 25195f6c167..adfce7d6229 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -235,8 +235,9 @@ if ($id > 0 || ! empty($ref))
$prodsfather = $object->getFather(); // Parent Products
- $object->get_sousproduits_arbo(); // Load $object->sousprod
- $prods_arbo=$object->get_arbo_each_prod();
+ $object->get_sousproduits_arbo(); // Load $object->sousprods
+ $prods_arbo=$object->get_arbo_each_prod();
+
$nbofsubsubproducts=count($prods_arbo); // This include sub sub product into nb
$prodschild = $object->getChildsArbo($id,1);
$nbofsubproducts=count($prodschild); // This include only first level of childs
@@ -379,10 +380,10 @@ if ($id > 0 || ! empty($ref))
print ''."\n";
}
- else // By default, we do not show this. It makes screen very difficult to understand
+ else
{
$hide='';
- if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide=' hideobject';
+ if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide=' hideobject'; // By default, we do not show this. It makes screen very difficult to understand
$class=($class=='impair')?'pair':'impair';
print '';
@@ -394,9 +395,13 @@ if ($id > 0 || ! empty($ref))
print $productstatic->getNomUrl(1,'composition').'';
print '| '.$productstatic->label.' | ';
+ // Best buying price
print ' | ';
print ' | ';
-
+ // Best selling price
+ print ' | ';
+ print ' | ';
+
if (! empty($conf->stock->enabled)) print ' | '; // Real stock
print ''.$value['nb'].' | ';
print ' | ';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 1d63964be1c..d8adf66bcc1 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -145,7 +145,7 @@ $arrayfields=array(
'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))),
'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))),
- 'p.sellprice'=>array('label'=>$titlesellprice, 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
+ 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
@@ -425,7 +425,7 @@ else
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
+
print '';
print '';
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder);
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index a3465480b24..e330e9d8b75 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -267,19 +267,16 @@ if ($resql)
print_liste_field_titre($langs->trans("StockLimit"), $_SERVER["PHP_SELF"], "p.seuil_stock_alerte",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DesiredStock"), $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder);
-
- /*
- * Details per warehouse
- */
-
- if($nb_warehouse>1) {
-
- foreach($warehouses_list as &$wh) {
- print_liste_field_titre($wh['label'], '', '','','','align="right"');
+ // Details per warehouse
+ if (! empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
+ {
+ if ($nb_warehouse>1) {
+ foreach($warehouses_list as &$wh) {
+ print_liste_field_titre($wh['label'], '', '','','','align="right"');
+ }
+
}
-
}
-
if ($virtualdiffersfromphysical) print_liste_field_titre($langs->trans("VirtualStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
@@ -309,8 +306,8 @@ if ($resql)
print '| | ';
print ' | ';
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons(0);
- print $searchpitco;
+ $searchpitco=$form->showFilterAndCheckAddButtons(0);
+ print $searchpitco;
print ' | ';
print ' ';
@@ -349,19 +346,17 @@ if ($resql)
print $objp->stock_physique;
print '';
- /*
- * Details per warehouse
- */
-
- if($nb_warehouse>1) {
-
- foreach($warehouses_list as &$wh) {
-
- print '';
- print empty($product->stock_warehouse[$wh['id']]->real) ? '0' : $product->stock_warehouse[$wh['id']]->real;
- print ' | ';
- }
-
+ // Details per warehouse
+ if (! empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
+ {
+ if($nb_warehouse>1) {
+ foreach($warehouses_list as &$wh) {
+
+ print '';
+ print empty($product->stock_warehouse[$wh['id']]->real) ? '0' : $product->stock_warehouse[$wh['id']]->real;
+ print ' | ';
+ }
+ }
}
|