Merge branch '2014.11-develop' into 2015.07
[tine20] / tine20 / Calendar / js / MainScreenCenterPanel.js
index e09dda6..f6b45a2 100644 (file)
@@ -57,7 +57,7 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
      */
     defaultPrintMode: 'sheet',
     
-    periodRe: /^(day|week|month)/i,
+    periodRe: /^(day|week|month|year)/i,
     presentationRe: /(sheet|grid)$/i,
     
     calendarPanels: {},
@@ -292,6 +292,15 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
             enableToggle: true,
             toggleGroup: 'Calendar_Toolbar_tgViews'
         });
+        this.showYearView = new Ext.Toolbar.Button({
+            pressed: String(this.activeView).match(/^year/i),
+            text: this.app.i18n._('Year'),
+            iconCls: 'cal-year-view',
+            xtype: 'tbbtnlockedtoggle',
+            handler: this.changeView.createDelegate(this, ["year"]),
+            enableToggle: true,
+            toggleGroup: 'Calendar_Toolbar_tgViews'
+        });
         
        this.action_import = new Ext.Action({
             requiredGrant: 'addGrant',
@@ -313,7 +322,11 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
             this.showWeekView,
             this.showMonthView
         ];
-        
+
+        if (this.app.featureEnabled('featureYearView')) {
+            this.changeViewActions.push(this.showYearView);
+        }
+
         this.recordActions = [
             this.action_import,
             this.action_editInNewWindow,
@@ -1666,6 +1679,12 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
                             period: tbar.getPeriod()
                         });
                         break;
+                    case 'yearSheet':
+                        view = new Tine.Calendar.YearView({
+                            store: store,
+                            period: tbar.getPeriod()
+                        });
+                        break;
                     default:
                     case 'weekSheet':
                         view = new Tine.Calendar.DaysView({