From de187ab398cccee634ae66152609f8dd21a1fea4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Feb 2012 16:14:41 +0100 Subject: [PATCH] Try a better fix --- htdocs/commande/fiche.php | 7 +++---- htdocs/fourn/commande/fiche.php | 7 +++---- htdocs/fourn/facture/fiche.php | 5 ++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 155d5accabe..26fe52579b3 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -229,7 +229,7 @@ if ($action == 'add' && $user->rights->commande->creer) $object->origin = $_POST['origin']; $object->origin_id = $_POST['originid']; - + // Possibility to add external linked objects with hooks $object->linked_objects[$object->origin] = $object->origin_id; if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) @@ -641,15 +641,14 @@ if ($action == 'addline' && $user->rights->commande->creer) { // Define output language $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','int')) $newlang=GETPOST('lang_id','int'); + $newlang=GETPOST('lang_id','alpha'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - + $ret=$object->fetch($id); // Reload to get new records commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 09ebb908820..a2954d7263e 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -221,15 +221,14 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) { // Define output language $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','int')) $newlang=GETPOST('lang_id','int'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + $newlang=GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - + $ret=$object->fetch($id); // Reload to get new records supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref')); } diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 5706396fd10..4aad2f8a79d 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -509,9 +509,8 @@ elseif ($action == 'addline') { // Define output language $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','int')) $newlang=GETPOST('lang_id','int'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + $newlang=GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf);