remove acl restrictions from searchcombo and move them to concrete usage
authorMichael Spahn <m.spahn@metaways.de>
Wed, 26 Jul 2017 11:49:06 +0000 (13:49 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Wed, 26 Jul 2017 11:44:59 +0000 (13:44 +0200)
Change-Id: I79dc5576b70e34f3cfd14178c1eae37bf334066b
Reviewed-on: http://gerrit.tine20.com/customers/5322
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Calendar/js/AddToEventPanel.js
tine20/Calendar/js/SearchCombo.js

index 4a312ba..e3bb7bf 100644 (file)
@@ -46,7 +46,7 @@ Tine.Calendar.AddToEventPanel = Ext.extend(Tine.widgets.dialog.AddToRecordPanel,
         var config = {
             role: this.chooseRoleBox.getValue(),
             status: this.chooseStatusBox.getValue()
-        }
+        };
         return config;
     },
     
@@ -72,8 +72,21 @@ Tine.Calendar.AddToEventPanel = Ext.extend(Tine.widgets.dialog.AddToRecordPanel,
                     margins: '10px 10px',
                     border:  false,
                     frame:   false,
-                    items: [ 
-                        Tine.widgets.form.RecordPickerManager.get('Calendar', 'Event', {ref: '../../../searchBox'}),
+                    items: [
+                        Tine.widgets.form.RecordPickerManager.get(
+                            'Calendar',
+                            'Event',
+                            {
+                                ref: '../../../searchBox',
+                                onStoreLoad: function(store, records) {
+                                    store.each(function(record) {
+                                        // Only show records with edit grant
+                                        if(!record.data.editGrant) {
+                                            store.remove(record);
+                                        }
+                                    });
+                                }
+                            }),
                         {
                             fieldLabel: this.app.i18n._('Role'),
                             emptyText: this.app.i18n._('Select Role'),
index 217db36..47b52cf 100644 (file)
@@ -108,15 +108,11 @@ Tine.Calendar.SearchCombo = Ext.extend(Ext.ux.form.ClearableComboBox, {
     setValue: Tine.Tinebase.widgets.form.RecordPickerComboBox.prototype.setValue,
 
     /**
-     * is called, when records has been fetched
-     * records without edit grant are removed
      * @param {} store
      * @param {} records
      */
     onStoreLoad: function(store, records) {
-        store.each(function(record) {
-            if(!record.data.editGrant) store.remove(record);
-        });
+        // override, when required.
     },
 
     /**