From 311d6d666dad46de5cd9ad35304b1497ad19bfb3 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Tue, 25 Jan 2022 15:12:32 +0100 Subject: [PATCH 1/4] fix ticket : an external user should be able to access only its own company tickets. --- htdocs/ticket/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index e4ba75b84c5..44b9edf358e 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -157,6 +157,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); if (!$user->rights->ticket->read) { accessforbidden(); } +// restrict view to current user's company +if ($user->socid > 0) $socid = $user->socid; // Store current page url $url_page_current = DOL_URL_ROOT.'/ticket/list.php'; From a7d3facf889e4431f7d6999b1cd3ba4185d00590 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jan 2022 23:58:31 +0100 Subject: [PATCH 2/4] Fix tooltip for payment --- .../class/paymentexpensereport.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 48adeab929d..3aac0cee2b8 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -635,7 +635,16 @@ class PaymentExpenseReport extends CommonObject if (empty($this->ref)) { $this->ref = $this->label; } - $label = $langs->trans("ShowPayment").': '.$this->ref; + $label = img_picto('', $this->picto).' '.$langs->trans("Payment").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } + if (!empty($this->ref)) { + $label .= '
'.$langs->trans('Ref').': '.$this->ref; + } + if (!empty($this->datep)) { + $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->datep, 'dayhour'); + } if (!empty($this->id)) { $link = ''; From 4f54149555b0bed3c66382ca76d7885e1820a593 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 25 Jan 2022 22:28:47 +0100 Subject: [PATCH 3/4] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2d5ae6ca78b..dbf8f3869e0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2293,6 +2293,15 @@ abstract class CommonObject if (get_class($this) == 'Fournisseur') { $this->mode_reglement_supplier_id = $id; } + // Triggers + if (!$error && !$notrigger) { + // Call triggers + $result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } return 1; } else { dol_syslog(get_class($this).'::setPaymentMethods Error '.$this->db->error()); From 7ce6f1393397bccbda9346308c3b4c3a7ebe01a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Jan 2022 14:07:13 +0100 Subject: [PATCH 4/4] Fix php8 --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index dbf8f3869e0..cf00dc0e317 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2266,7 +2266,10 @@ abstract class CommonObject */ public function setPaymentMethods($id) { + $error = 0; $notrigger = 0; + dol_syslog(get_class($this).'::setPaymentMethods('.$id.')'); + if ($this->statut >= 0 || $this->element == 'societe') { // TODO uniformize field name $fieldname = 'fk_mode_reglement';