From 45517c0245117a4f0a572e33a59fd7e31c589862 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2006 09:46:25 +0000 Subject: [PATCH] =?UTF-8?q?d=E9but=20ajout=20option=20:=20confirmation=20d?= =?UTF-8?q?e=20suppression=20d'une=20ligne=20produit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 4591e58e209..aa9fcec11c7 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -87,6 +87,19 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes') exit; } +if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes') +{ + if ($user->rights->propale->creer) + { + $propal = new Propal($db); + $propal->fetch($_GET['propalid']); + $propal->delete_product($_GET['ligne']); + propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf); + } + Header('Location: '.$_SERVER["PHP_SELF"]); + exit; +} + if ($_POST['action'] == 'confirm_validate' && $_POST['confirm'] == 'yes') { if ($user->rights->propale->valider) @@ -421,7 +434,7 @@ if ($_POST['action'] == 'builddoc' && $user->rights->propale->creer) } -if ($_GET['action'] == 'del_ligne' && $user->rights->propale->creer) +if ($_GET['action'] == 'del_ligne' && $user->rights->propale->creer && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE) { /* * Supprime une ligne produit dans la propale @@ -534,6 +547,15 @@ if ($_GET['propalid'] > 0) $html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete'); print '
'; } + + /* + * Confirmation de la suppression d'une ligne produit + */ + if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) + { + $html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&ligne='.$objp->rowid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); + print '
'; + } /* * Confirmation de la validation de la propale @@ -912,7 +934,14 @@ if ($_GET['propalid'] > 0) print 'rowid.'">'; print img_edit(); print ''; - print 'rowid.'">'; + if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) + { + print 'rowid.'">'; + } + else + { + print 'rowid.'">'; + } print img_delete(); print ''; print '';