From fe7e8ef9ac4d4e2418ed7b292e78582479adeead Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 27 Jun 2011 14:34:40 +0000 Subject: [PATCH] Don't warn about losing access for a new category --- admin/inc/class.admin_categories.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index 6bfbf1d69f..ae56418266 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -200,7 +200,17 @@ class admin_categories $sel_options['owner'] = array(); // User's category - add current value to be able to preserve owner - if(!$content['id'] && $this->appname != 'admin') $content['owner'] = $GLOBALS['egw_info']['user']['account_id']; + if(!$content['id']) + { + if($this->appname != 'admin') + { + $content['owner'] = $GLOBALS['egw_info']['user']['account_id']; + } + else + { + $content['owner'] = 0; + } + } if($content['owner'] > 0 ) { @@ -231,7 +241,7 @@ class admin_categories egw_framework::validate_file('.','global_categories','admin'); egw_framework::set_onload('$(document).ready(function() { - cat_original_owner = [' . ($content['owner'] ? $content['owner'] : '0') .']; + cat_original_owner = [' . ($content['owner'] ? $content['owner'] : $content['id'] ? '0' : '') .']; permission_prompt = \'' . lang('cat_permission_confirm').'\'; });');