catches problems with missing exports & split view button
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Jun 2017 19:28:22 +0000 (21:28 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 14 Jun 2017 08:47:09 +0000 (10:47 +0200)
Change-Id: Ie2aad93f83614c2dc6a7f9c1e0eff5eb1eb2f963
Reviewed-on: http://gerrit.tine20.com/customers/4873
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/js/CalendarPanelSplitPlugin.js
tine20/Calendar/js/MainScreenCenterPanel.js

index b572030..895c041 100644 (file)
@@ -79,7 +79,7 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
     
     getDefaultData: function() {
         var defaultData = this.originalGetDefaultData(),
-            useSplit = Tine.Calendar.CalendarPanelSplitPlugin.splitBtn.pressed,
+            useSplit = Tine.Calendar.CalendarPanelSplitPlugin.splitBtn && Tine.Calendar.CalendarPanelSplitPlugin.splitBtn.pressed,
             centerPanel = this.app.getMainScreen().getCenterPanel(),
             activeCalPanel = centerPanel.getCalendarPanel(centerPanel.activeView),
             activeView = this.getActiveView(),
@@ -133,7 +133,7 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
         // create view for each attendee
         var filteredAttendee = this.attendeeFilterGrid.getValue(),
             attendeeStore = Tine.Calendar.Model.Attender.getAttendeeStore(filteredAttendee),
-            useSplit = Tine.Calendar.CalendarPanelSplitPlugin.splitBtn.pressed;
+            useSplit = Tine.Calendar.CalendarPanelSplitPlugin.splitBtn && Tine.Calendar.CalendarPanelSplitPlugin.splitBtn.pressed;
             
         // remove views not longer in filter
         this.calPanel.items.each(function(view) {
@@ -218,7 +218,7 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
     
     manageSplitViews: function(filteredAttendee) {
         // create view for each attendee
-        var useSplit = Tine.Calendar.CalendarPanelSplitPlugin.splitBtn.pressed;
+        var useSplit = Tine.Calendar.CalendarPanelSplitPlugin.splitBtn && Tine.Calendar.CalendarPanelSplitPlugin.splitBtn.pressed;
         
         if (useSplit) {
             // add subviews new to filter
index 48c70c9..d7a8caa 100644 (file)
@@ -316,8 +316,11 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
                     }
                 }).createDelegate(this)
         }, Tine.widgets.exportAction.SCOPE_MULTI);
-        this.action_export.setDisabled(false);
-        this.action_export.setText(this.action_export.initialConfig.pluralText);
+        // FIXME: how can this be null? is it ok??
+        if (this.action_export) {
+            this.action_export.setDisabled(false);
+            this.action_export.setText(this.action_export.initialConfig.pluralText);
+        }
 
         this.changeViewActions = [
             this.showDayView,
@@ -392,15 +395,16 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
     onActionToolbarResize: Tine.widgets.grid.GridPanel.prototype.onActionToolbarResize,
     
     getActionToolbarItems: function() {
+        var items = [this.action_import];
+        if (this.action_export) {
+            items = items.concat(this.action_export);
+        }
         return [{
             xtype: 'buttongroup',
             columns: 1,
             rows: 2,
             frame: false,
-            items: [
-                this.action_import,
-                this.action_export
-            ]
+            items: items
         }, {xtype: 'tbseparator'}, {
             xtype: 'buttongroup',
             frame: false,