From 6e03e0ba83662c41cb59ace1a1416ad3752c0dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 28 Oct 2019 08:08:59 +0100 Subject: [PATCH 1/2] Update contact.class.php --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e1403b25578..724b1a93c13 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1264,7 +1264,7 @@ class Contact extends CommonObject // phpcs:enable global $langs; - if (empty($this->status) || empty($this->statusshort)) + if (empty($this->labelstatus) || empty($this->labelstatusshort)) { $this->labelstatus[0] = 'ActivityCeased'; $this->labelstatusshort[0] = 'ActivityCeased'; From 8a7a7ad0c880e582cccdf8c134375f8c6fe9c0b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 28 Oct 2019 08:16:43 +0100 Subject: [PATCH 2/2] Update contact.class.php --- htdocs/contact/class/contact.class.php | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 724b1a93c13..3def7123d24 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1264,23 +1264,24 @@ class Contact extends CommonObject // phpcs:enable global $langs; - if (empty($this->labelstatus) || empty($this->labelstatusshort)) - { - $this->labelstatus[0] = 'ActivityCeased'; - $this->labelstatusshort[0] = 'ActivityCeased'; - $this->labelstatus[5] = 'ActivityCeased'; - $this->labelstatusshort[5] = 'ActivityCeased'; - $this->labelstatus[1] = 'InActivity'; - $this->labelstatusshort[1] = 'InActivity'; - $this->labelstatus[4] = 'InActivity'; - $this->labelstatusshort[4] = 'InActivity'; - } + $labelstatus = array( + 0 => 'ActivityCeased', + 1 => 'InActivity', + 4 => 'InActivity', + 5 => 'ActivityCeased', + ); + $labelstatusshort = array( + 0 => 'ActivityCeased', + 1 => 'InActivity', + 4 => 'InActivity', + 5 => 'ActivityCeased', + ); $statusType = 'status4'; if ($status==0 || $status==5) $statusType = 'status5'; - $label = $langs->trans($this->labelstatus[$status]); - $labelshort = $langs->trans($this->labelstatusshort[$status]); + $label = $langs->trans($labelstatus[$status]); + $labelshort = $langs->trans($labelstatusshort[$status]); return dolGetStatus($label, $labelshort, '', $statusType, $mode); }