Esempio n. 1
0
 * Actions
 */
// Activation du mandats apres creation
if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) {
    $object->fetch($id);
    $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment'));
    if ($result > 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
        exit;
    } else {
        $mesg = $object->error;
    }
} else {
    if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) {
        $object->fetch($id);
        $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
        if ($result > 0) {
            header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
            exit;
        } else {
            $mesg = $object->error;
        }
    }
}
// Si ajout champ produit predefini
// Si ajout champ  libre
if (GETPOST('mode') == 'libre') {
    $date_start_sl = '';
    $date_end_sl = '';
    if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) {
        $date_start_sl = dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear'));