mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-31 19:19:43 +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
|
- list
|
||||||
select all button --> add actions for selected: move to other cat,...
|
select all button --> add actions for selected: move to other cat,...
|
||||||
popup on picture --> show
|
popup on picture --> show
|
||||||
make button-alignment nicer
|
|
||||||
add show-calender button
|
add show-calender button
|
||||||
|
|
||||||
- edit/add
|
- 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);
|
$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;
|
$nr = $this->so->total;
|
||||||
|
|
||||||
// We don't need the readonly checkes if we only show bookable resources
|
// we are called to serve bookable resources (e.g. calendar-dialog)
|
||||||
if($query['show_bookable']) return $nr;
|
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)
|
foreach((array)$rows as $num => $resource)
|
||||||
{
|
{
|
||||||
@ -240,7 +249,7 @@ class bo_resources
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* returns info about resource for calender
|
* 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
|
* @param int/array $res_id single id or array $num => $res_id
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@ -341,10 +341,15 @@ class ui_resources
|
|||||||
openerid='resources_selectbox';
|
openerid='resources_selectbox';
|
||||||
id='exec[nm][rows][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);
|
openerSelectBox = opener.document.getElementById(openerid);
|
||||||
|
|
||||||
if (openerSelectBox) {
|
if (openerSelectBox) {
|
||||||
select = '';
|
select = '';
|
||||||
for(i=0; i < openerSelectBox.length; i++) {
|
for(i=0; i < openerSelectBox.length; i++) {
|
||||||
@ -355,7 +360,7 @@ class ui_resources
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
select += (select ? ',' : '')+value;
|
select += (select ? ',' : '')+value;
|
||||||
opener.selectbox_add_option(openerid,label,value,0);
|
opener.selectbox_add_option(openerid,label,value+':'+quantity,0);
|
||||||
}
|
}
|
||||||
selectBox = document.getElementById(id);
|
selectBox = document.getElementById(id);
|
||||||
if (selectBox) {
|
if (selectBox) {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user