mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Calendar - add context menu actions for email & documents to non-list views
This commit is contained in:
parent
e75692df59
commit
6baad3bee1
@ -1318,6 +1318,14 @@ class calendar_uiforms extends calendar_ui
|
||||
{
|
||||
//error_log(__METHOD__.__LINE__.' '.$uid.':'.array2string($status));
|
||||
if (empty($status)) continue;
|
||||
if(!is_array($status))
|
||||
{
|
||||
calendar_so::split_status($status,$quantity,$role);
|
||||
$status = array(
|
||||
'status' => $status,
|
||||
'uid' => $uid,
|
||||
);
|
||||
}
|
||||
$toadd = '';
|
||||
if ((isset($status['status']) && $status['status'] == 'R') || (isset($status['uid']) && $status['uid'] == $this->user)) continue;
|
||||
|
||||
|
@ -954,6 +954,29 @@ class calendar_uilist extends calendar_ui
|
||||
'popup' => Link::get_registry('infolog', 'add_popup'),
|
||||
);
|
||||
}
|
||||
if($GLOBALS['egw_info']['user']['apps']['mail'])
|
||||
{
|
||||
//Send to email
|
||||
$actions['email'] = array(
|
||||
'caption' => 'Email',
|
||||
'icon' => 'mail/navbar',
|
||||
'hideOnDisabled' => true,
|
||||
'group' => $group,
|
||||
'allowOnMultiple' => false,
|
||||
'children' => array(
|
||||
'mail' => array(
|
||||
'caption' => 'Mail all participants',
|
||||
'onExecute' => 'javaScript:app.calendar.action_mail',
|
||||
|
||||
),
|
||||
'sendrequest' => array(
|
||||
'caption' => 'Meetingrequest to all participants',
|
||||
'onExecute' => 'javaScript:app.calendar.action_mail',
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if ($GLOBALS['egw_info']['user']['apps']['timesheet'])
|
||||
{
|
||||
$actions['timesheet'] = array( // interactive add for a single event
|
||||
|
@ -931,11 +931,16 @@ class calendar_uiviews extends calendar_ui
|
||||
$actions['infolog_app']['open'] = '{"app": "infolog", "type": "add", "extra": "type=task&action=$app&action_id=$id"}';
|
||||
$actions['infolog_app']['onExecute'] = 'javaScript:app.calendar.action_open';
|
||||
}
|
||||
if ($actions['documents'])
|
||||
// Get documents working with other views
|
||||
$set_execute = function(&$action) use (&$set_execute)
|
||||
{
|
||||
// TODO: See if we can get this working sensibly
|
||||
$actions['documents']['enabled'] = false;
|
||||
$action['onExecute'] = 'javaScript:app.calendar.action_merge';
|
||||
foreach($action['children'] as &$child)
|
||||
{
|
||||
$set_execute($child);
|
||||
}
|
||||
};
|
||||
$set_execute($actions['documents']);
|
||||
$actions['ical']['onExecute'] = 'javaScript:app.calendar.ical';
|
||||
|
||||
$actions['delete']['onExecute'] = 'javaScript:app.calendar.delete';
|
||||
|
@ -1788,6 +1788,40 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Send a mail or meeting request to event participants
|
||||
*
|
||||
* @param {egwAction} _action
|
||||
* @param {egwActionObject[]} _selected
|
||||
*/
|
||||
action_mail: function(_action, _selected)
|
||||
{
|
||||
var data = egw.dataGetUIDdata(_selected[0].id) || {data:{}};
|
||||
var event = data.data;
|
||||
this.egw.json('calendar.calendar_uiforms.ajax_custom_mail',
|
||||
[event, false, _action.id==='sendrequest'],
|
||||
null,null,null,null
|
||||
).sendRequest();
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert selected event(s) into a document
|
||||
*
|
||||
* Actually, just pass it off to the nextmatch
|
||||
*
|
||||
* @param {egwAction} _action
|
||||
* @param {egwActionObject[]} _selected
|
||||
*/
|
||||
action_merge: function(_action, _selected)
|
||||
{
|
||||
var ids = {ids:[]};
|
||||
for(var i = 0; i < _selected.length; i++)
|
||||
{
|
||||
ids.ids.push(_selected[i].id);
|
||||
}
|
||||
nm_action(egw_getAppActionManager('calendar').getActionById('nm').getActionById(_action.id), _selected, null, ids);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sidebox merge
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user