unset($_POST['durationhour']); unset($_POST['durationmin']); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST['fichinterid']); exit; } /* * Supprime une ligne d'intervention AVEC confirmation */ if ($action == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes') { if ($user->rights->ficheinter->creer) { $fichinterline = new FichinterLigne($db); if ($fichinterline->fetch($_GET['ligne']) <= 0) { dol_print_error($db); exit; } $result=$fichinterline->deleteline(); $object = new Fichinter($db); if ($object->fetch($fichinterline->fk_fichinter) <= 0) { dol_print_error($db); exit; } // Define output language $outputlangs = $langs; $newlang='';
print '<td align="center" class="nowrap">'; $form->select_date($db->jdate($objp->date_intervention), 'di', 1, 1, 0, "date_intervention"); print '</td>'; // Duration print '<td align="right">'; $selectmode = 'select'; if (!empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) { $selectmode = 'text'; } $form->select_duration('duration', $objp->duree, 0, $selectmode); print '</td>'; print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">'; print '<br><input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></td>'; print '</tr>' . "\n"; $line = new FichinterLigne($db); $line->fetch($objp->rowid); $extrafieldsline = new ExtraFields($db); $extralabelslines = $extrafieldsline->fetch_name_optionals_label($line->table_element); $line->fetch_optionals($line->rowid, $extralabelslines); print $line->showOptionals($extrafieldsline, 'edit', array('style' => $bc[$var], 'colspan' => 5)); } $i++; } $db->free($resql); // Add new line if ($object->statut == 0 && $user->rights->ficheinter->creer && $action != 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) { if (!$num) { print '<br><table class="noborder" width="100%">'; } print '<tr class="liste_titre">'; print '<td>';
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { $newlang = $object->client->default_lang; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { fichinter_create($db, $object, $object->modelpdf, $outputlangs); } header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } else { if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer) { $objectline = new FichinterLigne($db); if ($objectline->fetch(GETPOST('line_id', 'int')) <= 0) { dol_print_error($db); exit; } $result = $objectline->deleteline($user); if ($object->fetch($objectline->fk_fichinter) <= 0) { dol_print_error($db); exit; } // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'alpha')) { $newlang = GETPOST('lang_id', 'alpha'); } if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {