コード例 #1
0
    $socid = $user->societe_id;
}
$result = restrictedArea($user, $origin, $origin_id);
$action = GETPOST('action', 'alpha');
$object = new Expedition($db);
GETPOST('id') ? $object->fetch(GETPOST('id')) : "";
llxHeader('', $langs->trans('Sending'), 'Expedition');
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
$product_static = new Product($db);
if ($action == 'setdate_livraison' && $user->rights->expedition->creer) {
    //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
    $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
    $object->fetch($id);
    $result = $object->set_date_livraison($user, $datedelivery);
    if ($result < 0) {
        $mesg = '<div class="error">' . $object->error . '</div>';
    }
} else {
    if ($action == 'settrackingnumber' || $action == 'settrackingurl' || $action == 'settrueWeight' || $action == 'settrueWidth' || $action == 'settrueHeight' || $action == 'settrueDepth' || $action == 'setshipping_method_id') {
        $error = 0;
        $shipping = new Expedition($db);
        $result = $shipping->fetch($id);
        if ($result < 0) {
            dol_print_error($db, $shipping->error);
        }
        if ($action == 'settrackingnumber') {
            $shipping->tracking_number = trim(GETPOST('trackingnumber', 'alpha'));
        }
        if ($action == 'settrackingurl') {