From 4bbe307b410297d3dc418b9b36042934e88796de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Apr 2020 15:34:53 +0200 Subject: [PATCH] Look and feel v12 --- htdocs/admin/mails_templates.php | 8 +++---- .../modulebuilder/template/myobject_card.php | 13 ++++++----- .../modulebuilder/template/myobject_list.php | 22 ++++++++++--------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index f2d27cf2849..cc8a92f819b 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -754,9 +754,9 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print '
'; - print ''; + print ''; print ''; $fieldsforcontent = array('topic', 'joinfiles', 'content'); @@ -902,10 +902,10 @@ if ($resql) // Modify link / Delete link print ''; - if ($canbemodified) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; if ($iserasable) { - print '   '.img_delete().''; + print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin } print ''; diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 69272de686f..e299fec88c5 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -100,11 +100,6 @@ if (empty($action) && empty($id) && empty($ref)) $action = 'view'; // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissiontoread = $user->rights->mymodule->myobject->read; $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php @@ -113,6 +108,14 @@ $permissionnote = $user->rights->mymodule->myobject->write; // Used by the inclu $permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1]; +// Security check - Protection if external user +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); +//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); + +//if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 5865af34e78..9b230eae594 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -107,16 +107,6 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. if (!$sortorder) $sortorder = "ASC"; -// Security check -if (empty($conf->mymodule->enabled)) accessforbidden('Module not enabled'); -$socid = 0; -if ($user->socid > 0) // Protection if external user -{ - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'mymodule', $id, ''); - // Initialize array of search criterias $search_all = trim(GETPOST("search_all", 'alpha')); $search = array(); @@ -161,6 +151,18 @@ $permissiontoread = $user->rights->mymodule->myobject->read; $permissiontoadd = $user->rights->mymodule->myobject->write; $permissiontodelete = $user->rights->mymodule->myobject->delete; +// Security check +if (empty($conf->mymodule->enabled)) accessforbidden('Module not enabled'); +$socid = 0; +if ($user->socid > 0) // Protection if external user +{ + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'mymodule', $id, ''); +//if (!$permissiontoread) accessforbidden(); + + /* * Actions