From 4515f24b85b32f96f4ce392bf436ce08f68c1fe3 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 6 Jul 2011 15:10:46 +0000 Subject: [PATCH] - Clear owner popup after use - Remove user if adding group to user category --- admin/inc/class.admin_categories.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index 35e45a9d2f..4b11178086 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -305,7 +305,7 @@ class admin_categories * @param array &$readonlys eg. to disable buttons based on acl, not use here, maybe in a derived class * @return int total number of rows */ - public function get_rows($query,&$rows,&$readonlys) + public function get_rows(&$query,&$rows,&$readonlys) { self::init_static(); @@ -479,6 +479,7 @@ class admin_categories $content['msg'] = $msg; $content['add_link']= $this->add_link.'&appname='.$appname; $content['edit_link']= $this->edit_link.'&appname='.$appname; + $content['owner'] = ''; $sel_options['appname'] = $sel_options['app'] = $this->get_app_list(); @@ -591,7 +592,8 @@ class admin_categories } } $owner = $query['col_filter']['owner'] ? $query['col_filter']['owner'] : $query['filter']; - $cats = new categories($owner,$query['appname']); + $app = $query['col_filter']['app'] ? $query['col_filter']['app'] : $query['appname']; + $cats = new categories($owner,$app); list($action, $settings) = explode('_', $action, 2); @@ -609,7 +611,6 @@ class admin_categories $action_msg = lang('updated'); list($add_remove, $ids) = explode('_', $settings, 2); $ids = explode(',',$ids); - // Adding 'All users' removes all the others if($add_remove == 'add' && array_search(categories::GLOBAL_ACCOUNT,$ids) !== false) $ids = array(categories::GLOBAL_ACCOUNT); @@ -617,7 +618,7 @@ class admin_categories { if (!$data = $cats->read($id)) continue; $data['owner'] = explode(',',$data['owner']); - if(array_search(categories::GLOBAL_ACCOUNT,$data['owner']) !== false) + if(array_search(categories::GLOBAL_ACCOUNT,$data['owner']) !== false || $data['owner'][0] > 0) { $data['owner'] = array(); }