From 05884f9b6ada00a42b04734405db1f84f22a917d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 18 Nov 2023 12:10:04 +0100 Subject: [PATCH 01/32] Fix : we can't use the reserved word offset (#26705) --- htdocs/expensereport/class/expensereport.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 73851690f05..737cb367404 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2603,7 +2603,7 @@ class ExpenseReport extends CommonObject //Clean $qty = price2num($qty); - $sql = " SELECT r.range_ik, t.ikoffset as offset, t.coef"; + $sql = " SELECT r.range_ik, t.ikoffset, t.coef"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_ik t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_exp_tax_range r ON r.rowid = t.fk_range"; $sql .= " WHERE t.fk_c_exp_tax_cat = ".(int) $fk_cat; @@ -2630,6 +2630,7 @@ class ExpenseReport extends CommonObject $obj = $this->db->fetch_object($resql); $cumulYearQty = $obj->cumul; } + $qty = $cumulYearQty + $qty; } @@ -2647,12 +2648,12 @@ class ExpenseReport extends CommonObject if ($i < ($num - 1)) { if ($qty > $ranges[$i]->range_ik && $qty < $ranges[$i+1]->range_ik) { $coef = $ranges[$i]->coef; - $offset = $ranges[$i]->offset; + $offset = $ranges[$i]->ikoffset; } } else { if ($qty > $ranges[$i]->range_ik) { $coef = $ranges[$i]->coef; - $offset = $ranges[$i]->offset; + $offset = $ranges[$i]->ikoffset; } } } From 4d0230a8d4cb08c1e61a2b202bff6f22424119da Mon Sep 17 00:00:00 2001 From: IC-Ilies <86972374+IC-Ilies@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:11:25 +0100 Subject: [PATCH 02/32] FIX#25399 (#26694) --- htdocs/mailmanspip/class/mailmanspip.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 9635c0e2c1f..63e094357d9 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; /** * Class to manage mailman and spip From 75a7d0de9b7efb8999de58712226e150973b1b7f Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 9 Oct 2023 19:52:21 +0200 Subject: [PATCH 03/32] fix shipping ref if already set (#26156) Co-authored-by: Christophe Battarel --- htdocs/expedition/class/expedition.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 869e44f1435..eaff6848ad8 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -733,6 +733,8 @@ class Expedition extends CommonObject // Define new ref if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life $numref = $this->getNextNumRef($soc); + } elseif (!empty($this->ref)) { + $numref = $this->ref; } else { $numref = "EXP".$this->id; } From ef1916f0db3241367fc4abb077599afdcaa8f42d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 18 Nov 2023 14:15:34 +0100 Subject: [PATCH 04/32] Fix : translated product desc was overwriting desc even if text was added after (#26687) --- htdocs/core/lib/pdf.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index bff1f1f92ee..3ac72e0d2c2 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1440,8 +1440,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } else { $textwasnotmodified = ($desc == $prodser->description); } - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasnotmodified || $translatealsoifmodified)) { - $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"]; + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"])) { + if ($textwasnotmodified) { + $desc = str_replace($prodser->description, $prodser->multilangs[$outputlangs->defaultlang]["description"], $desc); + } elseif ($translatealsoifmodified) { + $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"]; + } } // Set note From 564d930d3363cae8f8b9945cebf79957f5253899 Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:55:25 +0100 Subject: [PATCH 05/32] FIX escape HTML tags in return value of getFullName() (#26735) --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fd0e75bb0cf..5e676f2059f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -734,7 +734,7 @@ abstract class CommonObject $ret .= dolGetFirstLastname($firstname, $lastname, $nameorder); - return dol_trunc($ret, $maxlen); + return dol_escape_htmltag(dol_trunc($ret, $maxlen)); } /** From 181ee31c47dd484fe4a395960c7d7eadc4dcf0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Sun, 19 Nov 2023 00:08:49 +0100 Subject: [PATCH 06/32] doActions hook on update category (#26726) * doActions hook on update category * Update edit.php --- htdocs/categories/edit.php | 80 +++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index b21d0a1c27c..ec1c5048468 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -79,51 +79,59 @@ $error = 0; /* * Actions */ - -if ($cancel) { - if ($backtopage) { - header("Location: ".$backtopage); - exit; - } else { - header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); - exit; - } +$parameters = array('id' => $id, 'ref' => $ref, 'cancel'=> $cancel, 'backtopage' => $backtopage, 'socid' => $socid, 'label' => $label, 'description' => $description, 'color' => $color, 'visible' => $visible, 'parent' => $parent); +// Note that $action and $object may be modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -// Action mise a jour d'une categorie -if ($action == 'update' && $user->rights->categorie->creer) { - $object->oldcopy = dol_clone($object); - $object->label = $label; - $object->description = dol_htmlcleanlastbr($description); - $object->color = $color; - $object->socid = ($socid > 0 ? $socid : 0); - $object->visible = $visible; - $object->fk_parent = $parent != -1 ? $parent : 0; - - if (empty($object->label)) { - $error++; - $action = 'edit'; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); - } - if (!$error && empty($object->error)) { - $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); - if ($ret < 0) { - $error++; +if (empty($reshook)) { + if ($cancel) { + if ($backtopage) { + header("Location: ".$backtopage); + exit; + } else { + header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); + exit; } + } - if (!$error && $object->update($user) > 0) { - if ($backtopage) { - header("Location: ".$backtopage); - exit; + // Action mise a jour d'une categorie + if ($action == 'update' && $user->rights->categorie->creer) { + $object->oldcopy = dol_clone($object); + $object->label = $label; + $object->description = dol_htmlcleanlastbr($description); + $object->color = $color; + $object->socid = ($socid > 0 ? $socid : 0); + $object->visible = $visible; + $object->fk_parent = $parent != -1 ? $parent : 0; + + if (empty($object->label)) { + $error++; + $action = 'edit'; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); + } + if (!$error && empty($object->error)) { + $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); + if ($ret < 0) { + $error++; + } + + if (!$error && $object->update($user) > 0) { + if ($backtopage) { + header("Location: ".$backtopage); + exit; + } else { + header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); + exit; + } } else { - header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); - exit; + setEventMessages($object->error, $object->errors, 'errors'); } } else { setEventMessages($object->error, $object->errors, 'errors'); } - } else { - setEventMessages($object->error, $object->errors, 'errors'); } } From 1a6d8e304d463b826039396a46fac8898676f81f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 11:41:02 +0100 Subject: [PATCH 07/32] Fix responsive and css. Rename time spent. --- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/lib/project.lib.php | 29 +++++++++++----------- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 6 ++--- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 2 +- htdocs/projet/activity/perweek.php | 2 +- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d8dfe544584..e9a531303ae 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -371,7 +371,7 @@ class FormOther public function select_percent($selected = 0, $htmlname = 'percent', $disabled = 0, $increment = 5, $start = 0, $end = 100, $showempty = 0) { // phpcs:enable - $return = ''; if ($showempty) { $return .= ''; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index cc9a03ca441..8416df31b72 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1265,20 +1265,17 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec // Ref print ''; - print ''; + print ''; for ($k = 0; $k < $level; $k++) { - print "   "; + print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { - print "   "; + print "
"; } - print $taskstatic->label; - //print "
"; - //for ($k = 0 ; $k < $level ; $k++) print "   "; - //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); print "\n"; // Date @@ -1583,14 +1580,14 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr // Ref print ''; - print ''; + print ''; for ($k = 0; $k < $level; $k++) { print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; - print ''.$taskstatic->label.''; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { print "
"; } @@ -1981,15 +1978,15 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } // Ref - print ''; - print ''; + print ''; + print ''; for ($k = 0; $k < $level; $k++) { print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; - print ''.$taskstatic->label.''; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { print "
"; } @@ -2023,7 +2020,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; // $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user if ($lines[$i]->duration_effective) { - print ''; + print ''; print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin'); print ''; } else { @@ -2035,7 +2032,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); if ($tmptimespent['total_duration']) { + print ''; print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); + print ''; } else { print '--:--'; } @@ -2286,14 +2285,14 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & // Ref print ''; - print ''; + print ''; for ($k = 0; $k < $level; $k++) { print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; - print ''.$taskstatic->label.''; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { print "
"; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 879edcd0fe5..43379266484 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -429,7 +429,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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 2, __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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->hasRight("projet","lire")', '', 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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 3, __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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'TimeEntry', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 3, __ENTITY__); -- Project - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4557075657f..45ce276611d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2273,13 +2273,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - // Project affected to user + // Project assigned to user $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); } } @@ -2387,7 +2387,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $search_project_user = GETPOST('search_project_user', 'int'); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); } } } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index bd530592d2c..de0505e4f9e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1082,6 +1082,7 @@ CommentPage=Comments space CommentAdded=Comment added CommentDeleted=Comment deleted Everybody=Everybody +EverybodySmall=Everybody PayedBy=Paid by PayedTo=Paid to Monthly=Monthly diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 5d7b4b41b7b..4e56f346cea 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -45,6 +45,7 @@ OutOfProject=Out of project NoProject=No project defined or owned NbOfProjects=Number of projects NbOfTasks=Number of tasks +TimeEntry=Time tracking TimeSpent=Time spent TimeSpentByYou=Time spent by you TimeSpentByUser=Time spent by user diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 2f9e083828b..806bda880fb 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -609,7 +609,7 @@ if (!empty($arrayfields['timeconsumed']['checked'])) { print ''.$langs->trans("TimeSpent").'
'; print ''; print 'Photo'; - print ''.$langs->trans("Everybody").''; + print ''.$langs->trans("EverybodySmall").''; print ''; print ''; print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index ea620d9800d..d68f3796536 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -491,7 +491,7 @@ print ''.$langs->trans("ProgressDeclared"). print ''.$langs->trans("TimeSpent").'
'; print ''; print 'Photo'; -print ''.$langs->trans("Everybody").''; +print ''.$langs->trans("EverybodySmall").''; print ''; print ''; print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 0e5c9a37b12..14f1efea5e1 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -663,7 +663,7 @@ if (!empty($arrayfields['timeconsumed']['checked'])) { print ''; print 'Photo'; //print '
'.img_object('', 'user', 'class=""', 0, 0, $notooltip ? 0 : 1).'
'; - print ''.$langs->trans("Everybody").''; + print ''.$langs->trans("EverybodySmall").''; print '
'; print ''; print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').''; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index b24e10ce452..a014cd8d8d5 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -69,7 +69,7 @@ $colortexttitle = '40, 40, 60'; $colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; -$fontsize = '0.94em'; +$fontsize = '0.93em'; $fontsizesmaller = '0.75em'; $topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; From 090ecd361179f5f9db1bb839e3a9cc2632999096 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 12:31:30 +0100 Subject: [PATCH 08/32] Debug v19 --- htdocs/core/lib/parsemd.lib.php | 2 +- htdocs/modulebuilder/template/README.md | 16 ++++-- htdocs/modulebuilder/template/admin/setup.php | 50 ++++++++++--------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 284ea81e6d3..4015227a104 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -37,7 +37,7 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) $content = preg_replace('/([^<]+)<\/a>/', '[\3](\1)', $content); // Replace HTML coments - $content = preg_replace('//ms', '', $content); // We remove HTML comment that are not MD comment because they will be escaped and output when setSafeMode is set to true. + $content = preg_replace('//Ums', '', $content); // We remove HTML comment that are not MD comment because they will be escaped and output when setSafeMode is set to true. if (is_array($replaceimagepath)) { foreach ($replaceimagepath as $key => $val) { diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index 2e63e69bd0b..30f081abd78 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -22,10 +22,13 @@ For more information, see the [translator's documentation](https://wiki.dolibarr There is a [Transifex project](https://transifex.com/projects/p/dolibarr-module-template) for this module. --> - + + + +### Final steps From your browser: @@ -73,7 +83,7 @@ From your browser: - Go to "Setup" -> "Modules" - You should now be able to find and enable the module ---> + ## Licenses diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index a985dfe3998..68b28ea758c 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -91,39 +91,40 @@ if (!class_exists('FormSetup')) { $formSetup = new FormSetup($db); -// HTTP HOST -$item = $formSetup->newItem('NO_PARAM_JUST_TEXT'); +// Enter here all parameters in your setup page + +// Setup conf for selection of an URL +$item = $formSetup->newItem('MYMODULE_MYPARAM1'); $item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST']; $item->cssClass = 'minwidth500'; -// Setup conf MYMODULE_MYPARAM1 as a simple string input -$item = $formSetup->newItem('MYMODULE_MYPARAM1'); +// Setup conf for selection of a simple string input +$item = $formSetup->newItem('MYMODULE_MYPARAM2'); $item->defaultFieldValue = 'default value'; -// Setup conf MYMODULE_MYPARAM2 as a simple textarea input but we replace the text of field title -$item = $formSetup->newItem('MYMODULE_MYPARAM2'); +// Setup conf for selection of a simple textarea input but we replace the text of field title +$item = $formSetup->newItem('MYMODULE_MYPARAM3'); $item->nameText = $item->getNameText().' more html text '; -// Setup conf MYMODULE_MYPARAM3 -$item = $formSetup->newItem('MYMODULE_MYPARAM3'); +// Setup conf for a selection of a thirdparty +$item = $formSetup->newItem('MYMODULE_MYPARAM4'); $item->setAsThirdpartyType(); -// Setup conf MYMODULE_MYPARAM4 : exemple of quick define write style -$formSetup->newItem('MYMODULE_MYPARAM4')->setAsYesNo(); +// Setup conf for a selection of a boolean +$formSetup->newItem('MYMODULE_MYPARAM5')->setAsYesNo(); -// Setup conf MYMODULE_MYPARAM5 -$formSetup->newItem('MYMODULE_MYPARAM5')->setAsEmailTemplate('thirdparty'); +// Setup conf for a selection of an email template of type thirdparty +$formSetup->newItem('MYMODULE_MYPARAM6')->setAsEmailTemplate('thirdparty'); -// Setup conf MYMODULE_MYPARAM6 -//$formSetup->newItem('MYMODULE_MYPARAM6')->setAsSecureKey(); +// Setup conf for a selection of a secured key +//$formSetup->newItem('MYMODULE_MYPARAM7')->setAsSecureKey(); -// Setup conf MYMODULE_MYPARAM7 -$formSetup->newItem('MYMODULE_MYPARAM7')->setAsProduct(); +// Setup conf for a selection of a product +$formSetup->newItem('MYMODULE_MYPARAM8')->setAsProduct(); -$formSetup->newItem('Title')->setAsTitle(); +// Add a title for a new section +$formSetup->newItem('NewSection')->setAsTitle(); -// Setup conf MYMODULE_MYPARAM8 -$item = $formSetup->newItem('MYMODULE_MYPARAM8'); $TField = array( 'test01' => $langs->trans('test01'), 'test02' => $langs->trans('test02'), @@ -132,13 +133,16 @@ $TField = array( 'test05' => $langs->trans('test05'), 'test06' => $langs->trans('test06'), ); -$item->setAsMultiSelect($TField); -$item->helpText = $langs->transnoentities('MYMODULE_MYPARAM8'); - -// Setup conf MYMODULE_MYPARAM9 +// Setup conf for a simple combo list $formSetup->newItem('MYMODULE_MYPARAM9')->setAsSelect($TField); +// Setup conf for a multiselect combo list +$item = $formSetup->newItem('MYMODULE_MYPARAM10'); +$item->setAsMultiSelect($TField); +$item->helpText = $langs->transnoentities('MYMODULE_MYPARAM10'); + + // Setup conf MYMODULE_MYPARAM10 $item = $formSetup->newItem('MYMODULE_MYPARAM10'); From e7a629b3190116895728fe6bd6a853c5b309af88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 14:54:13 +0100 Subject: [PATCH 09/32] Debug v19 --- htdocs/stripe/payout.php | 4 +++- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index b1d1d9e6201..ca6addc5118 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -55,7 +55,6 @@ $pagenext = $page + 1; $optioncss = GETPOST('optioncss', 'alpha'); $param = ""; $num = 0; -$totalnboflines = 0; $result = restrictedArea($user, 'banque'); @@ -85,6 +84,9 @@ $stripeacc = $stripe->getStripeAccount($service); print $langs->trans('ErrorStripeAccountNotDefined'); }*/ +$moreforfilter = ''; +$totalnboflines = -1; + if (!$rowid) { print '
'; if ($optioncss != '') { diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index a014cd8d8d5..93db8d61250 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -69,7 +69,7 @@ $colortexttitle = '40, 40, 60'; $colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; -$fontsize = '0.93em'; +$fontsize = '0.92em'; $fontsizesmaller = '0.75em'; $topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; From ed122e5408fc73240f4532f0f6223b7646cb68a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 17:46:57 +0100 Subject: [PATCH 10/32] Clean depracted table --- htdocs/core/class/html.form.class.php | 49 ------------------- .../mysql/tables/llx_societe_address.sql | 37 -------------- .../mysql/tables/llx_societe_contacts.sql | 2 +- htdocs/install/pgsql/functions/functions.sql | 1 - htdocs/societe/class/societe.class.php | 2 - 5 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_societe_address.sql diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8644b88da7f..c9f00ad0d0f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3995,57 +3995,8 @@ class Form } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - - /** - * Return list of delivery address - * - * @param string $selected Id contact pre-selectionn - * @param int $socid Id of company - * @param string $htmlname Name of HTML field - * @param int $showempty Add an empty field - * @return integer - */ - public function select_address($selected, $socid, $htmlname = 'address_id', $showempty = 0) - { - // phpcs:enable - // looking for users - $sql = "SELECT a.rowid, a.label"; - $sql .= " FROM " . $this->db->prefix() . "societe_address as a"; - $sql .= " WHERE a.fk_soc = " . ((int) $socid); - $sql .= " ORDER BY a.label ASC"; - - dol_syslog(get_class($this) . "::select_address", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - print ''; - return $num; - } else { - dol_print_error($this->db); - return -1; - } - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** * Load into cache list of payment terms * diff --git a/htdocs/install/mysql/tables/llx_societe_address.sql b/htdocs/install/mysql/tables/llx_societe_address.sql deleted file mode 100644 index 2b5f2d57146..00000000000 --- a/htdocs/install/mysql/tables/llx_societe_address.sql +++ /dev/null @@ -1,37 +0,0 @@ --- ======================================================================== --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2005-2013 Houssin Regis --- --- 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 . --- --- ======================================================================== - -create table llx_societe_address -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, -- creation date - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date - label varchar(30), -- - fk_soc integer DEFAULT 0, -- - name varchar(60), -- company name - address varchar(255), -- company adresse - zip varchar(10), -- zipcode - town varchar(50), -- town - fk_pays integer DEFAULT 0, -- - phone varchar(20), -- phone number - fax varchar(20), -- fax number - note text, -- - fk_user_creat integer, - fk_user_modif integer -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_societe_contacts.sql b/htdocs/install/mysql/tables/llx_societe_contacts.sql index 3f301c0cf34..cd8b92667e3 100644 --- a/htdocs/install/mysql/tables/llx_societe_contacts.sql +++ b/htdocs/install/mysql/tables/llx_societe_contacts.sql @@ -17,7 +17,7 @@ -- ======================================================================== -- This table contains the contacts by default of a thirdparty --- Such contacts will be added to document automatiall if their role match the one expected by the document. +-- Such contacts will be added to document automatically if their role match the one expected by the document. create table llx_societe_contacts ( diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index b8f5dc60eae..6727d486d35 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -161,7 +161,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propaldet_extrafield CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_resource FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_address FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_prices FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_remise FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 60aa52567c1..c5993ecd1e3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -104,7 +104,6 @@ class Societe extends CommonObject */ protected $childtablesoncascade = array( 'societe_prices', - 'societe_address', 'product_fournisseur_price', 'product_customer_price_log', 'product_customer_price', @@ -5208,7 +5207,6 @@ class Societe extends CommonObject * Do not include llx_societe because it will be replaced later */ $tables = array( - 'societe_address', 'societe_commerciaux', 'societe_prices', 'societe_remise', From a9c2a4407456030dfb74646147e72d59cafd0172 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 18:23:28 +0100 Subject: [PATCH 11/32] CSS --- htdocs/compta/stats/casoc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index b499ca17c71..00f71708085 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -630,18 +630,18 @@ if (count($amount)) { } else { $linkname = $langs->trans("PaymentsNotLinkedToInvoice"); } - print "".$linkname."\n"; + print ''.$linkname."\n"; print ''; - print $address_zip[$key]; + print $address_pays($address_zip[$key]); print ''; - print ''; - print $address_town[$key]; + print ''; + print $address_pays($address_town[$key]); print ''; - print ''; - print $address_pays[$key]; + print ''; + print $address_pays($address_pays[$key]); print ''; // Amount w/o VAT From 472f25d945ad537a2ffb90556b9f10c72cdfa921 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 19:50:47 +0100 Subject: [PATCH 12/32] Debug v19: Caches must be stored into conf->cache['nameofcache'] --- .../accountancy/class/bookkeeping.class.php | 114 +++++++++++++----- 1 file changed, 85 insertions(+), 29 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index c6262e0f6d1..711b6a8601a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -197,10 +197,6 @@ class BookKeeping extends CommonObject */ public $picto = 'generic'; - /** - * @var array List of active fiscal periods cached [[date_start, date_end], ...] - */ - public static $active_fiscal_period_cached; /** * @var string[] SQL filter used for check if the bookkeeping record can be created/inserted/modified/deleted (cached) */ @@ -2280,6 +2276,8 @@ class BookKeeping extends CommonObject */ public function getCanModifyBookkeepingSQL($alias = '', $force = false) { + global $conf; + $alias = trim($alias); $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias . "." : $alias; @@ -2290,8 +2288,8 @@ class BookKeeping extends CommonObject } $sql_list = array(); - if (is_array(self::$active_fiscal_period_cached)) { - foreach (self::$active_fiscal_period_cached as $fiscal_period) { + if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= {$alias}doc_date AND {$alias}doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; } } @@ -2309,26 +2307,52 @@ class BookKeeping extends CommonObject */ public function canModifyBookkeeping($id) { - $result = $this->loadFiscalPeriods(false, 'active'); - if ($result < 0) { - return -1; - } + global $conf; - $bookkeeping = new BookKeeping($this->db); - $result = $bookkeeping->fetch($id); - if ($result <= 0) { - return $result; - } + if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') == 'blockedonclosed') { + $result = $this->loadFiscalPeriods(false, 'closed'); - if (is_array(self::$active_fiscal_period_cached)) { - foreach (self::$active_fiscal_period_cached as $fiscal_period) { - if ($fiscal_period['date_start'] <= $bookkeeping->doc_date && $bookkeeping->doc_date <= $fiscal_period['date_end']) { - return 1; + if ($result < 0) { + return -1; + } + + $bookkeeping = new BookKeeping($this->db); + $result = $bookkeeping->fetch($id); + if ($result <= 0) { + return $result; + } + + if (!empty($conf->cache['closed_fiscal_period_cached']) && is_array($conf->cache['closed_fiscal_period_cached'])) { + foreach ($conf->cache['closed_fiscal_period_cached'] as $fiscal_period) { + if ($fiscal_period['date_start'] <= $bookkeeping->doc_date && $bookkeeping->doc_date <= $fiscal_period['date_end']) { + return 0; + } } } - } - return 0; + return 1; + } else { + $result = $this->loadFiscalPeriods(false, 'active'); + if ($result < 0) { + return -1; + } + + $bookkeeping = new BookKeeping($this->db); + $result = $bookkeeping->fetch($id); + if ($result <= 0) { + return $result; + } + + if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { + if ($fiscal_period['date_start'] <= $bookkeeping->doc_date && $bookkeeping->doc_date <= $fiscal_period['date_end']) { + return 1; + } + } + } + + return 0; + } } /** @@ -2339,10 +2363,23 @@ class BookKeeping extends CommonObject */ public function validBookkeepingDate($date) { + global $conf; + if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') == 'blockedonclosed') { $result = $this->loadFiscalPeriods(false, 'closed'); - // TODO + if ($result < 0) { + return -1; + } + + if (!empty($conf->cache['closed_fiscal_period_cached']) && is_array($conf->cache['closed_fiscal_period_cached'])) { + foreach ($conf->cache['closed_fiscal_period_cached'] as $fiscal_period) { + if ($fiscal_period['date_start'] <= $date && $date <= $fiscal_period['date_end']) { + return 0; + } + } + } + return 1; } else { $result = $this->loadFiscalPeriods(false, 'active'); @@ -2350,16 +2387,16 @@ class BookKeeping extends CommonObject return -1; } - if (is_array(self::$active_fiscal_period_cached)) { - foreach (self::$active_fiscal_period_cached as $fiscal_period) { + if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { if ($fiscal_period['date_start'] <= $date && $date <= $fiscal_period['date_end']) { return 1; } } } - } - return 0; + return 0; + } } /** @@ -2374,7 +2411,7 @@ class BookKeeping extends CommonObject global $conf; if ($mode == 'active') { - if (!isset(self::$active_fiscal_period_cached) || $force) { + if (!isset($conf->cache['active_fiscal_period_cached']) || $force) { $sql = "SELECT date_start, date_end"; $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; $sql .= " WHERE entity = " . ((int) $conf->entity); @@ -2393,12 +2430,31 @@ class BookKeeping extends CommonObject 'date_end' => $this->db->jdate($obj->date_end), ); } - self::$active_fiscal_period_cached = $list; + $conf->cache['active_fiscal_period_cached'] = $list; } } if ($mode == 'closed') { - // TODO + if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) { + $sql = "SELECT date_start, date_end"; + $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; + $sql .= " WHERE entity = " . ((int) $conf->entity); + $sql .= " AND statut = 1"; + $resql = $this->db->query($sql); + if (!$resql) { + $this->errors[] = $this->db->lasterror(); + return -1; + } + + $list = array(); + while ($obj = $this->db->fetch_object($resql)) { + $list[] = array( + 'date_start' => $this->db->jdate($obj->date_start), + 'date_end' => $this->db->jdate($obj->date_end), + ); + } + $conf->cache['closed_fiscal_period_cached'] = $list; + } } return 1; From da4bdfe82224c907f2559d8596a63a7c04e0ccea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 20:13:24 +0100 Subject: [PATCH 13/32] FIX #26751 --- htdocs/core/modules/modTakePos.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 1324ea1b010..43abea4d860 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -337,9 +337,9 @@ class modTakePos extends DolibarrModules $searchaccountid = $cashaccount->create($user); } if ($searchaccountid > 0) { - dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH1", $result, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH1", $searchaccountid, 'chaine', 0, '', $conf->entity); } else { - setEventMessages($societe->error, $category->errors, 'errors'); + setEventMessages($cashaccount->error, $cashaccount->errors, 'errors'); } } From 7be1ba3432c15598abfaa10c80f5b9b477176023 Mon Sep 17 00:00:00 2001 From: Beef <84393940+TheRealBeef@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:14:35 +0100 Subject: [PATCH 14/32] Fixes syntax errors in Advanced Stock Transfer and adds checks for null values (#26766) --- .../stock/stocktransfer/class/stocktransferline.class.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index 0e63cb8dbe8..507dc556d5e 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -153,7 +153,7 @@ class StockTransferLine extends CommonObjectLine // Translate some data of arrayofkeyval if (is_object($langs)) { foreach ($this->fields as $key => $val) { - if (is_array($val['arrayofkeyval'])) { + if (isset($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { foreach ($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index cf428668cd4..f4f6898e12b 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -195,7 +195,7 @@ if (empty($reshook)) { $line->pmp = $prod->pmp; if ($line->id > 0) $line->update($user); else { - $line->rang = count($object->lines) + 1; + $line->rang = (is_array($object->lines) || $object->lines instanceof Countable) ? count($object->lines) + 1 : 1; $line->create($user); } $object->fetchLines(); From 11a98067b596a9d15756ec0450161c30b1f5af0a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:15:16 +0100 Subject: [PATCH 15/32] Update README.md (#26762) added some new available modules --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4645176a3f5..1d7ea4b321c 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Batches / Lots / Serials - Product Variants - Bill of Materials (BOM) -- Manufacturing Orders +- Manufacturing Orders (MO) Customer/Sales Management @@ -114,7 +114,8 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Customer Orders management - Contracts/Subscription management - Interventions management -- Ticket System +- Ticket System (+ Knowledge management) +- Partnership management - Shipping management - Customer Invoices/Credit notes and payment management - Point of Sale (POS) @@ -143,14 +144,16 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Shared calendar/agenda (with ical and vcal import/export for third-party tools integration) - Projects & Tasks management +- Event organization - Ticket System - Surveys - HR + HR - Human Resources Management - Employee's leaves management - Expense reports - Recruitment management +- Employee/staff management - Timesheets ### Other application/modules @@ -168,7 +171,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Payment platforms integration (PayPal, Stripe, Paybox...) - Email-Collector -(around 100 modules available by default, 1000+ on the addon marketplace) +(around 100 modules available by default, 1000+ addons at the official marketplace Dolistore.com) ### Other general features From 78259c37ceaf63af6e76a8c1993c43dcebbe6af1 Mon Sep 17 00:00:00 2001 From: IC-Nicolas Date: Mon, 20 Nov 2023 20:17:24 +0100 Subject: [PATCH 16/32] Duplicate entries (#26759) --- htdocs/core/lib/functions.lib.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a5638960e10..937eedfc123 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -224,8 +224,6 @@ function isModEnabled($module) 'category' => 'categorie', 'contract' => 'contrat', 'project' => 'projet', - 'bank' => 'banque', - 'category' => 'categorie' ); if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { $arrayconv['supplier_order'] = 'fournisseur'; From fd31c4743980ba8088ba831c4f8a569b7fe438af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 20 Nov 2023 20:18:24 +0100 Subject: [PATCH 17/32] fix duplicate (#26753) From 06874fdd9030e2c28cba567611cd4817cd16b225 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:18:59 +0200 Subject: [PATCH 18/32] fix translation (#26754) --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 8e60cbbba56..6d60b8f0fd1 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -81,7 +81,7 @@ PurchasedAmount=Purchased amount NewPrice=New price MinPrice=Min. selling price MinPriceHT=Min. selling price (excl. tax) -MinPriceTTC=Prix de vente min (inc. tax) +MinPriceTTC=Min. selling price (inc. tax) EditSellingPriceLabel=Edit selling price label CantBeLessThanMinPrice=The selling price can't be lower than minimum allowed for this product (%s without tax). This message can also appear if you type a significant discount. CantBeLessThanMinPriceInclTax=The selling price can't be lower than minimum allowed for this product (%s including taxes). This message can also appears if you type a too important discount. From 714c0767859f71e6bc95e561c39dfca13a33cdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 20 Nov 2023 20:20:14 +0100 Subject: [PATCH 19/32] fix typos in apstats.php (#26749) * fix typos in apstats.php * Update apstats.php --- dev/tools/apstats.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index e294a216f92..ed23307cf8a 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -302,7 +302,7 @@ $html .= '

Lines of code

'."\n"; $html .= '
'."\n"; $html .= ''; $html .= ''; -$html .= ''; $html .= ''; $html .= ''; $html .= ''; @@ -310,7 +310,7 @@ $html .= ''; $html .= ''; $html .= ''; //$html .= ''; -$html .= ''; +$html .= ''; foreach (array('proj', 'dep') as $source) { $html .= ''; if ($source == 'proj') { @@ -400,7 +400,7 @@ $( ".seedetail" ).on( "click", function() { }); '; -$html .= ''; +$html .= ''; $html .= ''; $fh = fopen($outputpath, 'w'); From ca7fe7e29e8eea908cd02ec358b70682a6eaae92 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 20 Nov 2023 20:38:42 +0100 Subject: [PATCH 20/32] FIX MAIN_LANG_DEFAULT was no longer saved during installation (#26637) --- htdocs/install/step5.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index cf8262261e1..07f3690a671 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -366,6 +366,11 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { dol_print_error($db, 'Error in setup program'); } + // May fail if parameter already defined + dolibarr_install_syslog('step5: set the default language'); + $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT').", ".$db->encrypt($setuplang).", 'chaine', 0, 'Default language', 1)"); + //if (! $resql) dol_print_error($db,'Error in setup program'); + $db->commit(); } } else { @@ -414,11 +419,6 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { dol_print_error($db, 'Error in setup program'); } } - - // May fail if parameter already defined - dolibarr_install_syslog('step5: set the default language'); - $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT').", ".$db->encrypt($setuplang).", 'chaine', 0, 'Default language', 1)"); - //if (! $resql) dol_print_error($db,'Error in setup program'); } else { print $langs->trans("ErrorFailedToConnect")."
"; } From 73087bee2fd70b9d1d49e268df3700b749e1b407 Mon Sep 17 00:00:00 2001 From: atm-lucas <121817516+atm-lucasmantegari@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:42:27 +0100 Subject: [PATCH 21/32] FIX - change error message on quantity (#26606) * Added a new error message on quantity split * fault correction * Add loading translation files * Fault * Translation key * Code correction --------- Co-authored-by: Laurent Destailleur --- htdocs/langs/en_US/mrp.lang | 7 ++++++- htdocs/langs/fr_FR/mrp.lang | 2 +- htdocs/mrp/js/lib_dispatch.js.php | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 55d002b2554..935995ea3ae 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -128,5 +128,10 @@ Manufacturing=Manufacturing Disassemble=Disassemble ProducedBy=Produced by QtyTot=Qty Total + +QtyCantBeSplit= Quantity cannot be split +NoRemainQtyToDispatch=No quantity remaining to divide + THMOperatorEstimatedHelp=Estimated cost of operator per hour. Will be used to estimate cost of a BOM using this workstation. -THMMachineEstimatedHelp=Estimated cost of machine per hour. Will be used to estimate cost of a BOM using this workstation. \ No newline at end of file +THMMachineEstimatedHelp=Estimated cost of machine per hour. Will be used to estimate cost of a BOM using this workstation. + diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index b9e43ce69db..0236c90550f 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -127,4 +127,4 @@ BOMServicesList=Les services de BOM Manufacturing=Fabrication Disassemble=Déassemblage ProducedBy=Produit par -QtyTot=Qté totale +QtyTot=Qté totale \ No newline at end of file diff --git a/htdocs/mrp/js/lib_dispatch.js.php b/htdocs/mrp/js/lib_dispatch.js.php index 1dd2d9d164c..27cc38f988c 100644 --- a/htdocs/mrp/js/lib_dispatch.js.php +++ b/htdocs/mrp/js/lib_dispatch.js.php @@ -47,6 +47,9 @@ session_cache_limiter('public'); require_once '../../main.inc.php'; +// Load translation files required by the page +$langs->loadLangs(array("mrp")); + // Define javascript type top_httphead('text/javascript; charset=UTF-8'); // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. @@ -153,10 +156,12 @@ function addDispatchLine(index, type, mode) */ function addDispatchTR(qtyOrdered, qtyDispatched, index, nbrTrs, warehouseId, inputId, type, qty, mode, $row) { if (qtyOrdered <= 1) { - window.alert("Quantity can't be split"); + let errormsg = 'trans('QtyCantBeSplit')); ?>'; + $.jnotify(errormsg, 'error', true); return -1; } else if (qtyDispatched >= qtyOrdered) { - window.alert("No remain qty to dispatch"); + let errormsg = 'trans('NoRemainQtyToDispatch')); ?>; + $.jnotify(errormsg, 'error', true); return -1; } else if (qtyDispatched < qtyOrdered) { //replace tr suffix nbr From 406447d1d5fc50cfb28095e36db8db9d5d0df49d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 21:16:32 +0100 Subject: [PATCH 22/32] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 22de1d56036..d75a6ef25c8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2426,6 +2426,6 @@ ExtrafieldsDeleted=Extrafields %s has been deleted LargeModern=Large - Modern SpecialCharActivation=Enable the button to open a virtual keyboard to enter special characters DeleteExtrafield=Delete extrafield -ConfirmDeleteExtrafield=Confirm delete %s extrafield ? All data is going to be lost +ConfirmDeleteExtrafield=Do you confirm deletion of the field %s ? All data aved into this field will be definitely deleted ExtraFieldsSupplierInvoicesRec=Complementary attributes (templates invoices) ExtraFieldsSupplierInvoicesLinesRec=Complementary attributes (invoice lines) From f5240781a110cb5fbb419ee0186eca48d697d503 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 21:25:37 +0100 Subject: [PATCH 23/32] Fix phpcs --- htdocs/mrp/js/lib_dispatch.js.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/js/lib_dispatch.js.php b/htdocs/mrp/js/lib_dispatch.js.php index 27cc38f988c..58c3abc68f5 100644 --- a/htdocs/mrp/js/lib_dispatch.js.php +++ b/htdocs/mrp/js/lib_dispatch.js.php @@ -156,12 +156,12 @@ function addDispatchLine(index, type, mode) */ function addDispatchTR(qtyOrdered, qtyDispatched, index, nbrTrs, warehouseId, inputId, type, qty, mode, $row) { if (qtyOrdered <= 1) { - let errormsg = 'trans('QtyCantBeSplit')); ?>'; - $.jnotify(errormsg, 'error', true); + let errormsg = 'trans('QtyCantBeSplit')); ?>'; + $.jnotify(errormsg, 'error', true); return -1; } else if (qtyDispatched >= qtyOrdered) { - let errormsg = 'trans('NoRemainQtyToDispatch')); ?>; - $.jnotify(errormsg, 'error', true); + let errormsg = 'trans('NoRemainQtyToDispatch')); ?>; + $.jnotify(errormsg, 'error', true); return -1; } else if (qtyDispatched < qtyOrdered) { //replace tr suffix nbr From eb0eac0dfa028c997a49cd916dd60b637d051312 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Nov 2023 21:47:48 +0100 Subject: [PATCH 24/32] FIX delivery note disappear after generation --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 937eedfc123..8b0ee3e0748 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -224,6 +224,7 @@ function isModEnabled($module) 'category' => 'categorie', 'contract' => 'contrat', 'project' => 'projet', + 'delivery_note' => 'expedition' ); if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { $arrayconv['supplier_order'] = 'fournisseur'; From f0cff097683409989d823a7b1e45fdb7d42df2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 20 Nov 2023 23:39:12 +0100 Subject: [PATCH 25/32] fix phpstan (#26772) * fix phpstan * Update server_order.php --- htdocs/webservices/server_order.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index b6ded243233..ec9b46c49a2 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -374,7 +374,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') +function getOrder($authentication, $id = 0, $ref = '', $ref_ext = '') { global $db, $conf; @@ -806,7 +806,7 @@ function createOrder($authentication, $order) * @param int $id_warehouse Id of warehouse to use for stock decrease * @return array Array result */ -function validOrder($authentication, $id = '', $id_warehouse = 0) +function validOrder($authentication, $id = 0, $id_warehouse = 0) { global $db, $conf, $langs; From be9cbeb1b6d04eba540801a0bf3f96fc13d46627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 20 Nov 2023 23:45:35 +0100 Subject: [PATCH 26/32] Update DolibarrModules.class.php (#26770) --- htdocs/core/modules/DolibarrModules.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 08abdcb40ab..807291469e1 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2139,6 +2139,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it global $langs, $conf; $err = 0; + $name = ''; if (isset($this->dirs) && is_array($this->dirs)) { foreach ($this->dirs as $key => $value) { From 3c966469efc2d048eca87a23484d294911ccae7d Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 20 Nov 2023 23:47:06 +0100 Subject: [PATCH 27/32] QUAL No return values in __construct(), correct PHPDoc for typing (#26768) --- htdocs/compta/bank/class/api_bankaccounts.class.php | 2 +- htdocs/core/class/dolgeoip.class.php | 8 ++++---- htdocs/core/class/menubase.class.php | 1 - htdocs/core/db/pgsql.class.php | 6 ++---- htdocs/core/db/sqlite3.class.php | 6 ++---- htdocs/core/modules/import/import_xlsx.modules.php | 2 +- htdocs/fourn/class/api_supplier_invoices.class.php | 2 +- htdocs/product/class/propalmergepdfproduct.class.php | 2 +- 8 files changed, 12 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index e05a911ffee..cd6ebd9c3bf 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -23,7 +23,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; /** * API class for accounts * - * @property DoliDB db + * @property DoliDB $db * @access protected * @class DolibarrApiAccess {@requires user,external} */ diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 86f02628ff2..171aeddaf9b 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -71,20 +71,20 @@ class DolGeoIP } } else { print 'ErrorBadParameterInConstructor'; - return 0; + return; } // Here, function exists (embedded into PHP or exists because we made include) if (empty($type) || empty($datfile)) { $this->errorlabel = 'Constructor was called with no datafile parameter'; dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); - return 0; + return; } if (!file_exists($datfile) || !is_readable($datfile)) { $this->error = 'ErrorGeoIPClassNotInitialized'; $this->errorlabel = "Datafile ".$datfile." not found"; dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); - return 0; + return; } if ($geoipversion == '2') { @@ -93,7 +93,7 @@ class DolGeoIP } catch (Exception $e) { $this->error = $e->getMessage(); dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); - return 0; + return; } } elseif (function_exists('geoip_open') && defined('GEOIP_STANDARD')) { $this->gi = geoip_open($datfile, constant('GEOIP_STANDARD')); diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 807d1c66646..7f80422432b 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -172,7 +172,6 @@ class Menubase { $this->db = $db; $this->menu_handler = $menu_handler; - return 1; } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 2db5a1a8d04..4e2201cf638 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -101,7 +101,7 @@ class DoliDBPgsql extends DoliDB $this->ok = false; $this->error = "Pgsql PHP functions are not available in this version of PHP"; dol_syslog(get_class($this)."::DoliDBPgsql : Pgsql PHP functions are not available in this version of PHP", LOG_ERR); - return $this->ok; + return; } if (!$host) { @@ -109,7 +109,7 @@ class DoliDBPgsql extends DoliDB $this->ok = false; $this->error = $langs->trans("ErrorWrongHostParameter"); dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect, wrong host parameters", LOG_ERR); - return $this->ok; + return; } // Essai connexion serveur @@ -144,8 +144,6 @@ class DoliDBPgsql extends DoliDB // Pas de selection de base demandee, ok ou ko $this->database_selected = false; } - - return $this->ok; } diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 5d2502cf935..9d8f5fcb81d 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -86,7 +86,7 @@ class DoliDBSqlite3 extends DoliDB $this->ok = false; $this->error="Sqlite PHP functions for using Sqlite driver are not available in this version of PHP. Try to use another driver."; dol_syslog(get_class($this)."::DoliDBSqlite3 : Sqlite PHP functions for using Sqlite driver are not available in this version of PHP. Try to use another driver.",LOG_ERR); - return $this->ok; + return; }*/ /*if (! $host) @@ -95,7 +95,7 @@ class DoliDBSqlite3 extends DoliDB $this->ok = false; $this->error=$langs->trans("ErrorWrongHostParameter"); dol_syslog(get_class($this)."::DoliDBSqlite3 : Erreur Connect, wrong host parameters",LOG_ERR); - return $this->ok; + return; }*/ // Essai connexion serveur @@ -126,8 +126,6 @@ class DoliDBSqlite3 extends DoliDB //$this->error=sqlite_connect_error(); dol_syslog(get_class($this)."::DoliDBSqlite3 : Error Connect ".$this->error, LOG_ERR); } - - return $this->ok; } diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 1ffbc0cc028..f57b5f02c70 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -116,7 +116,7 @@ class ImportXlsx extends ModeleImports if (!class_exists('ZipArchive')) { // For Excel2007 $langs->load("errors"); $this->error = $langs->trans('ErrorPHPNeedModule', 'zip'); - return -1; + return; } $this->label_lib = 'PhpSpreadSheet'; $this->version_lib = '1.8.0'; diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index a09b8d4fbf6..098ab394683 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -24,7 +24,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; /** * API class for supplier invoices * - * @property DoliDB db + * @property DoliDB $db * @access protected * @class DolibarrApiAccess {@requires user,external} */ diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 84b6cbe7123..a3df01938ad 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -577,6 +577,6 @@ class PropalmergepdfproductLine */ public function __construct() { - return 1; + return; } } From 7d11edcc6eec22dc40423b0dda27cbf1e7080016 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 20 Nov 2023 23:58:08 +0100 Subject: [PATCH 28/32] Add printFieldListSearchParam hook to product list (#26769) --- htdocs/product/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index e10d02e3a3a..b1a844cd2ac 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -814,6 +814,11 @@ if ($search_finished) { // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + // List of mass actions available $arrayofmassactions = array( 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), From bfab3aa07708cc57035fae0a74905ab9dcbfca28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 20 Nov 2023 23:59:09 +0100 Subject: [PATCH 29/32] fix phpstan (#26773) --- htdocs/user/class/user.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d5aa0513ceb..c2ae5a046a5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -419,11 +419,11 @@ class User extends CommonObject * @param string $sid If defined, sid to used for search * @param int $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx), 0=do not load personal conf. * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. - * @param int $email If defined, email to used for search + * @param string $email If defined, email to used for search * @param int $fk_socpeople If defined, id of contact for search * @return int <0 if KO, 0 not found, >0 if OK */ - public function fetch($id = '', $login = '', $sid = '', $loadpersonalconf = 0, $entity = -1, $email = '', $fk_socpeople = 0) + public function fetch($id = 0, $login = '', $sid = '', $loadpersonalconf = 0, $entity = -1, $email = '', $fk_socpeople = 0) { global $conf, $user; From 3a17b1543272bb67639729f462108efd4477ac63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Nov 2023 00:00:06 +0100 Subject: [PATCH 30/32] fix phpstan (#26774) --- htdocs/user/class/usergroup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index c06cda641ad..8854c724471 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -163,7 +163,7 @@ class UserGroup extends CommonObject * @param boolean $load_members Load all members of the group * @return int <0 if KO, >0 if OK */ - public function fetch($id = '', $groupname = '', $load_members = false) + public function fetch($id = 0, $groupname = '', $load_members = false) { global $conf; From fba227d618d99a97c7527a802c56449b065a0042 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Tue, 21 Nov 2023 00:06:59 +0100 Subject: [PATCH 31/32] Replace hook ll header (#26736) * Change behavior of keydown * Fix accessibility * New hook llxHeader to replace changeHelpURL * remove space --------- Co-authored-by: Laurent Destailleur --- ChangeLog | 1 + htdocs/main.inc.php | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index eca42af81a7..4ae175c119f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -231,6 +231,7 @@ WARNING: -------- The following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* The hook changeHelpURL is replaced by llxHeader * The property ->brouillon has been removed from all classes. It was not reliable and was a duplicate of ->status == self::STATUS_DRAFT. * The duplicated and deprecated property ->date_livraison that was renamed into ->delivery_date has been completely removed. * The property ->user_close to store ID of closing user has been renamed into ->user_closing_id. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 654648a35f7..9a1c6f49d6d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1460,6 +1460,28 @@ if (!function_exists("llxHeader")) { { global $conf, $hookmanager; + $parameters = array( + 'head' =>& $head, + 'title' =>& $title, + 'help_url' =>& $help_url, + 'target' =>& $target, + 'disablej' =>& $disablej, + 'disablehea' =>& $disablehea, + 'arrayofjs' =>& $arrayofjs, + 'arrayofcss' =>& $arrayofcss, + 'morequerystring' =>& $morequerystring, + 'morecssonbody' =>& $morecssonbody, + 'replacemainareaby' =>& $replacemainareaby, + 'disablenofollow' =>& $disablenofollow, + 'disablenoindex' =>& $disablenoindex + + ); + $reshook = $hookmanager->executeHooks('llxHeader', $parameters); + if ($reshook > 0) { + print $hookmanager->resPrint; + return; + } + // html header top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow, $disablenoindex); @@ -1478,12 +1500,6 @@ if (!function_exists("llxHeader")) { print ''."\n"; - $parameters = array('help_url' => $help_url); - $reshook = $hookmanager->executeHooks('changeHelpURL', $parameters); - if ($reshook > 0) { - $help_url = $hookmanager->resPrint; - } - // top menu and left menu area if ((empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) && !GETPOST('dol_openinpopup', 'aZ09')) { top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring, $help_url); From d2ebffa64c08adba9dd30c286d4b8aaf91852b34 Mon Sep 17 00:00:00 2001 From: Laurent Magnin Date: Tue, 21 Nov 2023 00:24:11 +0100 Subject: [PATCH 32/32] fix: comment translation into English (#26702) --- htdocs/core/modules/project/task/modules_task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 5752b03dec3..f42e094ea21 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php'; /** - * Parent class for projects models + * Parent class for task models */ abstract class ModelePDFTask extends CommonDocGenerator { @@ -58,7 +58,7 @@ abstract class ModelePDFTask extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de projets + * Parent class of task reference numbering models */ abstract class ModeleNumRefTask extends CommonNumRefGenerator {
Language'; +$html .= 'LanguageBytesFilesLinesBlanksCommentsCode'.$val['Complexity'].'