This commit is contained in:
Laurent Destailleur 2011-03-08 10:09:15 +00:00
parent 79e1552085
commit 05c4533b5b
2 changed files with 19 additions and 15 deletions

View File

@ -1375,10 +1375,10 @@ class Commande extends CommonObject
} }
/** /**
* \brief Load array this->expeditions of nb of products sent by line in order * Load array this->expeditions of nb of products sent by line in order
* \param filtre_statut Filter on status * @param filtre_statut Filter on status
* \return int <0 if KO, Nb of lines found if OK * @return int <0 if KO, Nb of lines found if OK
* \TODO deprecated, move to Sending class * TODO deprecated, move to Shipping class
*/ */
function loadExpeditions($filtre_statut=-1) function loadExpeditions($filtre_statut=-1)
{ {
@ -1424,7 +1424,7 @@ class Commande extends CommonObject
/** /**
* Renvoie un tableau avec nombre de lignes d'expeditions * Renvoie un tableau avec nombre de lignes d'expeditions
* \TODO deprecated, move to Sending class * TODO deprecated, move to Shipping class
*/ */
function nb_expedition() function nb_expedition()
{ {
@ -1440,10 +1440,10 @@ class Commande extends CommonObject
} }
/** /**
* \brief Renvoie un tableau avec les livraisons par ligne * Renvoie un tableau avec les livraisons par ligne
* \param filtre_statut Filtre sur statut * @param filtre_statut Filtre sur statut
* \return int 0 si OK, <0 si KO * @return int 0 si OK, <0 si KO
* \TODO deprecated, move to Delivery class * TODO deprecated, move to Shipping class
*/ */
function livraison_array($filtre_statut=-1) function livraison_array($filtre_statut=-1)
{ {
@ -2177,7 +2177,6 @@ class Commande extends CommonObject
global $langs; global $langs;
$label=$langs->trans('OrderSource'.$this->source); $label=$langs->trans('OrderSource'.$this->source);
// \TODO Si libelle non trouve, on va chercher en base dans dictionnaire
if ($label == 'OrderSource') return ''; if ($label == 'OrderSource') return '';
return $label; return $label;

View File

@ -371,26 +371,31 @@ class Translate {
{ {
global $db; global $db;
$newstr=$key; $newstr=$key;
if (preg_match('/CurrencySing([A-Z][A-Z][A-Z])$/i',$key,$reg)) if (preg_match('/^CurrencySing([A-Z][A-Z][A-Z])$/i',$key,$reg))
{ {
$newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','labelsing'); $newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','labelsing');
} }
else if (preg_match('/Currency([A-Z][A-Z][A-Z])$/i',$key,$reg)) else if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
{ {
$newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label'); $newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label');
} }
else if (preg_match('/SendingMethod([0-9A-Z]+)$/i',$key,$reg)) else if (preg_match('/^SendingMethod([0-9A-Z]+)$/i',$key,$reg))
{ {
$newstr=$this->getLabelFromKey($db,$reg[1],'c_shipment_mode','code','libelle'); $newstr=$this->getLabelFromKey($db,$reg[1],'c_shipment_mode','code','libelle');
} }
else if (preg_match('/PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg)) else if (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg))
{ {
$newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle'); $newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle');
} }
else if (preg_match('/Civility([0-9A-Z]+)$/i',$key,$reg)) else if (preg_match('/^Civility([0-9A-Z]+)$/i',$key,$reg))
{ {
$newstr=$this->getLabelFromKey($db,$reg[1],'c_civilite','code','civilite'); $newstr=$this->getLabelFromKey($db,$reg[1],'c_civilite','code','civilite');
} }
else if (preg_match('/^OrderSource([0-9A-Z]+)$/i',$key,$reg))
{
// TODO Add a table for OrderSourceX
//$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label');
}
return $newstr; return $newstr;
} }