Add conflict check when listing resources in a category for calendar owner / participan

This commit is contained in:
nathangray 2016-09-28 11:01:10 -06:00
parent 1c18fed409
commit 6abb75cd5c

View File

@ -546,7 +546,16 @@ class resources_bo
if($cat && stripos($cat, $search) !== FALSE) if($cat && stripos($cat, $search) !== FALSE)
{ {
// Get resources for that category // Get resources for that category
if(!$options['exec'])
{
$resources = $bo->get_resources_by_category($cat_id); $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 // Edit dialog sends exec as an option, don't add categories
if(count($resources) && !$options['exec']) if(count($resources) && !$options['exec'])
@ -707,6 +716,10 @@ class resources_bo
if($options['start'] || $options['num_rows']) { if($options['start'] || $options['num_rows']) {
$limit = array($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']) if($options['accessory_of'])
{ {
$filter['accessory_of'] = $options['accessory_of']; $filter['accessory_of'] = $options['accessory_of'];