From c4b2fd4a64d880c4e7be5d2b8f049f29070e6e26 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 5 Apr 2012 18:33:49 +0000 Subject: [PATCH] Default owner to same as parent category when adding a child category --- admin/inc/class.admin_categories.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index 39fa28d7d7..c5941c7f28 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -101,7 +101,10 @@ class admin_categories $content = array('data' => array()); if(isset($_GET['parent']) && $_GET['parent'] > 0) { + // Sub-category - set some defaults from parent $content['parent'] = (int)$_GET['parent']; + $parent_cat = categories::read($content['parent']); + $content['owner'] = $parent_cat['owner']; } if (isset($_GET['appname']) && isset($GLOBALS['egw_info']['apps'][$_GET['appname']])) { @@ -201,7 +204,7 @@ class admin_categories $sel_options['owner'] = array(); // User's category - add current value to be able to preserve owner - if(!$content['id']) + if(!$content['id'] && !$content['owner']) { if($this->appname != 'admin') {