From 9d067d74abd934f969cd38fe04330d87276feb4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 17:51:03 +0100 Subject: [PATCH 01/11] Fix responsive --- htdocs/admin/agenda_other.php | 22 ++++++++++++---------- htdocs/comm/action/card.php | 13 +++++++------ htdocs/core/get_menudiv.php | 3 ++- htdocs/core/menus/standard/eldy_menu.php | 2 +- htdocs/theme/md/style.css.php | 8 +++++++- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 1cce5388f90..8e50380e2ae 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -104,6 +104,8 @@ if ($action == 'set') { $resultCreat = $defaultValues->create($user); if ($resultCreat < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); + } else { + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } } elseif ($action == 'specimen') { // For orders $modele = GETPOST('module', 'alpha'); @@ -316,6 +318,16 @@ print ' '."\n"; print ''.$langs->trans("Value").''."\n"; print ''."\n"; +// AGENDA_DEFAULT_VIEW +print ''."\n"; +$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); +print ''.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).''."\n"; +print ' '."\n"; +print ''."\n"; +$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); +print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); +print ''."\n"; + // Manual or automatic print ''."\n"; @@ -340,16 +352,6 @@ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''."\n"; } -// AGENDA_DEFAULT_VIEW -print ''."\n"; -$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); -print ''.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).''."\n"; -print ' '."\n"; -print ''."\n"; -$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); -print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); -print ''."\n"; - // AGENDA_EVENT_DEFAULT_STATUS print ''."\n"; print ''.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").''."\n"; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 63f18d2c046..5577e97a5ba 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1000,7 +1000,7 @@ if ($action == 'create') { print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").''; // Full day - print ''.$langs->trans("EventOnFullDay").''; + print ''; $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); if (GETPOST('datep', 'int', 1)) { @@ -1311,7 +1311,7 @@ if ($action == 'create') { print ''; - if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) { + if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { //checkbox create reminder print '
'; print '
'; @@ -1336,10 +1336,11 @@ if ($action == 'create') { print ''; //Mail Model - print ''.$langs->trans("EMailTemplates").''; - print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1); - print ''; - + if (getDolGlobalString('AGENDA_REMINDER_EMAIL')) { + print ''.$langs->trans("EMailTemplates").''; + print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1); + print ''; + } print ''; print ''; diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 77b0416956b..597031945f1 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -121,12 +121,13 @@ print ' display: none; } - a.alilevel0 { + a.alilevel0, span.spanlilevel0 { background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important; background-repeat: no-repeat !important; background-position-x: 10px; background-position-y: 16px; padding: 1em 15px 1em 40px; + display: block; } li.lilevel0 font.vsmenudisabled { background-repeat: no-repeat !important; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 35186e423ef..5b426199a6e 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -317,7 +317,7 @@ class MenuManager print ''; } if ($val['enabled'] == 2) { - print ''; + print ''; // Add font-awesome if ($val['level'] == 0 && !empty($val['prefix'])) { print $val['prefix']; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 538e347a216..bfc36ea408e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3003,8 +3003,14 @@ a.vmenu:link, a.vmenu:visited { } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } +span.vsmenudisabled:not(.spanlilevel0), font.vsmenudisabled:not(.spanlilevel0) { + font-size:px; +} span.vsmenudisabled, font.vsmenudisabled { - font-size:px; font-family: ; text-align: ; font-weight: normal; color: #aaa; + font-family: ; + text-align: ; + font-weight: normal; + color: #aaa; } a.vsmenu:link, a.vsmenu:visited { color: var(--colortextbackvmenu); From 0e44bfd4e46e2a8b14ce009dd37dc2a6fbecb0f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 18:53:57 +0100 Subject: [PATCH 02/11] Fix remove $_GET --- htdocs/comm/action/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 77d2680c222..0746ca13a17 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -107,10 +107,10 @@ $year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y"); $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); -$pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOST("search_status", 'aZ09') ?GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' -$type = GETPOST("search_type", 'aZ09') ?GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); -$maxprint = (isset($_GET["maxprint"]) ?GETPOST("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' +$type = GETPOSTISSET("search_type", 'aZ09') ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); +$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); From a072c8911ad9186e251f0f9ec366abe27b2b3ea1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 19:07:02 +0100 Subject: [PATCH 03/11] Fix tz of message on popup --- htdocs/core/ajax/check_notifications.php | 4 ++-- htdocs/core/js/lib_notification.js.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index bbbc95a19c5..0f17f5a80fd 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -170,8 +170,8 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto $event['code'] = $obj->code; $event['label'] = $obj->label; $event['location'] = $obj->location; - $event['reminder_date_formated'] = dol_print_date($db->jdate($obj->dateremind), 'standard'); - $event['event_date_start_formated'] = dol_print_date($db->jdate($obj->datep), 'standard'); + $event['reminder_date_formated'] = dol_print_date($db->jdate($obj->dateremind), 'standard', 'tzuser'); + $event['event_date_start_formated'] = dol_print_date($db->jdate($obj->datep), 'standard', 'tzuser'); $eventfound[$obj->id_agenda] = $event; } diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index f4a4e59526a..af5952f6026 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -64,7 +64,7 @@ print "jQuery(document).ready(function () {\n"; //print " console.log('referrer=".dol_escape_js($_SERVER['HTTP_REFERER'])."');\n"; print ' var nowtime = Date.now();'; -print ' var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined +print ' var time_auto_update = '.max(1, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_FREQUENCY')).';'."\n"; // Always defined print ' var time_js_next_test;'."\n"; ?> From 812f12ccc4d9b9953f7f11df0f4766d15410e380 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 19:09:18 +0100 Subject: [PATCH 04/11] Fix tz message --- htdocs/core/ajax/check_notifications.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 0f17f5a80fd..a5efb52e787 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -170,6 +170,8 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto $event['code'] = $obj->code; $event['label'] = $obj->label; $event['location'] = $obj->location; + $event['reminder_date_formated_tzserver'] = dol_print_date($db->jdate($obj->dateremind), 'standard', 'tzserver'); + $event['event_date_start_formated_tzserver'] = dol_print_date($db->jdate($obj->datep), 'standard', 'tzserver'); $event['reminder_date_formated'] = dol_print_date($db->jdate($obj->dateremind), 'standard', 'tzuser'); $event['event_date_start_formated'] = dol_print_date($db->jdate($obj->datep), 'standard', 'tzuser'); From 2f7832ee44adc5b8e5ae91bc08dad45528fe74f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 19:18:48 +0100 Subject: [PATCH 05/11] css --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 126b69c233e..28a20ad6b09 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1999,7 +1999,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } } } elseif (!$phototoshow) { // example if modulepart = 'societe' or 'photo' - $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos); + $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photowithmargin photoref', 'small', 1, 0, $maxvisiblephotos); } if ($phototoshow) { From 70e4705149861b4b6effd2b5312470079af4376a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 22:52:56 +0100 Subject: [PATCH 06/11] Clean code --- htdocs/comm/action/card.php | 5 +++-- htdocs/comm/action/class/cactioncomm.class.php | 4 ++-- htdocs/core/class/html.formactions.class.php | 4 ++-- htdocs/core/class/link.class.php | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5577e97a5ba..d9118fefcdd 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -937,7 +937,7 @@ if ($action == 'create') { $("#selectcomplete").change(function() { if ($("#selectcomplete").val() == 100) { - if ($("#doneby").val() <= 0) $("#doneby").val(\''.$user->id.'\'); + if ($("#doneby").val() <= 0) $("#doneby").val(\''.((int) $user->id).'\'); } if ($("#selectcomplete").val() == 0) { @@ -992,7 +992,8 @@ if ($action == 'create') { if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.$langs->trans("Type").''; $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); - $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1); + print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); + print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", -1, -1, 0, 1); print ''; } diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index a248482ee9d..32c2345a657 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -145,7 +145,7 @@ class CActionComm * @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @param string $idorcode 'id' or 'code' or 'all' * @param string $excludetype Type to exclude ('system' or 'systemauto') - * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...) + * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...) * @param string $morefilter Add more SQL filter * @param int $shortlabel 1=Get short label instead of long label * @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. @@ -241,7 +241,7 @@ class CActionComm $transcode = $langs->trans($keyfortrans); } $label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label)); - if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (($onlyautoornot == -1 || $onlyautoornot == -2) && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) { if ($typecalendar == 'system') { $label = '   '.$label; $repid[-99] = $langs->trans("ActionAC_MANUAL"); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index d4f4779a606..f5502426b00 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -352,7 +352,7 @@ class FormActions * @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too. * @param string $htmlname Name of select field * @param string $excludetype A type to exclude ('systemauto', 'system', '') - * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual" + * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet) * @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value * @param int $multiselect 1=Allow multiselect of action type * @param int $nooutput 1=No output @@ -373,7 +373,7 @@ class FormActions $caction = new CActionComm($this->db); // Suggest a list with manual events or all auto events - $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); + $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by. if (empty($multiselect)) { // Add empty line at start only if no multiselect array_unshift($arraylist, ' '); diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index eaf4804b213..f69dcb2874d 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -249,7 +249,7 @@ class Link extends CommonObject $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); - dol_syslog(get_class($this)."::fetchAll ".$num."records", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll num=".((int) $num), LOG_DEBUG); if ($num > 0) { while ($obj = $this->db->fetch_object($resql)) { $link = new Link($this->db); From 254ed31fb14d572e10ee52ed325d59ca938a9820 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Jan 2022 23:47:23 +0100 Subject: [PATCH 07/11] Fix combo --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index d9118fefcdd..52b93acdabb 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -993,7 +993,7 @@ if ($action == 'create') { print ''.$langs->trans("Type").''; $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); - print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", -1, -1, 0, 1); + print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot print ''; } From e19994c75699700c614f3735b5681547b972ec63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jan 2022 00:07:45 +0100 Subject: [PATCH 08/11] Fix drag event on week view --- htdocs/comm/action/index.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 0746ca13a17..4d6a032492f 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -570,7 +570,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on $s .= 'console.log("found parent div.dayevent with id = "+newval);'."\n"; $s .= 'var frm=jQuery("#searchFormList");'."\n"; $s .= 'var newurl = ui.item.find("a.cal_event").attr("href");'."\n"; - $s .= 'console.log(newurl);'."\n"; + $s .= 'console.log("Found url on href of a.cal_event"+newurl+", we submit form with actionmove=mupdate");'."\n"; $s .= 'frm.attr("action", newurl).children("#newdate").val(newval);frm.submit();}'."\n"; $s .= '});'."\n"; } @@ -1393,7 +1393,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month print ''; print '
'; - print ''; + print '
'; print ' '; // Column title of weeks numbers echo ' '; @@ -1482,7 +1482,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month print ''; print ''; - print ''; + print ''; print ''; } elseif ($mode == 'show_week') { // View by week @@ -1502,7 +1502,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month print ''; print '
'; - print '
#
'; + print '
'; print ' '; $i = 0; while ($i < 7) { @@ -1544,10 +1544,9 @@ if (empty($mode) || $mode == 'show_month') { // View by month print ''; echo ''; - echo ''; + echo ''; echo ''; -} else // View by day -{ +} else { // View by day $newparam = $param; // newparam is for birthday links $newparam = preg_replace('/mode=show_month&?/i', '', $newparam); $newparam = preg_replace('/mode=show_week&?/i', '', $newparam); From b5de1323437c434153ae2874be6a6b06fde2541f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jan 2022 00:22:25 +0100 Subject: [PATCH 09/11] Fix responsive --- htdocs/product/stock/replenish.php | 2 +- htdocs/product/stock/replenishorders.php | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 695e4356582..23e93aba785 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -623,7 +623,7 @@ if (empty($reshook)) { } print '
'; -print ''; +print ''; print '
'; print ''; diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 8c2a218b40c..1eba8556753 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -37,11 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'orders')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'produit|service'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'replenishorders'; // To manage different context of search $sall = GETPOST('search_all', 'alphanohtml'); $sref = GETPOST('search_ref', 'alpha'); @@ -70,6 +66,12 @@ if ($page < 0) { } $offset = $limit * $page; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'produit|service'); + /* * Actions @@ -171,9 +173,10 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - print ''.$langs->trans("ReplenishmentOrdersDesc").'

'; + print '
'; + print ''; - print ''; + print ''.$langs->trans("ReplenishmentOrdersDesc").'
'; print_barre_liste('', $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, 0, ''); @@ -209,6 +212,7 @@ if ($resql) { $param .= '&optioncss='.urlencode($optioncss); } + print '
'; print '
'; print ''; @@ -347,6 +351,8 @@ if ($resql) { $i++; } print '
'; + print '
'; + print ''; $db->free($resql); From f91504b9c189284f83520738fd1f567643b11e5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jan 2022 12:16:13 +0100 Subject: [PATCH 10/11] Add property --- htdocs/core/db/DoliDB.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index daa5f657549..fb7f432e9f4 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -62,6 +62,9 @@ abstract class DoliDB implements Database /** @var string Last error number. For example: 'DB_ERROR_RECORD_ALREADY_EXISTS', '12345', ... */ public $lasterrno; + /** @var string If we need to set a prefix specific to the database so it can be reused instead of MAIN_DB_PREFIX when defined to forge requests */ + public $prefix_db; + /** @var bool Status */ public $ok; /** @var string */ From 874bbca8810cc009becbdfa49546f9ebf4e4802d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jan 2022 12:24:19 +0100 Subject: [PATCH 11/11] Doc --- htdocs/core/db/DoliDB.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index fb7f432e9f4..fdbb755637a 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -62,7 +62,7 @@ abstract class DoliDB implements Database /** @var string Last error number. For example: 'DB_ERROR_RECORD_ALREADY_EXISTS', '12345', ... */ public $lasterrno; - /** @var string If we need to set a prefix specific to the database so it can be reused instead of MAIN_DB_PREFIX when defined to forge requests */ + /** @var string If we need to set a prefix specific to the database so it can be reused (when defined instead of MAIN_DB_PREFIX) to forge requests */ public $prefix_db; /** @var bool Status */