Use 0 instead of current user ID in calendar state to allow admins to create default calendar favorites useful for all users.

This commit is contained in:
Nathan Gray 2015-01-08 15:51:36 +00:00
parent eec3ebbc5d
commit e8821f2497

View File

@ -1247,6 +1247,14 @@ app.classes.calendar = AppJS.extend(
jQuery.extend(state, this._super.apply(this, arguments)); // call default implementation
}
// Don't store current user in state to allow admins to create favourites for all
// Should make no difference for normal users.
if(state.owner == egw.user('account_id'))
{
// 0 is always the current user, so if an admin creates a default favorite,
// it will work for other users too.
state.owner = 0;
}
return state;
},