open calendar of contacts in listview with date-filter "all" and for jdots in calendar tab (not addressbook)

This commit is contained in:
Ralf Becker 2012-01-07 23:35:17 +00:00
parent c1f61c914b
commit b7babf5079
3 changed files with 10 additions and 3 deletions

View File

@ -557,8 +557,9 @@ class addressbook_ui extends addressbook_bo
'calendar_view' => array( 'calendar_view' => array(
'caption' => 'Show', 'caption' => 'Show',
'icon' => 'view', '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 'onExecute' => 'javaScript:add_cal', // call server for org-view only
'targetapp' => 'calendar', // open in calendar tab
), ),
'calendar_add' => array( 'calendar_add' => array(
'caption' => 'Add appointment', 'caption' => 'Add appointment',

View File

@ -31,7 +31,8 @@ function add_cal(_action, _senders)
{ {
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(/=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); nm_action(_action, _senders);
} }

View File

@ -163,7 +163,12 @@ class calendar_uilist extends calendar_ui
'actions' => $this->get_actions(), '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']; $content['nm']['search'] = $_GET['search'];
} }
if (isset($_REQUEST['keywords'])) // new search => set filters so every match is shown if (isset($_REQUEST['keywords'])) // new search => set filters so every match is shown