0009926: CalDAV URL field to be added to task collection
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 1 Aug 2014 09:55:08 +0000 (11:55 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:38 +0000 (11:26 +0200)
* adds caldav url field to Tasks containers
* generalizes caldav url container properties hook

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

Change-Id: I838e86aab9b271de5317c60b3b236b6c76fe6980
Reviewed-on: http://gerrit.tine20.com/customers/922
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/Calendar/js/CalDAVContainerPropertiesHookField.js
tine20/Tasks/Tasks.jsb2
tine20/Tasks/js/CalDAVContainerPropertiesHookField.js [new file with mode: 0644]
tine20/Tinebase/Tinebase.jsb2
tine20/Tinebase/js/widgets/container/CalDAVContainerPropertiesHookField.js [new file with mode: 0644]

index 7faa547..d56e586 100644 (file)
@@ -3,57 +3,18 @@
  * 
  * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
  * @author      Cornelius Weiss <c.weiss@metaways.de>
- * @copyright   Copyright (c) 2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @copyright   Copyright (c) 2011-2014 Metaways Infosystems GmbH (http://www.metaways.de)
  */
 Ext.ns('Tine.Calendar');
 
 /**
- * render the CalDAV Url into property panel of contianers
+ * render the CalDAV Url into property panel of containers
  * 
  * @class   Tine.Calendar.CalDAVContainerPropertiesHookField
- * @extends Ext.form.TextField
+ * @extends Tine.widgets.container.CalDAVContainerPropertiesHookField
  */
-Tine.Calendar.CalDAVContainerPropertiesHookField = Ext.extend(Ext.form.TextField, {
-
-    anchor: '100%',
-    readOnly: true,
-    
-    /**
-     * @private
-     */
-    initComponent: function() {
-        this.on('added', this.onContainerAdded, this);
-
-        Tine.Calendar.CalDAVContainerPropertiesHookField.superclass.initComponent.call(this);
-    },
-    
-    /**
-     * @private
-     */
-    onContainerAdded: function() {
-        this.app = Tine.Tinebase.appMgr.get('Calendar');
-        this.fieldLabel = this.app.i18n._('CalDAV URL');
-        
-        this.propertiesDialog = this.findParentBy(function(p) {return !! p.grantContainer});
-        this.grantContainer = this.propertiesDialog.grantContainer;
-        
-        if (this.grantContainer.application_id && this.grantContainer.application_id.name) {
-            this.isCalendar = (this.grantContainer.application_id.name == 'Calendar');
-        } else {
-            this.isCalendar = this.grantContainer.application_id === this.app.id;
-        }
-        
-        this.hidden = ! this.isCalendar;
-        // calDAV URL
-        this.value = [
-            window.location.href.replace(/\/?(index\.php.*)?$/, ''),
-            '/calendars/',
-            Tine.Tinebase.registry.get('currentAccount').contact_id,
-            '/',
-            this.grantContainer.id
-        ].join('');
-    }
-    
+Tine.Calendar.CalDAVContainerPropertiesHookField = Ext.extend(Tine.widgets.container.CalDAVContainerPropertiesHookField, {
+    appName: 'Calendar'
 });
 
 Ext.ux.ItemRegistry.registerItem('Tine.widgets.container.PropertiesDialog.FormItems.Properties', Tine.Calendar.CalDAVContainerPropertiesHookField, 100);
\ No newline at end of file
index ca11446..2333c75 100644 (file)
         {
           "text": "TaskEditDialog.js",
           "path": "js/"
+        },
+        {
+          "text": "CalDAVContainerPropertiesHookField.js",
+          "path": "js/"
         }
       ]
     },
diff --git a/tine20/Tasks/js/CalDAVContainerPropertiesHookField.js b/tine20/Tasks/js/CalDAVContainerPropertiesHookField.js
new file mode 100644 (file)
index 0000000..c4208cf
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Tine 2.0
+ * 
+ * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
+ * @author      Cornelius Weiss <c.weiss@metaways.de>
+ * @copyright   Copyright (c) 2011-2014 Metaways Infosystems GmbH (http://www.metaways.de)
+ */
+Ext.ns('Tine.Tasks');
+
+/**
+ * render the CalDAV Url into property panel of containers
+ * 
+ * @class   Tine.Calendar.CalDAVContainerPropertiesHookField
+ * @extends Tine.widgets.container.CalDAVContainerPropertiesHookField
+ */
+Tine.Tasks.CalDAVContainerPropertiesHookField = Ext.extend(Tine.widgets.container.CalDAVContainerPropertiesHookField, {
+    appName: 'Tasks'
+});
+
+Ext.ux.ItemRegistry.registerItem('Tine.widgets.container.PropertiesDialog.FormItems.Properties', Tine.Tasks.CalDAVContainerPropertiesHookField, 100);
\ No newline at end of file
index 60f6ec2..3caa7c0 100644 (file)
           "path": "js/widgets/container/"
         },
         {
+          "text": "CalDAVContainerPropertiesHookField.js",
+          "path": "js/widgets/container/"
+        },
+        {
           "text": "GrantsGrid.js",
           "path": "js/widgets/container/"
         },
diff --git a/tine20/Tinebase/js/widgets/container/CalDAVContainerPropertiesHookField.js b/tine20/Tinebase/js/widgets/container/CalDAVContainerPropertiesHookField.js
new file mode 100644 (file)
index 0000000..ca6fec7
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Tine 2.0
+ * 
+ * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
+ * @author      Cornelius Weiss <c.weiss@metaways.de>
+ * @copyright   Copyright (c) 2011-2014 Metaways Infosystems GmbH (http://www.metaways.de)
+ */
+Ext.ns('Tine.widgets', 'Tine.widgets.container');
+
+/**
+ * render the CalDAV Url into property panel of containers
+ * 
+ * @class   Tine.widgets.container.CalDAVContainerPropertiesHookField
+ * @extends Ext.form.TextField
+ */
+Tine.widgets.container.CalDAVContainerPropertiesHookField = Ext.extend(Ext.form.TextField, {
+
+    anchor: '100%',
+    readOnly: true,
+    
+    /**
+     * @private
+     */
+    initComponent: function() {
+        this.on('added', this.onContainerAdded, this);
+
+        Tine.widgets.container.CalDAVContainerPropertiesHookField.superclass.initComponent.call(this);
+    },
+    
+    /**
+     * @private
+     */
+    onContainerAdded: function() {
+        this.app = Tine.Tinebase.appMgr.get(this.appName);
+        this.fieldLabel = _('CalDAV URL');
+        
+        this.propertiesDialog = this.findParentBy(function(p) {return !! p.grantContainer});
+        this.grantContainer = this.propertiesDialog.grantContainer;
+        
+        if (this.grantContainer.application_id && this.grantContainer.application_id.name) {
+            this.hasCalDAVSupport = (this.grantContainer.application_id.name == this.appName);
+        } else {
+            this.hasCalDAVSupport = this.grantContainer.application_id === this.app.id;
+        }
+        
+        this.hidden = ! this.hasCalDAVSupport;
+        // calDAV URL
+        this.value = [
+            window.location.href.replace(/\/?(index\.php.*)?$/, ''),
+            '/calendars/',
+            Tine.Tinebase.registry.get('currentAccount').contact_id,
+            '/',
+            this.grantContainer.id
+        ].join('');
+    }
+});