diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index f31f695606..15bf670c8c 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -557,8 +557,9 @@ class addressbook_ui extends addressbook_bo 'calendar_view' => array( 'caption' => 'Show', 'icon' => 'view', - 'url' => 'menuaction=calendar.calendar_uiviews.index&owner=c$id', + 'url' => 'menuaction=calendar.calendar_uilist.listview&filter=all&owner=0,c$id', 'onExecute' => 'javaScript:add_cal', // call server for org-view only + 'targetapp' => 'calendar', // open in calendar tab ), 'calendar_add' => array( 'caption' => 'Add appointment', diff --git a/addressbook/js/app.js b/addressbook/js/app.js index df379fe20d..0bd79ff9a1 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -31,7 +31,8 @@ function add_cal(_action, _senders) { ids += "c" + _senders[i].id + ((i < _senders.length - 1) ? "," : ""); } - _action.data.url = _action.data.url.replace(/=c%24id/,"="+ids); + // we cant just replace $id, as under jdots this can get called multiple times (with already replaced url)! + _action.data.url = _action.data.url.replace(/(owner|participants)=(0%2C)?[^&]+/,"$1=$2"+ids); } nm_action(_action, _senders); } diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 00145ef4af..123adce541 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -163,7 +163,12 @@ class calendar_uilist extends calendar_ui 'actions' => $this->get_actions(), ); } - if ($_GET['search']) { + if (isset($_GET['filter']) && in_array($_GET['filter'],array_keys($this->date_filters))) + { + $content['nm']['filter'] = $_GET['filter']; + } + if ($_GET['search']) + { $content['nm']['search'] = $_GET['search']; } if (isset($_REQUEST['keywords'])) // new search => set filters so every match is shown