From 5d41268d1e03a9f591f54ffef20113f03b0d476a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Nov 2019 19:28:04 +0100 Subject: [PATCH] CSS --- htdocs/expedition/class/expedition.class.php | 53 +++++--------------- htdocs/product/stock/productlot_list.php | 2 +- htdocs/reception/class/reception.class.php | 19 +++++++ htdocs/variants/list.php | 2 +- 4 files changed, 33 insertions(+), 43 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 2e61ad47733..8ec0cd64ec6 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -197,13 +197,6 @@ class Expedition extends CommonObject $this->statutshorts[0] = 'StatusSendingDraftShort'; $this->statutshorts[1] = 'StatusSendingValidatedShort'; $this->statutshorts[2] = 'StatusSendingProcessedShort'; - - /* Status "billed" or not is managed by another field than status - if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) - { - $this->statuts[2] = 'StatusSendingBilled'; - $this->statutshorts[2] = 'StatusSendingBilledShort'; - }*/ } /** @@ -1673,45 +1666,23 @@ class Expedition extends CommonObject /** * Return label of a status * - * @param int $status Id statut - * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto - * @return string Label of status + * @param int $status Id statut + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status */ public function LibStatut($status, $mode) { // phpcs:enable - global $langs; + global $langs; - if ($mode==0) - { - if ($status==0) return $langs->trans($this->statuts[$status]); - elseif ($status==1) return $langs->trans($this->statuts[$status]); - elseif ($status==2) return $langs->trans($this->statuts[$status]); - } - elseif ($mode==1) - { - if ($status==0) return $langs->trans($this->statutshorts[$status]); - elseif ($status==1) return $langs->trans($this->statutshorts[$status]); - elseif ($status==2) return $langs->trans($this->statutshorts[$status]); - } - elseif ($mode == 3) - { - if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0'); - elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4'); - elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut6'); - } - elseif ($mode == 4) - { - if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]); - elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]); - elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); - } - elseif ($mode == 5) - { - if ($status==0) return $langs->trans($this->statutshorts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut0'); - elseif ($status==1) return $langs->trans($this->statutshorts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut4'); - elseif ($status==2) return $langs->trans($this->statutshorts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6'); - } + $labelStatus = $langs->trans($this->statuts[$status]); + $labelStatusShort = $langs->trans($this->statutshorts[$status]); + + $statusType = 'status'.$status; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + if ($status == self::STATUS_CLOSED) $statusType = 'status6'; + + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } /** diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 88949818698..8dc8f34b7e0 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -217,7 +217,7 @@ $sql.= " p.label as product_label,"; $sql.= " p.tobatch"; // Add fields for extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); } // Add fields from hooks $parameters=array(); diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 48a35412987..8dd58798c8f 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -120,6 +120,13 @@ class Reception extends CommonObject $this->statuts[0] = 'StatusReceptionDraft'; $this->statuts[1] = 'StatusReceptionValidated'; $this->statuts[2] = 'StatusReceptionProcessed'; + + // List of short language codes for status + $this->statutshorts = array(); + $this->statutshorts[-1] = 'StatusReceptionCanceledShort'; + $this->statutshorts[0] = 'StatusReceptionDraftShort'; + $this->statutshorts[1] = 'StatusReceptionValidatedShort'; + $this->statutshorts[2] = 'StatusReceptionProcessedShort'; } /** @@ -1152,6 +1159,18 @@ class Reception extends CommonObject */ public function LibStatut($status, $mode) { + // phpcs:enable + global $langs; + + $labelStatus = $langs->trans($this->statuts[$status]); + $labelStatusShort = $langs->trans($this->statutshorts[$status]); + + $statusType = 'status'.$status; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + if ($status == self::STATUS_CLOSED) $statusType = 'status6'; + + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); + // phpcs:enable global $langs; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index da19bd88205..c4fd52f250c 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -110,7 +110,7 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; }); - +
trans('Ref') ?> trans('Label') ?>