From 864a8b4b3ebda7dd8698c4e2d7e2b4b44f2e31e2 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 6 Aug 2021 16:22:19 +0200 Subject: [PATCH 01/10] FIX: holiday card: hooks uninitialized --- htdocs/holiday/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 692b9639805..8929e7881bc 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -81,6 +81,9 @@ if (($id > 0) || $ref) } } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('holidaycard', 'globalcard')); + $cancreate = 0; if (!empty($user->rights->holiday->write_all)) $cancreate = 1; if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate = 1; From 108a5ff7cbf610b29858cef7f1bc6747b58dcda9 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Mon, 9 Aug 2021 15:14:25 +0200 Subject: [PATCH 02/10] FIX postgre filter select search extrafield --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 6b08baddb72..557c057c1c1 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -41,7 +41,7 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) { - $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = "' . $db->escape($crit) . '")'; + $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = \'' . $db->escape($crit) . '\')'; continue; } $sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search); From e4cb1e023aa4b678235f5a6115478f3e4bf94e05 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Mon, 9 Aug 2021 15:39:04 +0200 Subject: [PATCH 03/10] fix link to supplier card of thirdparty on supplier_order list --- htdocs/supplier_proposal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 5fcafb2fdc4..3c89be6bfe4 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -877,7 +877,7 @@ if ($resql) { // Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { print ''; - print $companystatic->getNomUrl(1, 'customer'); + print $companystatic->getNomUrl(1, 'supplier'); print ''; if (!$i) { $totalarray['nbfield']++; From b610cc1c6ca45f99291c39cd4180eebe83dbf34b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 10 Aug 2021 11:18:25 +0200 Subject: [PATCH 04/10] FIX: shipping validation workflow: 'ORDER_CLOSE' trigger called from wrong object --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index b40900dd6c7..e58f84f338c 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -309,7 +309,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $diff_array = array_diff_assoc($qtyordred, $qtyshipped); if (count($diff_array) == 0) { //No diff => mean everythings is shipped - $ret = $object->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE'); + $ret = $order->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE'); if ($ret < 0) { $this->error = $object->error; $this->errors = $object->errors; return $ret; From 087e2691038e151eb1d78c04283545b00861d243 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 10 Aug 2021 17:34:47 +0200 Subject: [PATCH 05/10] FIX : on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref) --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dbb454ef800..08516fbc7d2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -464,7 +464,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".$this->socid; $sql .= " WHERE l.fk_commande = ".$this->id; if ($only_product) $sql .= ' AND p.fk_product_type = 0'; $sql .= " ORDER BY l.rang, l.rowid"; From 6fbd93999fe888f5e5f396cf85de53f426f5935e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 13:33:51 +0200 Subject: [PATCH 06/10] css --- htdocs/core/class/html.form.class.php | 2 +- htdocs/product/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cee87c8ab41..33d2f70caa4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4724,7 +4724,7 @@ class Form $more .= '
'."\n"; foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) { - $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2472c764d7e..281613caae9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2417,7 +2417,7 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->d // Define confirmation messages $formquestionclone = array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), + array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss'=>'width150'), array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), ); From c12905f0f3ce498bfa9ae226ed5079ad50f3983c Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 17:51:39 +0200 Subject: [PATCH 07/10] ok --- htdocs/admin/pdf_other.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index ed14f2ac119..01ba7236f90 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -53,6 +53,9 @@ if ($cancel) { } if ($action == 'update') { + + if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); From 775164f84a0f513d44f7b7d1a67204945be50f7d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Aug 2021 06:50:50 +0000 Subject: [PATCH 08/10] Fixing style errors. --- htdocs/admin/pdf_other.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 01ba7236f90..f03bfc6a5ec 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -53,7 +53,6 @@ if ($cancel) { } if ($action == 'update') { - if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); From 8da328b183a9ffeeaa828bfc40898eaaa3a486ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 15:44:48 +0200 Subject: [PATCH 09/10] Update extrafields_list_search_sql.tpl.php --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 557c057c1c1..f62f65f18e9 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -41,7 +41,7 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) { - $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = \'' . $db->escape($crit) . '\')'; + $sql .= " AND (" . $extrafieldsobjectprefix.$tmpkey . " = '" . $db->escape($crit) . "')"; continue; } $sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search); From 51a28a4ac4f6a2f9c5a630503aacca9d54e888ab Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 5 Aug 2021 16:31:21 +0200 Subject: [PATCH 10/10] Fix lang error on hrm/index.php --- htdocs/hrm/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index fe2c42b0d1b..8a294a47e2c 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -234,7 +234,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { print ''; print ''.$holidaystatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1, 'leave').''; - print ''.dol_escape_htmltag($typeleaves[$obj->fk_type]['label']).''; + print ''.dol_escape_htmltag($langs->trans($typeleaves[$obj->fk_type]['code'])).''; $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning'; $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';