From e77b246f33dcaba3384232c1d430ee95c44eb3f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jun 2005 01:31:37 +0000 Subject: [PATCH] Trad: Traduction statut propal --- htdocs/comm/propal.php | 10 +++++----- htdocs/propal.class.php | 16 +++++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index be824cc90e0..9af69fe9ff6 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -994,7 +994,7 @@ else $pageprev = $page - 1; $pagenext = $page + 1; - $sql = 'SELECT s.nom, s.idp, s.client, p.rowid as propalid, p.price, p.ref,'.$db->pdate('p.datep').' as dp,'.$db->pdate('p.fin_validite').' as dfv, c.label as statut, c.id as statutid'; + $sql = 'SELECT s.nom, s.idp, s.client, p.rowid as propalid, p.price, p.ref,'.$db->pdate('p.datep').' as dp,'.$db->pdate('p.fin_validite').' as dfv, c.id as statutid'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c'; $sql .= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id'; @@ -1064,8 +1064,7 @@ else print ''; print ''; print ''; - print ''; - print ''; + print ''; print ''; print "\n"; print ''; @@ -1092,7 +1091,7 @@ else if ( $now > $objp->dfv && $objp->dfv > 0 ) { - print ''.strftime('%d %b %Y',$objp->dfv).''; + print ''.dolibarr_print_date($objp->dfv).''; } else { @@ -1110,7 +1109,8 @@ else print strftime('%Y',$objp->dp)."\n"; print ''.price($objp->price)."\n"; - print ''.$objp->statut."\n"; + $propal=New Propal($db); + print ''.$propal->LibStatut($objp->statutid,0)."\n"; print "\n"; $total = $total + $objp->price; diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 5673e36020a..0d401585ca5 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -63,11 +63,19 @@ class Propal function Propal($DB, $soc_idp="", $propalid=0) { + global $langs; + $this->db = $DB ; $this->socidp = $soc_idp; $this->id = $propalid; $this->products = array(); $this->remise = 0; + + $langs->load("propals"); + $this->statut[0]=$langs->trans("PropalStatusDraft"); + $this->statut[1]=$langs->trans("PropalStatusValidated"); + $this->statut_short[0]=$langs->trans("PropalStatusDraft"); + $this->statut_short[1]=$langs->trans("Opened"); } @@ -955,12 +963,10 @@ class Propal * \param statut id statut * \return string Libellé */ - function LibStatut($statut) + function LibStatut($statut,$size=1) { - global $langs; - $langs->load("propals"); - if ($statut == 0) return $langs->trans("PropalStatusDraft"); - return $langs->trans("PropalStatusValidated"); + if ($size) return $this->statut[$statut]; + else return $this->statut_short[$statut]; } }