Merge pull request #22189 from dolibit-ut/patch-559

Update bom_card.php
This commit is contained in:
Laurent Destailleur 2022-09-25 17:14:18 +02:00 committed by GitHub
commit 259ef24cef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/bom/bom_card.php * \file htdocs/bom/bom_card.php
* \ingroup bom * \ingroup bom
* \brief Page to create/edit/view BOM * \brief Page to create/edit/view Bill Of Material
*/ */
// Load Dolibarr environment // Load Dolibarr environment
@ -34,17 +34,16 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('mrp', 'other')); $langs->loadLangs(array('mrp', 'other'));
global $filtertype;
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$lineid = GETPOST('lineid', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomcard'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$lineid = GETPOST('lineid', 'int');
// PDF // PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@ -56,6 +55,7 @@ $object = new BOM($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
@ -86,6 +86,7 @@ if ($object->id > 0) {
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); $result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
// Permissions
$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php $permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php