diff --git a/htdocs/api/class/api_status.class.php b/htdocs/api/class/api_status.class.php index 899bd1b40aa..f6cf09e289f 100644 --- a/htdocs/api/class/api_status.class.php +++ b/htdocs/api/class/api_status.class.php @@ -1,5 +1,7 @@ +/* + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2023 Christian Foellmann * * 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 @@ -43,14 +45,23 @@ class Status extends DolibarrApi */ public function index() { - global $conf; + global $dolibarr_main_prod; - return array( + $response = array( 'success' => array( 'code' => 200, 'dolibarr_version' => DOL_VERSION, - 'access_locked' => (!getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED') ? '0' : $conf->global->MAIN_ONLY_LOGIN_ALLOWED), + 'access_locked' => getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED', '0'), ), ); + + if (empty($dolibarr_main_prod)) { + $response['success']['environment'] = 'non-production'; + $response['success']['timestamp_now_utc'] = dol_now(); + $response['success']['timestamp_php_tz'] = date_default_timezone_get(); + $response['success']['date_tz'] = dol_print_date(dol_now('gmt'), 'standard'); + } + + return $response; } } diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php index a82b3ebe28d..b0518902a34 100644 --- a/htdocs/asset/accountancy_codes.php +++ b/htdocs/asset/accountancy_codes.php @@ -127,7 +127,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('Asset'), $help_url); +llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_accountancy'); if ($id > 0 || !empty($ref)) { $head = assetPrepareHead($object); diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 221c54f84ff..9d2fd0a3a53 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -131,7 +131,7 @@ if ($object->id > 0) { $title = $langs->trans("Agenda"); //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung'; - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index fad962338a9..d67e3f7043b 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -172,7 +172,7 @@ $formfile = new FormFile($db); $title = $langs->trans("Asset").' - '.$langs->trans("Card"); $help_url = ''; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card'); // Part to create if ($action == 'create') { diff --git a/htdocs/asset/depreciation.php b/htdocs/asset/depreciation.php index 7f24d1853ee..6c8659aad9c 100644 --- a/htdocs/asset/depreciation.php +++ b/htdocs/asset/depreciation.php @@ -97,7 +97,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('Asset'), $help_url); +llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_depreciation'); if ($id > 0 || !empty($ref)) { $head = assetPrepareHead($object); diff --git a/htdocs/asset/depreciation_options.php b/htdocs/asset/depreciation_options.php index 0796ff6010f..bc11e2196ed 100644 --- a/htdocs/asset/depreciation_options.php +++ b/htdocs/asset/depreciation_options.php @@ -133,7 +133,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('Asset'), $help_url); +llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_depreciation_options'); if ($id > 0 || !empty($ref)) { $head = assetPrepareHead($object); diff --git a/htdocs/asset/disposal.php b/htdocs/asset/disposal.php index a7f89f15a9a..98f07003db1 100644 --- a/htdocs/asset/disposal.php +++ b/htdocs/asset/disposal.php @@ -88,7 +88,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('Asset'), $help_url); +llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_disposal'); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 5a79de0d4e0..e6359b3a190 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -101,7 +101,7 @@ $form = new Form($db); $title = $langs->trans("Asset").' - '.$langs->trans("Files"); $help_url = ''; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_documents'); if ($object->id) { /* diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index e1f7272dd22..13e11efbefa 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -354,7 +354,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/asset/model/accountancy_codes.php b/htdocs/asset/model/accountancy_codes.php index db631f4785c..7e41aaf4288 100644 --- a/htdocs/asset/model/accountancy_codes.php +++ b/htdocs/asset/model/accountancy_codes.php @@ -131,7 +131,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('AssetModel'), $help_url); +llxHeader('', $langs->trans('AssetModel'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_accountancy'); if ($id > 0 || !empty($ref)) { $head = assetModelPrepareHead($object); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index c66ec0ae68e..19d3b7ef58d 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -137,7 +137,7 @@ if ($object->id > 0) { $title = $langs->trans("Agenda"); //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung'; - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index cfa78d07640..5aecdb93f54 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -144,7 +144,7 @@ $formfile = new FormFile($db); $title = $langs->trans("AssetModel") . ' - ' . $langs->trans("Card"); $help_url = ''; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card'); // Part to create if ($action == 'create') { diff --git a/htdocs/asset/model/depreciation_options.php b/htdocs/asset/model/depreciation_options.php index 5388dc206ed..89b85be1f04 100644 --- a/htdocs/asset/model/depreciation_options.php +++ b/htdocs/asset/model/depreciation_options.php @@ -133,7 +133,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('AssetModel'), $help_url); +llxHeader('', $langs->trans('AssetModel'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_depreciation_options'); if ($id > 0 || !empty($ref)) { $head = assetModelPrepareHead($object); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index fd2ad44f133..9b85eded84e 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -357,7 +357,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-model-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/asset/model/note.php b/htdocs/asset/model/note.php index e6d284e7fc8..984b3fb867b 100644 --- a/htdocs/asset/model/note.php +++ b/htdocs/asset/model/note.php @@ -93,7 +93,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('AssetModel'), $help_url); +llxHeader('', $langs->trans('AssetModel'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_notes'); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index 2fc3d091dc6..d2a89f96f0f 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -86,7 +86,7 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('Asset'), $help_url); +llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_notes'); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); diff --git a/htdocs/commande/agenda.php b/htdocs/commande/agenda.php index 00dffc78012..5cf1dd6c184 100644 --- a/htdocs/commande/agenda.php +++ b/htdocs/commande/agenda.php @@ -128,7 +128,7 @@ if ($object->id > 0) { $title = $langs->trans("Agenda"); //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung'; - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 6d1821472c0..1f8e46b06cf 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1646,7 +1646,7 @@ if ($action == 'create') { } $help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card'); $form = new Form($db); $formfile = new FormFile($db); @@ -2916,7 +2916,7 @@ if ($action == 'create' && $usercancreate) { $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); if (empty($reshook)) { // Reopen a closed order - if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) { + if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate && (!$object->billed || !getDolGlobalInt('ORDER_DONT_REOPEN_BILLED'))) { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 1d800e1eaca..c29aae6e44a 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -127,7 +127,7 @@ if ($id > 0 || !empty($ref)) { $title = $object->ref." - ".$langs->trans('ContactsAddresses'); $help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge'; - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_contact'); $head = commande_prepare_head($object); print dol_get_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index c354e9f34ec..d5f179bf225 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -100,7 +100,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $object->ref." - ".$langs->trans('Documents'); $help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_documents'); $form = new Form($db); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 962fbf318b5..bc106bef635 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1170,7 +1170,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index edcd2a14f16..368a8333317 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -83,7 +83,7 @@ if (empty($reshook)) { */ $title = $object->ref." - ".$langs->trans('Notes'); $help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_notes'); $form = new Form($db); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 702ee59d5e9..b1c4a814fc0 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -101,7 +101,7 @@ if ($mode == 'supplier') { $dir = $conf->fournisseur->commande->dir_temp; } -llxHeader('', $title); +llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-order page-stats'); print load_fiche_titre($title, '', $picto); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index c28be51a0c8..0612f3e357f 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -71,14 +71,6 @@ if ($user->socid) { $socid = $user->socid; } -$allowed = 0; -if ($user->hasRight('accounting', 'chartofaccount')) { - $allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account -} -if (!$allowed) { - $result = restrictedArea($user, 'banque'); -} - $diroutputmassaction = $conf->bank->dir_output.'/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -137,6 +129,15 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $permissiontoadd = $user->rights->banque->modifier; $permissiontodelete = $user->rights->banque->configurer; +$allowed = 0; +if ($user->hasRight('accounting', 'chartofaccount')) { + $allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account +} +if (!$allowed) { + $result = restrictedArea($user, 'banque'); +} + + /* * Actions */ @@ -181,10 +182,14 @@ if (empty($reshook)) { $form = new FormCategory($db); $title = $langs->trans('BankAccounts'); +$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas'; // Load array of financial accounts (opened by default) $accounts = array(); + +// Build and execute select +// -------------------------------------------------------------------- $sql = "SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.currency_code, b.datec as date_creation, b.tms as date_update"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -196,6 +201,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); $sqlfields = $sql; // $sql fields to remove for count total @@ -270,13 +276,14 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } $db->free($resql); } +// Complete request and execute it with limit $sql .= $db->order($sortfield, $sortorder); if ($limit) { $sql .= $db->plimit($limit + 1, $offset); @@ -298,8 +305,6 @@ if ($resql) { -$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas'; - llxHeader('', $title, $help_url); @@ -315,6 +320,9 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} if ($search_ref != '') { $param .= '&search_ref='.urlencode($search_ref); } @@ -330,9 +338,6 @@ if ($search_status != '') { if ($show_files) { $param .= '&show_files='.urlencode($show_files); } -if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); -} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks @@ -345,7 +350,7 @@ $arrayofmassactions = array( // 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), // 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -if ($permissiontodelete) { +if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (isModEnabled('category') && $user->hasRight('banque', 'modifier')) { @@ -365,9 +370,9 @@ print ''; print ''; print ''; -print ''; - print ''; +print ''; +print ''; print ''; print ''; @@ -411,11 +416,14 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print '
'; } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table @@ -426,7 +434,7 @@ print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; @@ -507,7 +515,7 @@ if (!empty($arrayfields['balance']['checked'])) { } // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; @@ -520,6 +528,7 @@ $totalarray['nbfield'] = 0; // Fields title label // -------------------------------------------------------------------- print ''; +// Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); $totalarray['nbfield']++; @@ -578,20 +587,23 @@ if (!empty($arrayfields['balance']['checked'])) { print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; } +// Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); $totalarray['nbfield']++; } -print "\n"; +print ''."\n"; +// Loop on record +// -------------------------------------------------------------------- +$i = 0; $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val'] = array('balance'=>0); $total = array(); $found = 0; -$i = 0; $lastcurrencycode = ''; $imaxinloop = ($limit ? min($num, $limit) : $num); @@ -619,13 +631,24 @@ foreach ($accounts as $key => $type) { print '
'; } // Output Kanban - print $objecttmp->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + } + //print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => $selected)); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; } } else { - print ''; + // Show line of result + $j = 0; + print ''; + // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Ref if (!empty($arrayfields['b.ref']['checked'])) { @@ -830,12 +856,12 @@ foreach ($accounts as $key => $type) { print ''; } print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } - print ''; + print ''."\n"; if (empty($total[$objecttmp->currency_code])) { $total[$objecttmp->currency_code] = $solde; @@ -863,10 +889,10 @@ if ($lastcurrencycode != 'various') { // If there is several currency, $lastcurr include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; } -print '
'; + print ''; $searchpicto = $form->showFilterButtons('left'); print $searchpicto; print ''; + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'; @@ -637,6 +660,9 @@ foreach ($accounts as $key => $type) { print ''; } print '
'; -print "
"; +print ''."\n"; +print ''."\n"; -print ""; +print ''."\n"; // End of page llxFooter(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eff88cf20c4..8f2db7f796a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4304,13 +4304,19 @@ class Form * @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) + * @param int $noprint if set to one we return the html to print, if 0 (default) we print it * @return void * @deprecated */ - public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) + public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0) { // phpcs:enable - print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent); + $out = $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent); + if (empty($noprint)) { + print $out; + } else { + return $out; + } } diff --git a/htdocs/core/lib/profid.lib.php b/htdocs/core/lib/profid.lib.php new file mode 100644 index 00000000000..51fd9bf35d3 --- /dev/null +++ b/htdocs/core/lib/profid.lib.php @@ -0,0 +1,58 @@ + + * Copyright (C) 2022 Frédéric France + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file htdocs/core/lib/profid.lib.php + * \brief Set of functions for professional identifiers + */ + + +/** + * Check the validity of a SIREN. + * + * @param string $siren SIREN to check + * @return boolean True if valid, False otherwise + */ +function isValidSiren($siren) +{ + $siren = trim($siren); + $siren = preg_replace('/(\s)/', '', $siren); + + if (!is_numeric($siren) || dol_strlen($siren) != 9) { + return false; + } + + // we take each figure one by one and: + // - if its index is odd then we double its value, + // - if the latter is higher than 9 then we substract 9 from it, + // - anf finally we add the result to the overall sum. + $sum = 0; + for ($index = 0; $index < 9; $index++) { + $number = (int) $siren[$index]; + if (($index % 2) != 0) { + if (($number *= 2) > 9) { + $number -= 9; + } + } + $sum += $number; + } + + // the siren is valid if the sum is a multiple of 10 + return (($sum % 10) == 0) ? true : false; +} diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 4a71abe85bc..d1261c96dcc 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -496,8 +496,8 @@ print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortord print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder); //print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50'); -print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50 '); +print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center tdoverflowmax100 '); print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("CronLastOutput", $_SERVER["PHP_SELF"], "t.lastoutput", "", $param, '', $sortfield, $sortorder); @@ -684,7 +684,7 @@ if ($num > 0) { print ''; // Next run date - print ''; + print ''; if (!empty($obj->datenextrun)) { $datenextrun = $db->jdate($obj->datenextrun); if (empty($obj->status)) { diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 89f03fde211..5a09ccd8f6b 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -173,7 +173,9 @@ if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } -llxHeader('', $langs->trans("DonationsSetup"), 'DonConfiguration'); +$help_url = ''; +llxHeader('', $langs->trans("DonationsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-admin'); + $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/don/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php index a0454ea08d7..ef2c011d9cf 100644 --- a/htdocs/don/admin/donation_extrafields.php +++ b/htdocs/don/admin/donation_extrafields.php @@ -63,7 +63,8 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("Donations"); -llxHeader('', $langs->trans("DonationsSetup")); +$help_url = ''; +llxHeader('', $langs->trans("DonationsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-admin_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index b4d72e29738..2ccfafae0f1 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -391,7 +391,7 @@ $title = $langs->trans("Donation"); $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:Modul_Spenden'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card'); $form = new Form($db); $formfile = new FormFile($db); diff --git a/htdocs/don/document.php b/htdocs/don/document.php index fd40fea0594..6931f12d744 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -111,7 +111,7 @@ $title = $langs->trans('Donation')." - ".$langs->trans('Documents'); $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:Modul_Spenden'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card_documents'); if ($object->id) { diff --git a/htdocs/don/index.php b/htdocs/don/index.php index f09d6437dae..d817dd98428 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -56,7 +56,7 @@ $donstatic = new Don($db); $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:Modul_Spenden'; -llxHeader('', $langs->trans("Donations"), $help_url); +llxHeader('', $langs->trans("Donations"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-index'); $nb = array(); $somme = array(); diff --git a/htdocs/don/info.php b/htdocs/don/info.php index bf7d9e3d350..a2f9438eb33 100644 --- a/htdocs/don/info.php +++ b/htdocs/don/info.php @@ -69,7 +69,7 @@ $title = $langs->trans('Donation')." - ".$langs->trans('Info'); $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:Modul_Spenden'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card_info'); $form = new Form($db); if (isModEnabled('project')) { diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 12fd413f0de..c076268bce8 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -208,7 +208,7 @@ if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sea // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-list'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll // Example : Adding jquery code // print '