From e652d0075ca11a32e5e508c61812071f3b2298b1 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 16 Feb 2023 15:15:36 +0800 Subject: [PATCH] * Code for fix bug #32189. --- module/custom/config.php | 2 +- module/custom/view/sidebar.html.php | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/module/custom/config.php b/module/custom/config.php index 768eed8bdf..5e1fc06856 100644 --- a/module/custom/config.php +++ b/module/custom/config.php @@ -71,4 +71,4 @@ $config->custom->fieldList['doc'] = 'keywords,content'; $config->custom->fieldList['user']['create'] = 'dept,role,email,commiter'; $config->custom->fieldList['user']['edit'] = 'dept,role,email,commiter,skype,qq,mobile,phone,address,zipcode,dingding,slack,whatsapp,weixin'; -$config->custom->notSetMethods = array('required', 'browsestoryconcept', 'product'); +$config->custom->notSetMethods = array('required', 'browsestoryconcept', 'product', 'role'); diff --git a/module/custom/view/sidebar.html.php b/module/custom/view/sidebar.html.php index bc1d591184..763619ed35 100644 --- a/module/custom/view/sidebar.html.php +++ b/module/custom/view/sidebar.html.php @@ -5,9 +5,10 @@ custom->{$module}->fields as $key => $value) { - $params = $key == 'required' ? "module=$module" : ''; - $method = $key; - $active = $app->rawMethod == $key ? 'active' : ''; + $currentModule = 'custom'; + $method = $key; + $params = $key == 'required' ? "module=$module" : ''; + $active = $app->rawMethod == $key ? 'active' : ''; if(!in_array($key, $config->custom->notSetMethods)) { $params = "module=$module&field=$key"; @@ -15,14 +16,18 @@ $active = (isset($field) and $field == $key) ? 'active' : $active; } - if($module == 'approvalflow' and in_array($key, array('project', 'workflow'))) + if($module == 'approvalflow') { - $method = 'browse'; - $params = "type=$key"; - $active = (isset($type) and $type == $key) ? 'active' : $active; + $currentModule = 'approvalflow'; + if(in_array($key, array('project', 'workflow'))) + { + $method = 'browse'; + $params = "type=$key"; + $active = (isset($type) and $type == $key) ? 'active' : $active; + } } - if(common::hasPriv('custom', $method)) echo html::a(inlink($method, $params), $value, '', "class='$active'"); + if(common::hasPriv($currentModule, $method)) echo html::a(inlink($method, $params), $value, '', "class='$active'"); } ?>