diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index 18c2477c37f..6d01fc00867 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -453,7 +453,7 @@ if ($socidp > 0)
}
print '
'.dolibarr_print_date($objp->dp)." | \n";
print ''.price($objp->price).' | ';
- print ''.$propal_static->LibStatut($objp->fk_statut,2).' | ';
+ print ''.$propal_static->LibStatut($objp->fk_statut,5).' | ';
$var=!$var;
$i++;
}
@@ -548,7 +548,7 @@ if ($socidp > 0)
.(!isset($objp->ref) ? $objp->id : $objp->ref) ."\n";
print ''.dolibarr_print_date($objp->dc)." | \n";
print ' | ';
- print ''.$contratstatic->LibStatut($objp->statut,2)." | \n";
+ print ''.$contratstatic->LibStatut($objp->statut,5)." | \n";
print '';
$i++;
}
diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index 54147778c1a..1ef77f26100 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -364,7 +364,7 @@ if ($socid > 0)
}
print "".price($objp->total_ttc)." | \n";
- print ''.($facturestatic->LibStatut($objp->paye,$objp->statut,2))." | \n";
+ print ''.($facturestatic->LibStatut($objp->paye,$objp->statut,5))." | \n";
print "\n";
$i++;
}
diff --git a/htdocs/contrat/contrat.class.php b/htdocs/contrat/contrat.class.php
index 52cfa102edd..8e1c966f8b2 100644
--- a/htdocs/contrat/contrat.class.php
+++ b/htdocs/contrat/contrat.class.php
@@ -857,9 +857,9 @@ class Contrat
/**
- * \brief Retourne le libellé du statut du contrat
- * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
- * \return string Libellé
+ * \brief Retourne le libellé du statut du contrat
+ * \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é
*/
function getLibStatut($mode)
{
@@ -867,10 +867,10 @@ class Contrat
}
/**
- * \brief Renvoi le libellé d'un statut donné
- * \param statut id statut
- * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
- * \return string Libellé
+ * \brief Renvoi le libellé d'un statut donné
+ * \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é
*/
function LibStatut($statut,$mode)
{
@@ -906,6 +906,12 @@ class Contrat
if ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4').' '.$langs->trans("ContractStatusValidated"); }
if ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6').' '.$langs->trans("ContractStatusClosed"); }
}
+ if ($mode == 5)
+ {
+ if ($statut == 0) { return $langs->trans("ContractStatusDraft").' '.img_picto($langs->trans('ContractStatusDraft'),'statut0'); }
+ if ($statut == 1) { return $langs->trans("ContractStatusValidated").' '.img_picto($langs->trans('ContractStatusValidated'),'statut4'); }
+ if ($statut == 2) { return $langs->trans("ContractStatusClosed").' '.img_picto($langs->trans('ContractStatusClosed'),'statut6'); }
+ }
}
diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php
index 99cc8dc6a19..35bda68a227 100644
--- a/htdocs/fourn/fiche.php
+++ b/htdocs/fourn/fiche.php
@@ -186,6 +186,8 @@ if ( $societe->fetch($socid) )
/*
* Liste des commandes associées
*/
+ $orderstatic = new CommandeFournisseur($db);
+
$sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
$sql.= " WHERE p.fk_soc =".$societe->id;
@@ -222,7 +224,7 @@ if ( $societe->fetch($socid) )
print "-";
}
print '';
- print ' | ';
+ print ''.$orderstatic->LibStatut($obj->fk_statut,5).' | ';
print '';
$i++;
}
@@ -273,7 +275,7 @@ if ( $societe->fetch($socid) )
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dolibarr_trunc($obj->libelle,14).'';
print ''.dolibarr_print_date($obj->df).' | ';
print ''.price($obj->amount).' | ';
- print ''.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,2).' | ';
+ print ''.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).' | ';
print '';
$i++;
}
diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php
index 3e0d5f69015..388c9615ab7 100644
--- a/htdocs/fourn/fournisseur.commande.class.php
+++ b/htdocs/fourn/fournisseur.commande.class.php
@@ -273,6 +273,56 @@ class CommandeFournisseur
}
return $result ;
}
+
+
+ /**
+ * \brief Retourne le libellé du statut d'une commande (brouillon, validée, abandonnée, payée)
+ * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
+ * \return string Libelle
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut($this->statut,$mode);
+ }
+
+ /**
+ * \brief Renvoi le libellé d'un statut donné
+ * \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é du statut
+ */
+ function LibStatut($statut,$mode=0)
+ {
+ global $langs;
+ $langs->load('orders');
+
+ if ($mode == 0)
+ {
+ return $this->statuts[$statut];
+ }
+ if ($mode == 1)
+ {
+ return $this->statuts[$statut];
+ }
+ if ($mode == 2)
+ {
+ return $this->statuts[$statut];
+ }
+ if ($mode == 3)
+ {
+ return $this->statuts[$statut];
+ }
+ if ($mode == 4)
+ {
+ return $this->statuts[$statut];
+ }
+ if ($mode == 5)
+ {
+ return $this->statuts[$statut];
+ }
+ }
+
+
/*
*
*
diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php
index bec74517bdb..1de1d7f6748 100644
--- a/htdocs/propal.class.php
+++ b/htdocs/propal.class.php
@@ -1366,9 +1366,9 @@ class Propal
/**
- * \brief Retourne le libellé du statut d'une propale (brouillon, validée, ...)
- * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
- * \return string Libellé
+ * \brief Retourne le libellé du statut d'une propale (brouillon, validée, ...)
+ * \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é
*/
function getLibStatut($mode=0)
{
@@ -1376,16 +1376,16 @@ class Propal
}
/**
- * \brief Renvoi le libellé d'un statut donné
- * \param statut id statut
- * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
- * \return string Libellé
+ * \brief Renvoi le libellé d'un statut donné
+ * \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é
*/
function LibStatut($statut,$mode=1)
{
global $langs;
$langs->load("propal");
-
+
if ($mode == 0)
{
return $this->labelstatut[$statut];
@@ -1418,6 +1418,14 @@ class Propal
if ($statut==3) return img_picto($langs->trans('PropalStatusNotSigned'),'statut5').' '.$this->labelstatut[$statut];
if ($statut==4) return img_picto($langs->trans('PropalStatusBilled'),'statut6').' '.$this->labelstatut[$statut];
}
+ if ($mode == 5)
+ {
+ if ($statut==0) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusDraftShort'),'statut0');
+ if ($statut==1) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusOpenedShort'),'statut1');
+ if ($statut==2) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusSignedShort'),'statut3');
+ if ($statut==3) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusNotSignedShort'),'statut5');
+ if ($statut==4) return $this->labelstatut_short[$statut].' '.img_picto($langs->trans('PropalStatusBilledShort'),'statut6');
+ }
}