From b56eaf91e892f39252b1d431fd71eb082002fa85 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 2 Nov 2021 20:53:00 +0800 Subject: [PATCH 1/7] Update paiement.php --- htdocs/fourn/facture/paiement.php | 53 +++++++++++++------------------ 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 1dd6f0a0f12..cdd73b5ef70 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -555,14 +555,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$langs->trans('MulticurrencyAmountTTC').''; print ''.$langs->trans('MulticurrencyAlreadyPaid').''; print ''.$langs->trans('MulticurrencyRemainderToPay').''; + print ''.$langs->trans('MulticurrencyPaymentAmount').''; } print ''.$langs->trans('AmountTTC').''; print ''.$langs->trans('AlreadyPaid').''; print ''.$langs->trans('RemainderToPay').''; print ''.$langs->trans('PaymentAmount').''; - if (!empty($conf->multicurrency->enabled)) { - print ''.$langs->trans('MulticurrencyPaymentAmount').''; - } print ''; $total = 0; @@ -657,8 +655,26 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print price($sign * $multicurrency_remaintopay); } print ''; - } - + + print ''; + // Add remind multicurrency amount + $namef = 'multicurrency_amount_'.$objp->facid; + $nameRemain = 'multicurrency_remain_'.$objp->facid; + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { + if ($action != 'add_paiement') { + if (!empty($conf->use_javascript_ajax)) { + print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); + } + print ''; + print ''; + } else { + print ''; + print ''; + } + } + print ""; + } + print ''.price($sign * $objp->total_ttc).''; print ''.price($sign * $objp->am); @@ -690,29 +706,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ""; - // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) { - print ''; - - // Add remind multicurrency amount - $namef = 'multicurrency_amount_'.$objp->facid; - $nameRemain = 'multicurrency_remain_'.$objp->facid; - - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - if ($action != 'add_paiement') { - if (!empty($conf->use_javascript_ajax)) { - print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); - } - print ''; - print ''; - } else { - print ''; - print ''; - } - } - print ""; - } - print "\n"; $total += $objp->total_ht; $total_ttc += $objp->total_ttc; @@ -730,6 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ' '; print ' '; print ' '; + print ''; } print ''.price($sign * $total_ttc).''; print ''.price($sign * $totalrecu); @@ -742,9 +736,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; print ''; // Autofilled - if (!empty($conf->multicurrency->enabled)) { - print ''; - } print "\n"; } print "\n"; From 899f0bee9a191a699104ee60dad8b35bb5aa639f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 2 Nov 2021 12:59:38 +0000 Subject: [PATCH 2/7] Fixing style errors. --- htdocs/fourn/facture/paiement.php | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index cdd73b5ef70..76e15127098 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -655,26 +655,26 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print price($sign * $multicurrency_remaintopay); } print ''; - - print ''; - // Add remind multicurrency amount - $namef = 'multicurrency_amount_'.$objp->facid; - $nameRemain = 'multicurrency_remain_'.$objp->facid; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - if ($action != 'add_paiement') { - if (!empty($conf->use_javascript_ajax)) { - print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); - } - print ''; - print ''; - } else { - print ''; - print ''; - } - } - print ""; - } - + + print ''; + // Add remind multicurrency amount + $namef = 'multicurrency_amount_'.$objp->facid; + $nameRemain = 'multicurrency_remain_'.$objp->facid; + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { + if ($action != 'add_paiement') { + if (!empty($conf->use_javascript_ajax)) { + print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); + } + print ''; + print ''; + } else { + print ''; + print ''; + } + } + print ""; + } + print ''.price($sign * $objp->total_ttc).''; print ''.price($sign * $objp->am); From 1e20e082fe355d822a98ccc467767ea02171e571 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 9 Nov 2021 18:36:04 +0100 Subject: [PATCH 3/7] FIX lost superadmin grade after edit user card ! --- htdocs/user/card.php | 8 ++++++-- htdocs/user/class/user.class.php | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8622e293906..cfa89120053 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -450,11 +450,15 @@ if (empty($reshook)) { // Do we update also ->entity ? if (!empty($conf->multicompany->enabled)) { // If multicompany is not enabled, we never update the entity of a user. if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $object->entity = 1; // all users are in master entity + if (GETPOST('superadmin', 'int') === 1) { + $object->entity = 0; + } else { + $object->entity = 1; // all users are in master entity + } } else { // A user should not be able to move a user into another entity. Only superadmin should be able to do this. if ($user->entity == 0 && $user->admin) { - if (GETPOST("superadmin")) { + if (GETPOST('superadmin', 'int')) { // We try to set the user as superadmin. $object->entity = 0; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9540f082a4c..09bb34ddef3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1773,7 +1773,9 @@ class User extends CommonObject $sql .= ", salaryextra= ".($this->salaryextra != '' ? "'".$this->db->escape($this->salaryextra)."'" : "null"); } $sql .= ", weeklyhours= ".($this->weeklyhours != '' ? "'".$this->db->escape($this->weeklyhours)."'" : "null"); - $sql .= ", entity = ".((int) $this->entity); + if (!empty($user->admin) && empty($user->entity) && $user->id != $this->id) { + $sql .= ", entity = ".((int) $this->entity); // entity flag can be set/unset only by an another superadmin user + } $sql .= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null'); $sql .= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); $sql .= ", fk_warehouse = ".($this->fk_warehouse > 0 ? $this->fk_warehouse : "null"); From 5649e865c3e6cefa8e324769d663c1225a1125ef Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 9 Nov 2021 18:38:29 +0100 Subject: [PATCH 4/7] FIX wrong check --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cfa89120053..dec885e11eb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -450,7 +450,7 @@ if (empty($reshook)) { // Do we update also ->entity ? if (!empty($conf->multicompany->enabled)) { // If multicompany is not enabled, we never update the entity of a user. if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - if (GETPOST('superadmin', 'int') === 1) { + if (GETPOST('superadmin', 'int')) { $object->entity = 0; } else { $object->entity = 1; // all users are in master entity From 5eff0e7a0c996a16bb5b2805f77bcec9bfb814c6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 11 Nov 2021 17:48:23 +0100 Subject: [PATCH 5/7] FIX only a superadmin can modify entity --- htdocs/user/card.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index dec885e11eb..68218ab16bd 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -448,23 +448,15 @@ if (empty($reshook)) { $object->lang = GETPOST('default_lang', 'aZ09'); // Do we update also ->entity ? - if (!empty($conf->multicompany->enabled)) { // If multicompany is not enabled, we never update the entity of a user. - if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - if (GETPOST('superadmin', 'int')) { - $object->entity = 0; - } else { - $object->entity = 1; // all users are in master entity - } + if (!empty($conf->multicompany->enabled && $user->entity == 0 && !empty($user->admin))) { // If multicompany is not enabled, we never update the entity of a user. + if (GETPOST('superadmin', 'int')) { + $object->entity = 0; } else { - // A user should not be able to move a user into another entity. Only superadmin should be able to do this. - if ($user->entity == 0 && $user->admin) { - if (GETPOST('superadmin', 'int')) { - // We try to set the user as superadmin. - $object->entity = 0; - } else { - // We try to change the entity of user - $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity); - } + if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $object->entity = 1; // all users are in master entity + } else { + // We try to change the entity of user + $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity); } } } From 53b565ec1d8324f4289b2b5f5462ed62b2a5668c Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 11 Nov 2021 20:06:21 +0100 Subject: [PATCH 6/7] Fix date_select go away when sorting subscription --- htdocs/adherents/subscription/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 7146e89648e..4c9935b76a8 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -311,6 +311,7 @@ print ''; print ''; print ''; print ''; +print ''; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); From f2407a3f9432f2cf21793d4b23da20df83ce3683 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 13 Nov 2021 20:04:03 +0100 Subject: [PATCH 7/7] Fix 19306 - Tracking url is clickable in reception card --- htdocs/reception/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 111d65e8c7f..644bd115d4b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1557,9 +1557,8 @@ if ($action == 'create') { print ''; // Tracking Number - print ''.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->rights->reception->creer).''; - print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->rights->reception->creer, 'string', $object->tracking_number); + print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->rights->reception->creer, 'safehtmlstring', $object->tracking_number); print ''; // Incoterms