diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6705587a024..97a0ef4b55b 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -135,13 +135,18 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' { $propal = new Propal($db); $propal->fetch($_GET['propalid']); + $propal->fetch_client(); $result = $propal->delete_product($_GET['lineid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); } @@ -161,6 +166,7 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' & $result=$propal->valid($user); if ($result >= 0) { + // Define output language $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; @@ -313,15 +319,18 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer) { $db->commit(); - // Generation document PDF + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } propale_pdf_create($db, $id, $_REQUEST['model'], $outputlangs); - dol_syslog('Redirect to '.$_SERVER["PHP_SELF"].'?propalid='.$id); + Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$id); exit; } @@ -615,14 +624,20 @@ if ($_GET['action'] == 'modif' && $user->rights->propale->creer) */ $propal = new Propal($db); $propal->fetch($_GET['propalid']); + $propal->fetch_client(); $propal->set_draft($user); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } + propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); } @@ -758,11 +773,15 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer) if ($result > 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); @@ -791,6 +810,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST dol_print_error($db,$propal->error); exit; } + $propal->fetch_client(); // Define info_bits $info_bits=0; @@ -822,11 +842,15 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST 'HT', $info_bits); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); } @@ -839,16 +863,22 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer) { $propal = new Propal($db); $propal->fetch($_GET['propalid']); + $propal->fetch_client(); + if ($_REQUEST['model']) { $propal->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); if ($result <= 0) @@ -913,15 +943,21 @@ if ($_GET['action'] == 'up' && $user->rights->propale->creer) { $propal = new Propal($db, '', $_GET["propalid"]); $propal->fetch($_GET['propalid']); + $propal->fetch_client(); $propal->line_up($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); + Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET["propalid"].'#'.$_GET['rowid']); exit; } @@ -930,15 +966,21 @@ if ($_GET['action'] == 'down' && $user->rights->propale->creer) { $propal = new Propal($db, '', $_GET["propalid"]); $propal->fetch($_GET['propalid']); + $propal->fetch_client(); $propal->line_down($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$propal->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs); + Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$_GET["propalid"].'#'.$_GET['rowid']); exit; } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 97f0727de81..6e43d49f2e6 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -119,14 +119,20 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' { $commande = new Commande($db); $commande->fetch($_GET['id']); + $commande->fetch_client(); + $result = $commande->delete_line($_GET['lineid']); if ($result > 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } commande_pdf_create($db, $_GET['id'], $commande->modelpdf, $outputlangs); } @@ -445,11 +451,15 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer) if ($result > 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); @@ -478,6 +488,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS { $commande = new Commande($db,'',$_POST['id']); if (! $commande->fetch($_POST['id']) > 0) dol_print_error($db); + $commande->fetch_client(); // Clean parameters $date_start=''; @@ -541,11 +552,15 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS if ($result >= 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); } @@ -568,15 +583,20 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' & { $commande = new Commande($db); $commande->fetch($_GET['id']); // Load order and lines + $commande->fetch_client(); $result=$commande->valid($user); if ($result >= 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); } @@ -605,15 +625,20 @@ if ($_GET['action'] == 'modif' && $user->rights->commande->creer) */ $commande = new Commande($db); $commande->fetch($_GET['id']); // Load order and lines + $commande->fetch_client(); $result = $commande->set_draft($user); if ($result >= 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); } @@ -627,15 +652,22 @@ if ($_GET['action'] == 'up' && $user->rights->commande->creer) { $commande = new Commande($db,'',$_GET['id']); $commande->fetch($_GET['id']); + $commande->fetch_client(); $commande->line_up($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } + commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); + Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'#'.$_GET['rowid']); exit; } @@ -644,15 +676,21 @@ if ($_GET['action'] == 'down' && $user->rights->commande->creer) { $commande = new Commande($db,'',$_GET['id']); $commande->fetch($_GET['id']); + $commande->fetch_client(); $commande->line_down($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); + Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'#'.$_GET['rowid']); exit; } @@ -667,16 +705,22 @@ if ($_REQUEST['action'] == 'builddoc') // In get or post // Sauvegarde le dernier modele choisi pour generer un document $commande = new Commande($db, 0, $_REQUEST['id']); $result=$commande->fetch($_REQUEST['id']); + $commande->fetch_client(); + if ($_REQUEST['model']) { $commande->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$commande->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs); if ($result <= 0) @@ -1274,7 +1318,7 @@ else */ if ($_GET['action'] == 'delete') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); if ($ret == 'html') print '
'; } @@ -1302,7 +1346,7 @@ else $text.='
'; $text.=$notify->confirmMessage('NOTIFY_VAL_ORDER',$commande->socid); } - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', '', 0, 1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', '', 0, 1); if ($ret == 'html') print '
'; } @@ -1311,7 +1355,7 @@ else */ if ($_GET['action'] == 'close') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close', '', 0, 1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close', '', 0, 1); if ($ret == 'html') print '
'; } @@ -1320,7 +1364,7 @@ else */ if ($_GET['action'] == 'cancel') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel', '', 0, 1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel', '', 0, 1); if ($ret == 'html') print '
'; } @@ -1329,7 +1373,7 @@ else */ if ($_GET['action'] == 'ask_deleteline') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); if ($ret == 'html') print '
'; } @@ -1371,7 +1415,7 @@ else print ''; if ($user->rights->commande->creer && $_GET['action'] == 'refcustomer') { - print '
'; + print ''; print ''; print ''; print ''; @@ -1737,13 +1781,13 @@ else } else { - print 'rowid.'#'.$objp->rowid.'">'; + print 'rowid.'#'.$objp->rowid.'">'; print img_edit(); print ''; } print ''; print ''; - print 'rowid.'">'; + print 'rowid.'">'; print img_delete(); print ''; if ($num > 1) @@ -1777,7 +1821,7 @@ else print 'rowid.'" method="post">'; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1886,9 +1930,9 @@ else print ''; // Add free products/services form - print ''; + print ''; print ''; - print ''; + print ''; print ''; $var=true; @@ -1958,9 +2002,9 @@ else print ' '; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; $var=!$var; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index c2e2d49592f..2fe29c078c8 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -186,11 +186,15 @@ if ($_REQUEST['action'] == 'builddoc') $donation->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$donation->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=don_create($db, $donation->id, '', $donation->modelpdf, $outputlangs); if ($result <= 0) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 740eeb0d853..de3325dcc01 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -143,14 +143,20 @@ if ($_REQUEST['action'] == 'confirm_deleteproductline' && $_REQUEST['confirm'] = { $fac = new Facture($db); $fac->fetch($_GET['facid']); + $fac->fetch_client(); + $result = $fac->deleteline($_GET['rowid'], $user); if ($result > 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); if ($result > 0) @@ -306,11 +312,15 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $ $result = $fac->set_valid($user); if ($result >= 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); } @@ -325,6 +335,7 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier) { $fac = new Facture($db); $fac->fetch($_GET['facid']); + $fac->fetch_client(); // On verifie si la facture a des paiements $sql = 'SELECT pf.amount'; @@ -359,11 +370,15 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier) { $fac->set_draft($user); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); } @@ -987,11 +1002,15 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $ if ($result > 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); @@ -1016,6 +1035,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST { $fac = new Facture($db,'',$_POST['facid']); if (! $fac->fetch($_POST['facid']) > 0) dol_print_error($db); + $fac->fetch_client(); // Clean parameters $date_start=''; @@ -1078,11 +1098,15 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST $type ); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); } @@ -1105,15 +1129,21 @@ if ($_GET['action'] == 'up' && $user->rights->facture->creer) { $fac = new Facture($db,'',$_GET['facid']); $fac->fetch($_GET['facid']); + $fac->fetch_client(); $fac->line_up($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); + Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$_GET["facid"].'#'.$_GET['rowid']); exit; } @@ -1122,15 +1152,21 @@ if ($_GET['action'] == 'down' && $user->rights->facture->creer) { $fac = new Facture($db,'',$_GET['facid']); $fac->fetch($_GET['facid']); + $fac->fetch_client(); $fac->line_down($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); + Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$_GET["facid"].'#'.$_GET['rowid']); exit; } @@ -1390,17 +1426,22 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post { $fac = new Facture($db, 0, $_GET['facid']); $fac->fetch($_GET['facid']); + $fac->fetch_client(); if ($_REQUEST['model']) { $fac->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); if ($result <= 0) @@ -3598,11 +3639,15 @@ else // Construit PDF si non existant if (! is_readable($file)) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=facture_pdf_create($db, $fac->id, '', $_REQUEST['model'], $outputlangs); if ($result <= 0) @@ -3663,11 +3708,15 @@ else // Construit PDF si non existant if (! is_readable($file)) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=facture_pdf_create($db, $fac->id, '', $_REQUEST['model'], $outputlangs); if ($result <= 0) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index e942be72bfc..848ac1bcb1a 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -291,11 +291,15 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer) if ($result > 0) { /* + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$contrat->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } contrat_pdf_create($db, $contrat->id, $contrat->modelpdf, $outputlangs); */ diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 9738eaae7f2..e267b1a8692 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -144,8 +144,26 @@ if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $ { $expedition = new Expedition($db); $expedition->fetch($_GET["id"]); + $expedition->fetch_client(); + $result = $expedition->valid($user); - //$expedition->PdfWrite(); + + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$expedition->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + $result=expedition_pdf_create($db,$expedition->id,$expedition->modelpdf,$outputlangs); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } } if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes') @@ -177,17 +195,22 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post // Sauvegarde le dernier modele choisi pour generer un document $expedition = new Expedition($db, 0, $_REQUEST['id']); $expedition->fetch($_REQUEST['id']); + $expedition->fetch_client(); if ($_REQUEST['model']) { $expedition->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$expedition->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=expedition_pdf_create($db,$expedition->id,$expedition->modelpdf,$outputlangs); if ($result <= 0) diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index b0e0275e890..4e6ae07f299 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -53,13 +53,13 @@ if ($_GET["id"] > 0) { $fichinter = new Fichinter($db); if ( $fichinter->fetch($_GET["id"], $user->societe_id) > 0) - { + { $soc = new Societe($db, $fichinter->socid); $soc->fetch($fichinter->socid); $head = fichinter_prepare_head($fichinter); - dol_fiche_head($head, 'preview', $langs->trans("InterventionCard")); + dol_fiche_head($head, 'preview', $langs->trans("InterventionCard"), 0, 'intervention'); /* @@ -86,16 +86,16 @@ if ($_GET["id"] > 0) { print ''; - // Ref - print '"; - print ''; + // Ref + print '"; + print ''; - $nbrow=4; + $nbrow=4; print '"; - // Client - print ""; - print ''; - print ''; + // Client + print ""; + print ''; + print ''; - // Statut - print ''; - print "\n"; - print ''; + // Statut + print ''; + print "\n"; + print ''; - // Date - print ''; - print "\n"; - print ''; + // Date + print ''; + print "\n"; + print ''; print '
'.$langs->trans("Ref")."'.$fichinter->ref.'
'.$langs->trans("Ref")."'.$fichinter->ref.''; /* - * Documents - */ + * Documents + */ $fichinterref = dol_sanitizeFileName($fichinter->ref); $dir_output = $conf->ficheinter->dir_output . "/"; $filepath = $dir_output . $fichinterref . "/"; @@ -104,7 +104,7 @@ if ($_GET["id"] > 0) { $relativepath = "${fichinterref}/${fichinterref}.pdf"; $relativepathdetail = "${fichinterref}/${fichinterref}-detail.pdf"; - // Chemin vers png apercus + // Chemin vers png apercus $relativepathimage = "${fichinterref}/${fichinterref}.pdf.png"; $fileimage = $file.".png"; // Si PDF d'1 page $fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page @@ -167,22 +167,22 @@ if ($_GET["id"] > 0) { print "
".$langs->trans("Customer")."'; - print ''.$societe->nom.''; - print '
".$langs->trans("Customer")."'; + print ''.$societe->nom.''; + print '
'.$langs->trans("Status").'".$fichinter->getLibStatut(4)."
'.$langs->trans("Status").'".$fichinter->getLibStatut(4)."
'.$langs->trans("Date").'".dol_print_date($fichinter->date,"daytext")."
'.$langs->trans("Date").'".dol_print_date($fichinter->date,"daytext")."
'; } @@ -190,31 +190,31 @@ if ($_GET["id"] > 0) { dol_print_error($db); } } else { - // Intervention non trouv�e - print $langs->trans("ErrorFichinterNotFound",$_GET["id"]); + // Intervention non trouv�e + print $langs->trans("ErrorFichinterNotFound",$_GET["id"]); } } // Si fichier png PDF d'1 page trouv� if (file_exists($fileimage)) - { +{ print ''; - } +} // Si fichier png PDF de plus d'1 page trouv� elseif (file_exists($fileimagebis)) +{ + $multiple = $relativepathimage . "."; + + for ($i = 0; $i < 20; $i++) { - $multiple = $relativepathimage . "."; + $preview = $multiple.$i; - for ($i = 0; $i < 20; $i++) + if (file_exists($dir_output.$preview)) { - $preview = $multiple.$i; - - if (file_exists($dir_output.$preview)) - { - print '

'; - } + print '

'; } } +} print ''; diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index f5d2cf4177c..07d43424b7a 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -172,7 +172,7 @@ if ($id > 0) $head = fichinter_prepare_head($fichinter); - dol_fiche_head($head, 'contact', $langs->trans("InterventionCard")); + dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"), 0, 'intervention'); /* diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index a6d293c698a..1244baee525 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2005 Simon TOSSER @@ -21,11 +21,11 @@ */ /** - \file htdocs/contrat/document.php - \ingroup contrat - \brief Page des documents joints sur les contrats - \version $Id$ -*/ + * \file htdocs/fichinter/document.php + * \ingroup fichinter + * \brief Page des documents joints sur les contrats + * \version $Id$ + */ require('./pre.inc.php'); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); @@ -128,7 +128,7 @@ if ($object->id) $head=fichinter_prepare_head($object, $user); - dol_fiche_head($head, 'documents', $langs->trans("InterventionCard")); + dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), 0, 'intervention'); // Construit liste des fichiers diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 9928188bf5e..736c943f240 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -85,17 +85,21 @@ if ($_REQUEST["action"] != 'create' && $_REQUEST["action"] != 'add' && ! ($_REQU if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes') { $fichinter = new Fichinter($db); - $fichinter->id = $_GET["id"]; $fichinter->fetch($_GET["id"]); + $fichinter->fetch_client(); $result = $fichinter->setValid($user, $conf->fichinter->outputdir); if ($result >= 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$fichinter->id); @@ -110,17 +114,21 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes') if ($_REQUEST['action'] == 'confirm_modify' && $_REQUEST['confirm'] == 'yes') { $fichinter = new Fichinter($db); - $fichinter->id = $_GET["id"]; $fichinter->fetch($_GET["id"]); + $fichinter->fetch_client(); $result = $fichinter->setDraft($user); if ($result >= 0) { + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=fichinter_create($db, $fichinter, (empty($_REQUEST['model'])?$fichinter->model:$_REQUEST['model']), $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$fichinter->id); @@ -186,6 +194,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post { $fichinter = new Fichinter($db); $fichinter->fetch($_GET['id']); + $fichinter->fetch_client(); $fichinter->fetch_lines(); if ($_REQUEST['model']) @@ -193,11 +202,15 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $fichinter->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs); if ($result <= 0) @@ -243,6 +256,7 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer) { $fichinter = new Fichinter($db); $ret=$fichinter->fetch($_POST['fichinterid']); + $fichinter->fetch_client(); $desc=$_POST['np_desc']; $date_intervention = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]); @@ -255,11 +269,15 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer) $duration ); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST['fichinterid']); @@ -278,12 +296,15 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P dol_print_error($db); exit; } + $fichinter = new Fichinter($db); if ($fichinter->fetch($fichinterline->fk_fichinter) <= 0) { dol_print_error($db); exit; } + $fichinter->fetch_client(); + $desc=$_POST['np_desc']; $date_intervention = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]); $duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']); @@ -298,11 +319,15 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P exit; } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); @@ -339,11 +364,15 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes' exit; } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); } @@ -359,13 +388,18 @@ if ($_GET['action'] == 'up' && $user->rights->ficheinter->creer) { $fichinter = new Fichinter($db); $fichinter->fetch($_GET['id']); + $fichinter->fetch_client(); $fichinter->line_up($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'#'.$_GET['rowid']); @@ -376,13 +410,18 @@ if ($_GET['action'] == 'down' && $user->rights->ficheinter->creer) { $fichinter = new Fichinter($db); $fichinter->fetch($_GET['id']); + $fichinter->fetch_client(); $fichinter->line_down($_GET['rowid']); + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fichinter->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } fichinter_create($db, $fichinter, $fichinter->modelpdf, $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'#'.$_GET['rowid']); @@ -440,11 +479,11 @@ if ($_GET["action"] == 'create') print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''."\n"; if ($conf->projet->enabled) @@ -476,25 +515,28 @@ if ($_GET["action"] == 'create') print ''; print ''; - print ''; - print '
'.$langs->trans("Company").''.$societe->getNomUrl(1).'
'.$langs->trans("Company").''.$societe->getNomUrl(1).'
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'; - print ''; - print '
'; + + print '


