From 1c637d8397e3e1b90b4959dc36e1867f3201fc3d Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 28 Sep 2016 11:01:10 -0600 Subject: [PATCH] Add conflict check when listing resources in a category for calendar owner / participan --- resources/inc/class.resources_bo.inc.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/inc/class.resources_bo.inc.php b/resources/inc/class.resources_bo.inc.php index ce1a7da473..b0125b9b18 100755 --- a/resources/inc/class.resources_bo.inc.php +++ b/resources/inc/class.resources_bo.inc.php @@ -546,8 +546,17 @@ class resources_bo if($cat && stripos($cat, $search) !== FALSE) { // Get resources for that category - $resources = $bo->get_resources_by_category($cat_id); - + if(!$options['exec']) + { + $resources = $bo->get_resources_by_category($cat_id); + } + else + { + $cat_options = $options; + $cat_options['cat_id'] = $cat_id; + $resources = $bo->link_query('',$cat_options); + } + // Edit dialog sends exec as an option, don't add categories if(count($resources) && !$options['exec']) { @@ -704,6 +713,10 @@ class resources_bo if($options['start'] || $options['num_rows']) { $limit = array($options['start'], $options['num_rows']); } + if($options['cat_id'] && in_array($options['cat_id'], $filter['cat_id'])) + { + $filter['cat_id'] = $options['cat_id']; + } if($options['accessory_of']) { $filter['accessory_of'] = $options['accessory_of'];