Merge branch '2013.03'
[tine20] / tine20 / Calendar / js / MainScreenCenterPanel.js
index 7f7ad05..a06a165 100644 (file)
@@ -312,12 +312,16 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
     onRender: function(ct, position) {
         Tine.Calendar.MainScreenCenterPanel.superclass.onRender.apply(this, arguments);
         
-        var defaultFavorite = Tine.widgets.persistentfilter.model.PersistentFilter.getDefaultFavorite(this.app.appName),
+        var defaultFavorite = Tine.widgets.persistentfilter.model.PersistentFilter.getDefaultFavorite(this.app.appName, this.recordClass.prototype.modelName),
             favoritesPanel  = this.app.getMainScreen().getWestPanel().getFavoritesPanel();
         
         this.loadMask = new Ext.LoadMask(this.body, {msg: this.loadMaskText});
         
-        favoritesPanel.selectFilter(defaultFavorite);
+        if (defaultFavorite) {
+            favoritesPanel.selectFilter(defaultFavorite);
+        } else {
+            this.refresh();
+        }
     },
     
     getViewParts: function (view) {
@@ -469,6 +473,11 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
                     event: event,
                     datetime: datetime
                 }
+            },
+            // to allow gridpanel hooks (like email compose)
+            {
+                ptype: 'ux.itemregistry',
+                key:   'Calendar-GridPanel-ContextMenu'
             }],
             items: this.recordActions.concat(addAction, responseAction || [], copyAction || [])
         });