mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Debug ModuleBuilder
This commit is contained in:
@@ -124,15 +124,24 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object);
|
||||
}
|
||||
|
||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permission = 1;
|
||||
}
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||
//if (!$permissiontoread) accessforbidden();
|
||||
if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||
if (!$permissiontoread) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
@@ -159,7 +168,7 @@ if ($object->id) {
|
||||
*/
|
||||
$head = myobjectPrepareHead($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'document', '', -1, $object->picto);
|
||||
print dol_get_fiche_head($head, 'document', $langs->trans("MyObject"), -1, $object->picto);
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
Reference in New Issue
Block a user