mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-18 20:51:23 +01:00
Get calendar view working with orgs again
This commit is contained in:
parent
8c86b4b41f
commit
b7a8e41778
@ -579,15 +579,16 @@ class addressbook_ui extends addressbook_bo
|
|||||||
'calendar_view' => array(
|
'calendar_view' => array(
|
||||||
'caption' => 'Show',
|
'caption' => 'Show',
|
||||||
'icon' => 'view',
|
'icon' => 'view',
|
||||||
'url' => 'menuaction=calendar.calendar_uilist.listview&filter=all&owner=0,c$id&ajax=true',
|
'url' => 'menuaction=calendar.calendar_uiforms.edit&participants=c$id',
|
||||||
'targetapp' => 'calendar', // open in calendar tab
|
'onExecute' => 'javaScript:app.addressbook.view_calendar',
|
||||||
|
'targetapp' => 'calendar', // open in calendar tab,
|
||||||
|
'hideOnDisabled' => true,
|
||||||
),
|
),
|
||||||
'calendar_add' => array(
|
'calendar_add' => array(
|
||||||
'caption' => 'Add appointment',
|
'caption' => 'Add appointment',
|
||||||
'icon' => 'new',
|
'icon' => 'new',
|
||||||
'url' => 'menuaction=calendar.calendar_uiforms.edit&participants=c$id',
|
|
||||||
'popup' => egw_link::get_registry('calendar', 'add_popup'),
|
'popup' => egw_link::get_registry('calendar', 'add_popup'),
|
||||||
'onExecute' => 'javaScript:app.addressbook.add_cal', // call server for org-view only
|
'onExecute' => 'javaScript:app.addressbook.add_cal',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -1076,7 +1077,7 @@ window.egw_LAB.wait(function() {
|
|||||||
$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
|
case 'calendar_view': // show calendar for org-views, although all 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::redirect_link('/index.php',array(
|
egw::redirect_link('/index.php',array(
|
||||||
'menuaction' => 'calendar.calendar_uiviews.index',
|
'menuaction' => 'calendar.calendar_uiviews.index',
|
||||||
|
@ -157,6 +157,57 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the calender to view the selected contacts
|
||||||
|
* @param {egwAction} _action
|
||||||
|
* @param {egwActionObject[]} _senders
|
||||||
|
*/
|
||||||
|
view_calendar: function(_action, _senders)
|
||||||
|
{
|
||||||
|
var extras = {
|
||||||
|
filter: 'all',
|
||||||
|
owner: []
|
||||||
|
};
|
||||||
|
var orgs = [];
|
||||||
|
for(var i = 0; i < _senders.length; i++)
|
||||||
|
{
|
||||||
|
// Remove UID prefix for just contact_id
|
||||||
|
var ids = _senders[i].id.split('::');
|
||||||
|
ids.shift();
|
||||||
|
ids = ids.join('::');
|
||||||
|
|
||||||
|
// Orgs need to get all the contact IDs first
|
||||||
|
if (ids.substr(0,9) == 'org_name:')
|
||||||
|
{
|
||||||
|
orgs.push(ids);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
extras.owner.push('c'+ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(orgs.length > 0)
|
||||||
|
{
|
||||||
|
// Get organisation contacts, then show infolog list
|
||||||
|
this.egw.json('addressbook.addressbook_ui.ajax_organisation_contacts',
|
||||||
|
[orgs],
|
||||||
|
function(contacts) {
|
||||||
|
for(var i = 0; i < contacts.length; i++)
|
||||||
|
{
|
||||||
|
extras.owner.push('c'+contacts[i]);
|
||||||
|
}
|
||||||
|
extras.owner = extras.owner.join(',');
|
||||||
|
this.egw.open('','calendar','list',extras,'calendar');
|
||||||
|
},this,true,this
|
||||||
|
).sendRequest();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
extras.owner = extras.owner.join(',');
|
||||||
|
egw.open('', 'calendar', 'list', extras, 'calendar');
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Add appointment or show calendar 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
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user