setEventMessage($object->error, 'errors'); } } if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->cheque) { $object->id = $id; $result = $object->delete(); if ($result == 0) { header("Location: index.php"); exit; } else { setEventMessage($paiement->error, 'errors'); } } if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->cheque) { $result = $object->fetch($id); $result = $object->validate($user); if ($result >= 0) { // 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=$object->client->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } $result = $object->generatePdf(GETPOST('model'), $outputlangs); header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id); exit;
} if ($action == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && $user->rights->banque->cheque) { $remisecheque = new RemiseCheque($db); $remisecheque->id = $_GET["id"]; $result = $remisecheque->delete(); if ($result == 0) { Header("Location: index.php"); exit; } else { $mesg = '<div class="error">' . $paiement->error . '</div>'; } } if ($action == 'confirm_valide' && $_REQUEST['confirm'] == 'yes' && $user->rights->banque->cheque) { $remisecheque = new RemiseCheque($db); $result = $remisecheque->fetch($_GET["id"]); $result = $remisecheque->validate($user); if ($result >= 0) { // 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=$object->client->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } $result = $remisecheque->generatePdf($_POST["model"], $outputlangs); Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $remisecheque->id); exit;