Exemplo n.º 1
0
 if ($action == 'addline' && $user->rights->contrat->creer) {
     if (!GETPOST('qty')) {
         setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), 'errors');
         $error++;
     }
     if ((GETPOST('price_ht') == '' || !GETPOST('dp_desc')) && !GETPOST('idprod')) {
         setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors');
         $error++;
     }
     if (!$error) {
         $ret = $object->fetch($id);
         if ($ret < 0) {
             dol_print_error($db, $object->error);
             exit;
         }
         $ret = $object->fetch_thirdparty();
         $date_start = '';
         $date_end = '';
         // Si ajout champ produit libre
         if (GETPOST('mode') == 'libre') {
             if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) {
                 $date_start = dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear'));
             }
             if (GETPOST('date_end_slmonth') && GETPOST('date_end_slday') && GETPOST('date_end_slyear')) {
                 $date_end = dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear'));
             }
         }
         // Si ajout champ produit predefini
         if (GETPOST('mode') == 'predefined') {
             if (GETPOST('date_startmonth') && GETPOST('date_startday') && GETPOST('date_startyear')) {
                 $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));