Look: Modif esthétique mineure

This commit is contained in:
Laurent Destailleur 2006-03-25 12:49:55 +00:00
parent 856b871f74
commit 9bd15473d5
6 changed files with 86 additions and 20 deletions

View File

@ -453,7 +453,7 @@ if ($socidp > 0)
} }
print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dp)."</td>\n"; print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dp)."</td>\n";
print '<td align="right" width="120">'.price($objp->price).'</td>'; print '<td align="right" width="120">'.price($objp->price).'</td>';
print '<td align="center" width="100">'.$propal_static->LibStatut($objp->fk_statut,2).'</td></tr>'; print '<td align="right" nowrap="nowrap">'.$propal_static->LibStatut($objp->fk_statut,5).'</td></tr>';
$var=!$var; $var=!$var;
$i++; $i++;
} }
@ -548,7 +548,7 @@ if ($socidp > 0)
.(!isset($objp->ref) ? $objp->id : $objp->ref) ."</a></td>\n"; .(!isset($objp->ref) ? $objp->id : $objp->ref) ."</a></td>\n";
print '<td align="right" width="80">'.dolibarr_print_date($objp->dc)."</td>\n"; print '<td align="right" width="80">'.dolibarr_print_date($objp->dc)."</td>\n";
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '<td align="center" width="100">'.$contratstatic->LibStatut($objp->statut,2)."</td>\n"; print '<td align="right" nowrap="nowrap">'.$contratstatic->LibStatut($objp->statut,5)."</td>\n";
print '</tr>'; print '</tr>';
$i++; $i++;
} }

View File

@ -364,7 +364,7 @@ if ($socid > 0)
} }
print "<td align=\"right\">".price($objp->total_ttc)."</td>\n"; print "<td align=\"right\">".price($objp->total_ttc)."</td>\n";
print '<td align="left">'.($facturestatic->LibStatut($objp->paye,$objp->statut,2))."</td>\n"; print '<td align="right" nowrap="nowrap">'.($facturestatic->LibStatut($objp->paye,$objp->statut,5))."</td>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@ -857,9 +857,9 @@ class Contrat
/** /**
* \brief Retourne le libellé du statut du 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 * \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($mode) function getLibStatut($mode)
{ {
@ -867,10 +867,10 @@ class Contrat
} }
/** /**
* \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 * \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,$mode) 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 == 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 ($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'); }
}
} }

View File

@ -186,6 +186,8 @@ if ( $societe->fetch($socid) )
/* /*
* Liste des commandes associées * 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 = "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.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
$sql.= " WHERE p.fk_soc =".$societe->id; $sql.= " WHERE p.fk_soc =".$societe->id;
@ -222,7 +224,7 @@ if ( $societe->fetch($socid) )
print "-"; print "-";
} }
print '</td>'; print '</td>';
print '<td width="20"><img src="commande/statut'.$obj->fk_statut.'.png"></td>'; print '<td align="right" nowrap="nowrap">'.$orderstatic->LibStatut($obj->fk_statut,5).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }
@ -273,7 +275,7 @@ if ( $societe->fetch($socid) )
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dolibarr_trunc($obj->libelle,14).'</td>'; print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dolibarr_trunc($obj->libelle,14).'</td>';
print '<td align="center">'.dolibarr_print_date($obj->df).'</td>'; print '<td align="center">'.dolibarr_print_date($obj->df).'</td>';
print '<td align="right">'.price($obj->amount).'</td>'; print '<td align="right">'.price($obj->amount).'</td>';
print '<td align="left" nowrap="nowrap">'.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,2).'</td>'; print '<td align="right" nowrap="nowrap">'.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }

View File

@ -273,6 +273,56 @@ class CommandeFournisseur
} }
return $result ; 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];
}
}
/* /*
* *
* *

View File

@ -1366,9 +1366,9 @@ class Propal
/** /**
* \brief Retourne le libellé du statut d'une propale (brouillon, validée, ...) * \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 * \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($mode=0) function getLibStatut($mode=0)
{ {
@ -1376,16 +1376,16 @@ class Propal
} }
/** /**
* \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 * \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,$mode=1) function LibStatut($statut,$mode=1)
{ {
global $langs; global $langs;
$langs->load("propal"); $langs->load("propal");
if ($mode == 0) if ($mode == 0)
{ {
return $this->labelstatut[$statut]; 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==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 ($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');
}
} }