Qual: Translation of status must be in the "view" functions.
This commit is contained in:
parent
8924f1104a
commit
3ef86dedec
@ -65,16 +65,14 @@ class Mailing extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function Mailing($DB)
|
function Mailing($DB)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
$langs->load("mails");
|
|
||||||
|
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->db_table = MAIN_DB_PREFIX."mailing";
|
$this->db_table = MAIN_DB_PREFIX."mailing";
|
||||||
|
|
||||||
$this->statuts[0] = $langs->trans("MailingStatusDraft");
|
// List of language codes for status
|
||||||
$this->statuts[1] = $langs->trans("MailingStatusValidated");
|
$this->statuts[0] = 'MailingStatusDraft';
|
||||||
$this->statuts[2] = $langs->trans("MailingStatusSentPartialy");
|
$this->statuts[1] = 'MailingStatusValidated';
|
||||||
$this->statuts[3] = $langs->trans("MailingStatusSentCompletely");
|
$this->statuts[2] = 'MailingStatusSentPartialy';
|
||||||
|
$this->statuts[3] = 'MailingStatusSentCompletely';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -402,18 +400,18 @@ class Mailing extends CommonObject
|
|||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
if ($mode == 1)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$this->statuts[$statut];
|
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$this->statuts[$statut];
|
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$this->statuts[$statut];
|
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$this->statuts[$statut];
|
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
@ -424,19 +422,18 @@ class Mailing extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$this->statuts[$statut];
|
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$this->statuts[$statut];
|
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$this->statuts[$statut];
|
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$this->statuts[$statut];
|
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return $this->statuts[$statut].' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||||
if ($statut == 1) return $this->statuts[$statut].' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||||
if ($statut == 2) return $this->statuts[$statut].' '.img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
if ($statut == 2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut == 3) return $this->statuts[$statut].' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
if ($statut == 3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,9 +167,9 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td width="20%">Statut</td><td>';
|
print '<tr><td width="20%">'.$langs->trans('Status').'</td><td>';
|
||||||
print '<img src="./statut'.$bon->statut.'.png"> ';
|
print '<img src="./statut'.$bon->statut.'.png"> ';
|
||||||
print $lipre->statuts[$lipre->statut].'</td></tr>';
|
print $langs->trans($lipre->statuts[$lipre->statut]).'</td></tr>';
|
||||||
|
|
||||||
if($bon->date_trans <> 0)
|
if($bon->date_trans <> 0)
|
||||||
{
|
{
|
||||||
@ -220,7 +220,7 @@ if ($_GET["id"])
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="infocredit">';
|
print '<input type="hidden" name="action" value="infocredit">';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="20%">Crédité le</td><td>';
|
print '<tr><td width="20%">Cr<EFBFBD>dit<EFBFBD> le</td><td>';
|
||||||
print $html->select_date('','','','','',"infocredit");
|
print $html->select_date('','','','','',"infocredit");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td colspan="2" align="center">';
|
print '<tr><td colspan="2" align="center">';
|
||||||
|
|||||||
@ -30,15 +30,17 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class LignePrelevement
|
* \class LignePrelevement
|
||||||
\brief Classe permettant la gestion des prelevements
|
* \brief Classe permettant la gestion des prelevements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LignePrelevement
|
class LignePrelevement
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
|
var $statuts = array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur de la classe
|
* \brief Constructeur de la classe
|
||||||
@ -50,10 +52,10 @@ class LignePrelevement
|
|||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
$this->statuts = array();
|
// List of language codes for status
|
||||||
$this->statuts[0] = "En attente";
|
$this->statuts[0] = "Waiting";
|
||||||
$this->statuts[2] = "Credite";
|
$this->statuts[2] = "Credited";
|
||||||
$this->statuts[3] = "Rejete";
|
$this->statuts[3] = "Refused";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -100,8 +100,8 @@ if ($_GET["id"])
|
|||||||
print '<a href="fiche.php?id='.$lipre->bon_rowid.'">'.$lipre->bon_ref.'</a></td></tr>';
|
print '<a href="fiche.php?id='.$lipre->bon_rowid.'">'.$lipre->bon_ref.'</a></td></tr>';
|
||||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>';
|
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>';
|
||||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>';
|
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>';
|
||||||
print '<img src="./statut'.$lipre->statut.'.png"> ';
|
print '<img src="./statut'.$lipre->statut.'.png"> ';
|
||||||
print $lipre->statuts[$lipre->statut].'</td></tr>';
|
print $langs->trans($lipre->statuts[$lipre->statut]).'</td></tr>';
|
||||||
|
|
||||||
if ($lipre->statut == 3)
|
if ($lipre->statut == 3)
|
||||||
{
|
{
|
||||||
@ -151,8 +151,8 @@ if ($_GET["id"])
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="confirm_rejet">';
|
print '<input type="hidden" name="action" value="confirm_rejet">';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td colspan="3">Rejet de prélèvement</td></tr>';
|
print '<tr><td colspan="3">Rejet de pr<EFBFBD>l<EFBFBD>vement</td></tr>';
|
||||||
print '<tr><td class="valid">Etes-vous sûr de vouloir saisir un rejet de prélèvement pour la société '.$soc->nom.' ?</td>';
|
print '<tr><td class="valid">Etes-vous s<EFBFBD>r de vouloir saisir un rejet de pr<70>l<EFBFBD>vement pour la soci<63>t<EFBFBD> '.$soc->nom.' ?</td>';
|
||||||
print '<td colspan="2" class="valid">';
|
print '<td colspan="2" class="valid">';
|
||||||
print '<select name="confirm">';
|
print '<select name="confirm">';
|
||||||
print '<option value="yes">oui</option>';
|
print '<option value="yes">oui</option>';
|
||||||
|
|||||||
@ -54,20 +54,17 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisation
|
* Initialisation
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function Expedition($DB)
|
function Expedition($DB)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
$this->lignes = array();
|
$this->lignes = array();
|
||||||
|
|
||||||
$this->statuts[-1] = $langs->trans("Canceled");
|
|
||||||
$this->statuts[0] = $langs->trans("Draft");
|
|
||||||
$this->statuts[1] = $langs->trans("Validated");
|
|
||||||
|
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
|
|
||||||
|
// List of long language codes for status
|
||||||
|
$this->statuts[-1] = 'StatusSendingCanceled';
|
||||||
|
$this->statuts[0] = 'StatusSendingDraft';
|
||||||
|
$this->statuts[1] = 'StatusSendingValidated';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -690,10 +687,10 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi le libelle d'un statut donne
|
* \brief Return label of a status
|
||||||
* \param statut Id statut
|
* \param statut Id statut
|
||||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* \param mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
||||||
* \return string Libelle
|
* \return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode)
|
function LibStatut($statut,$mode)
|
||||||
{
|
{
|
||||||
@ -701,23 +698,23 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
if ($mode==0)
|
if ($mode==0)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $this->statuts[$statut];
|
if ($statut==0) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return $this->statuts[$statut];
|
if ($statut==1) return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode==1)
|
if ($mode==1)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $this->statuts[$statut];
|
if ($statut==0) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return $this->statuts[$statut];
|
if ($statut==1) return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans('StatusSendingDraft'),'statut0').' '.$langs->trans('StatusSendingDraft');
|
if ($statut==0) return img_picto(this->statuts[$statut],'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusSendingValidated'),'statut4').' '.$langs->trans('StatusSendingValidated');
|
if ($statut==1) return img_picto(this->statuts[$statut],'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $langs->trans('StatusSendingDraftShort').' '.img_picto($langs->trans('StatusSendingDraft'),'statut0');
|
if ($statut==0) return $langs->trans('StatusSendingDraftShort').' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||||
if ($statut==1) return $langs->trans('StatusSendingValidatedShort').' '.img_picto($langs->trans('StatusSendingValidated'),'statut4');
|
if ($statut==1) return $langs->trans('StatusSendingValidatedShort').' '.img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,18 +66,16 @@ class Fichinter extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function Fichinter($DB, $socid="")
|
function Fichinter($DB, $socid="")
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->socid = $socid;
|
$this->socid = $socid;
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
$this->projet_id = 0;
|
$this->projet_id = 0;
|
||||||
|
|
||||||
// Statut 0=brouillon, 1=valide
|
// List of language codes for status
|
||||||
$this->statuts[0]=$langs->trans("Draft");
|
$this->statuts[0]='Draft';
|
||||||
$this->statuts[1]=$langs->trans("Validated");
|
$this->statuts[1]='Validated';
|
||||||
$this->statuts_short[0]=$langs->trans("Draft");
|
$this->statuts_short[0]='Draft';
|
||||||
$this->statuts_short[1]=$langs->trans("Validated");
|
$this->statuts_short[1]='Validated';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -340,31 +338,31 @@ class Fichinter extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
if ($mode == 1)
|
||||||
{
|
{
|
||||||
return $this->statuts_short[$statut];
|
return $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0').' '.$this->statuts_short[$statut];
|
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
if ($statut==1) return img_picto($this->statuts_short[$statut],'statut6').' '.$this->statuts_short[$statut];
|
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0');
|
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1) return img_picto($this->statuts_short[$statut],'statut6');
|
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0').' '.$this->statuts[$statut];
|
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return img_picto($this->statuts_short[$statut],'statut6').' '.$this->statuts[$statut];
|
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $this->statuts_short[$statut].' '.img_picto($this->statuts_short[$statut],'statut0');
|
if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1) return $this->statuts_short[$statut].' '.img_picto($this->statuts_short[$statut],'statut6');
|
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ if ($resql)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td>'.$commande->statuts[$row[1]].'</td>';
|
print '<td>'.$langs->trans($commande->statuts[$row[1]]).'</td>';
|
||||||
print '<td align="right"><a href="liste.php?statut='.$row[1].'">'.$row[0].' '.$commande->LibStatut($row[1],3).'</a></td>';
|
print '<td align="right"><a href="liste.php?statut='.$row[1].'">'.$row[0].' '.$commande->LibStatut($row[1],3).'</a></td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -56,20 +56,17 @@ class CommandeFournisseur extends Commande
|
|||||||
function CommandeFournisseur($DB)
|
function CommandeFournisseur($DB)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
|
|
||||||
global $langs;
|
|
||||||
$langs->load('orders');
|
|
||||||
|
|
||||||
$this->statuts[0] = $langs->trans('StatusOrderDraft');
|
|
||||||
$this->statuts[1] = $langs->trans('StatusOrderValidated');
|
|
||||||
$this->statuts[2] = $langs->trans('StatusOrderApproved');
|
|
||||||
$this->statuts[3] = $langs->trans('StatusOrderOnProcess');
|
|
||||||
$this->statuts[4] = $langs->trans('StatusOrderReceivedPartially');
|
|
||||||
$this->statuts[5] = $langs->trans('StatusOrderReceivedAll');
|
|
||||||
$this->statuts[6] = $langs->trans('StatusOrderCanceled');
|
|
||||||
$this->statuts[9] = $langs->trans('StatusOrderRefused');
|
|
||||||
|
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
|
|
||||||
|
// List of language codes for status
|
||||||
|
$this->statuts[0] = 'StatusOrderDraft';
|
||||||
|
$this->statuts[1] = 'StatusOrderValidated';
|
||||||
|
$this->statuts[2] = 'StatusOrderApproved';
|
||||||
|
$this->statuts[3] = 'StatusOrderOnProcess';
|
||||||
|
$this->statuts[4] = 'StatusOrderReceivedPartially';
|
||||||
|
$this->statuts[5] = 'StatusOrderReceivedAll';
|
||||||
|
$this->statuts[6] = 'StatusOrderCanceled';
|
||||||
|
$this->statuts[9] = 'StatusOrderRefused';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -365,9 +362,9 @@ class CommandeFournisseur extends Commande
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le libelle du statut d'une commande (brouillon, validee, abandonnee, payee
|
* \brief Return label of the status of object
|
||||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
* \param mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label
|
||||||
* \return string Libelle
|
* \return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode=0)
|
||||||
{
|
{
|
||||||
@ -375,10 +372,10 @@ class CommandeFournisseur extends Commande
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi le libelle d'un statut donne
|
* \brief Return label of a status
|
||||||
* \param statut Id statut
|
* \param statut Id statut
|
||||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* \param mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
||||||
* \return string Libelle du statut
|
* \return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
@ -387,58 +384,58 @@ class CommandeFournisseur extends Commande
|
|||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
if ($mode == 1)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusOrderApproved'),'statut3');
|
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut==3) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
|
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut==4) return img_picto($langs->trans('StatusOrderReceivedPartially'),'statut3');
|
if ($statut==4) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut==5) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
if ($statut==5) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||||
if ($statut==6) return img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
if ($statut==6) return img_picto($langs->trans($this->statuts[$statut]),'statut5');
|
||||||
if ($statut==9) return img_picto($langs->trans('StatusOrderRefused'),'statut5');
|
if ($statut==9) return img_picto($langs->trans($this->statuts[$statut]),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$this->statuts[$statut];
|
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$this->statuts[$statut];
|
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusOrderApproved'),'statut3').' '.$this->statuts[$statut];
|
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==3) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3').' '.$this->statuts[$statut];
|
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==4) return img_picto($langs->trans('StatusOrderReceivedPartially'),'statut3').' '.$this->statuts[$statut];
|
if ($statut==4) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==5) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$this->statuts[$statut];
|
if ($statut==5) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==6) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$this->statuts[$statut];
|
if ($statut==6) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==9) return img_picto($langs->trans('StatusOrderRefused'),'statut5').' '.$this->statuts[$statut];
|
if ($statut==9) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||||
if ($statut==1) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
if ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||||
if ($statut==2) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderApproved'),'statut3');
|
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut==3) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
|
if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut==4) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderReceivedPartially'),'statut3');
|
if ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3');
|
||||||
if ($statut==5) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
if ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||||
if ($statut==6) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
if ($statut==6) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5');
|
||||||
if ($statut==9) return $this->statuts[$statut].' '.img_picto($langs->trans('StatusOrderRefused'),'statut5');
|
if ($statut==9) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie nom clicable (avec eventuellement le picto)
|
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||||
\param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
\param option Sur quoi pointe le lien
|
* \param option Sur quoi pointe le lien
|
||||||
\return string Chaine avec URL
|
* \return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option='')
|
function getNomUrl($withpicto=0,$option='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if ($resql)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td>'.$commande->statuts[$row[1]].'</td>';
|
print '<td>'.$langs->trans($commande->statuts[$row[1]]).'</td>';
|
||||||
print '<td align="center">'.$row[0].'</td>';
|
print '<td align="center">'.$row[0].'</td>';
|
||||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/fourn/commande/liste.php?statut='.$row[1].'">'.$commande->LibStatut($row[1],3).'</a></td>';
|
print '<td align="center"><a href="'.DOL_URL_ROOT.'/fourn/commande/liste.php?statut='.$row[1].'">'.$commande->LibStatut($row[1],3).'</a></td>';
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,10 @@ DateSendingShort=Date sending order
|
|||||||
SendingsForSameOrder=Shipments for this order
|
SendingsForSameOrder=Shipments for this order
|
||||||
SendingsAndReceivingForSameOrder=Shipments and receivings for this order
|
SendingsAndReceivingForSameOrder=Shipments and receivings for this order
|
||||||
SendingsToValidate=Sending to validate
|
SendingsToValidate=Sending to validate
|
||||||
|
StatusSendingCanceled=Canceled
|
||||||
StatusSendingDraft=Draft
|
StatusSendingDraft=Draft
|
||||||
StatusSendingValidated=Validated (products to ship or already shipped)
|
StatusSendingValidated=Validated (products to ship or already shipped)
|
||||||
|
StatusSendingCanceledShort=Canceled
|
||||||
StatusSendingDraftShort=Draft
|
StatusSendingDraftShort=Draft
|
||||||
StatusSendingValidatedShort=Validated
|
StatusSendingValidatedShort=Validated
|
||||||
SendingSheet=Sending sheet
|
SendingSheet=Sending sheet
|
||||||
|
|||||||
@ -27,8 +27,10 @@ DateSendingShort=Date ordre expéd.
|
|||||||
SendingsForSameOrder=Expéditions pour cette commande
|
SendingsForSameOrder=Expéditions pour cette commande
|
||||||
SendingsAndReceivingForSameOrder=Expéditions et réceptions pour cette commande
|
SendingsAndReceivingForSameOrder=Expéditions et réceptions pour cette commande
|
||||||
SendingsToValidate=Expéditions à valider
|
SendingsToValidate=Expéditions à valider
|
||||||
|
StatusSendingCanceled=Annulée
|
||||||
StatusSendingDraft=Brouillon
|
StatusSendingDraft=Brouillon
|
||||||
StatusSendingValidated=Validée (produits à envoyer ou envoyés)
|
StatusSendingValidated=Validée (produits à envoyer ou envoyés)
|
||||||
|
StatusSendingCanceledShort=Annulée
|
||||||
StatusSendingDraftShort=Brouillon
|
StatusSendingDraftShort=Brouillon
|
||||||
StatusSendingValidatedShort=Validée
|
StatusSendingValidatedShort=Validée
|
||||||
SendingSheet=Bordereau d'expédition
|
SendingSheet=Bordereau d'expédition
|
||||||
|
|||||||
@ -20,11 +20,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/livraison/livraison.class.php
|
\file htdocs/livraison/livraison.class.php
|
||||||
\ingroup livraison
|
\ingroup livraison
|
||||||
\brief Fichier de la classe de gestion des bons de livraison
|
\brief Fichier de la classe de gestion des bons de livraison
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
|
||||||
@ -34,9 +34,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class Livraison
|
\class Livraison
|
||||||
\brief Classe de gestion des bons de livraison
|
\brief Classe de gestion des bons de livraison
|
||||||
*/
|
*/
|
||||||
class Livraison extends CommonObject
|
class Livraison extends CommonObject
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
@ -60,28 +60,25 @@ class Livraison extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisation
|
* Initialisation
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
function Livraison($DB)
|
function Livraison($DB)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
$this->lignes = array();
|
$this->lignes = array();
|
||||||
|
|
||||||
$this->statuts[-1] = $langs->trans("Canceled");
|
|
||||||
$this->statuts[0] = $langs->trans("Draft");
|
|
||||||
$this->statuts[1] = $langs->trans("Validated");
|
|
||||||
|
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
}
|
|
||||||
|
// List of short language codes for status
|
||||||
|
$this->statuts[-1] = 'StatusSendingCanceled';
|
||||||
|
$this->statuts[0] = 'StatusSendingDraft';
|
||||||
|
$this->statuts[1] = 'StatusSendingValidated';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Create delivery receipt in database
|
* \brief Create delivery receipt in database
|
||||||
* \param user Objet du user qui cree
|
* \param user Objet du user qui cree
|
||||||
* \return int <0 si erreur, id livraison cree si ok
|
* \return int <0 si erreur, id livraison cree si ok
|
||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -143,8 +140,8 @@ class Livraison extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insertion des produits dans la base
|
* Insertion des produits dans la base
|
||||||
*/
|
*/
|
||||||
for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
|
for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
|
||||||
{
|
{
|
||||||
$origin_id=$this->lignes[$i]->origin_line_id;
|
$origin_id=$this->lignes[$i]->origin_line_id;
|
||||||
@ -216,9 +213,9 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function create_line($transaction, $commande_ligne_id, $qty, $fk_product=0, $description)
|
function create_line($transaction, $commande_ligne_id, $qty, $fk_product=0, $description)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -244,9 +241,9 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Read a delivery receipt
|
* \brief Read a delivery receipt
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -296,23 +293,23 @@ class Livraison extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->origin = "propal";
|
$this->origin = "propal";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->statut == 0) $this->brouillon = 1;
|
if ($this->statut == 0) $this->brouillon = 1;
|
||||||
|
|
||||||
$file = $conf->livraison->dir_output . "/" .get_exdir($livraison->id,2) . "/" . $this->id.".pdf";
|
$file = $conf->livraison->dir_output . "/" .get_exdir($livraison->id,2) . "/" . $this->id.".pdf";
|
||||||
$this->pdf_filename = $file;
|
$this->pdf_filename = $file;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lignes
|
* Lignes
|
||||||
*/
|
*/
|
||||||
$result=$this->fetch_lignes();
|
$result=$this->fetch_lignes();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -330,10 +327,10 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Valide l'expedition, et met a jour le stock si stock gere
|
* \brief Valide l'expedition, et met a jour le stock si stock gere
|
||||||
* \param user Objet de l'utilisateur qui valide
|
* \param user Objet de l'utilisateur qui valide
|
||||||
* \return int
|
* \return int
|
||||||
*/
|
*/
|
||||||
function valid($user)
|
function valid($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -368,17 +365,17 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Tester si non deja au statut valide. Si oui, on arrete afin d'eviter
|
// Tester si non deja au statut valide. Si oui, on arrete afin d'eviter
|
||||||
// de decrementer 2 fois le stock.
|
// de decrementer 2 fois le stock.
|
||||||
$sql = "SELECT ref FROM ".MAIN_DB_PREFIX."livraison where ref='".$this->ref."' AND fk_statut <> 0";
|
$sql = "SELECT ref FROM ".MAIN_DB_PREFIX."livraison where ref='".$this->ref."' AND fk_statut <> 0";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."livraison ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."livraison ";
|
||||||
$sql.= " SET ref='".addslashes($this->ref)."', fk_statut = 1, date_valid = ".$this->db->idate(mktime()).", fk_user_valid = ".$user->id;
|
$sql.= " SET ref='".addslashes($this->ref)."', fk_statut = 1, date_valid = ".$this->db->idate(mktime()).", fk_user_valid = ".$user->id;
|
||||||
@ -486,7 +483,7 @@ class Livraison extends CommonObject
|
|||||||
/** \brief Cree le bon de livraison depuis une expedition existante
|
/** \brief Cree le bon de livraison depuis une expedition existante
|
||||||
* \param user Utilisateur qui cree
|
* \param user Utilisateur qui cree
|
||||||
* \param sending_id Id de l'expedition qui sert de modele
|
* \param sending_id Id de l'expedition qui sert de modele
|
||||||
*/
|
*/
|
||||||
function create_from_sending($user, $sending_id)
|
function create_from_sending($user, $sending_id)
|
||||||
{
|
{
|
||||||
$expedition = new Expedition($this->db);
|
$expedition = new Expedition($this->db);
|
||||||
@ -522,9 +519,9 @@ class Livraison extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajoute une ligne
|
* Ajoute une ligne
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function addline( $id, $qty )
|
function addline( $id, $qty )
|
||||||
{
|
{
|
||||||
$num = sizeof($this->lignes);
|
$num = sizeof($this->lignes);
|
||||||
@ -537,9 +534,9 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function delete_line($idligne)
|
function delete_line($idligne)
|
||||||
{
|
{
|
||||||
if ($this->statut == 0)
|
if ($this->statut == 0)
|
||||||
@ -561,9 +558,9 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supprime la fiche
|
* Supprime la fiche
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -617,10 +614,10 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function fetch_lignes()
|
function fetch_lignes()
|
||||||
{
|
{
|
||||||
$this->lignes = array();
|
$this->lignes = array();
|
||||||
@ -669,14 +666,14 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le libelle du statut d'une expedition
|
* \brief Retourne le libelle du statut d'une expedition
|
||||||
* \return string Libelle
|
* \return string Libelle
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode=0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi le libelle d'un statut donne
|
* \brief Renvoi le libelle d'un statut donne
|
||||||
@ -684,29 +681,29 @@ class Livraison extends CommonObject
|
|||||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* \return string Libelle
|
* \return string Libelle
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode)
|
function LibStatut($statut,$mode)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode==0)
|
if ($mode==0)
|
||||||
{
|
{
|
||||||
if ($statut==-1) return $this->statuts[$statut];
|
if ($statut==-1) return $langs->trans('StatusSendingCanceled');
|
||||||
if ($statut==0) return $this->statuts[$statut];
|
if ($statut==0) return $langs->trans('StatusSendingDraft');
|
||||||
if ($statut==1) return $this->statuts[$statut];
|
if ($statut==1) return $langs->trans('StatusSendingValidated')
|
||||||
}
|
}
|
||||||
if ($mode==1)
|
if ($mode==1)
|
||||||
{
|
{
|
||||||
if ($statut==-1) return $this->statuts[$statut];
|
if ($statut==-1) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==0) return $this->statuts[$statut];
|
if ($statut==0) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return $this->statuts[$statut];
|
if ($statut==1) return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==-1) return img_picto($langs->trans('StatusSendingCanceled'),'statut5').' '.$langs->trans('StatusSendingDraft');
|
if ($statut==-1) return img_picto($langs->trans('StatusSendingCanceled'),'statut5').' '.$langs->trans('StatusSendingCanceled');
|
||||||
if ($statut==0) return img_picto($langs->trans('StatusSendingDraft'),'statut0').' '.$langs->trans('StatusSendingDraft');
|
if ($statut==0) return img_picto($langs->trans('StatusSendingDraft'),'statut0').' '.$langs->trans('StatusSendingDraft');
|
||||||
if ($statut==1) return img_picto($langs->trans('StatusSendingValidated'),'statut4').' '.$langs->trans('StatusSendingValidated');
|
if ($statut==1) return img_picto($langs->trans('StatusSendingValidated'),'statut4').' '.$langs->trans('StatusSendingValidated');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -787,9 +784,9 @@ class Livraison extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class LivraisonLigne
|
\class LivraisonLigne
|
||||||
\brief Classe de gestion des lignes de bons de livraison
|
\brief Classe de gestion des lignes de bons de livraison
|
||||||
*/
|
*/
|
||||||
class LivraisonLigne
|
class LivraisonLigne
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
|
|||||||
@ -52,22 +52,22 @@ class Entrepot extends CommonObject
|
|||||||
var $ville;
|
var $ville;
|
||||||
var $pays_id;
|
var $pays_id;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Constructeur de l'objet entrepot
|
* \brief Constructeur de l'objet entrepot
|
||||||
* \param DB Handler d'acc<EFBFBD>s <EFBFBD> la base de donn<EFBFBD>e
|
* \param DB Handler d'acc<EFBFBD>s <EFBFBD> la base de donn<EFBFBD>e
|
||||||
*/
|
*/
|
||||||
function Entrepot($DB)
|
function Entrepot($DB)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
|
|
||||||
$this->statuts[0] = $langs->trans("Closed2");
|
// List of short language codes for status
|
||||||
$this->statuts[1] = $langs->trans("Opened");
|
$this->statuts[0] = 'Closed2';
|
||||||
|
$this->statuts[1] = 'Opened';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Creation d'un entrepot en base
|
* \brief Creation d'un entrepot en base
|
||||||
* \param Objet user qui cr<EFBFBD>e l'entrepot
|
* \param Objet user qui cree l'entrepot
|
||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
@ -412,37 +412,37 @@ class Entrepot extends CommonObject
|
|||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
$prefix='';
|
$prefix='';
|
||||||
if ($statut == 0) return $langs->trans('Closed2');
|
if ($statut == 0) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 1) return $langs->trans('Opened');
|
if ($statut == 1) return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
if ($mode == 1)
|
||||||
{
|
{
|
||||||
$prefix='Short';
|
$prefix='Short';
|
||||||
if ($statut == 0) return $langs->trans('Closed2');
|
if ($statut == 0) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 1) return $langs->trans('Opened');
|
if ($statut == 1) return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
$prefix='Short';
|
$prefix='Short';
|
||||||
if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5').' '.$langs->trans('Closed2');
|
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4').' '.$langs->trans('Opened');
|
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
$prefix='Short';
|
$prefix='Short';
|
||||||
if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5');
|
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut5');
|
||||||
if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4');
|
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5').' '.$langs->trans('Closed2');
|
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4').' '.$langs->trans('Opened');
|
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
$prefix='Short';
|
$prefix='Short';
|
||||||
if ($statut == 0) return $langs->trans('Closed2').' '.img_picto($langs->trans('Closed2'),'statut5');
|
if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5');
|
||||||
if ($statut == 1) return $langs->trans('Opened').' '.img_picto($langs->trans('Opened'),'statut4');
|
if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user