From 283a2a01ff7eb3a576058bcb2853427811a4531e Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 7 Jul 2011 17:19:04 +0000 Subject: [PATCH] Change how app filter works: - Only list All and current app - All shows app + globals, app shows just app categories - App filter hidden when editing super globals --- admin/inc/class.admin_categories.inc.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index 4b11178086..d3d36c6d5a 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -324,10 +324,10 @@ class admin_categories } if($query['col_filter']['app']) { - $query['appname'] = $query['col_filter']['app']; + $globalcat = false; } $cats = new categories($filter['owner'],$query['appname']); - $globalcat = isset($GLOBALS['egw_info']['user']['apps']['admin']) ? 'all_no_acl' : 1; // ignore acl only for admins + $globalcat = $globalcat && isset($GLOBALS['egw_info']['user']['apps']['admin']) ? 'all_no_acl' : $globalcat; // ignore acl only for admins $rows = $cats->return_sorted_array($query['start'],false,$query['search'],$query['sort'],$query['order'],$globalcat,$parent=0,true,$filter); $count = $cats->total_records; foreach($rows as $key => &$row) @@ -425,7 +425,7 @@ class admin_categories { $content['nm']['start']=0; } - $content['nm']['appname'] = $content['nm']['col_filter']['app'] = $appname = $_GET['appname'] ? $_GET['appname'] : $appname; + $content['nm']['appname'] = $appname = $_GET['appname'] ? $_GET['appname'] : $appname; $content['nm']['actions'] = $this->get_actions($appname); $content['nm']['global_cats'] = true; @@ -481,7 +481,11 @@ class admin_categories $content['edit_link']= $this->edit_link.'&appname='.$appname; $content['owner'] = ''; - $sel_options['appname'] = $sel_options['app'] = $this->get_app_list(); + $sel_options['appname'] = $this->get_app_list(); + $sel_options['app'] = array( + '' => lang('All'), + $appname => lang($appname) + ); $sel_options['owner'][0] = lang('All users'); $accs = $GLOBALS['egw']->accounts->get_list('groups'); @@ -499,6 +503,10 @@ class admin_categories $readonlys['nm']['rows']['owner'] = true; $readonlys['nm']['col_filter']['owner'] = true; } + if($appname == categories::GLOBAL_APPNAME) { + $sel_options['app'] = array(''=>''); + $readonlys['nm']['rows']['app'] = true; + } $tmpl = new etemplate('admin.categories.index'); $tmpl->exec($this->list_link,$content,$sel_options,$readonlys,array(