Ajout picto sur statut commandes

This commit is contained in:
Laurent Destailleur 2006-03-26 21:42:00 +00:00
parent c19c5126b6
commit f5d9346e67

View File

@ -1300,22 +1300,66 @@ class Commande
/** /**
* \brief Retourne le libellé du statut de la commande * \brief Retourne le libellé du statut de la commande
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
* \return string Libellé * \return string Libellé
*/ */
function getLibStatut() function getLibStatut($mode)
{ {
return $this->LibStatut($this->statut); return $this->LibStatut($this->statut);
} }
/** /**
* \brief Renvoi le libellé d'un statut donné * \brief Renvoi le libellé d'un statut donné
* \param statut id statut * \param statut Id statut
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
* \return string Libellé * \return string Libellé
*/ */
function LibStatut($statut) function LibStatut($statut,$mode)
{
global $langs;
if ($mode == 0)
{
return $this->statuts[$statut];
}
if ($mode == 1)
{ {
return $this->status_label_short[$statut]; return $this->status_label_short[$statut];
} }
if ($mode == 2)
{
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut6').' '.$this->status_label_short[$statut];
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$this->status_label_short[$statut];
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$this->status_label_short[$statut];
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3').' '.$this->status_label_short[$statut];
if ($statut==3) return img_picto($langs->trans('StatusOrderProcessed'),'statut5').' '.$this->status_label_short[$statut];
}
if ($mode == 3)
{
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut6');
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1');
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
if ($statut==3) return img_picto($langs->trans('StatusOrderProcessed'),'statut5');
}
if ($mode == 4)
{
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut6').' '.$this->statuts[$statut];
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$this->statuts[$statut];
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$this->statuts[$statut];
if ($statut==2) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3').' '.$this->statuts[$statut];
if ($statut==3) return img_picto($langs->trans('StatusOrderProcessed'),'statut5').' '.$this->statuts[$statut];
}
if ($mode == 5)
{
if ($statut==-1) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderCanceled'),'statut6');
if ($statut==0) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
if ($statut==1) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderValidated'),'statut1');
if ($statut==2) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
if ($statut==3) return $this->status_label_short[$statut].' '.img_picto($langs->trans('StatusOrderProcessed'),'statut5');
}
}
/** /**
* \brief Charge les informations d'ordre info dans l'objet commande * \brief Charge les informations d'ordre info dans l'objet commande