get calendar favorites working for list-view (eg. changing owner)

This commit is contained in:
Ralf Becker 2013-12-12 03:42:08 +00:00
parent 2bb7b7565c
commit 1dc6964754
2 changed files with 16 additions and 6 deletions

View File

@ -272,7 +272,16 @@ class calendar_ui
// only look at _REQUEST, if we are in the calendar (prefs and admin show our sidebox menu too!)
if (is_null($set_states))
{
$set_states = substr($_GET['menuaction'],0,9) == 'calendar.' ? $_REQUEST : array();
// ajax-exec call has get-parameter in some json
if (isset($_REQUEST['json_data']) && ($json_data = json_decode($_REQUEST['json_data'], true)) &&
!empty($json_data['request']['parameters'][0]))
{
parse_str(substr($json_data['request']['parameters'][0], 10), $set_states); // cut off "/index.php?"
}
else
{
$set_states = substr($_GET['menuaction'],0,9) == 'calendar.' ? $_REQUEST : array();
}
}
if (!$states['date'] && $states['year'] && $states['month'] && $states['day'])
{

View File

@ -547,9 +547,10 @@ app.classes.calendar = AppJS.extend(
if (typeof state.state != 'undefined' && state.state.view == 'undefined' || state.state.view == 'listview')
{
menuaction = 'calendar.calendar_uilist.listview';
state.state.ajax = 'true';
if (state.name)
{
state.state = {favorite: state.name.replace(/[^A-Za-z0-9-_]/g, '_')};
state.state.favorite = state.name.replace(/[^A-Za-z0-9-_]/g, '_');
}
}
var query = jQuery.extend({menuaction: menuaction},state.state||{});
@ -560,7 +561,7 @@ app.classes.calendar = AppJS.extend(
query.owner = '0,'+ query.owner;
}
this.egw.open_link(this.egw.link('/',query), 'calendar');
this.egw.open_link(this.egw.link('/index.php',query), 'calendar');
// Stop the normal bubbling if this is called on click
return false;