Skip to content

Commit

Permalink
[bug #274] Article reste après suppression article
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Jan 9, 2012
1 parent 471f060 commit da03f9a
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions htdocs/fourn/commande/fiche.php
Expand Up @@ -310,21 +310,36 @@
}
}

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);
$result = $object->deleteline($_GET['lineid']);
$object->fetch($id);

$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
}
$result = $object->deleteline(GETPOST('lineid'));
if ($result >= 0)
{
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$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)
Expand Down

0 comments on commit da03f9a

Please sign in to comment.