adds version check config
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Sep 2016 15:19:23 +0000 (17:19 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 15 Sep 2016 07:51:13 +0000 (09:51 +0200)
Change-Id: I1e77c119383709615754a7ff1f77dbbb85b9e252
Reviewed-on: http://gerrit.tine20.com/customers/3568
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Config.php
tine20/Tinebase/js/MainScreen.js

index f136565..3271fb9 100644 (file)
@@ -362,6 +362,11 @@ class Tinebase_Config extends Tinebase_Config_Abstract
     const FAT_CLIENT_CUSTOM_JS = 'fatClientCustomJS';
 
     /**
+     * @var array of strings
+     */
+    const VERSION_CHECK = 'versionCheck';
+
+    /**
      * (non-PHPdoc)
      * @see tine20/Tinebase/Config/Definition::$_properties
      */
@@ -844,6 +849,16 @@ class Tinebase_Config extends Tinebase_Config_Abstract
             'setByAdminModule'      => TRUE,
             'setBySetupModule'      => TRUE,
         ),
+        self::VERSION_CHECK => array(
+            //_('Version check enabled')
+            'label'                 => 'Version check enabled',
+            'description'           => 'Version check enabled',
+            'type'                  => 'bool',
+            'default'               => true,
+            'clientRegistryInclude' => true,
+            'setByAdminModule'      => false,
+            'setBySetupModule'      => false,
+        ),
         self::FAT_CLIENT_CUSTOM_JS => array(
             // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
             //       tine20://<applicationid>/folders/shared/<containerid>/custom.js
index 16bab9b..d118ca8 100644 (file)
@@ -195,8 +195,13 @@ Tine.Tinebase.MainScreenPanel = Ext.extend(Ext.Panel, {
         
         this.activateDefaultApp();
         
-        // check for new version 
-        if (Tine.Tinebase.common.hasRight('check_version', 'Tinebase')) {
+        // check for new version
+        // TODO add helper function for fetching config ... this condition sucks.
+        if ((      ! Tine.Tinebase.registry.get("config")
+                || ! Tine.Tinebase.registry.get("config").versionCheck
+                ||   Tine.Tinebase.registry.get("config").versionCheck.value
+            ) && Tine.Tinebase.common.hasRight('check_version', 'Tinebase')
+        ) {
             Tine.widgets.VersionCheck();
         }