Skip to content
Snippets Groups Projects
Commit 790bc7b7 authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Withdrawals: Visual enhancements

parent 1de93c58
No related branches found
No related tags found
No related merge requests found
......@@ -48,13 +48,17 @@ class LignePrelevement
*/
function LignePrelevement($DB, $user)
{
global $conf,$langs;
$this->db = $DB ;
$this->user = $user;
// List of language codes for status
/*$this->statuts[0] = "Waiting";
$this->statuts[2] = "Credited";
$this->statuts[3] = "Refused";*/
$langs->load("withdrawals");
$this->statuts[0]=$langs->trans("StatusWaiting");
$this->statuts[2]=$langs->trans("StatusCredited");
$this->statuts[3]=$langs->trans("StatusRefused");
}
/**
......@@ -106,6 +110,52 @@ class LignePrelevement
return $result;
}
/**
* Return status label of object
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
* @return string Label
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->statut,$mode);
}
/**
* Return status label for a status
* @param statut id statut
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
* @return string Label
*/
function LibStatut($statut,$mode=0)
{
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 1)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut7').' '.$langs->trans($this->statuts[$statut]);
}
if ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4');
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut7');
}
if ($mode == 3)
{
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut4');
if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut7');
}
}
}
?>
......@@ -93,9 +93,9 @@ if ($_GET["id"])
{
$lipre = new LignePrelevement($db, $user);
$lipre->statuts[0] = $langs->trans("StatusWaiting");
$lipre->statuts[2] = $langs->trans("StatusCredited");
$lipre->statuts[3] = $langs->trans("StatusRefused");
//$lipre->statuts[0] = $langs->trans("StatusWaiting");
//$lipre->statuts[2] = $langs->trans("StatusCredited");
//$lipre->statuts[3] = $langs->trans("StatusRefused");
if ($lipre->fetch($_GET["id"]) == 0)
{
......
......@@ -128,8 +128,13 @@ if ($result)
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
if ($obj->statut==0) print img_picto($langs->trans("StatusWaiting"),'statut0');
if ($obj->statut==2) print img_picto($langs->trans("StatusCredited"),'statut4');
if ($obj->statut==3) print img_picto($langs->trans("StatusRefused"),'statut7');
print '<img border="0" src="./img/statut'.$obj->statut.'.png"></a>&nbsp;';
print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
print substr('000000'.$obj->rowid, -6);
print '</a></td>';
......@@ -142,7 +147,7 @@ if ($result)
if ($obj->statut == 3)
{
print '<b>Rejet�</b>';
print '<b>'.$langs->trans("StatusRefused").'</b>';
}
else
{
......
......@@ -131,12 +131,22 @@ if ($result)
print "<tr $bc[$var]><td>";
print '<img border="0" src="./img/statut'.$obj->statut_ligne.'.png"></a>&nbsp;';
if ($obj->statut_ligne==0) print img_picto($langs->trans("StatusWaiting"),'statut0');
if ($obj->statut_ligne==2) print img_picto($langs->trans("StatusCredited"),'statut4');
if ($obj->statut_ligne==3) print img_picto($langs->trans("StatusRefused"),'statut7');
print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid_ligne.'">';
print substr('000000'.$obj->rowid_ligne, -6);
print '</a></td>';
print '<td><img border="0" src="./img/statut'.$obj->statut.'.png"></a>&nbsp;';
print '<td>';
if ($obj->statut==0) print img_picto($langs->trans("StatusWaiting"),'statut0');
if ($obj->statut==1) print img_picto($langs->trans("StatusTrans"),'statut1');
if ($obj->statut==2) print img_picto($langs->trans("StatusCredited"),'statut4');
print "&nbsp;";
print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment