[bug #274] Article reste après suppression article
This commit is contained in:
parent
471f060647
commit
da03f9a951
@ -310,21 +310,36 @@ if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer && $
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_deleteproductline' && $confirm == 'yes')
|
if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
$object->fetch($id);
|
||||||
{
|
|
||||||
$object->fetch($id);
|
|
||||||
$result = $object->deleteline($_GET['lineid']);
|
|
||||||
|
|
||||||
$outputlangs = $langs;
|
$result = $object->deleteline(GETPOST('lineid'));
|
||||||
if (! empty($_REQUEST['lang_id']))
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = $langs;
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
if (! empty($_REQUEST['lang_id']))
|
||||||
}
|
{
|
||||||
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
$outputlangs = new Translate("",$conf);
|
||||||
}
|
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||||
|
}
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
|
{
|
||||||
|
$ret=$object->fetch($id); // Reload to get new records
|
||||||
|
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$mesg=$object->error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
Header("Location: fiche.php?id=".$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider)
|
if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user