forked from Wavyzz/dolibarr
Work on incomplete code on BOM module
This commit is contained in:
@@ -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'))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user