* Resources - add (usable / quantity) for bookable resources in calendar participants results

This commit is contained in:
nathangray 2018-08-07 13:00:35 -06:00
parent 0ce183a8e0
commit 5256ec5ac3

View File

@ -698,7 +698,7 @@ class resources_bo
$criteria = array('name' => $pattern $criteria = array('name' => $pattern
, 'short_description' => $pattern); , 'short_description' => $pattern);
} }
$only_keys = 'res_id,name,short_description,bookable,useable'; $only_keys = 'res_id,name,short_description,bookable,useable,quantity';
// If no read access to any category, just stop // If no read access to any category, just stop
if(!$this->acl->get_cats(Acl::READ)) if(!$this->acl->get_cats(Acl::READ))
@ -810,11 +810,15 @@ class resources_bo
//maybe this resource is reserved //maybe this resource is reserved
if ( ($resource['useable'] < 1) ) if ( ($resource['useable'] < 1) )
{ {
if($show_conflict) { if($show_conflict)
{
$list[$id] = ' ('.lang('conflict').') '.$resource['name']. ($resource['short_description'] ? ', ['.$resource['short_description'].']':''); $list[$id] = ' ('.lang('conflict').') '.$resource['name']. ($resource['short_description'] ? ', ['.$resource['short_description'].']':'');
} }
} else { }
$list[$id] = $resource['name']. ($resource['short_description'] ? ', ['.$resource['short_description'].']':''); else
{
$list[$id] = $resource['name']. ($resource['short_description'] ? ', ['.$resource['short_description'].']':'') .
($resource['useable'] > 1 ? "( {$resource['useable']} / {$resource['quantity']} )" : '');
} }
} }
} else { } else {