'; + print ''; + print '
'; + print '
'; } else { print '
'; print ''; - print ''; - print '
'.$langs->trans("Company").''; + print '
'.$langs->trans("Company").''; $html->select_societes('','socid','',1,1); print '
'; + print '
'; + + print '
'; print ''; print ''; - print ''; - print ''; + print '
'; + print '
'; } @@ -513,7 +555,7 @@ elseif ($fichinterid) $head = fichinter_prepare_head($fichinter); - dol_fiche_head($head, 'card', $langs->trans("InterventionCard")); + dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention'); // Confirmation de la suppression de la fiche d'intervention if ($_GET['action'] == 'delete') diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index 76f89900c46..144aecfd790 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -369,6 +369,30 @@ class Fichinter extends CommonObject } } + /** + * \brief Return clicable name (with picto eventually) + * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + + $lien = ''; + $lienfin=''; + + $picto='intervention'; + + $label=$langs->trans("Show").': '.$this->ref; + + if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; + return $result; + } + /** * \brief Verifie si la ref n'est pas deja utilisee * \param soc objet societe diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 1ca35203140..814d15bb6cd 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -20,7 +20,7 @@ /** * \file htdocs/fichinter/index.php - * \brief Page accueil espace fiches interventions + * \brief List of all interventions * \ingroup ficheinter * \version $Id$ */ @@ -87,7 +87,7 @@ if ($result) { $num = $db->num_rows($result); - $fichinter_static=new Fichinter($db); + $interventionstatic=new Fichinter($db); $urlparam="&socid=$socid"; print_barre_liste($langs->trans("ListOfInterventions"), $page, "index.php",$urlparam,$sortfield,$sortorder,'',$num); @@ -127,13 +127,17 @@ if ($result) $objp = $db->fetch_object($result); $var=!$var; print ""; - print "fichid."\">".img_object($langs->trans("Show"),"task").' '.$objp->ref."\n"; + print ""; + $interventionstatic->id=$objp->fichid; + $interventionstatic->ref=$objp->ref; + print $interventionstatic->getNomUrl(1); + print "\n"; print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44)."\n"; print ''.dol_htmlentitiesbr(dol_trunc($objp->description,20)).''; print ''.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).''; print ''.dol_print_date($objp->dp,'dayhour')."\n"; print ''.ConvertSecondToTime($objp->duree).''; - print ''.$fichinter_static->LibStatut($objp->fk_statut,5).''; + print ''.$interventionstatic->LibStatut($objp->fk_statut,5).''; print "\n"; diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index 291cc4f949e..0c44b7f7b72 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -1,6 +1,6 @@ - * Copyright (C) 2009 Laurent Destailleur + * Copyright (C) 2009-2010 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,11 +18,11 @@ */ /** - \file htdocs/fichinter/info.php - \ingroup fichinter - \brief Page d'affichage des infos d'une fiche d'intervention - \version $Id$ -*/ + * \file htdocs/fichinter/info.php + * \ingroup fichinter + * \brief Page d'affichage des infos d'une fiche d'intervention + * \version $Id$ + */ require('./pre.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); @@ -51,7 +51,7 @@ $societe = new Societe($db); $societe->fetch($fichinter->socid); $head = fichinter_prepare_head($fichinter); -dol_fiche_head($head, 'info', $langs->trans('InterventionCard')); +dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), 0, 'intervention'); $fichinter->info($fichinter->id); diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 5ae80d49ca6..ae95aa27fc1 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -17,10 +17,10 @@ */ /** - \file htdocs/fichinter/note.php - \ingroup fichinter - \brief Fiche d'information sur une fiche d'intervention - \version $Id$ + * \file htdocs/fichinter/note.php + * \ingroup fichinter + * \brief Fiche d'information sur une fiche d'intervention + * \version $Id$ */ require('./pre.inc.php'); @@ -99,13 +99,13 @@ if ($_GET['id']) if ( $societe->fetch($fichinter->socid) ) { $head = fichinter_prepare_head($fichinter); - dol_fiche_head($head, 'note', $langs->trans('InterventionCard')); + dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention'); print ''; print ''; - // Société + // Soci�t� print ''; // Note publique @@ -126,7 +126,7 @@ if ($_GET['id']) } print ""; - // Note privée + // Note priv�e if (! $user->societe_id) { print ''; @@ -146,7 +146,7 @@ if ($_GET['id']) } print ""; } - + print "
'.$langs->trans('Ref').''.$fichinter->ref.'
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans("NotePrivate").' :
"; print ''; diff --git a/htdocs/fichinter/rapport.php b/htdocs/fichinter/rapport.php index ec8bf183ad7..2542b6ca338 100644 --- a/htdocs/fichinter/rapport.php +++ b/htdocs/fichinter/rapport.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -28,20 +28,19 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); -llxHeader(); - /* - * Liste - * + * View */ +llxHeader(); + if ($sortorder == "") { - $sortorder="ASC"; + $sortorder="ASC"; } if ($sortfield == "") { - $sortfield="f.datei"; + $sortfield="f.datei"; } if ($page == -1) { $page = 0 ; } @@ -61,13 +60,13 @@ $sql.= " AND f.entity = ".$conf->entity; if ($socid > 0) { - $sql .= " AND s.rowid = " . $socid; + $sql .= " AND s.rowid = " . $socid; } if (empty ($MM)) - $MM=strftime("%m",time()); +$MM=strftime("%m",time()); if (empty($YY)) - $YY=strftime("%Y",time());; +$YY=strftime("%Y",time());; echo "
"; echo "\n
"; echo ""; @@ -80,13 +79,13 @@ echo "
"; $start="$YY-$MM-01 00:00:00"; if ($MM ==12) { - $y = $YY+1; - $end="$y-01-01 00:00:00"; + $y = $YY+1; + $end="$y-01-01 00:00:00"; } else { - $m = $MM+1; - $end="$YY-$m-01 00:00:00"; + $m = $MM+1; + $end="$YY-$m-01 00:00:00"; } $sql .= " AND datei >= '".$start."' AND datei < '".$end."'" ; @@ -94,52 +93,51 @@ $sql .= " ORDER BY $sortfield $sortorder "; if ( $db->query($sql) ) { - $num = $db->num_rows(); - $title = $langs->trans("Report")." ".dol_print_date(strtotime($start),"%B %Y"); - print_barre_liste($title, $page, "rapport.php","&socid=".$socid,$sortfield,$sortorder,'',$num); + $num = $db->num_rows(); + $title = $langs->trans("Report")." ".dol_print_date(strtotime($start),"%B %Y"); + print_barre_liste($title, $page, "rapport.php","&socid=".$socid,$sortfield,$sortorder,'',$num); - $i = 0; - print ''; - print ""; - print ''; - if (empty($socid)) - print ''; - print ''; + $i = 0; + print '
Num'.$langs->trans("Customers").''.$langs->trans("Description").'
'; + print ""; + print ''; + if (empty($socid)) + print ''; + print ''; - print ''; - print ''; - print "\n"; - $var=True; - $DureeTotal = 0; - while ($i < $num) - { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - print '\n'; + print ''; + print ''; + print "\n"; + $var=True; + $DureeTotal = 0; + while ($i < $num) + { + $objp = $db->fetch_object(); + $var=!$var; + print ""; + print '\n'; - if (empty($socid)) - { - if (!empty($MM)) - $filter="&MM=$MM&YY=$YY"; - print '\n"; - } - print ''; - print "\n"; - print ''; - $DureeTotal += $objp->duree; - print "\n"; + if (empty($socid)) + { + if (!empty($MM)) $filter="&MM=$MM&YY=$YY"; + print '\n"; + } + print ''; + print "\n"; + print ''; + $DureeTotal += $objp->duree; + print "\n"; - $i++; - } - print "
Num'.$langs->trans("Customers").''.$langs->trans("Description").'Date'.$langs->trans("Duration").'
'.$objp->ref.'Date'.$langs->trans("Duration").'
'.$objp->ref.' '; - print "rowid.$filter."\">".$objp->nom."'.nl2br($objp->description).'".dol_print_date($objp->dp,"%d %B %Y")."'.sprintf("%.1f",$objp->duree).'
 '; + print "rowid.$filter."\">".$objp->nom."'.nl2br($objp->description).'".dol_print_date($objp->dp,"%d %B %Y")."'.sprintf("%.1f",$objp->duree).'
