option to show or hide attendee roles
authorStefanie Stamer <s.stamer@metaways.de>
Thu, 1 Jun 2017 14:51:50 +0000 (16:51 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 16 Jun 2017 07:39:13 +0000 (09:39 +0200)
Change-Id: If9ad2eccd76aecf580308c1b06e7f6c432bd322f
Reviewed-on: http://gerrit.tine20.com/customers/4807
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/js/AttendeeGridPanel.js

index 8ca16f1..2233261 100644 (file)
@@ -39,7 +39,13 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
      * true to only show types and names in the list
      */
     showNamesOnly: false,
-    
+
+    /**
+     * @cfg {Boolean} showAttendeeRole
+     * true to show roles in the list
+     */
+    showAttendeeRole: false,
+
     /**
      * The record currently being edited
      * 
@@ -78,6 +84,8 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
      * @type Tine.Phone.AddressbookGridPanelHook
      */
     phoneHook: null,
+
+    lastSelectedRole: 'OPT',
     
     stateful: true,
     stateId: 'cal-attendeegridpanel',
@@ -136,9 +144,16 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
             dataIndex: 'role',
             width: 70,
             sortable: true,
-            hidden: this.showNamesOnly || true,
+            value: this.lastSelectedRole,
+            hidden: !this.showAttendeeRole || this.showNamesOnly,
             header: this.app.i18n._('Role'),
             renderer: this.renderAttenderRole.createDelegate(this),
+            listeners: {
+                scope: this,
+                select: function (field, newValue) {
+                    this.lastSelectedRole = newValue;
+                }
+            },
             editor: {
                 xtype: 'widget-keyfieldcombo',
                 app:   'Calendar',