Look: Ajout picto statut sur fiches interventions

This commit is contained in:
Laurent Destailleur 2006-05-10 20:34:25 +00:00
parent 497458ffc7
commit a2ae8d4821
3 changed files with 38 additions and 9 deletions

View File

@ -318,7 +318,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
$fichinter->fetch_projet(); $fichinter->fetch_projet();
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>'.$fichinter->projet.'</td></tr>'; print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>'.$fichinter->projet.'</td></tr>';
} }
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut().'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut(4).'</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Description").'</td>'; print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
print '<td>'; print '<td>';

View File

@ -62,6 +62,8 @@ class Fichinter
// Statut 0=brouillon, 1=validé // Statut 0=brouillon, 1=validé
$this->statuts[0]=$langs->trans("Draft"); $this->statuts[0]=$langs->trans("Draft");
$this->statuts[1]=$langs->trans("Validated"); $this->statuts[1]=$langs->trans("Validated");
$this->statuts_short[0]=$langs->trans("Draft");
$this->statuts_short[1]=$langs->trans("Validated");
} }
@ -294,9 +296,9 @@ class Fichinter
* \brief Retourne le libellé du statut de l'intervantion * \brief Retourne le libellé du statut de l'intervantion
* \return string Libellé * \return string Libellé
*/ */
function getLibStatut() function getLibStatut($mode=0)
{ {
return $this->LibStatut($this->statut); return $this->LibStatut($this->statut,$mode);
} }
/** /**
@ -304,9 +306,36 @@ class Fichinter
* \param statut id statut * \param statut id statut
* \return string Libellé * \return string Libellé
*/ */
function LibStatut($statut) function LibStatut($statut,$mode=0)
{ {
return $this->statuts[$statut]; if ($mode == 0)
{
return $this->statuts[$statut];
}
if ($mode == 1)
{
return $this->statuts_short[$statut];
}
if ($mode == 2)
{
if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0').' '.$this->statuts_short[$statut];
if ($statut==1) return img_picto($this->statuts_short[$statut],'statut1').' '.$this->statuts_short[$statut];
}
if ($mode == 3)
{
if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0');
if ($statut==1) return img_picto($this->statuts_short[$statut],'statut1');
}
if ($mode == 4)
{
if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0').' '.$this->statuts[$statut];
if ($statut==1) return img_picto($this->statuts_short[$statut],'statut1').' '.$this->statuts[$statut];
}
if ($mode == 5)
{
if ($statut==0) return $this->statuts_short[$statut].' '.img_picto($this->statuts_short[$statut],'statut0');
if ($statut==1) return $this->statuts_short[$statut].' '.img_picto($this->statuts_short[$statut],'statut1');
}
} }
} }
?> ?>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -65,7 +65,7 @@ if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.idp = s
if ($socid > 0) if ($socid > 0)
{ {
$sql .= " AND s.idp = " . $socid; $sql .= " AND s.idp = " . $socid;
} }
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1 ,$offset); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1 ,$offset);
@ -86,7 +86,7 @@ if ($result)
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print_liste_field_titre($langs->trans("Date"),"index.php","f.datei","","&amp;socid=$socid",'align="center"',$sortfield); print_liste_field_titre($langs->trans("Date"),"index.php","f.datei","","&amp;socid=$socid",'align="center"',$sortfield);
print '<td align="right">'.$langs->trans("Duration").'</td>'; print '<td align="right">'.$langs->trans("Duration").'</td>';
print '<td align="center">'.$langs->trans("Status").'</td>'; print '<td align="right">'.$langs->trans("Status").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
$total = 0; $total = 0;
@ -100,7 +100,7 @@ if ($result)
print '<td>'.nl2br($objp->note).'</td>'; print '<td>'.nl2br($objp->note).'</td>';
print '<td align="center">'.dolibarr_print_date($objp->dp)."</td>\n"; print '<td align="center">'.dolibarr_print_date($objp->dp)."</td>\n";
print '<td align="right">'.price($objp->duree).'</td>'; print '<td align="right">'.price($objp->duree).'</td>';
print '<td align="center">'.$fichinter_static->LibStatut($objp->fk_statut).'</td>'; print '<td align="right">'.$fichinter_static->LibStatut($objp->fk_statut,5).'</td>';
print "</tr>\n"; print "</tr>\n";
$total += $objp->duree; $total += $objp->duree;