resolve groupmembers for new events with preset attendee
authorCornelius Weiß <c.weiss@metaways.de>
Tue, 27 Jun 2017 08:51:51 +0000 (10:51 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Tue, 27 Jun 2017 08:48:55 +0000 (10:48 +0200)
Change-Id: I20f2654bb2089a2cbf7f842e8e0de9ab8d92dc54
Reviewed-on: http://gerrit.tine20.com/customers/4955
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Calendar/js/AttendeeGridPanel.js

index 5d56670..4626da9 100644 (file)
@@ -368,6 +368,8 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
     },
 
     resolveListMembers: function() {
     },
 
     resolveListMembers: function() {
+        if (this.showMemberOfType) return;
+
         var _ = window.lodash,
             members = Tine.Calendar.Model.Attender.getAttendeeStore.getData(this.store),
             fbInfoUpdate = [];
         var _ = window.lodash,
             members = Tine.Calendar.Model.Attender.getAttendeeStore.getData(this.store),
             fbInfoUpdate = [];
@@ -633,25 +635,36 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
     onRecordLoad: function(record) {
         this.record = record;
         this.store.removeAll();
     onRecordLoad: function(record) {
         this.record = record;
         this.store.removeAll();
-        var attendee = record.get('attendee');
-        Ext.each(attendee, function(attender) {
+        var attendee = record.get('attendee'),
+            resolveListMembers = false;
 
 
+        Ext.each(attendee, function(attender) {
             var record = new Tine.Calendar.Model.Attender(attender, attender.id);
             this.store.addSorted(record);
             
             if (attender.displaycontainer_id  && this.record.get('container_id') && attender.displaycontainer_id.id == this.record.get('container_id').id) {
                 this.eventOriginator = record;
             }
             var record = new Tine.Calendar.Model.Attender(attender, attender.id);
             this.store.addSorted(record);
             
             if (attender.displaycontainer_id  && this.record.get('container_id') && attender.displaycontainer_id.id == this.record.get('container_id').id) {
                 this.eventOriginator = record;
             }
+
+            if (String(record.get('user_type')).match(/^group/)) {
+                resolveListMembers = true;
+            }
         }, this);
 
         this.updateFreeBusyInfo();
 
         }, this);
 
         this.updateFreeBusyInfo();
 
-        if (record.get('editGrant')) {
+        if (resolveListMembers) {
+            this.resolveListMembers();
+        }
+
+        else if (record.get('editGrant')) {
             this.addNewAttendeeRow();
         }
     },
 
     updateFreeBusyInfo: function(force) {
             this.addNewAttendeeRow();
         }
     },
 
     updateFreeBusyInfo: function(force) {
+        if (this.showMemberOfType) return;
+
         var schedulingInfo = Ext.copyTo({}, this.record.data, 'id,dtstart,dtend,originator_tz,rrule,rrule_constraints,rrule_until,is_all_day_event,uid'),
             encodedSchedulingInfo = Ext.encode(schedulingInfo);
 
         var schedulingInfo = Ext.copyTo({}, this.record.data, 'id,dtstart,dtend,originator_tz,rrule,rrule_constraints,rrule_until,is_all_day_event,uid'),
             encodedSchedulingInfo = Ext.encode(schedulingInfo);