Implement ical context menu action on single events in non-list views

This commit is contained in:
Nathan Gray 2016-04-27 19:28:31 +00:00
parent 7c17f2a4a4
commit 91b8995938
2 changed files with 21 additions and 0 deletions

View File

@ -2602,6 +2602,7 @@ class calendar_uiviews extends calendar_ui
// TODO: See if we can get this working sensibly // TODO: See if we can get this working sensibly
$actions['documents']['enabled'] = false; $actions['documents']['enabled'] = false;
} }
$actions['ical']['onExecute'] = 'javaScript:app.calendar.ical';
$actions['delete']['onExecute'] = 'javaScript:app.calendar.delete'; $actions['delete']['onExecute'] = 'javaScript:app.calendar.delete';

View File

@ -1308,6 +1308,26 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
} }
}, },
/**
* Context menu action (on a single event) in non-listview to generate ical
*
* Since nextmatch is all ready to handle that, we pass it through
*
* @param {egwAction} _action
* @param {egwActionObject[]} _events
*/
ical: function(_action, _events)
{
// Send it through nextmatch
_action.data.nextmatch = etemplate2.getById('calendar-list').widgetContainer.getWidgetById('nm');
var ids = {ids:[]};
for(var i = 0; i < _events.length; i++)
{
ids.ids.push(_events[i].id);
}
nm_action(_action, _events, null, ids);
},
/** /**
* Change status (via AJAX) * Change status (via AJAX)
* *