diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 12da6092974..2bbc1b39588 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1375,10 +1375,10 @@ class Commande extends CommonObject } /** - * \brief Load array this->expeditions of nb of products sent by line in order - * \param filtre_statut Filter on status - * \return int <0 if KO, Nb of lines found if OK - * \TODO deprecated, move to Sending class + * Load array this->expeditions of nb of products sent by line in order + * @param filtre_statut Filter on status + * @return int <0 if KO, Nb of lines found if OK + * TODO deprecated, move to Shipping class */ function loadExpeditions($filtre_statut=-1) { @@ -1424,7 +1424,7 @@ class Commande extends CommonObject /** * Renvoie un tableau avec nombre de lignes d'expeditions - * \TODO deprecated, move to Sending class + * TODO deprecated, move to Shipping class */ function nb_expedition() { @@ -1440,10 +1440,10 @@ class Commande extends CommonObject } /** - * \brief Renvoie un tableau avec les livraisons par ligne - * \param filtre_statut Filtre sur statut - * \return int 0 si OK, <0 si KO - * \TODO deprecated, move to Delivery class + * Renvoie un tableau avec les livraisons par ligne + * @param filtre_statut Filtre sur statut + * @return int 0 si OK, <0 si KO + * TODO deprecated, move to Shipping class */ function livraison_array($filtre_statut=-1) { @@ -2177,7 +2177,6 @@ class Commande extends CommonObject global $langs; $label=$langs->trans('OrderSource'.$this->source); - // \TODO Si libelle non trouve, on va chercher en base dans dictionnaire if ($label == 'OrderSource') return ''; return $label; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 0704f47dee3..69c30ec41b7 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -371,26 +371,31 @@ class Translate { { global $db; $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'); } - 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'); } - 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'); } - 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'); } - 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'); } + 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; }