exit; } $mesg = $shipping->error; } $mesg = '<div class="error">' . $mesg . '</div>'; $action = ""; } /* * Build doc */ if ($action == 'builddoc') { require_once DOL_DOCUMENT_ROOT . "/includes/modules/expedition/pdf/ModelePdfExpedition.class.php"; // Sauvegarde le dernier modele choisi pour generer un document $shipment = new Expedition($db); $shipment->fetch($id); $shipment->fetch_thirdparty(); if ($_REQUEST['model']) { $shipment->setDocModel($user, $_REQUEST['model']); } // 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 = $shipment->client->default_lang; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang);
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; $langs->load("orders"); $langs->load("sendings"); $langs->load("companies"); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); // Security check if ($user->societe_id) { $socid = $user->societe_id; } $result = restrictedArea($user, 'expedition', $id, ''); $object = new Expedition($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); if (!empty($object->origin)) { $typeobject = $object->origin; $origin = $object->origin; $object->fetch_origin(); } // Linked documents if ($typeobject == 'commande' && $object->{$typeobject}->id && !empty($conf->commande->enabled)) { $objectsrc = new Commande($db); $objectsrc->fetch($object->{$typeobject}->id); } if ($typeobject == 'propal' && $object->{$typeobject}->id && !empty($conf->propal->enabled)) { $objectsrc = new Propal($db); $objectsrc->fetch($object->{$typeobject}->id); } }