"; - $db->free(); - print "
".$langs->trans("Total")." $DureeTotal jour[s]"; + $i++; + } + print ""; + $db->free(); + print "
".$langs->trans("Total")." $DureeTotal jour[s]"; } else { - dol_print_error($db); + dol_print_error($db); } $db->close(); diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index b4b79b65fab..a9ff49449e2 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -56,11 +56,11 @@ if ($_POST["action"] == 'add') $db->begin(); // Creation de l'objet livraison - $livraison = new Livraison($db); + $delivery = new Livraison($db); - $livraison->date_livraison = time(); - $livraison->note = $_POST["note"]; - $livraison->commande_id = $_POST["commande_id"]; + $delivery->date_livraison = time(); + $delivery->note = $_POST["note"]; + $delivery->commande_id = $_POST["commande_id"]; if (!$conf->expedition_bon->enabled && $conf->stock->enabled) { @@ -70,7 +70,7 @@ if ($_POST["action"] == 'add') // On boucle sur chaque ligne de commande pour completer objet livraison // avec qte a livrer $commande = new Commande($db); - $commande->fetch($livraison->commande_id); + $commande->fetch($delivery->commande_id); $commande->fetch_lines(); for ($i = 0 ; $i < sizeof($commande->lignes) ; $i++) { @@ -78,21 +78,21 @@ if ($_POST["action"] == 'add') $idl = "idl".$i; if ($_POST[$qty] > 0) { - $livraison->addline($_POST[$idl],$_POST[$qty]); + $delivery->addline($_POST[$idl],$_POST[$qty]); } } - $ret=$livraison->create($user); + $ret=$delivery->create($user); if ($ret > 0) { $db->commit(); - Header("Location: fiche.php?id=".$livraison->id); + Header("Location: fiche.php?id=".$delivery->id); exit; } else { $db->rollback(); - $mesg='
'.$livraison->error.'
'; + $mesg='
'.$delivery->error.'
'; $_GET["commande_id"]=$_POST["commande_id"]; $_GET["action"]='create'; } @@ -100,20 +100,38 @@ if ($_POST["action"] == 'add') if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $user->rights->expedition->livraison->valider) { - $livraison = new Livraison($db); - $livraison->fetch($_GET["id"]); - $result = $livraison->valid($user); - //$livraison->PdfWrite(); + $delivery = new Livraison($db); + $delivery->fetch($_GET["id"]); + $delivery->fetch_client(); + + $result = $delivery->valid($user); + + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$delivery->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + $result=delivery_order_pdf_create($db, $_REQUEST['id'],$_REQUEST['model'],$outputlangs); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } } if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->expedition->livraison->supprimer) { - $livraison = new Livraison($db); - $livraison->fetch($_GET["id"]); - $expedition_id = $livraison->expedition_id; + $delivery = new Livraison($db); + $delivery->fetch($_GET["id"]); + $expedition_id = $delivery->expedition_id; $db->begin(); - $result=$livraison->delete(); + $result=$delivery->delete(); if ($result > 0) { @@ -147,11 +165,15 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $delivery->setDocModel($user, $_REQUEST['model']); } + // Define output language $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$delivery->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $outputlangs->setDefaultLang($newlang); } $result=delivery_order_pdf_create($db, $_REQUEST['id'],$_REQUEST['model'],$outputlangs); if ($result <= 0) @@ -364,34 +386,34 @@ else { if ($_GET["id"] > 0) { - $livraison = new Livraison($db); - $result = $livraison->fetch($_GET["id"]); - $livraison->fetch_client(); + $delivery = new Livraison($db); + $result = $delivery->fetch($_GET["id"]); + $delivery->fetch_client(); $expedition=new Expedition($db); - $result = $expedition->fetch($livraison->expedition_id); + $result = $expedition->fetch($delivery->expedition_id); $typeobject = $expedition->origin; - if ($livraison->origin_id) + if ($delivery->origin_id) { - $object = $livraison->origin; - $livraison->fetch_object(); + $object = $delivery->origin; + $delivery->fetch_object(); } - if ( $livraison->id > 0) + if ( $delivery->id > 0) { $soc = new Societe($db); - $soc->fetch($livraison->socid); + $soc->fetch($delivery->socid); $h=0; if ($conf->expedition_bon->enabled) { - $head[$h][0] = DOL_URL_ROOT."/expedition/fiche.php?id=".$livraison->expedition_id; + $head[$h][0] = DOL_URL_ROOT."/expedition/fiche.php?id=".$delivery->expedition_id; $head[$h][1] = $langs->trans("SendingCard"); $h++; } - $head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$livraison->id; + $head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$delivery->id; $head[$h][1] = $langs->trans("DeliveryCard"); $hselected = $h; $h++; @@ -405,7 +427,7 @@ else if ($_GET["action"] == 'delete') { $expedition_id = $_GET["expid"]; - $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id.'&expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm"),'confirm_delete','','',1); + $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm"),'confirm_delete','','',1); if ($ret == 'html') print '
'; } @@ -415,7 +437,7 @@ else */ if ($_GET["action"] == 'valid') { - $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm"),'confirm_valid','','',1); + $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm"),'confirm_valid','','',1); if ($ret == 'html') print '
'; } @@ -427,7 +449,7 @@ else // Ref print ''.$langs->trans("Ref").''; - print ''.$livraison->ref.''; + print ''.$delivery->ref.''; // Client print ''.$langs->trans("Customer").''; @@ -458,24 +480,24 @@ else // Ref client print ''.$langs->trans("RefCustomer").''; - print ''.$livraison->ref_client."\n"; + print ''.$delivery->ref_client."\n"; print ''; // Date print ''.$langs->trans("Date").''; - print ''.dol_print_date($livraison->date_creation,'dayhourtext')."\n"; + print ''.dol_print_date($delivery->date_creation,'dayhourtext')."\n"; print ''; // Statut print ''.$langs->trans("Status").''; - print ''.$livraison->getLibStatut(4)."\n"; + print ''.$delivery->getLibStatut(4)."\n"; print ''; if (!$conf->expedition_bon->enabled && $conf->stock->enabled) { // Entrepot $entrepot = new Entrepot($db); - $entrepot->fetch($livraison->entrepot_id); + $entrepot->fetch($delivery->entrepot_id); print ''.$langs->trans("Warehouse").''; print ''.$entrepot->libelle.''; print ''; @@ -487,7 +509,7 @@ else * Lignes produits */ - $num_prod = sizeof($livraison->lignes); + $num_prod = sizeof($delivery->lignes); $i = 0; $total = 0; print ''; @@ -508,40 +530,40 @@ else $var=!$var; print ""; - if ($livraison->lignes[$i]->fk_product > 0) + if ($delivery->lignes[$i]->fk_product > 0) { $product = new Product($db); - $product->fetch($livraison->lignes[$i]->fk_product); + $product->fetch($delivery->lignes[$i]->fk_product); print '\n"; } - print ''; - print ''; + print ''; + print ''; print ""; @@ -563,20 +585,20 @@ else // if (! preg_match('/^(valid|delete)/i',$_REQUEST["action"])) // { - if ($livraison->statut == 0 && $user->rights->expedition->livraison->valider && $num_prod > 0) + if ($delivery->statut == 0 && $user->rights->expedition->livraison->valider && $num_prod > 0) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } if ($user->rights->expedition->livraison->supprimer) { if ($conf->expedition_bon->enabled) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } // } @@ -591,14 +613,14 @@ else * Documents generated */ - $livraisonref = dol_sanitizeFileName($livraison->ref); - $filedir = $conf->expedition->dir_output . "/receipt/" . $livraisonref; - $urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id; + $deliveryref = dol_sanitizeFileName($delivery->ref); + $filedir = $conf->expedition->dir_output . "/receipt/" . $deliveryref; + $urlsource = $_SERVER["PHP_SELF"]."?id=".$delivery->id; $genallowed=$user->rights->expedition->livraison->creer; $delallowed=$user->rights->expedition->livraison->supprimer; - $somethingshown=$formfile->show_documents('livraison',$livraisonref,$filedir,$urlsource,$genallowed,$delallowed,$livraison->modelpdf,'',0,0,28,0,'','','',$soc->default_lang); + $somethingshown=$formfile->show_documents('livraison',$deliveryref,$filedir,$urlsource,$genallowed,$delallowed,$delivery->modelpdf,'',0,0,28,0,'','','',$soc->default_lang); if ($genallowed && ! $somethingshown) $somethingshown=1; print '
'; // Affiche ligne produit - $text = ''; - if ($livraison->lignes[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service'); + $text = ''; + if ($delivery->lignes[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service'); else $text.= img_object($langs->trans('ShowProduct'),'product'); - $text.= ' '.$livraison->lignes[$i]->ref.''; - $text.= ' - '.$livraison->lignes[$i]->label; - $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($livraison->lignes[$i]->description)); + $text.= ' '.$delivery->lignes[$i]->ref.''; + $text.= ' - '.$delivery->lignes[$i]->label; + $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($delivery->lignes[$i]->description)); //print $description; print $html->textwithtooltip($text,$description,3,'','',$i); - print_date_range($livraison->lignes[$i]->date_start,$livraison->lignes[$i]->date_end); + print_date_range($delivery->lignes[$i]->date_start,$delivery->lignes[$i]->date_end); if ($conf->global->PRODUIT_DESC_IN_FORM) { - print ($livraison->lignes[$i]->description && $livraison->lignes[$i]->description!=$livraison->lignes[$i]->label)?'
'.dol_htmlentitiesbr($livraison->lignes[$i]->description):''; + print ($delivery->lignes[$i]->description && $delivery->lignes[$i]->description!=$delivery->lignes[$i]->label)?'
'.dol_htmlentitiesbr($delivery->lignes[$i]->description):''; } } else { print "
"; - if ($livraison->lignes[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); + if ($delivery->lignes[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); else $text = img_object($langs->trans('Product'),'product'); - print $text.' '.nl2br($livraison->lignes[$i]->description); + print $text.' '.nl2br($delivery->lignes[$i]->description); print_date_range($objp->date_start,$objp->date_end); print "'.$livraison->lignes[$i]->qty_asked.''.$livraison->lignes[$i]->qty_shipped.''.$delivery->lignes[$i]->qty_asked.''.$delivery->lignes[$i]->qty_shipped.'
';