2
0
forked from Wavyzz/dolibarr

Work on incomplete code on BOM module

This commit is contained in:
Laurent Destailleur
2019-06-03 20:46:11 +02:00
parent 7d2cedfdcf
commit a143dba9f8
9 changed files with 315 additions and 55 deletions

View File

@@ -195,8 +195,45 @@ if ($action == 'confirm_delete' && ! empty($permissiontodelete))
}
}
// Remove a line
if ($action == 'confirm_deleteline' && $confirm == 'yes' && ! empty($permissiontoadd))
{
$result = $object->deleteline($user, $lineid);
if ($result > 0)
{
// Define output language
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09'))
{
$newlang = GETPOST('lang_id', 'aZ09');
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty))
{
$newlang = $object->thirdparty->default_lang;
}
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($object->id); // Reload to get new records
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd)
if ($action == 'confirm_clone' && $confirm == 'yes' && ! empty($permissiontoadd))
{
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{