Add: confirmation de suppression de ligne produit
This commit is contained in:
parent
a6ce81310b
commit
27069126b4
@ -196,17 +196,20 @@ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->c
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['action'] == 'deleteline' && $user->rights->fournisseur->commande->creer)
|
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
{
|
{
|
||||||
$commande = new CommandeFournisseur($db);
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
$commande->fetch($_GET['id']);
|
{
|
||||||
$result = $commande->delete_line($_GET['lineid']);
|
$commande = new CommandeFournisseur($db);
|
||||||
if ($_REQUEST['lang_id'])
|
$commande->fetch($_GET['id']);
|
||||||
|
$result = $commande->delete_line($_GET['lineid']);
|
||||||
|
if ($_REQUEST['lang_id'])
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs",$conf);
|
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs",$conf);
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||||
}
|
}
|
||||||
supplier_order_pdf_create($db, $_GET['id'], $commande->modelpdf, $outputlangs);
|
supplier_order_pdf_create($db, $_GET['id'], $commande->modelpdf, $outputlangs);
|
||||||
|
}
|
||||||
Header('Location: fiche.php?id='.$_GET['id']);
|
Header('Location: fiche.php?id='.$_GET['id']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -539,6 +542,15 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* 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"].'?id='.$commande->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
* Commande
|
* Commande
|
||||||
*/
|
*/
|
||||||
$nbrow=8;
|
$nbrow=8;
|
||||||
@ -662,7 +674,7 @@ else
|
|||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|
||||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=deleteline&lineid='.$objp->rowid.'">';
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=delete_product_line&lineid='.$objp->rowid.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user