mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Handle show calendar if user did select all - fetch all IDs first
This commit is contained in:
parent
47674a96b5
commit
8599464e3b
@ -70,20 +70,35 @@ app.classes.resources = AppJS.extend(
|
||||
view_calendar: function (_action,_senders)
|
||||
{
|
||||
|
||||
var res_ids =[], matches = [];
|
||||
var res_ids = [];
|
||||
var matches = [];
|
||||
var nm = _action.parent.data.nextmatch;
|
||||
var selection = nm.getSelection();
|
||||
|
||||
for (var i=0;i<_senders.length;i++)
|
||||
var show_calendar = function(res_ids) {
|
||||
egw_message(this.egw.lang('%1 resource(s) View calendar',res_ids.length));
|
||||
|
||||
this.egw.open_link('calendar.calendar_uiviews.index&view=planner&sortby=user&owner=0,r'+res_ids.join(',r')+'&ajax=true');
|
||||
};
|
||||
|
||||
if(selection && selection.all)
|
||||
{
|
||||
res_ids.push(_senders[i].id);
|
||||
matches = res_ids[i].match(/^(?:resources::)?([0-9]+)(:([0-9]+))?$/);
|
||||
if (matches)
|
||||
{
|
||||
res_ids[i] = matches[1];
|
||||
}
|
||||
// Get selected ids from nextmatch - it will ask server if user did 'select all'
|
||||
fetchAll(res_ids, nm, show_calendar)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i=0;i<_senders.length;i++)
|
||||
{
|
||||
res_ids.push(_senders[i].id);
|
||||
matches = res_ids[i].match(/^(?:resources::)?([0-9]+)(:([0-9]+))?$/);
|
||||
if (matches)
|
||||
{
|
||||
res_ids[i] = matches[1];
|
||||
}
|
||||
}
|
||||
show_calendar(res_ids);
|
||||
}
|
||||
egw_message(this.egw.lang('%1 resource(s) View calendar',res_ids.length));
|
||||
|
||||
this.egw.open_link('calendar.calendar_uiviews.index&view=planner&sortby=user&owner=0,r'+res_ids.join(',r')+'&ajax=true');
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user