sometimes we don't have a record in summaryRenderer
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Mar 2014 14:45:34 +0000 (15:45 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 4 Mar 2014 13:38:08 +0000 (14:38 +0100)
- allows summaryRenderer to function without record
- this happens when user tries to select multiple events

Change-Id: Ic9a2b758a5d2091794a982016c44b37c4fdf4829
Reviewed-on: http://gerrit.tine20.com/customers/390
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/js/EventDetailsPanel.js

index 44cdc26..d412942 100644 (file)
@@ -78,24 +78,29 @@ Tine.Calendar.EventDetailsPanel = Ext.extend(Tine.widgets.grid.DetailsPanel, {
     },
     
     summaryRenderer: function(summary) {
+        if (! this.record) {
+            // no record, no summary
+            return '';
+        }
+        
         var myAttenderRecord = this.record.getMyAttenderRecord(),
             ret = Tine.Tinebase.common.tagsRenderer(this.record.get('tags')),
             status = null,
             recur = null;
-            
+        
         ret += Ext.util.Format.htmlEncode(summary);
         
-        if(myAttenderRecord) {
+        if (myAttenderRecord) {
             status = Tine.Tinebase.widgets.keyfield.Renderer.render('Calendar', 'attendeeStatus', myAttenderRecord.get('status'));
         }
-           
-        if(this.record.isRecurBase() || this.record.isRecurInstance()) {
+        
+        if (this.record.isRecurBase() || this.record.isRecurInstance()) {
             recur = '<img class="cal-recurring" unselectable="on" src="' + Ext.BLANK_IMAGE_URL + '">' + this.app.i18n._('recurring event');
         } else if (this.record.isRecurException()) {
             recur = '<img class="cal-recurring exception" unselectable="on" src="' + Ext.BLANK_IMAGE_URL + '">' + this.app.i18n._('recurring event exception');
-        }   
-
-        if(status || recur) {
+        }
+        
+        if (status || recur) {
             ret += '&nbsp;&nbsp;&nbsp;(&nbsp;';
             if(status) ret += status;
             if(status && recur) ret += '&nbsp;&nbsp;';
@@ -104,7 +109,6 @@ Tine.Calendar.EventDetailsPanel = Ext.extend(Tine.widgets.grid.DetailsPanel, {
         }
         
         return ret;
-                   
     },
     
     /**