adds feature switch for popup size state
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 17 Aug 2016 08:38:47 +0000 (10:38 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 31 Aug 2016 16:20:41 +0000 (18:20 +0200)
* and improves checking enabled features of Tinebase

0012024: remember popup window size in client state

https://forge.tine20.org/view.php?id=12024

Change-Id: I93e18edd0489ba7e1bca8e43cec4b436a43d423b
Reviewed-on: http://gerrit.tine20.com/customers/3442
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Config.php
tine20/Tinebase/js/Application.js
tine20/Tinebase/js/widgets/dialog/EditDialog.js
tine20/Tinebase/js/widgets/grid/FilterPanel.js

index ad36d8b..3bee876 100644 (file)
@@ -112,6 +112,13 @@ class Tinebase_Config extends Tinebase_Config_Abstract
     const FEATURE_SHOW_ACCOUNT_EMAIL = 'featureShowAccountEmail';
 
     /**
+     * FEATURE_REMEMBER_POPUP_SIZE
+     *
+     * @var string
+     */
+    const FEATURE_REMEMBER_POPUP_SIZE = 'featureRememberPopupSize';
+
+    /**
      * user defined page title postfix for browser page title
      * 
      * @var string
@@ -498,11 +505,17 @@ class Tinebase_Config extends Tinebase_Config_Abstract
                     'description'   => 'Show email address in account picker and attendee grids',
                     //_('Show email address in account picker and attendee grids')
                 ),
+                self::FEATURE_REMEMBER_POPUP_SIZE => array(
+                    'label'         => 'Remeber Popup Size', //_('Remeber Popup Size')
+                    'description'   => 'Save edit dialog size in state',
+                    //_('Save edit dialog size in state')
+                ),
             ),
             'default'               => array(
                 self::FEATURE_SHOW_ADVANCED_SEARCH  => false,
                 self::FEATURE_CONTAINER_CUSTOM_SORT => false,
                 self::FEATURE_SHOW_ACCOUNT_EMAIL => false,
+                self::FEATURE_REMEMBER_POPUP_SIZE   => true,
             ),
         ),
         self::CRONUSERID => array(
index ad37a3f..b5aa3e6 100644 (file)
@@ -212,3 +212,11 @@ Ext.extend(Tine.Tinebase.Application, Ext.util.Observable , {
     onDeActivate: Ext.emptyFn
     
 });
+
+Tine.Tinebase.featureEnabled = function(featureName) {
+    // need to create a "dummy" app to call featureEnabled()
+    var tinebaseApp = new Tine.Tinebase.Application({
+        appName: 'Tinebase'
+    });
+    return tinebaseApp.featureEnabled(featureName);
+};
\ No newline at end of file
index 7fdb0c5..dc3ffe8 100644 (file)
@@ -365,7 +365,7 @@ Tine.widgets.dialog.EditDialog = Ext.extend(Ext.FormPanel, {
             }, this);
         }
 
-        if (Ext.isFunction(this.window.relayEvents)) {
+        if (Ext.isFunction(this.window.relayEvents) && Tine.Tinebase.featureEnabled('featureRememberPopupSize')) {
             this.window.relayEvents(this, ['resize']);
         }
     },
index 8ab7462..2d196eb 100644 (file)
@@ -106,12 +106,7 @@ Ext.extend(Tine.widgets.grid.FilterPanel, Ext.Panel, {
         
         this.initQuickFilterField();
 
-        // need to create a "dummy" app to call featureEnabled()
-        // TODO: should be improved
-        var tinebaseApp = new Tine.Tinebase.Application({
-            appName: 'Tinebase'
-        });
-        this.advancedSearchEnabled = (tinebaseApp.featureEnabled('featureShowAdvancedSearch'));
+        this.advancedSearchEnabled = Tine.Tinebase.featureEnabled('featureShowAdvancedSearch');
 
         this.items = [{
             region: 'east',