mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 07:39:27 +01:00
* Addressbook: show calendar of contact(s) via context menu
This commit is contained in:
parent
a34e9b8431
commit
f71782a8e0
@ -551,11 +551,23 @@ class addressbook_ui extends addressbook_bo
|
|||||||
{
|
{
|
||||||
$actions['calendar'] = array(
|
$actions['calendar'] = array(
|
||||||
'icon' => 'calendar/navbar',
|
'icon' => 'calendar/navbar',
|
||||||
'caption' => 'Add appointment',
|
'caption' => 'Calendar',
|
||||||
'url' => 'menuaction=calendar.calendar_uiforms.edit&participants=c$id',
|
|
||||||
'popup' => egw_link::get_registry('calendar', 'add_popup'),
|
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'onExecute' => 'javaScript:add_cal', // call server for org-view only
|
'children' => array(
|
||||||
|
'calendar_view' => array(
|
||||||
|
'caption' => 'Show',
|
||||||
|
'icon' => 'view',
|
||||||
|
'url' => 'menuaction=calendar.calendar_uiviews.index&owner=c$id',
|
||||||
|
'onExecute' => 'javaScript:add_cal', // call server for org-view only
|
||||||
|
),
|
||||||
|
'calendar_add' => array(
|
||||||
|
'caption' => 'Add appointment',
|
||||||
|
'icon' => 'new',
|
||||||
|
'url' => 'menuaction=calendar.calendar_uiforms.edit&participants=c$id',
|
||||||
|
'popup' => egw_link::get_registry('calendar', 'add_popup'),
|
||||||
|
'onExecute' => 'javaScript:add_cal', // call server for org-view only
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
|
if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
|
||||||
@ -566,6 +578,8 @@ class addressbook_ui extends addressbook_bo
|
|||||||
'url' => 'menuaction=filemanager.filemanager_ui.index&path=/apps/addressbook/$id',
|
'url' => 'menuaction=filemanager.filemanager_ui.index&path=/apps/addressbook/$id',
|
||||||
'allowOnMultiple' => false,
|
'allowOnMultiple' => false,
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
|
// disable for for org-views, as it needs contact-ids
|
||||||
|
'enabled' => !isset($this->org_views[(string) $org_view]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -885,7 +899,7 @@ class addressbook_ui extends addressbook_bo
|
|||||||
$msg = ''; // no message, as we send none in javascript too and users sees opening popup
|
$msg = ''; // no message, as we send none in javascript too and users sees opening popup
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case 'calendar': // add appointment for org-views, other views are handled directly in javascript
|
case 'calendar_add': // add appointment for org-views, other views are handled directly in javascript
|
||||||
list($width,$height) = explode('x',egw_link::get_registry('calendar', 'add_popup'));
|
list($width,$height) = explode('x',egw_link::get_registry('calendar', 'add_popup'));
|
||||||
egw_framework::set_onload(
|
egw_framework::set_onload(
|
||||||
"egw_openWindowCentered2('".egw::link('/index.php',array(
|
"egw_openWindowCentered2('".egw::link('/index.php',array(
|
||||||
@ -894,6 +908,13 @@ class addressbook_ui extends addressbook_bo
|
|||||||
))."','_blank',$width,$height);");
|
))."','_blank',$width,$height);");
|
||||||
$msg = ''; // no message, as we send none in javascript too and users sees opening popup
|
$msg = ''; // no message, as we send none in javascript too and users sees opening popup
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
case 'calendar_view': // show calendar for org-views, other views are handled directly in javascript
|
||||||
|
list($width,$height) = explode('x',egw_link::get_registry('calendar', 'add_popup'));
|
||||||
|
egw::redirect_link('/index.php',array(
|
||||||
|
'menuaction' => 'calendar.calendar_uiviews.index',
|
||||||
|
'owner' => 'c'.implode(',c',$checked),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
foreach($checked as $id)
|
foreach($checked as $id)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add appointment for selected contacts, call default nm_action after some checks
|
* Add appointment or show calendar for selected contacts, call default nm_action after some checks
|
||||||
*
|
*
|
||||||
* @param _action
|
* @param _action
|
||||||
* @param _senders
|
* @param _senders
|
||||||
@ -25,13 +25,13 @@ function add_cal(_action, _senders)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// call nm_action's popup, but already replace id's in url, because they need to be prefix with a "c"
|
// call nm_action's popup, but already replace id's in url, because they need to be prefix with a "c"
|
||||||
_action.data.nm_action = "popup";
|
if (_action.data.popup) _action.data.nm_action = "popup";
|
||||||
var ids = "";
|
var ids = "";
|
||||||
for (var i = 0; i < _senders.length; i++)
|
for (var i = 0; i < _senders.length; i++)
|
||||||
{
|
{
|
||||||
ids += "c" + _senders[i].id + ((i < _senders.length - 1) ? "," : "");
|
ids += "c" + _senders[i].id + ((i < _senders.length - 1) ? "," : "");
|
||||||
}
|
}
|
||||||
_action.data.url = _action.data.url.replace(/participants=.*$/,"participants="+ids);
|
_action.data.url = _action.data.url.replace(/=c%24id/,"="+ids);
|
||||||
}
|
}
|
||||||
nm_action(_action, _senders);
|
nm_action(_action, _senders);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user