mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
add functionality to enter quantity on resource booking
This commit is contained in:
parent
a4b3f4fecb
commit
dd2b005a7d
@ -6,7 +6,6 @@ TODO:
|
||||
- list
|
||||
select all button --> add actions for selected: move to other cat,...
|
||||
popup on picture --> show
|
||||
make button-alignment nicer
|
||||
add show-calender button
|
||||
|
||||
- edit/add
|
||||
|
@ -68,8 +68,17 @@ class bo_resources
|
||||
$rows = $this->so->search($criteria,$read_onlys,$order_by,'','',$empty=False,$op='OR',$start,$filter,$join='',$need_full_no_count=false);
|
||||
$nr = $this->so->total;
|
||||
|
||||
// We don't need the readonly checkes if we only show bookable resources
|
||||
if($query['show_bookable']) return $nr;
|
||||
// we are called to serve bookable resources (e.g. calendar-dialog)
|
||||
if($query['show_bookable'])
|
||||
{
|
||||
// This is somehow ugly, i know...
|
||||
foreach($rows as $num => $resource)
|
||||
{
|
||||
$rows[$num]['default_qty'] = 1;
|
||||
}
|
||||
// we don't need all the following testing
|
||||
return $nr;
|
||||
}
|
||||
|
||||
foreach((array)$rows as $num => $resource)
|
||||
{
|
||||
@ -240,7 +249,7 @@ class bo_resources
|
||||
|
||||
/**
|
||||
* returns info about resource for calender
|
||||
* @author Cornelius Weiß <egw@von-und-zu-weiss.de>
|
||||
* @author Cornelius Weiss<egw@von-und-zu-weiss.de>
|
||||
* @param int/array $res_id single id or array $num => $res_id
|
||||
* @return array
|
||||
*/
|
||||
|
@ -341,10 +341,15 @@ class ui_resources
|
||||
openerid='resources_selectbox';
|
||||
id='exec[nm][rows][selectbox]';
|
||||
|
||||
function addOption(label,value)
|
||||
function addOption(label,value,button_id,useable)
|
||||
{
|
||||
quantity = document.getElementById(button_id+'[default_qty]').value;
|
||||
if(quantity>useable) {
|
||||
alert('".lang('You chose more resources than available')."');
|
||||
return false;
|
||||
}
|
||||
label = label+'['+quantity+'/'+useable+']';
|
||||
openerSelectBox = opener.document.getElementById(openerid);
|
||||
|
||||
if (openerSelectBox) {
|
||||
select = '';
|
||||
for(i=0; i < openerSelectBox.length; i++) {
|
||||
@ -355,7 +360,7 @@ class ui_resources
|
||||
}
|
||||
}
|
||||
select += (select ? ',' : '')+value;
|
||||
opener.selectbox_add_option(openerid,label,value,0);
|
||||
opener.selectbox_add_option(openerid,label,value+':'+quantity,0);
|
||||
}
|
||||
selectBox = document.getElementById(id);
|
||||
if (selectBox) {
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user