From bac3c364360933a8914f1dfa1487fc05339ab274 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Aug 2023 13:47:00 +0200 Subject: [PATCH 1/8] Fix warning --- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index ac19a73045c..9d96e51fae6 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -519,7 +519,7 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array('type'=>$type); + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; From 3a384be0c217110b6f60f5fabc95722384c912ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2023 19:27:16 +0200 Subject: [PATCH 2/8] FIX Export when old file export_csv.modules.php --- htdocs/core/modules/export/export_csviso.modules.php | 2 +- htdocs/core/modules/export/export_csvutf8.modules.php | 4 ++-- .../export/{exportcsv.modules.php => exportcsv.class.php} | 2 +- htdocs/core/modules/export/modules_export.php | 4 ++++ htdocs/install/upgrade2.php | 2 ++ 5 files changed, 10 insertions(+), 4 deletions(-) rename htdocs/core/modules/export/{exportcsv.modules.php => exportcsv.class.php} (99%) diff --git a/htdocs/core/modules/export/export_csviso.modules.php b/htdocs/core/modules/export/export_csviso.modules.php index 4e12c32f66c..d9976031686 100644 --- a/htdocs/core/modules/export/export_csviso.modules.php +++ b/htdocs/core/modules/export/export_csviso.modules.php @@ -21,7 +21,7 @@ * \brief File of class to build exports with CSV format */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/export/exportcsv.modules.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/export/exportcsv.class.php'; // avoid timeout for big export set_time_limit(0); diff --git a/htdocs/core/modules/export/export_csvutf8.modules.php b/htdocs/core/modules/export/export_csvutf8.modules.php index a98f3f5f7f8..3fcf1db669c 100644 --- a/htdocs/core/modules/export/export_csvutf8.modules.php +++ b/htdocs/core/modules/export/export_csvutf8.modules.php @@ -16,12 +16,12 @@ */ /** - * \file htdocs/core/modules/export/export_csv.modules.php + * \file htdocs/core/modules/export/exportcsv.class.php * \ingroup export * \brief File of class to build exports with CSV format */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/export/exportcsv.modules.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/export/exportcsv.class.php'; // avoid timeout for big export set_time_limit(0); diff --git a/htdocs/core/modules/export/exportcsv.modules.php b/htdocs/core/modules/export/exportcsv.class.php similarity index 99% rename from htdocs/core/modules/export/exportcsv.modules.php rename to htdocs/core/modules/export/exportcsv.class.php index fd96bf468f3..674bbe71a9c 100644 --- a/htdocs/core/modules/export/exportcsv.modules.php +++ b/htdocs/core/modules/export/exportcsv.class.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/core/modules/export/exportcsv.modules.php + * \file htdocs/core/modules/export/exportcsv.class.php * \ingroup export * \brief File of class to build exports with CSV format */ diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index 0cad4f76509..dc96e526130 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -62,8 +62,12 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac $i = 0; if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { + $reg = array(); if (preg_match("/^export_(.*)\.modules\.php$/i", $file, $reg)) { $moduleid = $reg[1]; + if ($moduleid == 'csv') { + continue; // This may happen if on old file export_csv.modules.php was not correctly deleted + } // Loading Class $file = $dir."export_".$moduleid.".modules.php"; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 0dadc7cb485..b9544de7f24 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4133,6 +4133,8 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/facture/pdf_crabe.modules.php', '/core/modules/facture/pdf_oursin.modules.php', '/core/modules/export/export_excel.modules.php', + '/core/modules/export/export_csv.modules.php', + '/core/modules/export/exportcsv.modules.php', '/core/modules/export/export_excel2007new.modules.php', '/core/boxes/box_members.php', From 106e4b95b8f9ad5a72712f3865271a2e2f1e2b10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2023 19:29:26 +0200 Subject: [PATCH 3/8] Prepare for 18.0.1 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 6db33208710..0070d587f01 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '18.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '18.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 6efcc795538c2d1b3f889497a4bb44c59020c737 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2023 21:30:53 +0200 Subject: [PATCH 4/8] css --- htdocs/product/card.php | 2 +- htdocs/projet/list.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3a4fb85416b..f70f35b0bed 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2057,7 +2057,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Default warehouse print ''.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); - print $formproduct->selectWarehouses((GETPOSTISSET('fk_default_warehouse') ? GETPOST('fk_default_warehouse') : $object->fk_default_warehouse), 'fk_default_warehouse', 'warehouseopen', 1); + print $formproduct->selectWarehouses((GETPOSTISSET('fk_default_warehouse') ? GETPOST('fk_default_warehouse') : $object->fk_default_warehouse), 'fk_default_warehouse', 'warehouseopen', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); print ' '; print ''; print ''; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 643c020cc50..985be60b138 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -992,12 +992,12 @@ $includeonly = ''; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); +$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= ''; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectsWithThisContact'); -$moreforfilter .= img_picto($tmptitle, 'contact', 'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact : '', 'search_project_contact', $tmptitle, '', '', 0, 'maxwidth250 widthcentpercentminusx'); +$moreforfilter .= img_picto($tmptitle, 'contact', 'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact : '', 'search_project_contact', $tmptitle, '', '', 0, 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= '
'; // If the user can view thirdparties other than his' @@ -1005,14 +1005,14 @@ if ($user->rights->user->user->lire) { $langs->load("commercial"); $moreforfilter .= '
'; $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250 widthcentpercentminusx'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= '
'; } // Filter on categories if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); - $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array, 'minwidth300imp widthcentpercentminusx'); + $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array, 'minwidth300imp minwidth300 widthcentpercentminusx'); } // Filter on customer categories if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST) && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { @@ -1021,7 +1021,7 @@ if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST) && isMo $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); $categoriesArr = $form->select_all_categories(Categorie::TYPE_CUSTOMER, '', '', 64, 0, 1); $categoriesArr[-2] = '- '.$langs->trans('NotCategorized').' -'; - $moreforfilter .= Form::multiselectarray('search_category_customer_list', $categoriesArr, $searchCategoryCustomerList, 0, 0, 'minwidth300', 0, 0, '', 'category', $tmptitle); + $moreforfilter .= Form::multiselectarray('search_category_customer_list', $categoriesArr, $searchCategoryCustomerList, 0, 0, 'minwidth300im minwidth300 widthcentpercentminusx', 0, 0, '', 'category', $tmptitle); $moreforfilter .= ' '; $moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories') . ' : ' . $tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_cus'); // Tooltip on click $moreforfilter .= ''; From 75d8c2c49afa5012e4a4aa56981e4dba810ad624 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2023 21:35:59 +0200 Subject: [PATCH 5/8] Fix warnings --- htdocs/projet/activity/perweek.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index daf1dd0ac7b..d5108333f6d 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -760,7 +760,11 @@ if (count($tasksarray) > 0) { $projectstatic->loadTimeSpent($firstdaytoshow, 0, $usertoprocess->id); // Load time spent from table element_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week for ($idw = 0; $idw < 7; $idw++) { $tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); - $totalforeachday[$tmpday] += $projectstatic->weekWorkLoad[$tmpday]; + if (empty($totalforeachday[$tmpday])) { + $totalforeachday[$tmpday] = empty($projectstatic->weekWorkLoad[$tmpday]) ? 0 : $projectstatic->weekWorkLoad[$tmpday]; + } else { + $totalforeachday[$tmpday] += empty($projectstatic->weekWorkLoad[$tmpday]) ? 0 : $projectstatic->weekWorkLoad[$tmpday]; + } } } From 6e7ca61b1f9d99ab416c33014535d3819e421cf6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2023 21:45:20 +0200 Subject: [PATCH 6/8] CSS --- htdocs/comm/propal/list.php | 2 +- htdocs/fourn/commande/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 97ea30f394d..93a2db80072 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1185,7 +1185,7 @@ if ($resql) { $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; - print ''."\n"; + print '
'."\n"; print ''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 58501c07246..22599d9eaba 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1332,7 +1332,7 @@ if ($resql) { } print '
'; - print '
'."\n"; + print '
'."\n"; print ''; // Action column From bb36521c3d27786d0f821c234763c588e91047ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2023 23:53:26 +0200 Subject: [PATCH 7/8] Fix warnings --- htdocs/admin/ihm.php | 2 +- htdocs/admin/modules.php | 4 ++-- htdocs/main.inc.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1026ea12442..44d2246b547 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -300,7 +300,7 @@ if ($action == 'update') { $_SESSION["mainmenu"] = ""; // The menu manager may have changed if (GETPOST('dol_resetcache')) { - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); } header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".'&mode='.$mode.(GETPOSTISSET('page_y') ? '&page_y='.GETPOST('page_y', 'int') : '')); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 51f05be23cb..9b5336a3ed5 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -258,7 +258,7 @@ if ($action == 'install') { if ($action == 'set' && $user->admin) { $resarray = activateModule($value); - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); if (!empty($resarray['errors'])) { setEventMessages('', $resarray['errors'], 'errors'); } else { @@ -282,7 +282,7 @@ if ($action == 'set' && $user->admin) { exit; } elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') { $result = unActivateModule($value); - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); if ($result) { setEventMessages($result, null, 'errors'); } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 79bfd9c9886..c44fafaf58f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1673,7 +1673,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } // Refresh value of MAIN_IHM_PARAMS_REV before forging the parameter line. if (GETPOST('dol_resetcache')) { - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); } $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id)).'&entity='.$conf->entity; From dcd751aa47d165e89de25c09ecc15b97ebc61ca3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2023 00:04:07 +0200 Subject: [PATCH 8/8] FIX fatal error with bad definition of dictionaries --- htdocs/admin/dict.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ac2a8a14528..3c536d7e310 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1674,6 +1674,9 @@ if ($id > 0) { } if (in_array($value, array('label', 'libelle', 'libelle_facture')) && empty($tabcomplete[$tabname[$id]]['help'][$value])) { + if (!is_array($tabcomplete[$tabname[$id]]['help'])) { // protection when $tabcomplete[$tabname[$id]]['help'] is a an empty string, we must force it into an array + $tabcomplete[$tabname[$id]]['help'] = array(); + } $tabcomplete[$tabname[$id]]['help'][$value] = $langs->trans('LabelUsedByDefault'); }