Merge pull request #22186 from dolibit-ut/patch-556
Update bom_net_needs.php
This commit is contained in:
commit
2fddba4a3b
@ -35,20 +35,24 @@ $langs->loadLangs(array("mrp", "other", "stocks"));
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$lineid = GETPOST('lineid', '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') : 'bomnet_needs'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomnet_needs'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
$object = new BOM($db);
|
$object = new BOM($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
|
||||||
|
// Initialize technical objects for hooks
|
||||||
$hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
|
// Massaction
|
||||||
|
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
|
||||||
// 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_');
|
||||||
@ -73,13 +77,13 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
$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
|
||||||
@ -123,13 +127,11 @@ if (empty($reshook)) {
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
|
|
||||||
$title = $langs->trans('BOM');
|
$title = $langs->trans('BOM');
|
||||||
$help_url ='EN:Module_BOM';
|
$help_url ='EN:Module_BOM';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||||
$head = bomPrepareHead($object);
|
$head = bomPrepareHead($object);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user