début ajout option : confirmation de suppression d'une ligne produit
This commit is contained in:
parent
6151457bf9
commit
fa894fcf2e
@ -43,6 +43,7 @@ $langs->load('companies');
|
|||||||
$langs->load('propal');
|
$langs->load('propal');
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
|
$langs->load('products');
|
||||||
|
|
||||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
|
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
|
||||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
||||||
@ -87,7 +88,7 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes')
|
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if ($user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,6 +45,7 @@ $langs->load('companies');
|
|||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
$langs->load('propal');
|
$langs->load('propal');
|
||||||
$langs->load('deliveries');
|
$langs->load('deliveries');
|
||||||
|
$langs->load('products');
|
||||||
|
|
||||||
$user->getrights('commande');
|
$user->getrights('commande');
|
||||||
$user->getrights('expedition');
|
$user->getrights('expedition');
|
||||||
@ -248,11 +249,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['action'] == 'deleteline' && $user->rights->commande->creer)
|
if ($_GET['action'] == 'deleteline' && $user->rights->commande->creer && !$conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
{
|
{
|
||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$commande->fetch($_GET['id']);
|
$commande->fetch($_GET['id']);
|
||||||
$result = $commande->delete_line($_GET['lineid']);
|
$result = $commande->delete_line($_GET['lineid']);
|
||||||
|
commande_pdf_create($db, $_GET['id'], $commande->modelpdf);
|
||||||
Header('Location: fiche.php?id='.$_GET['id']);
|
Header('Location: fiche.php?id='.$_GET['id']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -292,6 +294,19 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
|
{
|
||||||
|
if ($user->rights->commande->creer)
|
||||||
|
{
|
||||||
|
$commande = new Commande($db);
|
||||||
|
$commande->fetch($_GET['id']);
|
||||||
|
$commande->delete_line($_GET['lineid']);
|
||||||
|
commande_pdf_create($db, $_GET['id'], $commande->modelpdf);
|
||||||
|
}
|
||||||
|
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_GET['id']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_GET['action'] == 'modif' && $user->rights->commande->creer)
|
if ($_GET['action'] == 'modif' && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -798,7 +813,7 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'delete')
|
if ($_GET['action'] == 'delete')
|
||||||
{
|
{
|
||||||
$html->form_confirm('fiche.php?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,7 +823,7 @@ else
|
|||||||
if ($_GET['action'] == 'valid')
|
if ($_GET['action'] == 'valid')
|
||||||
{
|
{
|
||||||
//$numfa = commande_get_num($soc);
|
//$numfa = commande_get_num($soc);
|
||||||
$html->form_confirm('fiche.php?id='.$id, $langs->trans('ValidateOrder'), $langs->trans('ConfirmValidateOrder'), 'confirm_valid');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $langs->trans('ConfirmValidateOrder'), 'confirm_valid');
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -818,7 +833,7 @@ else
|
|||||||
if ($_GET['action'] == 'cloture')
|
if ($_GET['action'] == 'cloture')
|
||||||
{
|
{
|
||||||
//$numfa = commande_get_num($soc);
|
//$numfa = commande_get_num($soc);
|
||||||
$html->form_confirm('fiche.php?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close');
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -827,9 +842,18 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'annuler')
|
if ($_GET['action'] == 'annuler')
|
||||||
{
|
{
|
||||||
$html->form_confirm('fiche.php?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commande
|
* Commande
|
||||||
@ -1110,10 +1134,17 @@ else
|
|||||||
// Icone d'edition et suppression
|
// Icone d'edition et suppression
|
||||||
if ($commande->statut == 0 && $user->rights->commande->creer)
|
if ($commande->statut == 0 && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
print '<td align="right"><a href="fiche.php?id='.$id.'&action=editline&rowid='.$objp->rowid.'">';
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=editline&rowid='.$objp->rowid.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
print '<td align="right"><a href="fiche.php?id='.$id.'&action=deleteline&lineid='.$objp->rowid.'">';
|
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
|
{
|
||||||
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=delete_product_line&lineid='.$objp->rowid.'">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=deleteline&lineid='.$objp->rowid.'">';
|
||||||
|
}
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|||||||
@ -90,6 +90,8 @@ AddDel=Add/Delete
|
|||||||
Quantity=Quantity
|
Quantity=Quantity
|
||||||
NoMatchFound=No match found
|
NoMatchFound=No match found
|
||||||
DeleteProduct=Delete a product/service
|
DeleteProduct=Delete a product/service
|
||||||
ConfirmDeleteProduct=Are you sure you want to delete this product/service ?
|
ConfirmDeleteProduct=Are you sure you want to delete this product/service?
|
||||||
ProductDeleted=Product/Service "%s" deleted from database.
|
ProductDeleted=Product/Service "%s" deleted from database.
|
||||||
ExportDataset_produit_1=Products and services
|
ExportDataset_produit_1=Products and services
|
||||||
|
DeleteProductLine=Delete product line
|
||||||
|
ConfirmDeleteProductLine=Are you sure you want to delete this product line?
|
||||||
@ -103,3 +103,5 @@ DeleteProduct=Supprimer un produit/service
|
|||||||
ConfirmDeleteProduct=Etes-vous sûr de vouloir supprimer ce produit/service ?
|
ConfirmDeleteProduct=Etes-vous sûr de vouloir supprimer ce produit/service ?
|
||||||
ProductDeleted=Le produit/service "%s" à été supprimé de la base.
|
ProductDeleted=Le produit/service "%s" à été supprimé de la base.
|
||||||
ExportDataset_produit_1=Produits et services
|
ExportDataset_produit_1=Produits et services
|
||||||
|
DeleteProductLine=Supprimer ligne produit
|
||||||
|
ConfirmDeleteProductLine=Êtes-vous sûr de vouloir effacer cette ligne produit ?
|
||||||
Loading…
Reference in New Issue
Block a user