diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6e92b9fa32b..d9485938258 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -102,7 +102,9 @@ if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes $propal = new Propal($db); $propal->fetch($_GET['propalid']); $result = $propal->delete_product($_GET['lineid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -123,7 +125,8 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' & $result=$propal->valid($user); if ($result >= 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -199,7 +202,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer) $propal->note = $_POST['note']; $propal->ref = $_POST['ref']; $propal->statut = 0; - + $id = $propal->create_from($user); } else @@ -263,7 +266,8 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer) $db->commit(); // Generation document PDF - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -521,8 +525,8 @@ if ($_GET['action'] == 'modif' && $user->rights->propale->creer) $propal->fetch($_GET['propalid']); $propal->set_draft($user); - //reg�n�ration pdf - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -577,10 +581,10 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer) { $prod = new Product($db, $_POST['idprod']); $prod->fetch($_POST['idprod']); - + $tva_tx = get_default_tva($mysoc,$propal->client,$prod->tva_tx); $tva_npr = get_default_npr($mysoc,$propal->client,$prod->tva_tx); - + // On defini prix unitaire if ($conf->global->PRODUIT_MULTIPRICES == 1) { @@ -608,7 +612,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer) $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } - + $desc = $prod->description; $desc.= ($prod->description && $_POST['np_desc']) ? "\n" : ""; $desc.= $_POST['np_desc']; @@ -643,10 +647,11 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer) $pu_ttc, $info_bits ); - + if ($result > 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -668,7 +673,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer) if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save")) { $propal = new Propal($db); - if (! $propal->fetch($_POST['propalid']) > 0) + if (! $propal->fetch($_POST['propalid']) > 0) { dolibarr_print_error($db,$propal->error); exit; @@ -703,8 +708,9 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST $_POST['desc'], 'HT', $info_bits); - - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -725,7 +731,8 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer) $propal->setDocModel($user, $_REQUEST['model']); } - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -793,13 +800,16 @@ if ($_GET['action'] == 'up' && $user->rights->propale->creer) $propal = new Propal($db, '', $_GET["propalid"]); $propal->fetch($_GET['propalid']); $propal->line_up($_GET['rowid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET["propalid"].'#'.$_GET['rowid']); + exit; } if ($_GET['action'] == 'down' && $user->rights->propale->creer) @@ -807,7 +817,9 @@ if ($_GET['action'] == 'down' && $user->rights->propale->creer) $propal = new Propal($db, '', $_GET["propalid"]); $propal->fetch($_GET['propalid']); $propal->line_down($_GET['rowid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -1220,7 +1232,7 @@ if ($_GET['propalid'] > 0) { print ($objp->description && $objp->description!=$objp->product)?'
'.dol_htmlentitiesbr($objp->description):''; } - + print ''; } else @@ -1282,7 +1294,7 @@ if ($_GET['propalid'] > 0) print ''."\n"; - + print ''."\n"; @@ -1588,7 +1600,7 @@ if ($_GET['propalid'] > 0) $html->select_produits('','idprod','',$conf->produit->limit_size); } if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
'; - + // editeur wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) { @@ -1866,9 +1878,9 @@ else $sortfield=$_GET['sortfield']; $page=$_GET['page']; $viewstatut=addslashes($_GET['viewstatut']); - $propal_statut = addslashes($_GET['propal_statut']); - if($propal_statut != '') - $viewstatut=$propal_statut; + $propal_statut = addslashes($_GET['propal_statut']); + if($propal_statut != '') + $viewstatut=$propal_statut; if (! $sortfield) $sortfield='p.datep'; if (! $sortorder) $sortorder='DESC'; @@ -1910,9 +1922,9 @@ else if ($month > 0) { if ($year > 0) - $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; - else - $sql .= " AND date_format(p.datep, '%m') = '$month'"; + $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; + else + $sql .= " AND date_format(p.datep, '%m') = '$month'"; } if ($year > 0) { @@ -1930,14 +1942,14 @@ else if ($result) { $propalstatic=new Propal($db); - + $num = $db->num_rows($result); - + $param='&socid='.$socid.'&viewstatut='.$viewstatut; if ($month) $param.='&month='.$month; if ($year) $param.='&year='.$year; print_barre_liste($langs->trans('ListOfProposals'), $page,'propal.php',$param,$sortfield,$sortorder,'',$num); - + $i = 0; print ''; print ''; @@ -1948,7 +1960,7 @@ else print_liste_field_titre($langs->trans('Price'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder); print ''; - print "\n"; + print "\n"; // Lignes des champs de filtre print ''; @@ -1959,21 +1971,21 @@ else print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -2048,7 +2060,7 @@ else print '\n"; $propal=New Propal($db); print '\n"; - print ""; + print ""; print "\n"; $total = $total + $objp->total_ht; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 999a902033b..cd67020bbcc 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -95,7 +95,8 @@ if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes $result = $commande->delete_line($_GET['lineid']); if ($result > 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -164,17 +165,17 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer) // Insertion contact par defaut si defini if ($_POST["contactidp"]) { - $result=$commande->add_contact($_POST["contactidp"],'CUSTOMER','external'); + $result=$commande->add_contact($_POST["contactidp"],'CUSTOMER','external'); - if ($result > 0) - { - $error=0; - } - else - { - $mesg = '
'.$langs->trans("ErrorFailedToAddContact").'
'; - $error=1; - } + if ($result > 0) + { + $error=0; + } + else + { + $mesg = '
'.$langs->trans("ErrorFailedToAddContact").'
'; + $error=1; + } } $_GET['id'] = $commande->id; @@ -401,7 +402,8 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer) if ($result > 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -474,10 +476,11 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS if ($result >= 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); } commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); } @@ -504,7 +507,8 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' & $result=$commande->valid($user); if ($result >= 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -538,8 +542,9 @@ if ($_GET['action'] == 'modif' && $user->rights->commande->creer) $result = $commande->set_draft($user); if ($result >= 0) - { //regeneration pdf - if ($_REQUEST['lang_id']) + { + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -557,7 +562,9 @@ if ($_GET['action'] == 'up' && $user->rights->commande->creer) $commande = new Commande($db,'',$_GET['id']); $commande->fetch($_GET['id']); $commande->line_up($_GET['rowid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -572,7 +579,9 @@ if ($_GET['action'] == 'down' && $user->rights->commande->creer) $commande = new Commande($db,'',$_GET['id']); $commande->fetch($_GET['id']); $commande->line_down($_GET['rowid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -597,12 +606,12 @@ if ($_REQUEST['action'] == 'builddoc') // In get or post $commande->setDocModel($user, $_REQUEST['model']); } - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - $result=commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); if ($result <= 0) { @@ -1896,7 +1905,7 @@ else { print ''; print $langs->trans('ShipProduct').''; - + } else { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1eb4f15e1f0..7bb7efed37f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -121,12 +121,12 @@ if (($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'ye $result = $fac->deleteline($_GET['rowid'], $user); if ($result > 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - $result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); if ($result > 0) { @@ -263,12 +263,13 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $ $result = $fac->set_valid($user); if ($result >= 0) { - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } + facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); } else { @@ -311,13 +312,14 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier && $conf->glo if ($resteapayer == $fac->total_ttc && $fac->paye == 0 && $ventilExportCompta == 0) { $fac->set_draft($user); - //regénération PDF - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } + facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); } } @@ -900,12 +902,13 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') && if ($result > 0) { - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - facture_pdf_create($db, $fac->id, $fac->modelpdf, $outputlangs); + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } + facture_pdf_create($db, $fac->id, $fac->modelpdf, $outputlangs); } else { @@ -971,12 +974,13 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST $info_bits ); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } + facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); } $_GET['facid']=$_POST['facid']; // Pour réaffichage de la fiche en cours d'édition @@ -998,11 +1002,13 @@ if ($_GET['action'] == 'up' && $user->rights->facture->creer) $fac = new Facture($db,'',$_GET['facid']); $fac->fetch($_GET['facid']); $fac->line_up($_GET['rowid']); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$_GET["facid"].'#'.$_GET['rowid']); exit; @@ -1013,11 +1019,13 @@ if ($_GET['action'] == 'down' && $user->rights->facture->creer) $fac = new Facture($db,'',$_GET['facid']); $fac->fetch($_GET['facid']); $fac->line_down($_GET['rowid']); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$_GET["facid"].'#'.$_GET['rowid']); exit; @@ -1238,12 +1246,12 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $fac->setDocModel($user, $_REQUEST['model']); } - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } $result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); if ($result <= 0) { @@ -3138,7 +3146,8 @@ else // Construit PDF si non existant if (! is_readable($file)) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -3204,7 +3213,8 @@ else // Construit PDF si non existant if (! is_readable($file)) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index ba20b446e5d..b38a4a3d066 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -79,7 +79,9 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user- { $fac = new Facture($db); $fac->fetch($id); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index b6ffb981c6a..bf411afa569 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -181,8 +181,8 @@ for ($mois = 1 ; $mois < 13 ; $mois++) for ($annee = $year_start ; $annee <= $year_end ; $annee++) { $casenow = dolibarr_print_date(mktime(),"%Y-%m"); - $case = dolibarr_print_date(mktime(1,1,1,$mois,1,$annee),"%Y-%m"); - $caseprev = dolibarr_print_date(mktime(1,1,1,$mois,1,$annee-1),"%Y-%m"); + $case = dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,$annee),"%Y-%m"); + $caseprev = dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,$annee-1),"%Y-%m"); if ($annee == $year_current) { $total_CA += $cum[$case]; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index d4caa58909a..50e35c1bd43 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -286,7 +286,8 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer) if ($result > 0) { /* - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 81d483a0346..a4eead58460 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -72,13 +72,13 @@ if ($_POST["action"] == 'add') $expedition->note = $_POST["note"]; $expedition->origin = $origin; $expedition->origin_id = $origin_id; - $expedition->weight = $_POST["weight"]==""?"NULL":$_POST["weight"]; - $expedition->sizeH = $_POST["sizeH"]==""?"NULL":$_POST["sizeH"]; - $expedition->sizeW = $_POST["sizeW"]==""?"NULL":$_POST["sizeW"]; - $expedition->sizeS = $_POST["sizeS"]==""?"NULL":$_POST["sizeS"]; - $expedition->size_units = $_POST["size_units"]; - $expedition->weight_units = $_POST["weight_units"]; - + $expedition->weight = $_POST["weight"]==""?"NULL":$_POST["weight"]; + $expedition->sizeH = $_POST["sizeH"]==""?"NULL":$_POST["sizeH"]; + $expedition->sizeW = $_POST["sizeW"]==""?"NULL":$_POST["sizeW"]; + $expedition->sizeS = $_POST["sizeS"]==""?"NULL":$_POST["sizeS"]; + $expedition->size_units = $_POST["size_units"]; + $expedition->weight_units = $_POST["weight_units"]; + // On boucle sur chaque ligne du document d'origine pour completer objet expedition // avec qte a livrer $class = ucfirst($expedition->origin); @@ -163,7 +163,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') if ($_REQUEST['action'] == 'builddoc') // En get ou en post { require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/pdf/ModelePdfExpedition.class.php"); - + // Sauvegarde le dernier modele choisi pour generer un document $expedition = new Expedition($db, 0, $_REQUEST['id']); $expedition->fetch($_REQUEST['id']); @@ -173,7 +173,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $expedition->setDocModel($user, $_REQUEST['model']); } - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -293,27 +294,27 @@ if ($_GET["action"] == 'create') print '"; } print "
 
'; print ''; print ''; - print $langs->trans('Month').': '; - print ' '.$langs->trans('Year').': '; - $max_year = date("Y"); - $syear = $year; - //if($syear == '') $syear = date("Y"); - $html->select_year($syear,'year',1, '', $max_year); - print ''; + print $langs->trans('Month').': '; + print ' '.$langs->trans('Year').': '; + $max_year = date("Y"); + $syear = $year; + //if($syear == '') $syear = date("Y"); + $html->select_year($syear,'year',1, '', $max_year); + print ' '; print ''; print ''; - $html->select_propal_statut($viewstatut); - print ''; + $html->select_propal_statut($viewstatut); + print ''; print '
'.price($objp->total_ht)."'.$propal->LibStatut($objp->fk_statut,5)."  
'.$langs->trans("NotePrivate").': '.nl2br($object->note)."
"; - + print ''; - print ''; - print '
'; - print $langs->trans("Weight"); - print ''; - print $formproduct->select_measuring_units("weight_units","weight"); - print '
'; - print $langs->trans("Width"); - print '  
'; - print $langs->trans("Height"); - print ''; - print $formproduct->select_measuring_units("size_units","size"); - print '
'; - print $langs->trans("Depth"); - print ' 
'; + print $langs->trans("Weight"); + print ''; + print $formproduct->select_measuring_units("weight_units","weight"); + print ''; + print $langs->trans("Width"); + print ' '; + print ' '; + print $langs->trans("Height"); + print ''; + print $formproduct->select_measuring_units("size_units","size"); + print ''; + print $langs->trans("Depth"); + print ''; + print ' '; - - print ''; - - // Delivery method + + print '
'; + + // Delivery method print ""; print '\n"; - + print "
".$langs->trans("DeliveryMethod")."'; $expe->fetch_delivery_methods(); @@ -325,9 +326,9 @@ if ($_GET["action"] == 'create') print ''; print ''; print "
"; - + /* * Lignes de commandes * @@ -366,7 +367,7 @@ if ($_GET["action"] == 'create') while ($indiceAsked < $numAsked) { $product = new Product($db); - + $ligne = $object->lignes[$indiceAsked]; $var=!$var; print "\n"; @@ -455,7 +456,7 @@ if ($_GET["action"] == 'create') $html->select_array('entl'.$i,$array,'',1,0,0); print ''; } - + } else { @@ -481,7 +482,7 @@ if ($_GET["action"] == 'create') } } } - + $indiceAsked++; } @@ -579,19 +580,19 @@ else // Calcul du poids total et du volume total des produits $totalWeight = ''; $totalVolume = ''; - for ($i = 0 ; $i < $num_prod ; $i++) + for ($i = 0 ; $i < $num_prod ; $i++) { - $weightUnit=0; - $volumeUnit=0; + $weightUnit=0; + $volumeUnit=0; if (! empty($lignes[$i]->weight_units)) $weightUnit = $lignes[$i]->weight_units; - $trueWeightUnit=pow(10,$weightUnit); - $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped*$trueWeightUnit; - if (! empty($lignes[$i]->volume_units)) $volumeUnit = $lignes[$i]->volume_units; - $trueVolumeUnit=pow(10,$volumeUnit); - $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped*$trueVolumeUnit; + $trueWeightUnit=pow(10,$weightUnit); + $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped*$trueWeightUnit; + if (! empty($lignes[$i]->volume_units)) $volumeUnit = $lignes[$i]->volume_units; + $trueVolumeUnit=pow(10,$volumeUnit); + $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped*$trueVolumeUnit; } - $totalVolume=$totalVolume; - + $totalVolume=$totalVolume; + print ''; // Ref @@ -636,27 +637,27 @@ else print ''; // Weight - print ''; - print ''; + print ''; // Volume Total print ''; print '\n"; print ''; - // Taille - print ''; - print '\n"; - print ''; - + // Taille + print ''; + print '\n"; + print ''; + // Status print ''; print '\n"; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 7170f69213e..8cbf5ced00a 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -78,12 +78,12 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes') $result = $fichinter->valid($user, $conf->fichinter->outputdir); if ($result >= 0) { - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } $result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs); } else @@ -148,12 +148,12 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $fichinter->fetch($_GET['id']); $fichinter->fetch_lines(); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } $result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs); if ($result <= 0) { @@ -214,7 +214,8 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer) $duration ); - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -248,11 +249,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P $fichinterline->duration=$duration; $result = $fichinterline->update(); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); } @@ -275,11 +277,13 @@ if ($_GET['action'] == 'deleteline' && $user->rights->ficheinter->creer && !$con dolibarr_print_error($db); exit; } - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); } @@ -303,11 +307,13 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' dolibarr_print_error($db); exit; } - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); } Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET['id']); @@ -323,11 +329,13 @@ if ($_GET['action'] == 'up' && $user->rights->ficheinter->creer) $fichinter = new Fichinter($db); $fichinter->fetch($_GET['id']); $fichinter->line_up($_GET['rowid']); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'#'.$_GET['rowid']); exit; @@ -338,11 +346,13 @@ if ($_GET['action'] == 'down' && $user->rights->ficheinter->creer) $fichinter = new Fichinter($db); $fichinter->fetch($_GET['id']); $fichinter->line_down($_GET['rowid']); - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'#'.$_GET['rowid']); exit; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 94c546c961d..15057b52ca0 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -172,7 +172,8 @@ if ($_POST['action'] == 'addligne' && $user->rights->fournisseur->commande->cree //print "xx".$tva_tx; exit; if ($result > 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -204,12 +205,13 @@ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->c if ($result >= 0) { - if ($_REQUEST['lang_id']) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - supplier_order_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } + supplier_order_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); } else { @@ -231,7 +233,9 @@ if ($_REQUEST['action'] == 'confirm_deleteproductline' && ($_POST['confirm'] == $commande = new CommandeFournisseur($db); $commande->fetch($id); $result = $commande->delete_line($_GET['lineid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -252,7 +256,8 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $ $result = $commande->valid($user); if ($result >= 0) { - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -338,7 +343,9 @@ if ($_GET['action'] == 'up' && $user->rights->fournisseur->commande->creer) $commande = new CommandeFournisseur($db,'',$id); $commande->fetch($id); $commande->line_up($_GET['rowid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -353,7 +360,9 @@ if ($_GET['action'] == 'down' && $user->rights->fournisseur->commande->creer) $commande = new CommandeFournisseur($db,'',$id); $commande->fetch($id); $commande->line_down($_GET['rowid']); - if ($_REQUEST['lang_id']) + + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -379,7 +388,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $commande->setDocModel($user, $_REQUEST['model']); } - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); diff --git a/htdocs/includes/modules/facture/modules_facture.php b/htdocs/includes/modules/facture/modules_facture.php index 5254db3bf00..afd70b1d3ac 100644 --- a/htdocs/includes/modules/facture/modules_facture.php +++ b/htdocs/includes/modules/facture/modules_facture.php @@ -206,7 +206,7 @@ function facture_pdf_create($db, $id, $message, $modele, $outputlangs) facture_meta_create($db, $id); // et on supprime l'image correspondant au preview facture_delete_preview($db, $id); - + $outputlangs->charset_output=$sav_charset_output; return 1; } diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index fdd4c9d8846..8fa9c59cd45 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -56,7 +56,7 @@ class pdf_crabe extends ModelePDFFactures $this->db = $db; $this->name = "crabe"; $this->description = $langs->trans('PDFCrabeDescription'); - + // Dimension page pour format A4 $this->type = 'pdf'; $this->page_largeur = 210; @@ -105,10 +105,10 @@ class pdf_crabe extends ModelePDFFactures * \param outputlangs Lang object for output language * \return int 1=ok, 0=ko */ - function write_file($fac,$outputlangs='') + function write_file($fac,$outputlangs) { global $user,$langs,$conf; - + if (! is_object($outputlangs)) $outputlangs=$langs; // Force output charset to ISO, because, FPDF expect text encoded in ISO $outputlangs->charset_output='ISO-8859-1'; @@ -292,7 +292,7 @@ class pdf_crabe extends ModelePDFFactures if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) { // Affichage duree si il y en a une - $libelleproduitservice.="
".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")",1); + $libelleproduitservice.="
".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start,'',false,$outputlangs)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end,'',false,$outputlangs).")",1); } //if ($i==0) { print $libelleproduitservice; exit; } diff --git a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php index 8c35e5973f0..df387d08959 100644 --- a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php +++ b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php @@ -78,7 +78,7 @@ class pdf_soleil extends ModelePDFFicheinter \param fichinter Object fichinter \return int 1=ok, 0=ko */ - function write_file($fichinter,$outputlangs='') + function write_file($fichinter,$outputlangs) { global $user,$langs,$conf,$mysoc; @@ -243,7 +243,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0,0,100); $pdf->SetFont('Arial','B',14); - $pdf->Text(11, 94, $langs->trans("InterventionCard")." : ".$fichinter->ref); + $pdf->Text(11, 94, $outputlangs->trans("InterventionCard")." : ".$fichinter->ref); $pdf->SetFillColor(220,220,220); $pdf->SetTextColor(0,0,0); @@ -253,7 +253,7 @@ class pdf_soleil extends ModelePDFFicheinter $tab_height = 16; $pdf->SetXY (10, $tab_top); - $pdf->MultiCell(190,8,$langs->transnoentities("Description"),0,'L',0); + $pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0); $pdf->line(10, $tab_top + 8, 200, $tab_top + 8 ); $pdf->Rect(10, $tab_top, 190, $tab_height); @@ -279,7 +279,7 @@ class pdf_soleil extends ModelePDFFicheinter { $pdf->SetXY (10, $tab_top + 16 + $j * 20); $pdf->writeHTMLCell(0, 4, 20, $tab_top + 16 + $j * 20, - dol_htmlentitiesbr($langs->transnoentities("Date")." : ".dolibarr_print_date($fichinterligne->datei)." - ".$langs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration), 1), 0, 0, 0); + dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dolibarr_print_date($fichinterligne->datei,'',false,$outputlangs)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration), 1), 0, 0, 0); $pdf->SetXY (10, $tab_top + 22 + $j * 20); $pdf->writeHTMLCell(0, 4, 20, $tab_top + 22 + $j * 20, @@ -296,13 +296,13 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->MultiCell(60, 5, '', 0, 'J', 0); $pdf->SetXY(20,220); - $pdf->MultiCell(66,5, $langs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0); + $pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0); $pdf->SetXY(20,225); $pdf->MultiCell(80,30, '', 1); $pdf->SetXY(110,220); - $pdf->MultiCell(80,5, $langs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0); + $pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0); $pdf->SetXY(110,225); $pdf->MultiCell(80,30, '', 1); diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index f8271d42428..53508a92883 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -444,11 +444,11 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit) * "%d/%m/%Y %H:%M:%S", * "day", "daytext", "dayhour", "dayhourldap", "dayhourtext" * \param to_gmt false=output string if for local server TZ users, true=output string is for GMT users - * \param convtooutput true=Output string is encoded into encoding defined into $langs->charset_output + * \param outputlangs Object lang that contains charset_output property to define output * This means output is endoded in UTF-8 in default case. * \return string Formated date or '' if time is null */ -function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true) +function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='') { global $conf,$langs; @@ -496,7 +496,9 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true) $localtime=setlocale(LC_TIME,0); if (eregi('UTF',$localtime)) $pagecodefrom='UTF-8'; - return ($convtooutput?$langs->convToOuptutCharset($ret,$pagecodefrom):$ret); + if (! is_object($outputlangs)) $outputlangs=$langs; + + return $outputlangs->convToOuptutCharset($ret,$pagecodefrom); } @@ -2873,21 +2875,23 @@ function make_substitutions($chaine,$substitutionarray) * \remarks Updated by Matelli : added format paramter * \remarks See http://matelli.fr/showcases/patchs-dolibarr/update-date-range-format.html for details */ -function print_date_range($date_start,$date_end,$format = '') +function print_date_range($date_start,$date_end,$format = '',$outputlangs='') { global $langs; + if (! is_object($outputlangs)) $outputlangs=$langs; + if ($date_start && $date_end) { - print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start, $format, false, false),dolibarr_print_date($date_end, $format, false, false)).')'; + print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start, $format, false, $outputlangs),dolibarr_print_date($date_end, $format, false, $outputlangs)).')'; } if ($date_start && ! $date_end) { - print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start, $format, false, false)).')'; + print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start, $format, false, $outputlangs)).')'; } if (! $date_start && $date_end) { - print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end, $format, false, false)).')'; + print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end, $format, false, $outputlangs)).')'; } } diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 5f493b4a287..4212e4979ae 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -143,7 +143,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $delivery->setDocModel($user, $_REQUEST['model']); } - if ($_REQUEST['lang_id']) + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
'.$langs->trans("TotalWeight").''; - if ($expedition->trueWeight) - { - // If sending weigth defined - print $expedition->trueWeight.' '.measuring_units_string($expedition->weight_units,"weight"); - } - else - { + print '
'.$langs->trans("TotalWeight").''; + if ($expedition->trueWeight) + { + // If sending weigth defined + print $expedition->trueWeight.' '.measuring_units_string($expedition->weight_units,"weight"); + } + else + { // If sending Weight not defined we use sum of products // TODO Show in best unit - if ($totalWeight > 0) print $totalWeight.' '.measuring_units_string(0,"weight"); - else print ' '; - } + if ($totalWeight > 0) print $totalWeight.' '.measuring_units_string(0,"weight"); + else print ' '; + } print '
'.$langs->trans("TotalVolume").''; if ($expedition->trueVolume) - { + { // If sending volume defined print $expedition->trueVolume.' '.measuring_units_string($expedition->volumeUnit,"volume"); } @@ -670,18 +671,18 @@ else print "
'.$langs->trans("Size").''; - if ($expedition->trueWidth || $expedition->trueHeight || $expedition->trueDepth) - { - // If sending size defined - print $expedition->trueSize.' '.measuring_units_string($expedition->size_units,"size"); - } - else print ' '; - print "
'.$langs->trans("Size").''; + if ($expedition->trueWidth || $expedition->trueHeight || $expedition->trueDepth) + { + // If sending size defined + print $expedition->trueSize.' '.measuring_units_string($expedition->size_units,"size"); + } + else print ' '; + print "
'.$langs->trans("Status").''.$expedition->getLibStatut(4)."