From 7aa042172e28f06836b38b432a9d80be9f1e966e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Nov 2018 13:06:40 +0100 Subject: [PATCH 1/6] Fix sql error --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 996fdb79b17..0c9498fb594 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -55,7 +55,7 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN desc_fourn text after ref_f ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; ALTER TABLE llx_stock_mouvement ADD COLUMN fk_project integer; -Alter tABLE llx_c_action_trigger MODIFY COLUMN elementtype varchar(32) +ALTER TABLE llx_c_action_trigger MODIFY COLUMN elementtype varchar(32); ALTER TABLE llx_c_field_list ADD COLUMN visible tinyint DEFAULT 1 NOT NULL AFTER search; From 0201939ebec7ea16f5812356d93942f913526a1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Nov 2018 13:43:39 +0100 Subject: [PATCH 2/6] Fix column balance --- htdocs/user/perms.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index f45b2b155fd..5bb953c3a9d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -261,15 +261,18 @@ print '
'; print ''; print ''; print ''; -if ($caneditperms && empty($objMod->rights_admin_allowed) || empty($object->admin)) +if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) { - print ''; + if ($caneditperms) + { + print ''; + } + print ''; } -print ''; print ''; print ''."\n"; @@ -324,7 +327,7 @@ if ($result) print ''; - // Picto and label of permission + // Picto and label of module print ''; // Permission and tick @@ -383,6 +386,7 @@ if ($result) print ''; } + // Label $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); print ''; From ba22ae45e7a33bd875fa4f25358eb4da4f32cc31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Nov 2018 13:45:20 +0100 Subject: [PATCH 3/6] Fix column balance --- htdocs/user/perms.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 5bb953c3a9d..cee13c53d1c 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -313,14 +313,17 @@ if ($result) print ''; print ''; - print ''; + } } - print ''; print ''; print ''."\n"; } From df2aa2e2f6d49124e86869a85ef630f9ff1e55d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Nov 2018 13:52:43 +0100 Subject: [PATCH 4/6] Fix column balance --- htdocs/user/perms.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index cee13c53d1c..17666183319 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -313,7 +313,7 @@ if ($result) print ''; print ''; - if ($caneditperms && empty($objMod->rights_admin_allowed) || empty($object->admin)) + if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) { if ($caneditperms) { @@ -324,6 +324,13 @@ if ($result) print ''; } } + else + { + if ($caneditperms) + { + print ''; + } + } print ''; print ''."\n"; } From a7989eb8931d8034b58224f7a7bc001a44ac6805 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Nov 2018 13:55:10 +0100 Subject: [PATCH 5/6] Fix menu --- htdocs/core/lib/admin.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 0c9a43d5ca9..9d3bc24bd76 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1731,7 +1731,7 @@ function email_admin_prepare_head() $h = 0; $head = array(); - if ($user->admin && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) + if (! empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetup"); @@ -1752,7 +1752,7 @@ function email_admin_prepare_head() $head[$h][2] = 'templates'; $h++; - if ($conf->global->MAIN_FEATURES_LEVEL >= 1) + if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && ! empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php"; $head[$h][1] = $langs->trans("EmailSenderProfiles"); From 1f6ccd4a660ae7c3b2aa973249bf8303125066ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Nov 2018 13:58:00 +0100 Subject: [PATCH 6/6] Fix permission to edit websites --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 71b71e241a1..d64849ddc9b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; $langs->loadLangs(array("admin","other","website")); -if (! $user->admin) accessforbidden(); +if (! $user->rights->website->read) accessforbidden(); if (! ((GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) {
'.$langs->trans("Module").''; - print ''.$langs->trans("All").""; - print '/'; - print ''.$langs->trans("None").""; - print ''; + print ''.$langs->trans("All").""; + print '/'; + print ''.$langs->trans("None").""; + print '  '.$langs->trans("Permissions").'
'.img_object('',$picto,'class="pictoobjectwidth"').' '.$objMod->getName().' '.$permlabel.'
'.img_object('',$picto,'class="pictoobjectwidth"').' '.$objMod->getName(); print ''; if ($caneditperms && empty($objMod->rights_admin_allowed) || empty($object->admin)) { - print 'module.'">'.$langs->trans("All").""; - print '/'; - print 'module.'">'.$langs->trans("None").""; + if ($caneditperms) + { + print ''; + print 'module.'">'.$langs->trans("All").""; + print '/'; + print 'module.'">'.$langs->trans("None").""; + print ' 
'.img_object('',$picto,'class="pictoobjectwidth"').' '.$objMod->getName(); print '