Merge branch 'tine20.com/2012.10' into 2013.03
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 12 Apr 2013 09:11:01 +0000 (11:11 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 12 Apr 2013 09:11:01 +0000 (11:11 +0200)
tine20/Tinebase/js/data/Record.js
tine20/Tinebase/js/widgets/grid/FilterPanel.js
tine20/Tinebase/js/widgets/grid/FilterStructureTreePanel.js
tine20/Tinebase/js/widgets/grid/FilterToolbar.js

index d251f91..502244a 100644 (file)
@@ -89,8 +89,9 @@ Ext.extend(Tine.Tinebase.data.Record, Ext.data.Record, {
      * @return {Object} The value of the field.
      */
     get: function(name) {
+        var cfName = String(name).match(this.cfExp);
         
-        if (cfName = String(name).match(this.cfExp)) {
+        if (cfName) {
             return this.data.customfields ? this.data.customfields[cfName[1]] : null;
         }
         
@@ -104,7 +105,8 @@ Ext.extend(Tine.Tinebase.data.Record, Ext.data.Record, {
      */
     set : function(name, value) {
         var encode = Ext.isPrimitive(value) ? String : Ext.encode,
-            current = this.get(name);
+            current = this.get(name),
+            cfName;
             
         if (encode(current) == encode(value)) {
             return;
@@ -242,25 +244,25 @@ Tine.Tinebase.data.Record.create = function(o, meta) {
         return p.fields.indexOfKey(n) >= 0;
     };
     f.getRecordName = function() {
-        var app = i18n = Tine.Tinebase.appMgr.get(p.appName),
+        var app = Tine.Tinebase.appMgr.get(p.appName),
             i18n = app && app.i18n ? app.i18n :Tine.Tinebase.translation;
             
         return i18n.n_(p.recordName, p.recordsName, 1);
     };
     f.getRecordsName = function() {
-        var app = i18n = Tine.Tinebase.appMgr.get(p.appName),
+        var app = Tine.Tinebase.appMgr.get(p.appName),
             i18n = app && app.i18n ? app.i18n :Tine.Tinebase.translation;
             
         return i18n.n_(p.recordName, p.recordsName, 50);
     };
     f.getContainerName = function() {
-        var app = i18n = Tine.Tinebase.appMgr.get(p.appName),
+        var app = Tine.Tinebase.appMgr.get(p.appName),
             i18n = app && app.i18n ? app.i18n :Tine.Tinebase.translation;
             
         return i18n.n_(p.containerName, p.containersName, 1);
     };
     f.getContainersName = function() {
-        var app = i18n = Tine.Tinebase.appMgr.get(p.appName),
+        var app = Tine.Tinebase.appMgr.get(p.appName),
             i18n = app && app.i18n ? app.i18n :Tine.Tinebase.translation;
             
         return i18n.n_(p.containerName, p.containersName, 50);
index 42f73b4..aa39c6a 100644 (file)
@@ -518,7 +518,9 @@ Ext.extend(Tine.widgets.grid.FilterPanel, Ext.Panel, {
                 
                 // create new filterPanel
                 else {
-                    filterPanel = this.addFilterPanel({id: filterData.id});
+                    // NOTE: don't use filterData.id here, it's a ext-comp-* which comes from a different session
+                    // and might be a totally different element yet.
+                    filterPanel = this.addFilterPanel();
                     this.setActiveFilterPanel(filterPanel);
                 }
                 
index 462ceff..7dbc3ea 100644 (file)
@@ -126,7 +126,7 @@ Tine.widgets.grid.FilterStructureTreePanel = Ext.extend(Ext.tree.TreePanel, {
      */
     onNodeInsert: function(tree, parent, node) {
         
-        var clickEl = Ext.EventObject.getTarget('.x-tree-node-el', 10),
+        var clickEl = Ext.EventObject.target ? Ext.EventObject.getTarget('.x-tree-node-el', 10) : null,
             isUserActionInsert = clickEl && Ext.fly(clickEl, '_treeEvents').getAttribute('tree-node-id', 'ext') == 'addFilterPanel' ? true : false,
             nodeCount = this.getRootNode().childNodes.length;
         
index b8077fa..ee5c5da 100644 (file)
@@ -222,7 +222,7 @@ Ext.extend(Tine.widgets.grid.FilterToolbar, Ext.Panel, {
         }, this);
         
         // render static action buttons
-        for (action in this.actions) {
+        for (var action in this.actions) {
             this.actions[action].hidden = true;
             this.actions[action].render(this.bwrap);
         }
@@ -754,7 +754,7 @@ Ext.extend(Tine.widgets.grid.FilterToolbar, Ext.Panel, {
             var firstFilter = this.addFilter();
             
             // save buttons somewhere
-            for (action in this.actions) {
+            for (var action in this.actions) {
                 this.actions[action].hide();
                 this.bwrap.insertFirst(action == 'startSearch' ? this.searchButtonWrap : this.actions[action].getEl());
             }