This commit is contained in:
Laurent Destailleur 2019-11-04 19:28:04 +01:00
parent ec8bd6327d
commit 5d41268d1e
4 changed files with 33 additions and 43 deletions

View File

@ -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);
}
/**

View File

@ -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();

View File

@ -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;

View File

@ -110,7 +110,7 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1;
});
</script>
<table class="liste" id="tablelines">
<table class="liste nobottom" id="tablelines">
<tr class="liste_titre nodrag nodrop">
<th class="liste_titre"><?php print $langs->trans('Ref') ?></th>
<th class="liste_titre"><?php print $langs->trans('Label') ?></th>