From 80cd11972abba05a74673114d5daced9a47d3952 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 22 Aug 2014 11:48:18 +0000 Subject: [PATCH] SelectAccount with type "none" should get sel_options but it should be readonly if user has no admin access. Fix infolog delegation for admin users with selectAccount type "none" selected --- etemplate/inc/class.etemplate_widget_menupopup.inc.php | 4 +++- etemplate/js/et2_widget_selectAccount.js | 1 - infolog/inc/class.infolog_ui.inc.php | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.etemplate_widget_menupopup.inc.php b/etemplate/inc/class.etemplate_widget_menupopup.inc.php index 9587edf56d..e408e81b0f 100644 --- a/etemplate/inc/class.etemplate_widget_menupopup.inc.php +++ b/etemplate/inc/class.etemplate_widget_menupopup.inc.php @@ -199,8 +199,10 @@ class etemplate_widget_menupopup extends etemplate_widget { // Check selection preference, we may be able to skip reading some data $select_pref = $GLOBALS['egw_info']['user']['preferences']['common']['account_selection']; - if($this->attrs['type'] == 'select-account' && !$GLOBALS['egw_info']['apps']['admin'] && $select_pref == 'none') + if($this->attrs['type'] == 'select-account' && !$GLOBALS['egw_info']['user']['apps']['admin'] && $select_pref == 'none') { + self::$request->preserv[$this->id] = self::$request->content[$this->id]; + unset(self::$request->content[$this->id]); $this->attrs['readonly'] = true; } diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index b4f2de90cd..e56f9c0a16 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -111,7 +111,6 @@ var et2_selectAccount = et2_selectbox.extend( switch(type) { case 'none': - break; case 'selectbox': case 'groupmembers': default: diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 2500a4c2a5..df352efede 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -2060,8 +2060,6 @@ class infolog_ui { $readonlys['tabs']['project'] = true; // disable the project tab } - $readonlys['tabs']['delegation'] = $GLOBALS['egw_info']['user']['preferences']['common']['account_selection'] == 'none' && - !isset($GLOBALS['egw_info']['user']['apps']['admin']); $content['duration_format'] = $this->duration_format; $content['hours_per_workday'] = $this->hours_per_workday;