#5524: make exceptions working in IE again
authorAlexander Stintzing <alex@stintzing.net>
Wed, 8 Feb 2012 14:25:49 +0000 (15:25 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 8 Feb 2012 14:39:55 +0000 (15:39 +0100)
Change-Id: I34c5c9649f11acb1d71fb01038dc0bab3d0ff9a8
Reviewed-on: https://gerrit.tine20.org/tine20/115
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
24 files changed:
tine20/Calendar/js/CalendarPanel.js
tine20/Calendar/js/MainScreenCenterPanel.js
tine20/Calendar/js/RrulePanel.js
tine20/Calendar/js/iMIPDetailsPanel.js
tine20/Felamimail/js/GridDetailsPanel.js
tine20/Felamimail/js/GridPanel.js
tine20/Tinebase/js/data/RecordProxy.js
tine20/Tinebase/js/ux/TabPanelKeyPlugin.js
tine20/Tinebase/js/widgets/container/GrantsGrid.js
tine20/Tinebase/js/widgets/container/TreePanel.js
tine20/Tinebase/js/widgets/dialog/DuplicateResolveGridPanel.js
tine20/Tinebase/js/widgets/dialog/EditDialog.js
tine20/Tinebase/js/widgets/dialog/ImportDialog.js
tine20/Tinebase/js/widgets/dialog/MultipleEditDialogPlugin.js
tine20/Tinebase/js/widgets/dialog/MultipleEditResultSummary.js
tine20/Tinebase/js/widgets/dialog/PreferencesDialog.js
tine20/Tinebase/js/widgets/dialog/TokenModeEditDialogPlugin.js
tine20/Tinebase/js/widgets/form/RecordPickerManager.js
tine20/Tinebase/js/widgets/grid/FilterToolbar.js
tine20/Tinebase/js/widgets/grid/ForeignRecordFilter.js
tine20/Tinebase/js/widgets/grid/GridPanel.js
tine20/Tinebase/js/widgets/grid/RendererManager.js
tine20/Tinebase/js/widgets/persistentfilter/PickerPanel.js
tine20/Tinebase/js/widgets/relation/FilterModel.js

index 14063a2..87d1881 100644 (file)
@@ -91,20 +91,16 @@ Tine.Calendar.CalendarPanel = Ext.extend(Ext.Panel, {
      * @private
      */
     onRender: function(ct, position) {
-        try {
-            Tine.Calendar.CalendarPanel.superclass.onRender.apply(this, arguments);
-            
-            var c = this.body;
-            this.el.addClass('cal-panel');
-            this.view.init(this);
-            
-            c.on("keydown", this.onKeyDown, this);
-            //this.relayEvents(c, ["keypress"]);
-            
-            this.view.render();
-        } catch (e) {
-            console.err(e.stack ? e.stack : e);
-        }
+        Tine.Calendar.CalendarPanel.superclass.onRender.apply(this, arguments);
+        
+        var c = this.body;
+        this.el.addClass('cal-panel');
+        this.view.init(this);
+        
+        c.on("keydown", this.onKeyDown, this);
+        //this.relayEvents(c, ["keypress"]);
+        
+        this.view.render();
     },
     
     /**
index db67060..afb1092 100644 (file)
@@ -59,65 +59,61 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
     applyState: Ext.emptyFn,
     
     initComponent: function () {
-        try {
-            var me = this;
-            
-            this.addEvents(
-            /**
-             * @event changeview
-             * fired if an event got clicked
-             * @param {Tine.Calendar.MainScreenCenterPanel} mspanel
-             * @param {String} view
-             */
-            'changeview');
-            
-            this.recordClass = Tine.Calendar.Model.Event;
-            
-            this.app = Tine.Tinebase.appMgr.get('Calendar');
-            
-            // init some translations
-            this.i18nRecordName = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), 1);
-            this.i18nRecordsName = this.app.i18n._hidden(this.recordClass.getMeta('recordsName'));
-            this.i18nContainerName = this.app.i18n.n_hidden(this.recordClass.getMeta('containerName'), this.recordClass.getMeta('containersName'), 1);
-            this.i18nContainersName = this.app.i18n._hidden(this.recordClass.getMeta('containersName'));
-            
-            this.i18nEditActionText = String.format(Tine.Tinebase.translation.ngettext('Edit {0}', 'Edit {0}', 1), this.i18nRecordName);
-            
-            this.loadMaskText = this.app.i18n._hidden(this.loadMaskText);
-            
-            var state = Ext.state.Manager.get(this.stateId, {});
-            Ext.apply(this, state);
-            
-            this.defaultFilters = [
-                {field: 'attender', operator: 'in', value: [Ext.apply(Tine.Calendar.Model.Attender.getDefaultData(), {
-                    user_id: Tine.Tinebase.registry.get('currentAccount')
-                })]},
-                {field: 'attender_status', operator: 'notin', value: ['DECLINED']}
-            ];
-            this.filterToolbar = this.getFilterToolbar({
-                onFilterChange: this.refresh.createDelegate(this, [false]),
-                getAllFilterData: this.getAllFilterData.createDelegate(this)
-            });
-            
-            this.filterToolbar.getQuickFilterPlugin().criteriaIgnores.push(
-                {field: 'period'},
-                {field: 'grants'}
-            );
-            
-            this.startDates = [];
-            this.initActions();
-            this.initLayout();
-            
-            // init autoRefresh
-            this.autoRefreshTask = new Ext.util.DelayedTask(this.refresh.createDelegate(this, [true]), this, [{
-                refresh: true,
-                autoRefresh: true
-            }]);
-        
-            Tine.Calendar.MainScreenCenterPanel.superclass.initComponent.call(this);
-        } catch (e) {
-            console.err(e.stack ? e.stack : e);
-        }
+        var me = this;
+        
+        this.addEvents(
+        /**
+         * @event changeview
+         * fired if an event got clicked
+         * @param {Tine.Calendar.MainScreenCenterPanel} mspanel
+         * @param {String} view
+         */
+        'changeview');
+        
+        this.recordClass = Tine.Calendar.Model.Event;
+        
+        this.app = Tine.Tinebase.appMgr.get('Calendar');
+        
+        // init some translations
+        this.i18nRecordName = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), 1);
+        this.i18nRecordsName = this.app.i18n._hidden(this.recordClass.getMeta('recordsName'));
+        this.i18nContainerName = this.app.i18n.n_hidden(this.recordClass.getMeta('containerName'), this.recordClass.getMeta('containersName'), 1);
+        this.i18nContainersName = this.app.i18n._hidden(this.recordClass.getMeta('containersName'));
+        
+        this.i18nEditActionText = String.format(Tine.Tinebase.translation.ngettext('Edit {0}', 'Edit {0}', 1), this.i18nRecordName);
+        
+        this.loadMaskText = this.app.i18n._hidden(this.loadMaskText);
+        
+        var state = Ext.state.Manager.get(this.stateId, {});
+        Ext.apply(this, state);
+        
+        this.defaultFilters = [
+            {field: 'attender', operator: 'in', value: [Ext.apply(Tine.Calendar.Model.Attender.getDefaultData(), {
+                user_id: Tine.Tinebase.registry.get('currentAccount')
+            })]},
+            {field: 'attender_status', operator: 'notin', value: ['DECLINED']}
+        ];
+        this.filterToolbar = this.getFilterToolbar({
+            onFilterChange: this.refresh.createDelegate(this, [false]),
+            getAllFilterData: this.getAllFilterData.createDelegate(this)
+        });
+        
+        this.filterToolbar.getQuickFilterPlugin().criteriaIgnores.push(
+            {field: 'period'},
+            {field: 'grants'}
+        );
+        
+        this.startDates = [];
+        this.initActions();
+        this.initLayout();
+        
+        // init autoRefresh
+        this.autoRefreshTask = new Ext.util.DelayedTask(this.refresh.createDelegate(this, [true]), this, [{
+            refresh: true,
+            autoRefresh: true
+        }]);
+    
+        Tine.Calendar.MainScreenCenterPanel.superclass.initComponent.call(this);
     },
     
     initActions: function () {
@@ -327,61 +323,57 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
     },
     
     changeView: function (view, startDate) {
-        try {
-            // autocomplete view
-            var viewParts = this.getViewParts(view);
-            view = viewParts.toString();
-            
-            Tine.log.debug('Tine.Calendar.MainScreenCenterPanel::changeView(' + view + ',' + startDate + ')');
-            
-            // save current startDate
-            this.startDates[this.activeView] = this.startDate.clone();
-            
-            if (startDate && Ext.isDate(startDate)) {
-                this.startDate = startDate.clone();
-            } else {
-                // see if a recent startDate of that view fits
-                var lastStartDate = this.startDates[view],
-                    currentPeriod = this.getCalendarPanel(this.activeView).getView().getPeriod();
-                    
-                if (Ext.isDate(lastStartDate) && lastStartDate.between(currentPeriod.from, currentPeriod.until)) {
-                    this.startDate = this.startDates[view].clone();
-                }
-            }
-            
-            var panel = this.getCalendarPanel(view);
-            var cardPanel = this.items.first();
-            
-            if (panel.rendered) {
-                cardPanel.layout.setActiveItem(panel.id);
-            } else {
-                cardPanel.add(panel);
-                cardPanel.layout.setActiveItem(panel.id);
-                cardPanel.doLayout();
-            }
-            
-            this.activeView = view;
-            
-            // move around changeViewButtons
-            var rightRow = Ext.get(Ext.DomQuery.selectNode('tr[class=x-toolbar-right-row]', panel.tbar.dom));
-            
-            for (var i = this.changeViewActions.length - 1; i >= 0; i--) {
-                rightRow.insertFirst(this.changeViewActions[i].getEl().parent().dom);
+        // autocomplete view
+        var viewParts = this.getViewParts(view);
+        view = viewParts.toString();
+        
+        Tine.log.debug('Tine.Calendar.MainScreenCenterPanel::changeView(' + view + ',' + startDate + ')');
+        
+        // save current startDate
+        this.startDates[this.activeView] = this.startDate.clone();
+        
+        if (startDate && Ext.isDate(startDate)) {
+            this.startDate = startDate.clone();
+        } else {
+            // see if a recent startDate of that view fits
+            var lastStartDate = this.startDates[view],
+                currentPeriod = this.getCalendarPanel(this.activeView).getView().getPeriod();
+                
+            if (Ext.isDate(lastStartDate) && lastStartDate.between(currentPeriod.from, currentPeriod.until)) {
+                this.startDate = this.startDates[view].clone();
             }
-            this['show' + Ext.util.Format.capitalize(viewParts.period) +  'View'].toggle(true);
-            this['show' + Ext.util.Format.capitalize(viewParts.presentation) +  'View'].toggle(true);
-            
-            // update actions
-            this.updateEventActions();
-            
-            // update data
-            panel.getView().updatePeriod({from: this.startDate});
-            panel.getStore().load({});
-            
-            this.fireEvent('changeview', this, view);
-        } catch (e) {
-            console.err(e.stack ? e.stack : e);
         }
+        
+        var panel = this.getCalendarPanel(view);
+        var cardPanel = this.items.first();
+        
+        if (panel.rendered) {
+            cardPanel.layout.setActiveItem(panel.id);
+        } else {
+            cardPanel.add(panel);
+            cardPanel.layout.setActiveItem(panel.id);
+            cardPanel.doLayout();
+        }
+        
+        this.activeView = view;
+        
+        // move around changeViewButtons
+        var rightRow = Ext.get(Ext.DomQuery.selectNode('tr[class=x-toolbar-right-row]', panel.tbar.dom));
+        
+        for (var i = this.changeViewActions.length - 1; i >= 0; i--) {
+            rightRow.insertFirst(this.changeViewActions[i].getEl().parent().dom);
+        }
+        this['show' + Ext.util.Format.capitalize(viewParts.period) +  'View'].toggle(true);
+        this['show' + Ext.util.Format.capitalize(viewParts.presentation) +  'View'].toggle(true);
+        
+        // update actions
+        this.updateEventActions();
+        
+        // update data
+        panel.getView().updatePeriod({from: this.startDate});
+        panel.getStore().load({});
+        
+        this.fireEvent('changeview', this, view);
     },
     
     /**
@@ -501,32 +493,31 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
                 ],
                 
                 handler: function(option) {
-                    try {
-                        switch (option) {
-                            case 'yes':
-                                if (actionType == 'update') this.onUpdateEvent(event, true, actionType);
-                                else this.onAddEvent(event, checkBusyConflicts, true);
-                                break;
-                            case 'no':
-                            default:
-                                try {
-                                    var panel = this.getCalendarPanel(this.activeView);
-                                    if(panel) {
-                                        var store = panel.getStore(),
-                                            view = panel.getView();
-                                    }
-                                } catch(e) {
-                                    var panel = null, 
-                                        store = null,
-                                        view = null;
+                    switch (option) {
+                        case 'yes':
+                            if (actionType == 'update') this.onUpdateEvent(event, true, actionType);
+                            else this.onAddEvent(event, checkBusyConflicts, true);
+                            break;
+                        case 'no':
+                        default:
+                            try {
+                                var panel = this.getCalendarPanel(this.activeView);
+                                if(panel) {
+                                    var store = panel.getStore(),
+                                        view = panel.getView();
                                 }
-                                
-                                if (actionType == 'add') {
-                                    if(store) store.remove(event);
-                                } else {
-                                    if (view && view.calPanel && view.rendered) {
-                                        this.loadMask.show();
-                                        store.reload();
+                            } catch(e) {
+                                var panel = null, 
+                                    store = null,
+                                    view = null;
+                            }
+                            
+                            if (actionType == 'add') {
+                                if(store) store.remove(event);
+                            } else {
+                                if (view && view.calPanel && view.rendered) {
+                                    this.loadMask.show();
+                                    store.reload();
 //                                        TODO: restore original event so no reload is needed
 //                                        var updatedEvent = event;
 //                                        updatedEvent.dirty = false;
@@ -535,14 +526,11 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
 //                                        
 //                                        store.replaceRecord(event, updatedEvent);
 //                                        view.getSelectionModel().select(event);
-                                    }
-                                    this.setLoading(false);
                                 }
-                        }
-                    } catch (e) {
-                        Tine.log.error('Tine.Calendar.MainScreenCenterPanel::checkPastEvent::handler');
-                        Tine.log.error(e);
+                                this.setLoading(false);
+                            }
                     }
+
                 }             
             });
         } else {
@@ -619,54 +607,49 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
                     
                 ],
                 handler: function(option) {
-                    try {
-                        var panel = this.getCalendarPanel(this.activeView),
-                            store = panel.getStore(),
-                            view = panel.getView();
+                    var panel = this.getCalendarPanel(this.activeView),
+                        store = panel.getStore(),
+                        view = panel.getView();
+                        
+                    switch (option) {
+                        case 'series':
+                            this.loadMask.show();
                             
-                        switch (option) {
-                            case 'series':
-                                this.loadMask.show();
-                                
-                                var options = {
-                                    scope: this,
-                                    success: function() {
+                            var options = {
+                                scope: this,
+                                success: function() {
+                                    store.load({refresh: true});
+                                },
+                                failure: this.onProxyFail.createDelegate(this, [event], true)
+                            };
+                            
+                            Tine.Calendar.backend.updateRecurSeries(event, options);
+                            break;
+                            
+                        case 'this':
+                        case 'future':
+                            var options = {
+                                scope: this,
+                                success: function(updatedEvent) {
+                                    if (option === 'this') {
+                                        event =  store.indexOf(event) != -1 ? event : store.getById(event.id);
+                                        
+                                        store.replaceRecord(event ,updatedEvent);
+                                        this.setLoading(false);
+                                        view.getSelectionModel().select(updatedEvent);
+                                    } else {
                                         store.load({refresh: true});
-                                    },
-                                    failure: this.onProxyFail.createDelegate(this, [event], true)
-                                };
-                                
-                                Tine.Calendar.backend.updateRecurSeries(event, options);
-                                break;
-                                
-                            case 'this':
-                            case 'future':
-                                var options = {
-                                    scope: this,
-                                    success: function(updatedEvent) {
-                                        if (option === 'this') {
-                                            event =  store.indexOf(event) != -1 ? event : store.getById(event.id);
-                                            
-                                            store.replaceRecord(event ,updatedEvent);
-                                            this.setLoading(false);
-                                            view.getSelectionModel().select(updatedEvent);
-                                        } else {
-                                            store.load({refresh: true});
-                                        }
-                                    },
-                                    failure: this.onProxyFail.createDelegate(this, [event], true)
-                                };
+                                    }
+                                },
+                                failure: this.onProxyFail.createDelegate(this, [event], true)
+                            };
+                            
+                            Tine.Calendar.backend.createRecurException(event, false, option == 'future', options);
                                 
-                                Tine.Calendar.backend.createRecurException(event, false, option == 'future', options);
-                                    
-                            default:
-                                this.loadMask.show();
-                                store.load({refresh: true});
-                                break;
-                        }
-                    } catch (e) {
-                        Tine.log.error('Tine.Calendar.MainScreenCenterPanel::onUpdateEvent::handle');
-                        Tine.log.error(e);
+                        default:
+                            this.loadMask.show();
+                            store.load({refresh: true});
+                            break;
                     }
                 } 
             });
@@ -676,53 +659,48 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
     },
     
     onUpdateEventAction: function(event) {
-        try {
-            var panel = this.getCalendarPanel(this.activeView),
-                store = panel.getStore(),
-                view = panel.getView();
-                
-            Tine.Calendar.backend.saveRecord(event, {
-                scope: this,
-                success: function(updatedEvent) {
-                    if (updatedEvent.isRecurBase()) {
-                        store.load({refresh: true});
-                    } else {
+        var panel = this.getCalendarPanel(this.activeView),
+            store = panel.getStore(),
+            view = panel.getView();
+            
+        Tine.Calendar.backend.saveRecord(event, {
+            scope: this,
+            success: function(updatedEvent) {
+                if (updatedEvent.isRecurBase()) {
+                    store.load({refresh: true});
+                } else {
+                    
+                    // no sm when called from another app
+                    if (view && view.calPanel && view.rendered) {
                         
-                        // no sm when called from another app
-                        if (view && view.calPanel && view.rendered) {
-                            
-                            // find out if filter still matches for this record
-                            var filterData = this.getAllFilterData();
-                            filterData[0].filters[0].filters.push({field: 'id', operator: 'in', value: [ event.get('id') ]});
-                            
-                            Tine.Calendar.searchEvents(filterData, {}, function(r) {
-                                if(event) store.replaceRecord(event, updatedEvent);
-                                else store.add(updatedEvent);
-                                
-                                view.getSelectionModel().select(updatedEvent);
-                                var selection = view.getSelectionModel().getSelected();
-                                
-                                if(r.totalcount == 0) {   
-                                    selection.ui.markOutOfFilter();
-                                } 
-    
-                                this.setLoading(false);                            
-                            }, this);
-                        } else {
+                        // find out if filter still matches for this record
+                        var filterData = this.getAllFilterData();
+                        filterData[0].filters[0].filters.push({field: 'id', operator: 'in', value: [ event.get('id') ]});
+                        
+                        Tine.Calendar.searchEvents(filterData, {}, function(r) {
                             if(event) store.replaceRecord(event, updatedEvent);
                             else store.add(updatedEvent);
-                            this.setLoading(false);
-                        }
-                   }
-                },
-                failure: this.onProxyFail.createDelegate(this, [event], true)
-            }, {
-                checkBusyConflicts: 1
-            });
-        } catch(e) {
-            Tine.log.error('Tine.Calendar.MainScreenCenterPanel::onUpdateEventAction');
-            Tine.log.error(e.stack ? e.stack : e);
-        } 
+                            
+                            view.getSelectionModel().select(updatedEvent);
+                            var selection = view.getSelectionModel().getSelected();
+                            
+                            if(r.totalcount == 0) {   
+                                selection.ui.markOutOfFilter();
+                            } 
+
+                            this.setLoading(false);                            
+                        }, this);
+                    } else {
+                        if(event) store.replaceRecord(event, updatedEvent);
+                        else store.add(updatedEvent);
+                        this.setLoading(false);
+                    }
+               }
+            },
+            failure: this.onProxyFail.createDelegate(this, [event], true)
+        }, {
+            checkBusyConflicts: 1
+        });
     },
        
     onDeleteRecords: function () {
@@ -769,45 +747,39 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
                     {text: this.app.i18n._('Delete nothing'), name: 'nothing'}
                 ],
                 handler: function (option) {
-                    try {
-                        switch (option) {
-                            case 'all':
-                            case 'this':
-                            case 'future':
-                                panel.getTopToolbar().beforeLoad();
-                                if (option !== 'this') {
-                                    this.loadMask.show();
-                                }
-                                
-                                var options = {
-                                    scope: this,
-                                    success: function () {
-                                        if (option === 'this') {
-                                            Ext.each(selection, function (event) {
-                                                panel.getStore().remove(event);
-                                            });
-                                            panel.getTopToolbar().onLoad();
-                                        } else {
-                                            this.refresh(true);
-                                        }
-                                        
+                    switch (option) {
+                        case 'all':
+                        case 'this':
+                        case 'future':
+                            panel.getTopToolbar().beforeLoad();
+                            if (option !== 'this') {
+                                this.loadMask.show();
+                            }
+                            
+                            var options = {
+                                scope: this,
+                                success: function () {
+                                    if (option === 'this') {
+                                        Ext.each(selection, function (event) {
+                                            panel.getStore().remove(event);
+                                        });
+                                        panel.getTopToolbar().onLoad();
+                                    } else {
+                                        this.refresh(true);
                                     }
-                                };
-                                
-                                if (option === 'all') {
-                                    Tine.Calendar.backend.deleteRecurSeries(selection[0], options);
-                                } else {
-                                    Tine.Calendar.backend.createRecurException(selection[0], true, option === 'future', options);
+                                    
                                 }
-                                break;
-                            default:
-                                this.onDeleteRecordsConfirmFail(panel, selection);
-                                break;
-                    }
-                    
-                    } catch (e) {
-                        Tine.log.error('Tine.Calendar.MainScreenCenterPanel::onDeleteRecords::handle');
-                        Tine.log.error(e);
+                            };
+                            
+                            if (option === 'all') {
+                                Tine.Calendar.backend.deleteRecurSeries(selection[0], options);
+                            } else {
+                                Tine.Calendar.backend.createRecurException(selection[0], true, option === 'future', options);
+                            }
+                            break;
+                        default:
+                            this.onDeleteRecordsConfirmFail(panel, selection);
+                            break;
                     }
                 }
             });
index 4bc8bfa..f13d865 100644 (file)
@@ -335,28 +335,22 @@ Tine.Calendar.RrulePanel.AbstractCard = Ext.extend(Ext.Panel, {
     },
     
     onLimitRender: function() {
-        try {
-            var untilradioel = Ext.get(this.limitId + 'untilRadio');
-            var untilel = Ext.get(this.limitId + 'until');
-            
-            var countradioel = Ext.get(this.limitId + 'countRadio');
-            var countel = Ext.get(this.limitId + 'count');
-            
-            if (! (untilradioel && countradioel)) {
-                return this.onLimitRender.defer(100, this, arguments);
-            }
-            
-            this.untilRadio.render(untilradioel);
-            this.until.render(untilel);
-            this.until.wrap.setWidth(80);
-            
-            this.countRadio.render(countradioel);
-            this.count.render(countel);
-             
-        } catch (e) {
-            Tine.log.error('Tine.Calendar.RrulePanel::onLimitRender');
-            Tine.log.error(e);
+        var untilradioel = Ext.get(this.limitId + 'untilRadio');
+        var untilel = Ext.get(this.limitId + 'until');
+        
+        var countradioel = Ext.get(this.limitId + 'countRadio');
+        var countel = Ext.get(this.limitId + 'count');
+        
+        if (! (untilradioel && countradioel)) {
+            return this.onLimitRender.defer(100, this, arguments);
         }
+        
+        this.untilRadio.render(untilradioel);
+        this.until.render(untilel);
+        this.until.wrap.setWidth(80);
+        
+        this.countRadio.render(countradioel);
+        this.count.render(countel);
     },
     
     onLimitRadioCheck: function(radio, checked) {
index 7138d10..223f6de 100644 (file)
@@ -46,25 +46,20 @@ Tine.Calendar.iMIPDetailsPanel = Ext.extend(Tine.Calendar.EventDetailsPanel, {
      * init this component
      */
     initComponent: function() {
-        try {
-            this.app = Tine.Tinebase.appMgr.get('Calendar');
-            
-            this.iMIPrecord = new Tine.Calendar.Model.iMIP(this.preparedPart.preparedData);
-            if (! Ext.isFunction(this.iMIPrecord.get('event').beginEdit)) {
-                this.iMIPrecord.set('event', Tine.Calendar.backend.recordReader({
-                    responseText: Ext.util.JSON.encode(this.preparedPart.preparedData.event)
-                }));
-            }
-            
-            this.initIMIPToolbar();
-            
-            this.on('afterrender', this.showIMIP, this);
-                
-            Tine.Calendar.iMIPDetailsPanel.superclass.initComponent.call(this);
-        } catch (e) {
-            Tine.log.error('Tine.Calendar.iMIPDetailsPanel::initComponent');
-            Tine.log.error(e.stack ? e.stack : e);
+        this.app = Tine.Tinebase.appMgr.get('Calendar');
+
+        this.iMIPrecord = new Tine.Calendar.Model.iMIP(this.preparedPart.preparedData);
+        if (! Ext.isFunction(this.iMIPrecord.get('event').beginEdit)) {
+            this.iMIPrecord.set('event', Tine.Calendar.backend.recordReader({
+                responseText: Ext.util.JSON.encode(this.preparedPart.preparedData.event)
+            }));
         }
+
+        this.initIMIPToolbar();
+
+        this.on('afterrender', this.showIMIP, this);
+
+        Tine.Calendar.iMIPDetailsPanel.superclass.initComponent.call(this);
     },
     
     /**
@@ -180,88 +175,81 @@ Tine.Calendar.iMIPDetailsPanel = Ext.extend(Tine.Calendar.EventDetailsPanel, {
      * show/layout iMIP panel
      */
     showIMIP: function() {
-        try {
-            var singleRecordPanel = this.getSingleRecordPanel(),
-                preconditions = this.iMIPrecord.get('preconditions'),
-                method = this.iMIPrecord.get('method'),
-                event = this.iMIPrecord.get('event'),
-                existingEvent = this.iMIPrecord.get('existing_event'),
-                myAttenderRecord = event.getMyAttenderRecord(),
-                myAttenderstatus = myAttenderRecord ? myAttenderRecord.get('status') : null;
-                
-            // show container from existing event if exists
-            if (existingEvent && existingEvent.container_id) {
-                event.set('container_id', existingEvent.container_id);
-            }
-                
-            // reset actions
-            Ext.each(this.actions, function(action) {action.setHidden(true)});
+        var singleRecordPanel = this.getSingleRecordPanel(),
+            preconditions = this.iMIPrecord.get('preconditions'),
+            method = this.iMIPrecord.get('method'),
+            event = this.iMIPrecord.get('event'),
+            existingEvent = this.iMIPrecord.get('existing_event'),
+            myAttenderRecord = event.getMyAttenderRecord(),
+            myAttenderstatus = myAttenderRecord ? myAttenderRecord.get('status') : null;
             
-            // check preconditions
-            if (preconditions) {
-                if (preconditions.hasOwnProperty('EVENTEXISTS')) {
-                    this.iMIPclause.setText(this.app.i18n._("The event of this message does not exist"));
-                }
-                
-                else if (preconditions.hasOwnProperty('ORIGINATOR')) {
-                    // display spam box -> might be accepted by user?
-                    this.iMIPclause.setText(this.app.i18n._("The sender is not authorised to update the event"));
-                }
-                
-                else if (preconditions.hasOwnProperty('RECENT')) {
-    //            else if (preconditions.hasOwnProperty('TOPROCESS')) {
-                    this.iMIPclause.setText(this.app.i18n._("This message is already processed"));
-                }
-                
-                else if (preconditions.hasOwnProperty('ATTENDEE')) {
-                    // party crush button?
-                    this.iMIPclause.setText(this.app.i18n._("You are not an attendee of this event"));
-                } 
-                
-                else {
-                    this.iMIPclause.setText(this.app.i18n._("Unsupported message"));
-                }
-            } 
+        // show container from existing event if exists
+        if (existingEvent && existingEvent.container_id) {
+            event.set('container_id', existingEvent.container_id);
+        }
             
-            // method specific text / actions
-            else {
-                switch (method) {
-                    case 'REQUEST':
-                        if (! myAttenderRecord) {
-                            // might happen in shared folders -> we might want to become a party crusher?
-                            this.iMIPclause.setText(this.app.i18n._("This is an event invitation for someone else."));
-                        } else if (myAttenderstatus !== 'NEEDS-ACTION') {
-                            this.iMIPclause.setText(this.app.i18n._("You have already replied to this event invitation."));
-                        } else {
-                            this.iMIPclause.setText(this.app.i18n._('You received an event invitation. Set your response to:'));
-                            Ext.each(this.statusActions, function(action) {action.setHidden(false)});
-                        }
-                        break;
-                        
-                        
-                    case 'REPLY':
-                        // Someone replied => autoprocessing atm.
-                        this.iMIPclause.setText(this.app.i18n._('An invited attendee responded to the invitation.'));
-                        break;
-                        
-                    default:            
-                        this.iMIPclause.setText(this.app.i18n._("Unsupported method"));
-                        break;
-                }
+        // reset actions
+        Ext.each(this.actions, function(action) {action.setHidden(true)});
+        
+        // check preconditions
+        if (preconditions) {
+            if (preconditions.hasOwnProperty('EVENTEXISTS')) {
+                this.iMIPclause.setText(this.app.i18n._("The event of this message does not exist"));
             }
             
-            this.getLoadMask().hide();
-            singleRecordPanel.setVisible(true);
-            singleRecordPanel.setHeight(150);
+            else if (preconditions.hasOwnProperty('ORIGINATOR')) {
+                // display spam box -> might be accepted by user?
+                this.iMIPclause.setText(this.app.i18n._("The sender is not authorised to update the event"));
+            }
             
+            else if (preconditions.hasOwnProperty('RECENT')) {
+//            else if (preconditions.hasOwnProperty('TOPROCESS')) {
+                this.iMIPclause.setText(this.app.i18n._("This message is already processed"));
+            }
             
-            this.record = event;
-            singleRecordPanel.loadRecord(event);
-        } catch (e) {
-            Tine.log.error('Tine.Calendar.iMIPDetailsPanel::showIMIP');
-            Tine.log.error(e.stack ? e.stack : e);
+            else if (preconditions.hasOwnProperty('ATTENDEE')) {
+                // party crush button?
+                this.iMIPclause.setText(this.app.i18n._("You are not an attendee of this event"));
+            } 
             
-            singleRecordPanel.setVisible(false);
+            else {
+                this.iMIPclause.setText(this.app.i18n._("Unsupported message"));
+            }
+        } 
+        
+        // method specific text / actions
+        else {
+            switch (method) {
+                case 'REQUEST':
+                    if (! myAttenderRecord) {
+                        // might happen in shared folders -> we might want to become a party crusher?
+                        this.iMIPclause.setText(this.app.i18n._("This is an event invitation for someone else."));
+                    } else if (myAttenderstatus !== 'NEEDS-ACTION') {
+                        this.iMIPclause.setText(this.app.i18n._("You have already replied to this event invitation."));
+                    } else {
+                        this.iMIPclause.setText(this.app.i18n._('You received an event invitation. Set your response to:'));
+                        Ext.each(this.statusActions, function(action) {action.setHidden(false)});
+                    }
+                    break;
+                    
+                    
+                case 'REPLY':
+                    // Someone replied => autoprocessing atm.
+                    this.iMIPclause.setText(this.app.i18n._('An invited attendee responded to the invitation.'));
+                    break;
+                    
+                default:            
+                    this.iMIPclause.setText(this.app.i18n._("Unsupported method"));
+                    break;
+            }
         }
+        
+        this.getLoadMask().hide();
+        singleRecordPanel.setVisible(true);
+        singleRecordPanel.setHeight(150);
+        
+        
+        this.record = event;
+        singleRecordPanel.loadRecord(event);
     }
 });
index 0944f02..0db03f8 100644 (file)
@@ -202,29 +202,23 @@ Ext.ns('Tine.Felamimail');
      * @param {Tine.Felamimail.Model.Message} record
      */
     handlePreparedParts: function(record) {
-        try {
-            var firstPreparedPart = this.record.get('preparedParts')[0],
-                mimeType = String(firstPreparedPart.contentType).split(/[ ;]/)[0],
-                mainType = Tine.Felamimail.MimeDisplayManager.getMainType(mimeType);
-                
-            if (! mainType) {
-                Tine.log.info('Tine.Felamimail.GridDetailsPanel::handlePreparedParts nothing found to handle ' + mimeType);
-                return;
-            }
+        var firstPreparedPart = this.record.get('preparedParts')[0],
+            mimeType = String(firstPreparedPart.contentType).split(/[ ;]/)[0],
+            mainType = Tine.Felamimail.MimeDisplayManager.getMainType(mimeType);
             
-            var bodyEl = this.getMessageRecordPanel().getEl().query('div[class=preview-panel-felamimail-body]')[0],
-                detailsPanel = Tine.Felamimail.MimeDisplayManager.create(mainType, {
-                    preparedPart: firstPreparedPart
-                });
-                
-            // quick hack till we have a card body here 
-            Ext.fly(bodyEl).update('');
-            detailsPanel.render(bodyEl);
-
-        } catch (e) {
-            Tine.log.err('Tine.Felamimail.GridDetailsPanel::handlePreparedParts');
-            Tine.log.err(e.stack ? e.stack : e);
+        if (! mainType) {
+            Tine.log.info('Tine.Felamimail.GridDetailsPanel::handlePreparedParts nothing found to handle ' + mimeType);
+            return;
         }
+        
+        var bodyEl = this.getMessageRecordPanel().getEl().query('div[class=preview-panel-felamimail-body]')[0],
+            detailsPanel = Tine.Felamimail.MimeDisplayManager.create(mainType, {
+                preparedPart: firstPreparedPart
+            });
+            
+        // quick hack till we have a card body here 
+        Ext.fly(bodyEl).update('');
+        detailsPanel.render(bodyEl);
     },
     
     /**
index 034ac6a..0b6ca40 100644 (file)
@@ -784,46 +784,42 @@ Tine.Felamimail.GridPanel = Ext.extend(Tine.widgets.grid.GridPanel, {
     onAfterCompose: function(composedMsg, action, affectedMsgs, mode) {
         Tine.log.debug('Tine.Felamimail.GridPanel::onAfterCompose / arguments:');
         Tine.log.debug(arguments);
-        try {
-            // mark send folders cache status incomplete
-            composedMsg = Ext.isString(composedMsg) ? new this.recordClass(Ext.decode(composedMsg)) : composedMsg;
-            
-            // NOTE: if affected messages is decoded, we need to fetch the originals out of our store
-            if (Ext.isString(affectedMsgs)) {
-                var msgs = [],
-                    store = this.getStore();
-                Ext.each(Ext.decode(affectedMsgs), function(msgData) {
-                    var msg = store.getById(msgData.id);
-                    if (msg) {
-                        msgs.push(msg);
-                    }
-                }, this);
-                affectedMsgs = msgs;
-            }
-            
-            var composerAccount = this.app.getAccountStore().getById(composedMsg.get('account_id')),
-                sendFolderId = composerAccount ? composerAccount.getSendFolderId() : null,
-                sendFolder = sendFolderId ? this.app.getFolderStore().getById(sendFolderId) : null;
-                
-            if (sendFolder) {
-                sendFolder.set('cache_status', 'incomplete');
-            }
+
+        // mark send folders cache status incomplete
+        composedMsg = Ext.isString(composedMsg) ? new this.recordClass(Ext.decode(composedMsg)) : composedMsg;
+        
+        // NOTE: if affected messages is decoded, we need to fetch the originals out of our store
+        if (Ext.isString(affectedMsgs)) {
+            var msgs = [],
+                store = this.getStore();
+            Ext.each(Ext.decode(affectedMsgs), function(msgData) {
+                var msg = store.getById(msgData.id);
+                if (msg) {
+                    msgs.push(msg);
+                }
+            }, this);
+            affectedMsgs = msgs;
+        }
+        
+        var composerAccount = this.app.getAccountStore().getById(composedMsg.get('account_id')),
+            sendFolderId = composerAccount ? composerAccount.getSendFolderId() : null,
+            sendFolder = sendFolderId ? this.app.getFolderStore().getById(sendFolderId) : null;
             
-            if (Ext.isArray(affectedMsgs)) {
-                Ext.each(affectedMsgs, function(msg) {
-                    if (['reply', 'forward'].indexOf(action) !== -1) {
-                        msg.addFlag(action === 'reply' ? '\\Answered' : 'Passed');
-                    } else if (action == 'senddraft') {
-                        this.deleteTransactionId = Tine.Felamimail.messageBackend.addFlags(msg.id, '\\Deleted', { 
-                            callback: this.onAfterDelete.createDelegate(this, [[msg.id]])
-                        });
-                    }
-                }, this);
-               }
-        } catch (e) {
-            Tine.log.error('Tine.Felamimail.GridPanel::onAfterCompose');
-            Tine.log.error(e.stack ? e.stack : e);
+        if (sendFolder) {
+            sendFolder.set('cache_status', 'incomplete');
         }
+        
+        if (Ext.isArray(affectedMsgs)) {
+            Ext.each(affectedMsgs, function(msg) {
+                if (['reply', 'forward'].indexOf(action) !== -1) {
+                    msg.addFlag(action === 'reply' ? '\\Answered' : 'Passed');
+                } else if (action == 'senddraft') {
+                    this.deleteTransactionId = Tine.Felamimail.messageBackend.addFlags(msg.id, '\\Deleted', { 
+                        callback: this.onAfterDelete.createDelegate(this, [[msg.id]])
+                    });
+                }
+            }, this);
+               } 
     },
     
     /**
index 6e2399c..806def6 100644 (file)
@@ -384,28 +384,23 @@ Ext.extend(Tine.Tinebase.data.RecordProxy, Ext.data.DataProxy, {
             },
             // note incoming options are implicitly jsonprc converted
             failure: function (response, jsonrpcoptions) {
-                try {
-                    var responseData = Ext.decode(response.responseText),
-                        exception = responseData.data ? responseData.data : responseData;
-                        
-                    exception.request = jsonrpcoptions.jsonData;
-                    exception.response = response.responseText;
+                var responseData = Ext.decode(response.responseText),
+                    exception = responseData.data ? responseData.data : responseData;
                     
-                    if (typeof options.failure == 'function') {
-                        var args = [];
-                        if (typeof options.beforeFailure == 'function') {
-                            args = options.beforeFailure.call(this, response);
-                        } else {
-                            args = [exception];
-                        }
-                    
-                        options.failure.apply(options.scope, args);
+                exception.request = jsonrpcoptions.jsonData;
+                exception.response = response.responseText;
+                
+                if (typeof options.failure == 'function') {
+                    var args = [];
+                    if (typeof options.beforeFailure == 'function') {
+                        args = options.beforeFailure.call(this, response);
                     } else {
-                        this.handleRequestException(exception);
+                        args = [exception];
                     }
-                } catch (e) {
-                    Tine.log.err('Tine.Tinebase.data.RecordProxy::doXHTTPRequest::failure');
-                    Tine.log.err(e.stack ? e.stack : e);
+                
+                    options.failure.apply(options.scope, args);
+                } else {
+                    this.handleRequestException(exception);
                 }
             }
         };
index 3f13c6c..96adacc 100644 (file)
@@ -36,24 +36,19 @@ Ext.ux.TabPanelKeyPlugin.prototype = {
             this.onRender.defer(250, this);
             return;
         }
+
+        var tabCount = this.panel.items.length;
         
-        try {
-            var tabCount = this.panel.items.length;
-            
-            for (var index = 0; index < tabCount; index++) {
-                var item = this.panel.items.items[index];
-                if(item.disabled !== true) {
-                    new Ext.KeyMap(this.panel.el, [{
-                        key: index + 49,
-                        ctrl: true,
-                        scope: this,
-                        fn: this.switchTab
-                    }]);
-                }
+        for (var index = 0; index < tabCount; index++) {
+            var item = this.panel.items.items[index];
+            if(item.disabled !== true) {
+                new Ext.KeyMap(this.panel.el, [{
+                    key: index + 49,
+                    ctrl: true,
+                    scope: this,
+                    fn: this.switchTab
+                }]);
             }
-        } catch (e) {
-            Tine.log.error('Ext.ux.TabPanelKeyPlugin::onRender');
-            Tine.log.error(e.stack ? e.stack : e);
         }
     },
     
index c80cd26..cdba583 100644 (file)
@@ -83,27 +83,21 @@ Tine.widgets.container.GrantsGrid = Ext.extend(Tine.widgets.account.PickerGridPa
     },
 
     onStoreUpdate: function(store, record, operation) {
-        try {
-            if (this.alwaysShowAdminGrant || (this.grantContainer && this.grantContainer.type == 'shared')) {
-                if (record.get('adminGrant')) {
-                    // set all grants and mask other checkboxes
-                    Ext.each(this.getColumnModel().columns, function(col, colIdx) {
-                        var matches;
-                        if ((matches = col.dataIndex.match(/^([a-z]+)Grant$/)) && matches[1] != 'admin') {
+        if (this.alwaysShowAdminGrant || (this.grantContainer && this.grantContainer.type == 'shared')) {
+            if (record.get('adminGrant')) {
+                // set all grants and mask other checkboxes
+                Ext.each(this.getColumnModel().columns, function(col, colIdx) {
+                    var matches;
+                    if ((matches = col.dataIndex.match(/^([a-z]+)Grant$/)) && matches[1] != 'admin') {
 //                          //Ext.fly(this.getView().getCell(store.indexOf(record), colIdx)).mask('test');
-                            record.set(col.dataIndex, true);
-                        }
-                    }, this);
-                    
-                } else {
-                    // make sure grants are not masked
-                }
+                        record.set(col.dataIndex, true);
+                    }
+                }, this);
+                
+            } else {
+                // make sure grants are not masked
             }
-        } catch (e) {
-            Tine.log.err(e);
-            Tine.log.err(e.stack);
         }
-            
     },
     
     /**
index 0d9bb96..0d77a3e 100644 (file)
@@ -363,22 +363,17 @@ Ext.extend(Tine.widgets.container.TreePanel, Ext.tree.TreePanel, {
     afterRender: function() {
         Tine.widgets.container.TreePanel.superclass.afterRender.call(this);
 
-        try {
-            
-            if((this.stateApplied !== true) && (this.getDefaultContainerPath() != '/')) {
-                var root = '/' + this.getRootNode().id;
-                var path = this.getDefaultContainerPath();
-                this.expand();
-                this.expandPath(root + path);
-                Tine.log.debug('Expanding defaultPath: '. root+path);
-                this.stateApplied = true;
-            }
-            
-            if (this.filterMode == 'filterToolbar' && this.filterPlugin) {
-                this.filterPlugin.getGridPanel().filterToolbar.on('change', this.onFilterChange, this);
-            }
-        } catch (e) {
-            Tine.log.error(e.stack ? e.stack : e);   
+        if((this.stateApplied !== true) && (this.getDefaultContainerPath() != '/')) {
+            var root = '/' + this.getRootNode().id;
+            var path = this.getDefaultContainerPath();
+            this.expand();
+            this.expandPath(root + path);
+            Tine.log.debug('Expanding defaultPath: '. root+path);
+            this.stateApplied = true;
+        }
+        
+        if (this.filterMode == 'filterToolbar' && this.filterPlugin) {
+            this.filterPlugin.getGridPanel().filterToolbar.on('change', this.onFilterChange, this);
         }
     },
     
index 1ed4dd2..3bff614 100644 (file)
@@ -214,21 +214,14 @@ Tine.widgets.dialog.DuplicateResolveGridPanel = Ext.extend(Ext.grid.EditorGridPa
         var fieldName = record.get('fieldName'),
             dataIndex = this.getColumnModel().getDataIndex(colIndex),
             renderer = Tine.widgets.grid.RendererManager.get(this.app, this.store.recordClass, fieldName, Tine.widgets.grid.RendererManager.CATEGORY_GRIDPANEL);
-        
-        try {
-            // color management
-            if (dataIndex && dataIndex.match(/clientValue|value\d+/) && !this.store.resolveStrategy.match(/(keep|discard)/)) {
-                
-                var action = record.get('finalValue') == value ? 'keep' : 'discard';
-                metaData.css = 'tine-duplicateresolve-' + action + 'value';
-//                metaData.css = 'tine-duplicateresolve-adoptedvalue';
-            }
-            
-            return renderer.apply(this, arguments);
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.DuplicateResolveGridPanel::valueRenderer');
-            Tine.log.err(e.stack ? e.stack : e);
+
+        // color management
+        if (dataIndex && dataIndex.match(/clientValue|value\d+/) && !this.store.resolveStrategy.match(/(keep|discard)/)) {
+            var action = record.get('finalValue') == value ? 'keep' : 'discard';
+            metaData.css = 'tine-duplicateresolve-' + action + 'value';
         }
+        
+        return renderer.apply(this, arguments);
     }
     
 });
@@ -384,40 +377,35 @@ Tine.widgets.dialog.DuplicateResolveStore = Ext.extend(Ext.data.GroupingStore, {
     sortData: function(f, direction) {
         direction = direction || 'ASC';
         
-        try {
-            var groupConflictScore = {};
-                
-            this.each(function(r) {
-                var group = r.get('group'),
-                    myValue = String(r.get('clientValue')).replace(/^undefined$|^null$|^\[\]$/, ''),
-                    theirValue = String(r.get('value' + this.duplicateIdx)).replace(/^undefined$|^null$|^\[\]$/, '');
-                
-                if (! groupConflictScore.hasOwnProperty(group)) {
-                    groupConflictScore[group] = 990;
-                }
-                
-                if (myValue || theirValue) {
-                    groupConflictScore[group] -= 1;
-                }
-                
-                if (myValue != theirValue) {
-                    groupConflictScore[group] -= 10;
-                }
-                
-            }, this);
+        var groupConflictScore = {};
             
-            this.data.sort('ASC', function(r1, r2) {
-                var g1 = r1.get('group'),
-                    v1 = String(groupConflictScore[g1]) + g1,
-                    g2 = r2.get('group'),
-                    v2 = String(groupConflictScore[g2]) + g2;
-                    
-                return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
-            });
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.DuplicateResolveStore::sortData');
-            Tine.log.err(e.stack ? e.stack : e);
-        }
+        this.each(function(r) {
+            var group = r.get('group'),
+                myValue = String(r.get('clientValue')).replace(/^undefined$|^null$|^\[\]$/, ''),
+                theirValue = String(r.get('value' + this.duplicateIdx)).replace(/^undefined$|^null$|^\[\]$/, '');
+            
+            if (! groupConflictScore.hasOwnProperty(group)) {
+                groupConflictScore[group] = 990;
+            }
+            
+            if (myValue || theirValue) {
+                groupConflictScore[group] -= 1;
+            }
+            
+            if (myValue != theirValue) {
+                groupConflictScore[group] -= 10;
+            }
+            
+        }, this);
+        
+        this.data.sort('ASC', function(r1, r2) {
+            var g1 = r1.get('group'),
+                v1 = String(groupConflictScore[g1]) + g1,
+                g2 = r2.get('group'),
+                v2 = String(groupConflictScore[g2]) + g2;
+                
+            return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
+        });
     },
     
     /**
index 0f31a4a..082f5df 100644 (file)
@@ -133,94 +133,89 @@ Tine.widgets.dialog.EditDialog = Ext.extend(Ext.FormPanel, {
     
     //private
     initComponent: function() {
-        try {
-            this.addEvents(
-                /**
-                 * @event cancel
-                 * Fired when user pressed cancel button
-                 */
-                'cancel',
-                /**
-                 * @event saveAndClose
-                 * Fired when user pressed OK button
-                 */
-                'saveAndClose',
-                /**
-                 * @event update
-                 * @desc  Fired when the record got updated
-                 * @param {Json String} data data of the entry
-                 * @pram  {String} this.mode
-                 */
-                'update',
-                /**
-                 * @event apply
-                 * Fired when user pressed apply button
-                 */
-                'apply',
-                /**
-                 * @event load
-                 * Fired when record is loaded
-                 */
-                'load',
-                /**
-                 * @event save
-                 * Fired when remote record is saving
-                 */
-                'save'
-            );
-            
-            if (this.recordClass) {
-                this.appName    = this.appName    ? this.appName    : this.recordClass.getMeta('appName');
-                this.modelName  = this.modelName  ? this.modelName  : this.recordClass.getMeta('modelName');
-            }
-            
-            if (! this.app) {
-                this.app = Tine.Tinebase.appMgr.get(this.appName);
-            }
-            
-            Tine.log.debug('initComponent: appName: ', this.appName);
-            Tine.log.debug('initComponent: modelName: ', this.modelName);
-            Tine.log.debug('initComponent: app: ', this.app);
-            
-            this.selectedRecords = Ext.decode(this.selectedRecords);
-            this.selectionFilter = Ext.decode(this.selectionFilter);
-            
-            // init some translations
-            if (this.app.i18n && this.recordClass !== null) {
-                this.i18nRecordName = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), 1);
-                this.i18nRecordsName = this.app.i18n._hidden(this.recordClass.getMeta('recordsName'));
-            }
+        this.addEvents(
+            /**
+             * @event cancel
+             * Fired when user pressed cancel button
+             */
+            'cancel',
+            /**
+             * @event saveAndClose
+             * Fired when user pressed OK button
+             */
+            'saveAndClose',
+            /**
+             * @event update
+             * @desc  Fired when the record got updated
+             * @param {Json String} data data of the entry
+             * @pram  {String} this.mode
+             */
+            'update',
+            /**
+             * @event apply
+             * Fired when user pressed apply button
+             */
+            'apply',
+            /**
+             * @event load
+             * Fired when record is loaded
+             */
+            'load',
+            /**
+             * @event save
+             * Fired when remote record is saving
+             */
+            'save'
+        );
         
-            if (! this.recordProxy && this.recordClass) {
-                Tine.log.debug('no record proxy given, creating a new one...');
-                this.recordProxy = new Tine.Tinebase.data.RecordProxy({
-                    recordClass: this.recordClass
-                });
-            }
-            
-            // init plugins
-            this.plugins = this.plugins ? this.plugins : [];
-            this.plugins.push(new Tine.widgets.customfields.EditDialogPlugin({}));
-            this.plugins.push(this.tokenModePlugin = new Tine.widgets.dialog.TokenModeEditDialogPlugin({}));
-            
-            if(this.useMultiple) this.plugins.push(new Tine.widgets.dialog.MultipleEditDialogPlugin({}));
-            
-            // init actions
-            this.initActions();
-            // init buttons and tbar
-            this.initButtons();
-            // init container selector
-            this.initContainerSelector();
-            // init record 
-            this.initRecord();
-            // get items for this dialog
-            this.items = this.getFormItems();
-            
-            Tine.widgets.dialog.EditDialog.superclass.initComponent.call(this);
-        } catch (e) {
-            Tine.log.error('Tine.widgets.dialog.EditDialog::initComponent');
-            Tine.log.error(e.stack ? e.stack : e);
+        if (this.recordClass) {
+            this.appName    = this.appName    ? this.appName    : this.recordClass.getMeta('appName');
+            this.modelName  = this.modelName  ? this.modelName  : this.recordClass.getMeta('modelName');
+        }
+        
+        if (! this.app) {
+            this.app = Tine.Tinebase.appMgr.get(this.appName);
+        }
+        
+        Tine.log.debug('initComponent: appName: ', this.appName);
+        Tine.log.debug('initComponent: modelName: ', this.modelName);
+        Tine.log.debug('initComponent: app: ', this.app);
+        
+        this.selectedRecords = Ext.decode(this.selectedRecords);
+        this.selectionFilter = Ext.decode(this.selectionFilter);
+        
+        // init some translations
+        if (this.app.i18n && this.recordClass !== null) {
+            this.i18nRecordName = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), 1);
+            this.i18nRecordsName = this.app.i18n._hidden(this.recordClass.getMeta('recordsName'));
+        }
+    
+        if (! this.recordProxy && this.recordClass) {
+            Tine.log.debug('no record proxy given, creating a new one...');
+            this.recordProxy = new Tine.Tinebase.data.RecordProxy({
+                recordClass: this.recordClass
+            });
         }
+        
+        // init plugins
+        this.plugins = this.plugins ? this.plugins : [];
+        this.plugins.push(new Tine.widgets.customfields.EditDialogPlugin({}));
+        this.plugins.push(this.tokenModePlugin = new Tine.widgets.dialog.TokenModeEditDialogPlugin({}));
+        
+        if(this.useMultiple) this.plugins.push(new Tine.widgets.dialog.MultipleEditDialogPlugin({}));
+        
+        // init actions
+        this.initActions();
+        // init buttons and tbar
+        this.initButtons();
+        // init container selector
+        this.initContainerSelector();
+        // init record 
+        this.initRecord();
+        // get items for this dialog
+        this.items = this.getFormItems();
+        
+        Tine.widgets.dialog.EditDialog.superclass.initComponent.call(this);
     },
     
     /**
@@ -380,31 +375,26 @@ Tine.widgets.dialog.EditDialog = Ext.extend(Ext.FormPanel, {
             return;
         }
         
-        try {
-            Tine.log.debug('loading of the following record completed:');
-            Tine.log.debug(this.record);
-            
-            if (this.copyRecord) {
-                this.doCopyRecord();
-                this.window.setTitle(String.format(_('Copy {0}'), this.i18nRecordName));
+        Tine.log.debug('loading of the following record completed:');
+        Tine.log.debug(this.record);
+        
+        if (this.copyRecord) {
+            this.doCopyRecord();
+            this.window.setTitle(String.format(_('Copy {0}'), this.i18nRecordName));
+        } else {
+            if (! this.record.id) {
+                this.window.setTitle(String.format(_('Add New {0}'), this.i18nRecordName));
             } else {
-                if (! this.record.id) {
-                    this.window.setTitle(String.format(_('Add New {0}'), this.i18nRecordName));
-                } else {
-                    this.window.setTitle(String.format(_('Edit {0} "{1}"'), this.i18nRecordName, this.record.getTitle()));
-                }
+                this.window.setTitle(String.format(_('Edit {0} "{1}"'), this.i18nRecordName, this.record.getTitle()));
             }
+        }
+        
+        if (this.fireEvent('load', this) !== false) {
+            this.getForm().loadRecord(this.record);
+            this.getForm().clearInvalid();
+            this.updateToolbars(this.record, this.recordClass.getMeta('containerProperty'));
             
-            if (this.fireEvent('load', this) !== false) {
-                this.getForm().loadRecord(this.record);
-                this.getForm().clearInvalid();
-                this.updateToolbars(this.record, this.recordClass.getMeta('containerProperty'));
-                
-                this.loadMask.hide();
-            }
-        } catch (e) {
-            Tine.log.error('Tine.widgets.dialog.EditDialog::onRecordLoad');
-            Tine.log.error(e.stack ? e.stack : e);
+            this.loadMask.hide();
         }
     },
     
@@ -422,35 +412,30 @@ Tine.widgets.dialog.EditDialog = Ext.extend(Ext.FormPanel, {
      * @private
      */
     onRender : function(ct, position){
-        try {
-            Tine.widgets.dialog.EditDialog.superclass.onRender.call(this, ct, position);
-            
-            // generalized keybord map for edit dlgs
-            var map = new Ext.KeyMap(this.el, [
-                {
-                    key: [10,13], // ctrl + return
-                    ctrl: true,
-                    scope: this,
-                    fn: function() {
-                        // focus ok btn
-                        if (this.action_saveAndClose.items) {
-                            this.action_saveAndClose.items[0].focus();
-                        }
-                        this.onSaveAndClose.defer(10, this);
+        Tine.widgets.dialog.EditDialog.superclass.onRender.call(this, ct, position);
+        
+        // generalized keybord map for edit dlgs
+        var map = new Ext.KeyMap(this.el, [
+            {
+                key: [10,13], // ctrl + return
+                ctrl: true,
+                scope: this,
+                fn: function() {
+                    // focus ok btn
+                    if (this.action_saveAndClose.items) {
+                        this.action_saveAndClose.items[0].focus();
                     }
+                    this.onSaveAndClose.defer(10, this);
                 }
-            ]);
-    
-            // should be fixed in WindowFactory
-            //this.setHeight(Ext.fly(this.el.dom.parentNode).getHeight());
-                
-            this.loadMask = new Ext.LoadMask(ct, {msg: String.format(_('Transferring {0}...'), this.i18nRecordName)});
-            if (this.mode !== 'local' && this.recordProxy !== null && this.recordProxy.isLoading(this.loadRequest)) {
-                this.loadMask.show();
             }
-        } catch (e) {
-            Tine.log.error('Tine.widgets.dialog.EditDialog::onRender');
-            Tine.log.error(e.stack ? e.stack : e);
+        ]);
+
+        // should be fixed in WindowFactory
+        //this.setHeight(Ext.fly(this.el.dom.parentNode).getHeight());
+            
+        this.loadMask = new Ext.LoadMask(ct, {msg: String.format(_('Transferring {0}...'), this.i18nRecordName)});
+        if (this.mode !== 'local' && this.recordProxy !== null && this.recordProxy.isLoading(this.loadRequest)) {
+            this.loadMask.show();
         }
     },
     
index a760519..5d547a8 100644 (file)
@@ -77,60 +77,56 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
      * init import wizard
      */
     initComponent: function() {
-        try {
-            Tine.log.debug('Tine.widgets.dialog.ImportDialog::initComponent this');
-            Tine.log.debug(this);
-            
-            this.app = Tine.Tinebase.appMgr.get(this.appName);
-            this.recordClass = Tine.Tinebase.data.RecordMgr.get(this.appName, this.modelName);
-            
-            this.allowedFileExtensions = [];
-            
-            // init definitions
-            this.definitionsStore = new Ext.data.JsonStore({
-                fields: Tine.Tinebase.Model.ImportExportDefinition,
-                root: 'results',
-                totalProperty: 'totalcount',
-                remoteSort: false
-            });
-            
-            if (Tine[this.appName].registry.get('importDefinitions')) {
-                Ext.each(Tine[this.appName].registry.get('importDefinitions').results, function(defData) {
-                    var options = defData.plugin_options,
-                        extension = options ? options.extension : null;
-                    
-                    defData.label = this.app.i18n._hidden(options && options.label ? options.label : defData.name);
-                    
-                    this.allowedFileExtensions = this.allowedFileExtensions.concat(extension);
-                    
-                    this.definitionsStore.addSorted(new Tine.Tinebase.Model.ImportExportDefinition(defData, defData.id));
-                }, this);
-            }
-            if (! this.selectedDefinition && Tine.Addressbook.registry.get('defaultImportDefinition')) {
-                this.selectedDefinition = this.definitionsStore.getById(Tine.Addressbook.registry.get('defaultImportDefinition').id);
-            }
+
+        Tine.log.debug('Tine.widgets.dialog.ImportDialog::initComponent this');
+        Tine.log.debug(this);
+
+        this.app = Tine.Tinebase.appMgr.get(this.appName);
+        this.recordClass = Tine.Tinebase.data.RecordMgr.get(this.appName, this.modelName);
+
+        this.allowedFileExtensions = [];
+
+        // init definitions
+        this.definitionsStore = new Ext.data.JsonStore({
+            fields: Tine.Tinebase.Model.ImportExportDefinition,
+            root: 'results',
+            totalProperty: 'totalcount',
+            remoteSort: false
+        });
+
+        if (Tine[this.appName].registry.get('importDefinitions')) {
+            Ext.each(Tine[this.appName].registry.get('importDefinitions').results, function(defData) {
+                var options = defData.plugin_options,
+                    extension = options ? options.extension : null;
                 
-            // init exception store
-            this.exceptionStore = new Ext.data.JsonStore({
-                mode: 'local',
-                idProperty: 'index',
-                fields: ['index', 'code', 'message', 'exception', 'resolveStrategy', 'resolvedRecord', 'isResolved']
-            });
-        
-            this.items = [
-                this.getFilePanel(),
-                this.getOptionsPanel(),
-                this.getConflictsPanel(),
-                this.getSummaryPanel()
-            ];
-            
-            Tine.widgets.dialog.ImportDialog.superclass.initComponent.call(this);
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.ImportDialog::initComponent');
-            Tine.log.err(e.stack ? e.stack : e);
+                defData.label = this.app.i18n._hidden(options && options.label ? options.label : defData.name);
+                
+                this.allowedFileExtensions = this.allowedFileExtensions.concat(extension);
+                
+                this.definitionsStore.addSorted(new Tine.Tinebase.Model.ImportExportDefinition(defData, defData.id));
+            }, this);
         }
+        if (! this.selectedDefinition && Tine.Addressbook.registry.get('defaultImportDefinition')) {
+            this.selectedDefinition = this.definitionsStore.getById(Tine.Addressbook.registry.get('defaultImportDefinition').id);
+        }
+
+        // init exception store
+        this.exceptionStore = new Ext.data.JsonStore({
+            mode: 'local',
+            idProperty: 'index',
+            fields: ['index', 'code', 'message', 'exception', 'resolveStrategy', 'resolvedRecord', 'isResolved']
+        });
+
+        this.items = [
+            this.getFilePanel(),
+            this.getOptionsPanel(),
+            this.getConflictsPanel(),
+            this.getSummaryPanel()
+        ];
+
+        Tine.widgets.dialog.ImportDialog.superclass.initComponent.call(this);
     },
-    
+
     /**
      * close window on cancel
      */
@@ -138,7 +134,7 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
         this.fireEvent('cancel', this, this.layout.activeItem);
         this.window.close();
     },
-    
+
     /**
      * do import request
      * 
@@ -146,28 +142,21 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
      * @param {Object}   importOptions
      */
     doImport: function(callback, importOptions, clientRecordData) {
-        try {
-            Ext.Ajax.request({
-                scope: this,
-                timeout: 1800000, // 30 minutes
-                callback: this.onImportResponse.createDelegate(this, [callback], true),
-                params: {
-                    method: this.appName + '.import' + this.recordClass.getMeta('recordsName'),
-                    tempFileId: this.uploadButton.getTempFileId(),
-                    definitionId: this.definitionCombo.getValue(),
-                    importOptions: Ext.apply({
-                        container_id: this.containerCombo.getValue(),
-                        autotags: this.tagsPanel.getFormField().getValue()
-                    }, importOptions || {}),
-                    clientRecordData: clientRecordData
-                }
-            });
-            
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.ImportDialog::doImport');
-            Tine.log.err(e.stack ? e.stack : e);
-        }
-        
+        Ext.Ajax.request({
+            scope: this,
+            timeout: 1800000, // 30 minutes
+            callback: this.onImportResponse.createDelegate(this, [callback], true),
+            params: {
+                method: this.appName + '.import' + this.recordClass.getMeta('recordsName'),
+                tempFileId: this.uploadButton.getTempFileId(),
+                definitionId: this.definitionCombo.getValue(),
+                importOptions: Ext.apply({
+                    container_id: this.containerCombo.getValue(),
+                    autotags: this.tagsPanel.getFormField().getValue()
+                }, importOptions || {}),
+                clientRecordData: clientRecordData
+            }
+        });
     },
     
     /**
@@ -179,35 +168,29 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
      * @param {Function} callback
      */
     onImportResponse: function(request, success, response, callback) {
-        try {
-            response = Ext.util.JSON.decode(response.responseText);
-            
-            Tine.log.debug('Tine.widgets.dialog.ImportDialog::onImportResponse server response');
-            Tine.log.debug(response);
-            
-            this.lastImportResponse = response;
-            
-            // load exception store
-            this.exceptionStore.loadData(response.exceptions);
-            this.exceptionStore.filterBy(this.exceptionStoreFilter, this);
-            
-            // update conflict panel
+        response = Ext.util.JSON.decode(response.responseText);
+        
+        Tine.log.debug('Tine.widgets.dialog.ImportDialog::onImportResponse server response');
+        Tine.log.debug(response);
+        
+        this.lastImportResponse = response;
+        
+        // load exception store
+        this.exceptionStore.loadData(response.exceptions);
+        this.exceptionStore.filterBy(this.exceptionStoreFilter, this);
+        
+        // update conflict panel
 //            var duplicatecount = response.duplicatecount || 0,
 //                recordsName = this.app.i18n.n_(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), duplicatecount);
 //                
 //            this.conflictsLabel.setText(String.format(this.conflictsLabel.rawText, duplicatecount, recordsName), false);
-            if (this.exceptionStore.getCount()) {
-                this.loadConflict(0);
-            }
-            
-            // finlay apply callback
-            if (Ext.isFunction(callback)) {
-                callback.call(this, request, success, response);
-            }
-            
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.ImportDialog::onImportResponse');
-            Tine.log.err(e.stack ? e.stack : e);
+        if (this.exceptionStore.getCount()) {
+            this.loadConflict(0);
+        }
+        
+        // finlay apply callback
+        if (Ext.isFunction(callback)) {
+            callback.call(this, request, success, response);
         }
     },
     
@@ -377,25 +360,20 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
             listeners: {
                 scope: this,
                 show: function() {
-                   try {
-                       var options = this.getImportPluginOptions();
-                    
-                        if (options.autotags) {
-                            var tags = options.autotags;
-                            
-                            Ext.each([].concat(tags), function(tag) {
-                                tag.name = this.app.i18n._hidden(tag.name);
-                                tag.description = this.app.i18n._hidden(tag.description);
-                            }, this);
-                            
-                            this.tagsPanel.getFormField().setValue(tags);
-                        }
+                   var options = this.getImportPluginOptions();
+                
+                    if (options.autotags) {
+                        var tags = options.autotags;
+                        
+                        Ext.each([].concat(tags), function(tag) {
+                            tag.name = this.app.i18n._hidden(tag.name);
+                            tag.description = this.app.i18n._hidden(tag.description);
+                        }, this);
                         
-                        this.containerCombo.setValue(options.container_id ? options.container_id : this.defaultImportContainer);
-                    } catch (e) {
-                        Tine.log.err('Tine.widgets.dialog.ImportDialog::optionsPanelShow');
-                        Tine.log.err(e.stack ? e.stack : e);
+                        this.tagsPanel.getFormField().setValue(tags);
                     }
+                    
+                    this.containerCombo.setValue(options.container_id ? options.container_id : this.defaultImportContainer);
                 }
             },
             
@@ -575,51 +553,45 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
             
             return this.loadConflict.defer(200, this, arguments);
         }
-        
-        try {
-            
-            var thisRecord = this.exceptionStore.getAt(this.conflictPagingToolbar.cursor),
-                nextRecord = this.exceptionStore.getAt(index),
-                resolveStore = this.duplicateResolveGridPanel.getStore();
-                
-            // preserv changes
-            if (this.conflictPagingToolbar.cursor != index && thisRecord && resolveStore.getCount()) {
-                thisRecord.set('resolvedRecord', resolveStore.getResolvedRecord());
-                thisRecord.set('resolveStrategy', resolveStore.resolveStrategy);
-            }
-            
-            if (nextRecord) {
-                resolveStore.loadData(nextRecord.get('exception'), nextRecord.get('resolveStrategy') || resolveStore.resolveStrategy, nextRecord.get('resolvedRecord'));
-            } else {
-                resolveStore.removeAll();
-                this.duplicateResolveGridPanel.getView().mainBody.update('<br />  ' + _('No conflict to resolve'));
-                this.navigate(+1);
-            }
-            
             
-            // update paging toolbar
-            var p = this.conflictPagingToolbar,
-                ap = index+1,
-                ps = this.exceptionStore.getCount();
-                
-            p.cursor = index;
-            p.afterTextItem.setText(String.format(p.afterPageText, ps));
-            p.inputItem.setValue(ap);
-            p.first.setDisabled(ap == 1);
-            p.prev.setDisabled(ap == 1);
-            p.next.setDisabled(ap == ps);
-            p.last.setDisabled(ap == ps);
-            this.conflictIndexText.setText(nextRecord ? 
-                String.format(_('(This is record {0} in you import file)'), nextRecord.get('index') + 1) :
-                _('No conflict to resolve')
-            );
+        var thisRecord = this.exceptionStore.getAt(this.conflictPagingToolbar.cursor),
+            nextRecord = this.exceptionStore.getAt(index),
+            resolveStore = this.duplicateResolveGridPanel.getStore();
             
-            this.conflictMask.hide();
-            this.conflictMask.hidden = true;
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.ImportDialog::loadConflict');
-            Tine.log.err(e.stack ? e.stack : e);
+        // preserv changes
+        if (this.conflictPagingToolbar.cursor != index && thisRecord && resolveStore.getCount()) {
+            thisRecord.set('resolvedRecord', resolveStore.getResolvedRecord());
+            thisRecord.set('resolveStrategy', resolveStore.resolveStrategy);
         }
+        
+        if (nextRecord) {
+            resolveStore.loadData(nextRecord.get('exception'), nextRecord.get('resolveStrategy') || resolveStore.resolveStrategy, nextRecord.get('resolvedRecord'));
+        } else {
+            resolveStore.removeAll();
+            this.duplicateResolveGridPanel.getView().mainBody.update('<br />  ' + _('No conflict to resolve'));
+            this.navigate(+1);
+        }
+        
+        
+        // update paging toolbar
+        var p = this.conflictPagingToolbar,
+            ap = index+1,
+            ps = this.exceptionStore.getCount();
+            
+        p.cursor = index;
+        p.afterTextItem.setText(String.format(p.afterPageText, ps));
+        p.inputItem.setValue(ap);
+        p.first.setDisabled(ap == 1);
+        p.prev.setDisabled(ap == 1);
+        p.next.setDisabled(ap == ps);
+        p.last.setDisabled(ap == ps);
+        this.conflictIndexText.setText(nextRecord ? 
+            String.format(_('(This is record {0} in you import file)'), nextRecord.get('index') + 1) :
+            _('No conflict to resolve')
+        );
+        
+        this.conflictMask.hide();
+        this.conflictMask.hidden = true;
     },
     
     /********************************************************** SUMMARY PANEL **********************************************************/
@@ -711,72 +683,66 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
         if (! this.summaryPanelInfo.rendered) {
             return this.onSummaryPanelShow.defer(100, this);
         }
+
+        // calc metrics
+        var rsp = this.lastImportResponse,
+            totalcount = rsp.totalcount,
+            failcount = 0,
+            mergecount = 0
+            discardcount = 0;
+            
+        this.exceptionStore.clearFilter();
+        this.exceptionStore.each(function(r) {
+            var strategy = r.get('resolveStrategy');
+            if (! strategy || !Ext.isString(strategy)) {
+                failcount++;
+            } else if (strategy == 'keep') {
+                totalcount++;
+            } else if (strategy.match(/^merge.*/)) {
+                mergecount++;
+            } else if (strategy == 'discard') {
+                discardcount++;
+            }
+        }, this);
         
-        try {
-            // calc metrics
-            var rsp = this.lastImportResponse,
-                totalcount = rsp.totalcount,
-                failcount = 0,
-                mergecount = 0
-                discardcount = 0;
-                
-            this.exceptionStore.clearFilter();
-            this.exceptionStore.each(function(r) {
-                var strategy = r.get('resolveStrategy');
-                if (! strategy || !Ext.isString(strategy)) {
-                    failcount++;
-                } else if (strategy == 'keep') {
-                    totalcount++;
-                } else if (strategy.match(/^merge.*/)) {
-                    mergecount++;
-                } else if (strategy == 'discard') {
-                    discardcount++;
-                }
-            }, this);
+        var tags = this.tagsPanel.getFormField().getValue(),
+            container = this.containerCombo.selectedContainer,
+            info = [String.format(_('In total we found {0} records in your import file.'), rsp.totalcount + rsp.duplicatecount + rsp.failcount)];
             
-            var tags = this.tagsPanel.getFormField().getValue(),
-                container = this.containerCombo.selectedContainer,
-                info = [String.format(_('In total we found {0} records in your import file.'), rsp.totalcount + rsp.duplicatecount + rsp.failcount)];
-                
-                if (totalcount) {
-                    info.push(String.format(_('{0} of them will be added as new records into: "{1}".'), 
-                        totalcount, 
-                        Tine.Tinebase.common.containerRenderer(container).replace('<div', '<span').replace('</div>', '</span>')
-                    ));
-                }
+            if (totalcount) {
+                info.push(String.format(_('{0} of them will be added as new records into: "{1}".'), 
+                    totalcount, 
+                    Tine.Tinebase.common.containerRenderer(container).replace('<div', '<span').replace('</div>', '</span>')
+                ));
+            }
+            
+            if (mergecount + discardcount) {
+                info.push(String.format(_('{0} of them where identified as duplicates.'), mergecount + discardcount));
                 
-                if (mergecount + discardcount) {
-                    info.push(String.format(_('{0} of them where identified as duplicates.'), mergecount + discardcount));
-                    
-                    if (mergecount) {
-                        info.push(String.format(_('From the identified duplicates {0} will be merged into the existing records.'), mergecount));
-                    }
-                    
-                    if (discardcount) {
-                        info.push(String.format(_('From the identified duplicates {0} will be discarded.'), discardcount));
-                    }
+                if (mergecount) {
+                    info.push(String.format(_('From the identified duplicates {0} will be merged into the existing records.'), mergecount));
                 }
                 
-                if (Ext.isArray(tags) && tags.length) {
-                    var tagNames = [];
-                    Ext.each(tags, function(tag) {tagNames.push(tag.name)});
-                    info.push(String.format(_('All records will be tagged with: "{0}" so you can find them easily.'), tagNames.join(',')));
+                if (discardcount) {
+                    info.push(String.format(_('From the identified duplicates {0} will be discarded.'), discardcount));
                 }
-                
-                
-            this.summaryPanelInfo.update('<div style="padding: 5px;">' + info.join('<br />') + '</div>');
+            }
             
-            // failures
-            if (failcount) {
-                this.exceptionStore.filter('code', 0);
-                this.summaryPanelFailures.show();
-                this.summaryPanelFailures.setTitle(String.format(_('{0} records have failures and will be discarded.'), failcount));
-                
+            if (Ext.isArray(tags) && tags.length) {
+                var tagNames = [];
+                Ext.each(tags, function(tag) {tagNames.push(tag.name)});
+                info.push(String.format(_('All records will be tagged with: "{0}" so you can find them easily.'), tagNames.join(',')));
             }
             
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.ImportDialog::onSummaryPanelShow');
-            Tine.log.err(e.stack ? e.stack : e);
+            
+        this.summaryPanelInfo.update('<div style="padding: 5px;">' + info.join('<br />') + '</div>');
+        
+        // failures
+        if (failcount) {
+            this.exceptionStore.filter('code', 0);
+            this.summaryPanelFailures.show();
+            this.summaryPanelFailures.setTitle(String.format(_('{0} records have failures and will be discarded.'), failcount));
+            
         }
     }
 });
index 4bf2dbc..72877a9 100644 (file)
@@ -342,17 +342,12 @@ Tine.widgets.dialog.MultipleEditDialogPlugin.prototype = {
                             Ext.MessageBox.hide();
                             var resp = Ext.decode(_result.responseText);
                             if(resp.failcount > 0) {
-                                try {
-                                    var window = Tine.widgets.dialog.MultipleEditResultSummary.openWindow({
-                                        response: _result.responseText,
-                                        appName: this.app.appName,
-                                        recordClass: this.editDialog.recordClass
-                                    });
-                                } catch (e) {
-                                    Tine.log.err('Tine.widgets.dialog.MultipleEditDialogPlugin::onRecordUpdate::openSummaryWindow');
-                                    Tine.log.err(e.stack ? e.stack : e);
-                                }
-                                
+                                var window = Tine.widgets.dialog.MultipleEditResultSummary.openWindow({
+                                    response: _result.responseText,
+                                    appName: this.app.appName,
+                                    recordClass: this.editDialog.recordClass
+                                });
+
                                 window.on('close', function() {
                                     this.editDialog.fireEvent('update');
                                     this.editDialog.purgeListeners();
index 7b07374..b0d6279 100644 (file)
@@ -53,35 +53,29 @@ Ext.extend(Tine.widgets.dialog.MultipleEditResultSummary, Ext.FormPanel, {
     recordClass: null,
     
     initComponent: function() {
-        try {
-            this.response = Ext.decode(this.response);
-            
-            if (!this.app) {
-                this.app = Tine.Tinebase.appMgr.get(this.appName);
-            }
-            
-            // init some translations
-            if (this.app.i18n && this.recordClass !== null) {
-                this.i18nRecordName = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), 1);
-                this.i18nRecordsName = this.app.i18n._hidden(this.recordClass.getMeta('recordsName'));
-            }
-            
-            // init actions
-            this.initActions();
-            // init buttons and tbar
-            this.initButtons();
-            
-            this.initStore();
-            
-            // get items for this dialog
-            this.items = this.getFormItems();
-           
-            Tine.widgets.dialog.MultipleEditResultSummary.superclass.initComponent.call(this);
+        this.response = Ext.decode(this.response);
+        
+        if (!this.app) {
+            this.app = Tine.Tinebase.appMgr.get(this.appName);
+        }
         
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.MultipleEditResultSummary::initComponent');
-            Tine.log.err(e.stack ? e.stack : e);
+        // init some translations
+        if (this.app.i18n && this.recordClass !== null) {
+            this.i18nRecordName = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), 1);
+            this.i18nRecordsName = this.app.i18n._hidden(this.recordClass.getMeta('recordsName'));
         }
+        
+        // init actions
+        this.initActions();
+        // init buttons and tbar
+        this.initButtons();
+        
+        this.initStore();
+        
+        // get items for this dialog
+        this.items = this.getFormItems();
+       
+        Tine.widgets.dialog.MultipleEditResultSummary.superclass.initComponent.call(this);
     },
     
     /**
@@ -144,74 +138,68 @@ Ext.extend(Tine.widgets.dialog.MultipleEditResultSummary, Ext.FormPanel, {
         this.window.close();
     },    
     
-    getFormItems: function() {
+    getFormItems: function() { 
+        if(this.items) return this.items;
+        var allrecs = this.response.totalcount + this.response.failcount;
         
-        try {        
-            if(this.items) return this.items;
-            var allrecs = this.response.totalcount + this.response.failcount;
+        var rn = (allrecs>1) ? this.i18nRecordsName : this.i18nRecordName;
+        var summary = String.format( (allrecs>1) ? _('You edited {0} {1}.') : _('You edited {0} {1}.'), allrecs, rn);
+        summary += '<br />';
+        rn = (this.response.totalcount>1) ? this.i18nRecordsName : this.i18nRecordName;
+        summary += String.format( (this.response.totalcount>1) ? _('{0} {1} have been updated properly.') : _('{0} {1} has been updated properly.'), this.response.totalcount, rn);
+        summary += '<br />';
+        rn = (this.response.failcount>1) ? this.i18nRecordsName : this.i18nRecordName;
+        summary += String.format( (this.response.failcount>1) ? _('{0} {1} have invalid data after updating. These {1} have not been changed.') : _('{0} {1} has invalid data after updating. This {1} has not been changed.'), this.response.failcount, rn);
+       
+        return {
+            border: false,            
+            cls : 'x-ux-display',
+            layout: 'ux.display',
             
-            var rn = (allrecs>1) ? this.i18nRecordsName : this.i18nRecordName;
-            var summary = String.format( (allrecs>1) ? _('You edited {0} {1}.') : _('You edited {0} {1}.'), allrecs, rn);
-            summary += '<br />';
-            rn = (this.response.totalcount>1) ? this.i18nRecordsName : this.i18nRecordName;
-            summary += String.format( (this.response.totalcount>1) ? _('{0} {1} have been updated properly.') : _('{0} {1} has been updated properly.'), this.response.totalcount, rn);
-            summary += '<br />';
-            rn = (this.response.failcount>1) ? this.i18nRecordsName : this.i18nRecordName;
-            summary += String.format( (this.response.failcount>1) ? _('{0} {1} have invalid data after updating. These {1} have not been changed.') : _('{0} {1} has invalid data after updating. This {1} has not been changed.'), this.response.failcount, rn);
-           
-            return {
-                border: false,            
-                cls : 'x-ux-display',
-                layout: 'ux.display',
-                
-                frame: true,
-                autoScroll: true,
-                items: [
-                    {
-                        height: 100,
-                        border: false,
-                        items: [{
-                            hideLabel: true,
-                            xtype: 'ux.displayfield',
-                            value: summary,
-                            htmlEncode: false,
-                            style: 'padding: 0 5px; color: black',
-                            cls: 'x-panel-mc'
-                        }],
+            frame: true,
+            autoScroll: true,
+            items: [
+                {
+                    height: 100,
+                    border: false,
+                    items: [{
                         hideLabel: true,
-                        ref: '../../summaryPanelInfo',
-                        layout: 'ux.display',
-                        layoutConfig: {
-                            background: 'border'
-                        }
-                    }, {
-                        baseCls: 'ux-arrowcollapse',
-                        cls: 'ux-arrowcollapse-plain',
-                        collapsible: true,
-                        hidden: false,
-                        flex: 1,
-                        title:'',
-                        ref: '../../summaryPanelFailures',
-                        items: [{
-                            xtype: 'grid',
-                            store: this.store,
-                            autoHeight: true,
-                            columns: [
-                                { id: 'id', header: _('Index'), width: 60, sortable: false, dataIndex: 'id', hidden: true}, 
-                                { id: 'record', header: this.i18nRecordName, width: 160, sortable: true, dataIndex: 'record', renderer: function(value) {
-                                    return value.n_fn;
-                                }},
-                                { id: 'failure', header: _('Failure'), width: 60, sortable: true, dataIndex: 'message'}
-                            ],
-                            autoExpandColumn: 'failure'
-                        }]
+                        xtype: 'ux.displayfield',
+                        value: summary,
+                        htmlEncode: false,
+                        style: 'padding: 0 5px; color: black',
+                        cls: 'x-panel-mc'
+                    }],
+                    hideLabel: true,
+                    ref: '../../summaryPanelInfo',
+                    layout: 'ux.display',
+                    layoutConfig: {
+                        background: 'border'
                     }
-                ]
-            };
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.MultipleEditResultSummary::getFormItems');
-            Tine.log.err(e.stack ? e.stack : e);
-        }
+                }, {
+                    baseCls: 'ux-arrowcollapse',
+                    cls: 'ux-arrowcollapse-plain',
+                    collapsible: true,
+                    hidden: false,
+                    flex: 1,
+                    title:'',
+                    ref: '../../summaryPanelFailures',
+                    items: [{
+                        xtype: 'grid',
+                        store: this.store,
+                        autoHeight: true,
+                        columns: [
+                            { id: 'id', header: _('Index'), width: 60, sortable: false, dataIndex: 'id', hidden: true}, 
+                            { id: 'record', header: this.i18nRecordName, width: 160, sortable: true, dataIndex: 'record', renderer: function(value) {
+                                return value.n_fn;
+                            }},
+                            { id: 'failure', header: _('Failure'), width: 60, sortable: true, dataIndex: 'message'}
+                        ],
+                        autoExpandColumn: 'failure'
+                    }]
+                }
+            ]
+        };
     }
 
 });
index 20169b9..3900eb4 100644 (file)
@@ -70,38 +70,33 @@ Tine.widgets.dialog.Preferences = Ext.extend(Ext.FormPanel, {
     
     //private
     initComponent: function(){
-        try {
-            this.addEvents(
-                /**
-                 * @event cancel
-                 * Fired when user pressed cancel button
-                 */
-                'cancel',
-                /**
-                 * @event saveAndClose
-                 * Fired when user pressed OK button
-                 */
-                'saveAndClose',
-                /**
-                 * @event update
-                 * @desc  Fired when the record got updated
-                 * @param {Json String} data data of the entry
-                 */
-                'update'
-            );
-            
-            this.i18n = new Locale.Gettext();
-            this.i18n.textdomain('Tinebase');
-    
-            this.initActions();
-            this.initButtons();
-            this.items = this.getItems();
-            
-            Tine.widgets.dialog.Preferences.superclass.initComponent.call(this);
-        } catch (e) {
-            Tine.log.err('Tine.widgets.dialog.Preferences::initComponent');
-            Tine.log.err(e.stack ? e.stack : e);
-        }
+        this.addEvents(
+            /**
+             * @event cancel
+             * Fired when user pressed cancel button
+             */
+            'cancel',
+            /**
+             * @event saveAndClose
+             * Fired when user pressed OK button
+             */
+            'saveAndClose',
+            /**
+             * @event update
+             * @desc  Fired when the record got updated
+             * @param {Json String} data data of the entry
+             */
+            'update'
+        );
+        
+        this.i18n = new Locale.Gettext();
+        this.i18n.textdomain('Tinebase');
+
+        this.initActions();
+        this.initButtons();
+        this.items = this.getItems();
+        
+        Tine.widgets.dialog.Preferences.superclass.initComponent.call(this);
     },
     
     /**
index ada3548..cb07070 100644 (file)
@@ -212,38 +212,33 @@ Tine.widgets.dialog.TokenModeEditDialogPlugin.prototype = {
     },
     
     getDragData: function(e) {
-        try {
-            var target = e.getTarget('.tinebase-tokenedit-token', 10, true);
-                
-            if (target) {
-                // autoselect token
-                if (this.selection.indexOf(target) < 0) {
-                    this.onClick(e);
-                }
-                this.processedEvent = e.browserEvent;
-                
-                var ddel = new Ext.Element(document.createElement('div'));
-                ddel.id = Ext.id();
-                
-                var sourceFields = [];
+        var target = e.getTarget('.tinebase-tokenedit-token', 10, true);
+            
+        if (target) {
+            // autoselect token
+            if (this.selection.indexOf(target) < 0) {
+                this.onClick(e);
+            }
+            this.processedEvent = e.browserEvent;
+            
+            var ddel = new Ext.Element(document.createElement('div'));
+            ddel.id = Ext.id();
+            
+            var sourceFields = [];
+            
+            Ext.each(this.selection, function(el) {
+                sourceFields.push(Ext.getCmp(el.parent('div[class^=tinebase-tokenedit-tokenbox]').parent('div').child('*[id^=ext-comp]').id));
                 
-                Ext.each(this.selection, function(el) {
-                    sourceFields.push(Ext.getCmp(el.parent('div[class^=tinebase-tokenedit-tokenbox]').parent('div').child('*[id^=ext-comp]').id));
-                    
-                    var clone = el.dom.cloneNode(true);
-                    clone.id = Ext.id();
-                    ddel.appendChild(clone);
-                }, this);
+                var clone = el.dom.cloneNode(true);
+                clone.id = Ext.id();
+                ddel.appendChild(clone);
+            }, this);
+            
+            return {
+                ddel: ddel.dom,
+                sourceFields: sourceFields
                 
-                return {
-                    ddel: ddel.dom,
-                    sourceFields: sourceFields
-                    
-                }
             }
-        } catch (e) {
-            Tine.log.error('Tine.widgets.dialog.TokenModeEditDialogPlugin::getDragData');
-            Tine.log.error(e.stack ? e.stack : e);
         }
     },
     
@@ -296,34 +291,28 @@ Tine.widgets.dialog.TokenModeEditDialogPlugin.prototype = {
     },
     
     onNodeDrop : function(target, dd, e, data) {
-        try {
-            var field = Ext.getCmp(target.up('div').child('*[id^=ext-comp]').id),
-                positionEl = this.getPositionEl();
-            
-            positionEl.setStyle('display', 'none');
+        var field = Ext.getCmp(target.up('div').child('*[id^=ext-comp]').id),
+            positionEl = this.getPositionEl();
+        
+        positionEl.setStyle('display', 'none');
+        
+        Ext.each(this.selection, function(el) {
+            el.insertBefore(positionEl);
+        }, this);
+        
+        // update source and target fields
+        Ext.each([field].concat(data.sourceFields), function(f) {
+            var value = [];
             
-            Ext.each(this.selection, function(el) {
-                el.insertBefore(positionEl);
+            Ext.each(f.itemCt.query('.tinebase-tokenedit-token'), function(el) {
+                value.push(el.innerHTML);
             }, this);
             
-            // update source and target fields
-            Ext.each([field].concat(data.sourceFields), function(f) {
-                var value = [];
-                
-                Ext.each(f.itemCt.query('.tinebase-tokenedit-token'), function(el) {
-                    value.push(el.innerHTML);
-                }, this);
-                
-                value = value.join(' ');
-                value = Ext.util.Format.htmlDecode(value.replace(/\s*\u21A9\s*/g, '\n'));
-                
-                f.setValue(value);
-            }, this);
+            value = value.join(' ');
+            value = Ext.util.Format.htmlDecode(value.replace(/\s*\u21A9\s*/g, '\n'));
             
-        } catch (e) {
-            Tine.log.error('Tine.widgets.dialog.TokenModeEditDialogPlugin::onNodeDrop');
-            Tine.log.error(e.stack ? e.stack : e);
-        }
+            f.setValue(value);
+        }, this);
     },
     
     getPositionEl: function() {
index 816c833..0e8f258 100644 (file)
@@ -28,47 +28,42 @@ Tine.widgets.form.RecordPickerManager = {
      * @return {Object} recordpicker
      */
     get: function(appName, modelName, config) {
-        try {
-            if(!config) var config = {};
+        if(!config) var config = {};
 
-            if (!appName) {
-                Tine.log.debug('Tine.widgets.form.RecordPickerManager::get - No appName given!');
-                return {};
-            }
+        if (!appName) {
+            Tine.log.debug('Tine.widgets.form.RecordPickerManager::get - No appName given!');
+            return {};
+        }
 
-            if (!modelName) {
-                Tine.log.debug('Tine.widgets.form.RecordPickerManager::get - No modelName given!');
-                return {};
-            }            
-            
-            if(Ext.isObject(appName)) {
-                appName = appName.name;
-            }
-            Tine.log.err('app',appName);
-            if(Ext.isObject(modelName)) {
-                modelName = modelName.getMeta('modelName');
-            }
-            
-            var key = appName+modelName;
-            
-            if(this.items[key]) {   // if registered
-                if(Ext.isString(this.items[key])) { // xtype
-                    return Ext.ComponentMgr.create(config, this.items[key]);
-                } else { 
-                    return new this.items[key](config);   
-                }
-            } else {    // not registered, create default
-                var defaultconfig = {
-                    recordClass: Tine[appName].Model[modelName],
-                    recordProxy: Tine[appName][modelName.toLowerCase() + 'Backend'],
-                    loadingText: _('Searching...')
-                };
-                Ext.apply(defaultconfig, config);
-                return new Tine.Tinebase.widgets.form.RecordPickerComboBox(defaultconfig);
+        if (!modelName) {
+            Tine.log.debug('Tine.widgets.form.RecordPickerManager::get - No modelName given!');
+            return {};
+        }            
+        
+        if(Ext.isObject(appName)) {
+            appName = appName.name;
+        }
+        Tine.log.err('app',appName);
+        if(Ext.isObject(modelName)) {
+            modelName = modelName.getMeta('modelName');
+        }
+        
+        var key = appName+modelName;
+        
+        if(this.items[key]) {   // if registered
+            if(Ext.isString(this.items[key])) { // xtype
+                return Ext.ComponentMgr.create(config, this.items[key]);
+            } else { 
+                return new this.items[key](config);   
             }
-        } catch(e) {
-            Tine.log.error('Tine.widgets.form.RecordPickerManager::get');
-            Tine.log.error(e.stack ? e.stack : e);
+        } else {    // not registered, create default
+            var defaultconfig = {
+                recordClass: Tine[appName].Model[modelName],
+                recordProxy: Tine[appName][modelName.toLowerCase() + 'Backend'],
+                loadingText: _('Searching...')
+            };
+            Ext.apply(defaultconfig, config);
+            return new Tine.Tinebase.widgets.form.RecordPickerComboBox(defaultconfig);
         }
     },
     
@@ -79,34 +74,27 @@ Tine.widgets.form.RecordPickerManager = {
      * @param {String/Object} component the component or xtype to register 
      */
     register: function(appName, modelName, component) {
-        try {
-            
-            if (!appName) {
-                Tine.log.debug('Tine.widgets.form.RecordPickerManager::register - No appName given!');
-                return {};
-            }
+        if (!appName) {
+            Tine.log.debug('Tine.widgets.form.RecordPickerManager::register - No appName given!');
+            return {};
+        }
 
-            if (!modelName) {
-                Tine.log.debug('Tine.widgets.form.RecordPickerManager::register - No modelName given!');
-                return {};
-            }            
-            
-            if(Ext.isObject(appName)) {
-                appName = appName.name;
-            }
-            if(Ext.isObject(modelName)) {
-                modelName = modelName.getMeta('modelName');
-            }
-            
-            var key = appName+modelName;
-            if(!this.items[key]) {
-                Tine.log.debug('RecordPickerManager::registerItem: ' + appName + modelName);
-                this.items[key] = component;
-            }
-         } catch(e) {
-            Tine.log.error('Tine.widgets.form.RecordPickerManager::register');
-            Tine.log.error(e.stack ? e.stack : e);
+        if (!modelName) {
+            Tine.log.debug('Tine.widgets.form.RecordPickerManager::register - No modelName given!');
+            return {};
+        }            
+        
+        if(Ext.isObject(appName)) {
+            appName = appName.name;
+        }
+        if(Ext.isObject(modelName)) {
+            modelName = modelName.getMeta('modelName');
+        }
+        
+        var key = appName+modelName;
+        if(!this.items[key]) {
+            Tine.log.debug('RecordPickerManager::registerItem: ' + appName + modelName);
+            this.items[key] = component;
         }
     }
-
 };
\ No newline at end of file
index b1e74bc..a0a8d7f 100644 (file)
@@ -766,40 +766,36 @@ Ext.extend(Tine.widgets.grid.FilterToolbar, Ext.Panel, {
         var filters = [];
         
         this.filterStore.each(function(filter) {
-            try {
-                var filterModel = this.getFilterModel(filter),
-                    line = Ext.isFunction(filterModel.getFilterData) ? filterModel.getFilterData(filter) : this.getFilterData(filter);
+            var filterModel = this.getFilterModel(filter),
+                line = Ext.isFunction(filterModel.getFilterData) ? filterModel.getFilterData(filter) : this.getFilterData(filter);
+            
+            if (line.field && Ext.isString(line.field) &&  line.field.match(/:/)) {
+                var parts = line.field.split(':');
                 
-                if (line.field && Ext.isString(line.field) &&  line.field.match(/:/)) {
-                    var parts = line.field.split(':');
-                    
-                    // customfield handling
-                    if (parts[0] == 'customfield') {
-                        filters.push({field: 'customfield', operator: line.operator, value: {cfId: parts[1], value: line.value}});
+                // customfield handling
+                if (parts[0] == 'customfield') {
+                    filters.push({field: 'customfield', operator: line.operator, value: {cfId: parts[1], value: line.value}});
+                }
+                
+                else if (filterModel && filterModel.superFilter) {
+                    // if we are a childfilter of a recordclass of the subfilter, just place the subfilter
+                    if (this.parentSheet && this.parentSheet.recordClass == filterModel.superFilter.foreignRecordClass) {
+                        filters.push(line);
+                        return;
                     }
                     
-                    else if (filterModel && filterModel.superFilter) {
-                        // if we are a childfilter of a recordclass of the subfilter, just place the subfilter
-                        if (this.parentSheet && this.parentSheet.recordClass == filterModel.superFilter.foreignRecordClass) {
-                            filters.push(line);
-                            return;
-                        }
+                    // check if filter of type superfilter is present
+                    if (this.filterStore.find('field', filterModel.superFilter.field) < 0) {
                         
-                        // check if filter of type superfilter is present
-                        if (this.filterStore.find('field', filterModel.superFilter.field) < 0) {
-                            
-                            // create one
-                            // @TODO HIDE? -> see ForeignRecordFilter line ~300
-                            var superFilter = this.addFilter(new this.record({field: filterModel.superFilter.field, operator: 'definedBy'}));
-                            line = this.getFilterData(superFilter);
-                            filters.push(line);
-                        }
+                        // create one
+                        // @TODO HIDE? -> see ForeignRecordFilter line ~300
+                        var superFilter = this.addFilter(new this.record({field: filterModel.superFilter.field, operator: 'definedBy'}));
+                        line = this.getFilterData(superFilter);
+                        filters.push(line);
                     }
-                } else {
-                    filters.push(line);
                 }
-            } catch (e) {
-                console.error(e.stack ? e.stack : e);
+            } else {
+                filters.push(line);
             }
         }, this);
         
@@ -855,60 +851,55 @@ Ext.extend(Tine.widgets.grid.FilterToolbar, Ext.Panel, {
     },
     
     setValue: function(filters) {
-        try {
-            this.supressEvents = true;
-            
-            var oldFilters = [];
-            this.filterStore.each(function(filterRecord) {oldFilters.push(filterRecord)}, this);
-            
-            var filterModel, filterData, filterRecord;
-            
-            // custom fields handling
-            for (var i=0; i<filters.length; i++) {
-                filterData = filters[i];
-                if (filterData.value && filterData.value.cfId) {
-                    filters[i].field = filterData.field + ':' + filterData.value.cfId;
-                    filters[i].value = filterData.value.value;
-                }
+        this.supressEvents = true;
+        
+        var oldFilters = [];
+        this.filterStore.each(function(filterRecord) {oldFilters.push(filterRecord)}, this);
+        
+        var filterModel, filterData, filterRecord;
+        
+        // custom fields handling
+        for (var i=0; i<filters.length; i++) {
+            filterData = filters[i];
+            if (filterData.value && filterData.value.cfId) {
+                filters[i].field = filterData.field + ':' + filterData.value.cfId;
+                filters[i].value = filterData.value.value;
             }
-            
-            for (var i=0; i<filters.length; i++) {
-                filterRecord = null;
-                filterData = filters[i],
+        }
+        
+        for (var i=0; i<filters.length; i++) {
+            filterRecord = null;
+            filterData = filters[i],
 //                filterData.filterValueWidth = this.filterValueWidth,
-                filterModel = filterData.condition ? this.ownRecordFilterModel : this.filterModelMap[filterData.field];
-                
-                if (filterModel) {
-                    if (filterData.id) {
-                        filterRecord = this.filterStore.getById(filterData.id);
-                    }
-                    
-                    // refresh existing filters
-                    if (filterRecord) {
-                        Ext.isFunction(filterModel.setFilterData) ? filterModel.setFilterData(filterRecord, filterData) : this.setFilterData(filterRecord, filterData);
-                        oldFilters.remove(filterRecord);
-                    } 
-                    
-                    // add non existing filters only if they where not created implicitly by server
-                    else if (! filterData.implicit) {
-                        filterRecord = new this.record(filterData, filterData.id);
-                        this.addFilter(filterRecord);
-                    }
+            filterModel = filterData.condition ? this.ownRecordFilterModel : this.filterModelMap[filterData.field];
+            
+            if (filterModel) {
+                if (filterData.id) {
+                    filterRecord = this.filterStore.getById(filterData.id);
                 }
                 
+                // refresh existing filters
+                if (filterRecord) {
+                    Ext.isFunction(filterModel.setFilterData) ? filterModel.setFilterData(filterRecord, filterData) : this.setFilterData(filterRecord, filterData);
+                    oldFilters.remove(filterRecord);
+                } 
+                
+                // add non existing filters only if they where not created implicitly by server
+                else if (! filterData.implicit) {
+                    filterRecord = new this.record(filterData, filterData.id);
+                    this.addFilter(filterRecord);
+                }
             }
             
-            // remove unused filters
-            Ext.each(oldFilters, function(filterRecord) {
-                this.deleteFilter(filterRecord);
-            }, this);
-            
-            this.supressEvents = false;
-            this.onFilterRowsChange();
-        } catch (e) {
-            console.error(e.stack ? e.stack : e);
         }
         
+        // remove unused filters
+        Ext.each(oldFilters, function(filterRecord) {
+            this.deleteFilter(filterRecord);
+        }, this);
+        
+        this.supressEvents = false;
+        this.onFilterRowsChange();
     },
     
     /**
index f9cbda4..7093f6f 100644 (file)
@@ -173,16 +173,12 @@ Tine.widgets.grid.ForeignRecordFilter = Ext.extend(Tine.widgets.grid.FilterModel
     },
     
     onDefineRelatedRecord: function(filter) {
-        try {
-            if (! filter.toolbar) {
-                this.createRelatedRecordToolbar(filter);
-            }
-            
-            this.ftb.setActiveSheet(filter.toolbar);
-            filter.formFields.value.setText((this.editDefinitionText));
-        } catch (e) {
-            console.error(e.stack ? e.stack : e);
+        if (! filter.toolbar) {
+            this.createRelatedRecordToolbar(filter);
         }
+        
+        this.ftb.setActiveSheet(filter.toolbar);
+        filter.formFields.value.setText((this.editDefinitionText));
     },
     
     /**
@@ -348,29 +344,24 @@ Tine.widgets.grid.ForeignRecordFilter = Ext.extend(Tine.widgets.grid.FilterModel
             foreignRecordClass = foreignRecordDefinition.foreignRecordClass,
             filterModels = foreignRecordClass.getFilterModel(),
             ftb = this.ftb;
-            
-        try {
-            if (! filter.toolbar) {
-                // add our subfilters in this toolbar (right hand)
-                if (Ext.isFunction(this.getSubFilters)) {
-                    filterModels = filterModels.concat(this.getSubFilters());
-                }
-                
-                filter.toolbar = new Tine.widgets.grid.FilterToolbar({
-                    recordClass: foreignRecordClass,
-                    filterModels: filterModels,
-                    defaultFilter: 'query'
-                });
-                
-                ftb.addFilterSheet(filter.toolbar);
-                
-                // force rendering as we can't set values on non rendered toolbar atm.
-                this.ftb.setActiveSheet(filter.toolbar);
-                this.ftb.setActiveSheet(this.ftb);
+
+        if (! filter.toolbar) {
+            // add our subfilters in this toolbar (right hand)
+            if (Ext.isFunction(this.getSubFilters)) {
+                filterModels = filterModels.concat(this.getSubFilters());
             }
             
-        } catch (e) {
-            console.error(e.stack ? e.stack : e);
+            filter.toolbar = new Tine.widgets.grid.FilterToolbar({
+                recordClass: foreignRecordClass,
+                filterModels: filterModels,
+                defaultFilter: 'query'
+            });
+            
+            ftb.addFilterSheet(filter.toolbar);
+            
+            // force rendering as we can't set values on non rendered toolbar atm.
+            this.ftb.setActiveSheet(filter.toolbar);
+            this.ftb.setActiveSheet(this.ftb);
         }
     },
     
index a3ad7af..7af29e7 100644 (file)
@@ -27,20 +27,19 @@ Ext.ns('Tine.widgets.grid');
  */
 Tine.widgets.grid.GridPanel = function(config) {
     Ext.apply(this, config);
-    
-    
+
     this.gridConfig = this.gridConfig || {};
     this.defaultSortInfo = this.defaultSortInfo || {};
     this.defaultPaging = this.defaultPaging || {
         start: 0,
         limit: 50
     };
-    
+
     // autogenerate stateId
     if (this.stateful !== false && ! this.stateId) {
         this.stateId = this.recordClass.getMeta('appName') + '-' + this.recordClass.getMeta('recordName') + '-GridPanel';
     }
-        
+
     Tine.widgets.grid.GridPanel.superclass.constructor.call(this);
 };
 
@@ -124,23 +123,23 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * specialised strings for delete action button
      */
     i18nDeleteActionText: null,
-    
+
     /**
      * @cfg {Object} editDialogConfig 
      * config passed to edit dialog
      */
     editDialogConfig: null,
-    
+
     /**
      * @cfg {String} editDialogClass 
      */
     editDialogClass: null,
-    
+
     /**
      * @cfg {String} i18nEmptyText 
      */
     i18nEmptyText: null,
-    
+
     /**
      * @cfg {String} newRecordIcon 
      * icon for adding new records button
@@ -152,40 +151,40 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * update details panel if context menu is shown
      */
     updateDetailsPanelOnCtxMenu: true,
-    
+
     /**
      * @cfg {Number} autoRefreshInterval (seconds)
      */
     autoRefreshInterval: 300,
-    
+
     /**
      * @cfg {Bool} hasFavoritesPanel 
      */
     hasFavoritesPanel: true,
-    
+
     /**
      * @cfg {Bool} hasQuickSearchFilterToolbarPlugin 
      */
     hasQuickSearchFilterToolbarPlugin: true,
-    
+
     /**
      * disable 'select all pages' in paging toolbar
      * @cfg {Bool} disableSelectAllPages
      */
     disableSelectAllPages: false,
-    
+
     /**
      * enable if records should be multiple editable
      * @cfg {Bool} multipleEdit
      */
     multipleEdit: false,
-    
+
     /**
      * @property autoRefreshTask
      * @type Ext.util.DelayedTask
      */
     autoRefreshTask: null,
-    
+
     /**
      * @type Bool
      * @property updateOnSelectionChange
@@ -205,7 +204,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @property actionToolbar
      */
     actionToolbar: null,
-    
+
     /**
      * @type Ext.ux.grid.PagingToolbar
      * @property pagingToolbar
@@ -217,36 +216,35 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @property contextMenu
      */
     contextMenu: null,
-    
+
     /**
      * @property lastStoreTransactionId 
      * @type String
      */
     lastStoreTransactionId: null,
-    
+
     /**
      * @property editBuffer  - array of ids of records edited since last explicit refresh
      * @type Array of ids
      */
     editBuffer: null,
-    
+
     /**
      * @property deleteQueue - array of ids of records currently being deleted
      * @type Array of ids
      */
     deleteQueue: null,
-    
+
     /**
      * @property selectionModel
      * @type Tine.widgets.grid.FilterSelectionModel
      */
     selectionModel: null,
-    
-    
+
     layout: 'border',
     border: false,
     stateful: true,
-    
+
     /**
      * extend standard initComponent chain
      * 
@@ -259,19 +257,19 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         this.i18nContainerName = this.app.i18n.n_hidden(this.recordClass.getMeta('containerName'), this.recordClass.getMeta('containersName'), 1);
         this.i18nContainersName = this.app.i18n._hidden(this.recordClass.getMeta('containersName'));
         this.i18nEmptyText = this.i18nEmptyText || String.format(Tine.Tinebase.translation._("No {0} where found. Please try to change your filter-criteria, view-options or the {1} you search in."), this.i18nRecordsName, this.i18nContainersName);
-        
+
         this.i18nEditActionText = this.i18nEditActionText ? this.i18nEditActionText : [String.format(Tine.Tinebase.translation.ngettext('Edit {0}', 'Edit {0}', 1), this.i18nRecordName), String.format(Tine.Tinebase.translation.ngettext('Edit {0}', 'Edit {0}', 2), this.i18nRecordsName)];
 
         this.editDialogConfig = this.editDialogConfig || {};
-        
+
         this.editBuffer = [];
         this.deleteQueue = [];
-        
+
         // init store
         this.initStore();
         // init (ext) grid
         this.initGrid();
-        
+
         // init actions
         this.actionUpdater = new Tine.widgets.ActionUpdater({
             containerProperty: this.recordClass.getMeta('containerProperty'), 
@@ -280,7 +278,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         this.initActions();
 
         this.initLayout();
-        
+
         // for some reason IE looses split height when outer layout is layouted
         if (Ext.isIE6 || Ext.isIE7) {
             this.on('show', function() {
@@ -293,7 +291,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
 
         Tine.widgets.grid.GridPanel.superclass.initComponent.call(this);
     },
-    
+
     /**
      * @private
      * 
@@ -310,7 +308,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             tbar: this.pagingToolbar,
             items: this.grid
         }];
-        
+
         // add detail panel
         if (this.detailsPanel) {
             this.items.push({
@@ -323,11 +321,11 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 layout: 'fit',
                 height: this.detailsPanel.defaultHeight ? this.detailsPanel.defaultHeight : 125,
                 items: this.detailsPanel
-                
+
             });
             this.detailsPanel.doBind(this.grid);
         }
-        
+
         // add filter toolbar
         if (this.filterToolbar) {
             this.items.push({
@@ -338,7 +336,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 listeners: {
                     scope: this,
                     afterlayout: function(ct) {
-                       ct.suspendEvents();
+                        ct.suspendEvents();
                         ct.setHeight(Math.min(120, this.filterToolbar.getHeight()));
                         ct.getEl().child('div[class^="x-panel-body"]', true).scrollTop = 1000000;
                         ct.ownerCt.layout.layout();
@@ -349,14 +347,14 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         }
 
     },
-    
+
     /**
      * init actions with actionToolbar, contextMenu and actionUpdater
      * 
      * @private
      */
     initActions: function() {
-        
+
         this.action_editInNewWindow = new Ext.Action({
             requiredGrant: 'readGrant',
             text: this.i18nEditActionText ? this.i18nEditActionText[0] : String.format(_('Edit {0}'), this.i18nRecordName),
@@ -370,7 +368,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             scope: this,
             allowMultiple: true
         });
-        
+
         this.action_editCopyInNewWindow = new Ext.Action({
             hidden: ! this.copyEditAction,
             requiredGrant: 'readGrant',
@@ -381,7 +379,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             iconCls: 'action_editcopy',
             scope: this
         });
-        
+
         this.action_addInNewWindow = new Ext.Action({
             requiredGrant: 'addGrant',
             actionType: 'add',
@@ -390,7 +388,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             iconCls: (this.newRecordIcon !== null) ? this.newRecordIcon : this.app.appName + 'IconCls',
             scope: this
         });
-        
+
         this.actions_print = new Ext.Action({
             requiredGrant: 'readGrant',
             text: _('Print Page'),
@@ -402,9 +400,9 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             scope: this,
             allowMultiple: true
         });
-        
+
         this.initDeleteAction();
-        
+
         this.action_tagsMassAttach = new Tine.widgets.tags.TagsMassAttachAction({
             hidden:         ! this.recordClass.getField('tags'),
             selectionModel: this.grid.getSelectionModel(),
@@ -420,7 +418,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             updateHandler:  this.loadGridData.createDelegate(this),
             app:            this.app
         });        
-        
+
         // add actions to updater
         this.actionUpdater.addActions([
             this.action_addInNewWindow,
@@ -430,11 +428,11 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             this.action_tagsMassDetach,
             this.action_editCopyInNewWindow
         ]);
-        
+
         // init actionToolbar (needed for correct fitertoolbar init atm -> fixme)
         this.getActionToolbar();
     },
-    
+
     initDeleteAction: function() {
         // note: unprecise plural form here, but this is hard to change
         this.action_deleteRecord = new Ext.Action({
@@ -450,7 +448,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             scope: this
         });
     },
-    
+
     /**
      * init store
      * @private
@@ -479,27 +477,27 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 recordClass: this.recordClass
             });
         }
-        
+
         // init autoRefresh
         this.autoRefreshTask = new Ext.util.DelayedTask(this.loadGridData, this, [{
             removeStrategy: 'keepBuffered',
             autoRefresh: true
         }]);
     },
-    
+
     /**
      * returns view row class
      */
     getViewRowClass: function(record, index, rowParams, store) {
         var noLongerInFilter = record.not_in_filter;
-        
+
         var className = '';
         if (noLongerInFilter) {
             className += 'tine-grid-row-nolongerinfilter';
         }
         return className;    
     },    
-    
+
     /**
      * new entry event -> add new record to store
      * 
@@ -507,7 +505,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @return {Boolean}
      */
     onStoreNewEntry: function(recordData) {
-        
+
         var initialData = null;
         if (Ext.isFunction(this.recordClass.getDefaultData)) {
             initialData = Ext.apply(this.recordClass.getDefaultData(), recordData);
@@ -516,7 +514,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         }
         var record = new this.recordClass(initialData);
         this.store.insert(0 , [record]);
-        
+
         if (this.usePagingToolbar) {
             this.pagingToolbar.refresh.disable();
         }
@@ -527,15 +525,15 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 this.store.remove(record);
                 this.store.insert(0 , [newRecord]);
                 this.store.resumeEvents();
-                
+
                 this.addToEditBuffer(newRecord);
-                
+
                 this.loadGridData({
                     removeStrategy: 'keepBuffered'
                 });
             }
         });
-            
+
         return true;
     },
 
@@ -556,7 +554,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             removeStrategy:     'default'
         });
     },
-    
+
     /**
      * called when Records have been added to the Store
      */
@@ -577,23 +575,23 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * called when the store gets updated, e.g. from editgrid
      */
     onStoreUpdate: function(store, record, operation) {
-         
+
         switch (operation) {
             case Ext.data.Record.EDIT:
-            
+
                 this.addToEditBuffer(record);
                 if (this.usePagingToolbar) {
                     this.pagingToolbar.refresh.disable();
                 }
-                
+
                 this.recordProxy.saveRecord(record, {
                     scope: this,
                     success: function(updatedRecord) {
                         store.commitChanges();
-                        
+
                         // update record in store to prevent concurrency problems
                         record.data = updatedRecord.data;
-                        
+
                         this.loadGridData({
                             removeStrategy: 'keepBuffered'
                         });
@@ -605,12 +603,12 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 break;
         }
     },
-    
+
     /**
      * called before store queries for data
      */
     onStoreBeforeload: function(store, options) {
-        
+
         // define a transaction
         this.lastStoreTransactionId = options.transactionId = Ext.id();
 
@@ -618,18 +616,18 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         // allways start with an empty filter set!
         // this is important for paging and sort header!
         options.params.filter = [];
-        
+
         if (! options.removeStrategy || options.removeStrategy !== 'keepBuffered') {
             this.editBuffer = [];
         }
-        
+
 //        options.preserveSelection = options.hasOwnProperty('preserveSelection') ? options.preserveSelection : true;
 //        options.preserveScroller = options.hasOwnProperty('preserveScroller') ? options.preserveScroller : true;
-        
+
         // fix nasty paging tb
         Ext.applyIf(options.params, this.defaultPaging);
     },
-    
+
     /**
      * called after a new set of Records has been loaded
      * 
@@ -644,8 +642,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
 //        if (this.store.getCount() > 0) {
 //            this.grid.getView().focusRow(0);
 //        }
-        
-       
+
         // restore selection
         if (Ext.isArray(options.preserveSelection)) {
             Ext.each(options.preserveSelection, function(record) {
@@ -655,18 +652,18 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 }
             }, this);
         }
-        
+
         // restore scroller
         if (Ext.isNumber(options.preserveScroller)) {
             this.grid.getView().scroller.dom.scrollTop = options.preserveScroller;
         }
-        
+
         // reset autoRefresh
         if (window.isMainWindow && this.autoRefreshInterval) {
             this.autoRefreshTask.delay(this.autoRefreshInterval * 1000);
         }
     },
-    
+
     /**
      * on store load exception
      * 
@@ -676,21 +673,21 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @param {Object} options
      */
     onStoreLoadException: function(proxy, type, error, options) {
-             
+
         // reset autoRefresh
         if (window.isMainWindow && this.autoRefreshInterval) {
             this.autoRefreshTask.delay(this.autoRefreshInterval * 5000);
         }
-        
+
         if (this.usePagingToolbar && this.pagingToolbar.refresh) {
             this.pagingToolbar.refresh.enable();
         }
-        
+
         if (! options.autoRefresh) {
             proxy.handleRequestException(error);
         }
     },
-    
+
     /**
      * onStoreBeforeLoadRecords
      * 
@@ -700,36 +697,36 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @param {Ext.data.Store} store
      */
     onStoreBeforeLoadRecords: function(o, options, success, store) {
-              
+
         if (this.lastStoreTransactionId && options.transactionId && this.lastStoreTransactionId !== options.transactionId) {
             Tine.log.debug('cancelling old transaction request.');
             return false;
         }
-        
+
         // save selection -> will be applied onLoad
         if (options.preserveSelection) {
             options.preserveSelection = this.grid.getSelectionModel().getSelections();
         }
-        
+
         // save scroller -> will be applied onLoad
         if (options.preserveScroller) {
             options.preserveScroller = this.grid.getView().scroller.dom.scrollTop;
         }
-        
+
         // apply removeStrategy
         if (! options.removeStrategy || options.removeStrategy === 'default') {
             return true;
         }
-        
+
         var records = [],
             recordsIds = [],
             newRecordCollection = new Ext.util.MixedCollection();
-            
+
         // fill new collection
         Ext.each(o.records, function(record) {
             newRecordCollection.add(record.id, record);
         });
-        
+
         // assemble update & keep
         this.store.each(function(record) {
             var newRecord = newRecordCollection.get(record.id);
@@ -743,7 +740,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 recordsIds.push(record.id);
             }
         }, this);
-        
+
         // assemble adds
         newRecordCollection.each(function(record, idx) {
             if (recordsIds.indexOf(record.id) == -1 && this.deleteQueue.indexOf(record.id) == -1) {
@@ -753,10 +750,10 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 recordsIds.splice(lastRecordIdx+1, 0, record.id);
             }
         }, this);
-        
+
         o.records = records;
     },
-    
+
     /**
      * perform the initial load of grid data
      */
@@ -772,12 +769,12 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 typeof this.autoLoad == 'object' ?
                     this.autoLoad : undefined]);
         }
-        
+
         if (this.usePagingToolbar && this.recordProxy) {
             this.pagingToolbar.refresh.disable.defer(10, this.pagingToolbar.refresh);
         }
     },
-    
+
     /**
      * init ext grid panel
      * @private
@@ -796,7 +793,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 this.detailsPanel.onDetailsUpdate(sm);
             }
         }, this);
-        
+
         if (this.usePagingToolbar) {
             this.pagingToolbar = new Ext.ux.grid.PagingToolbar(Ext.apply({
                 pageSize: this.defaultPaging && this.defaultPaging.limit ? this.defaultPaging.limit : 50,
@@ -813,7 +810,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 this.grid.getView().isPagingRefresh = true;
             }, this);
         }
-        
+
         // init view
         var view =  new Ext.grid.GridView({
             getRowClass: this.getViewRowClass,
@@ -826,40 +823,40 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                     this.grid.getView().isPagingRefresh = false;
                     return true;
                 }
-                
+
                 return false;
             }, this)
         });
-        
+
         // which grid to use?
         var Grid = this.gridConfig.quickaddMandatory ? Ext.ux.grid.QuickaddGridPanel : Ext.grid.GridPanel;
-        
+
         this.gridConfig.store = this.store;
-        
+
         // activate grid header menu for column selection
         this.gridConfig.plugins = this.gridConfig.plugins ? this.gridConfig.plugins : [];
         this.gridConfig.plugins.push(new Ext.ux.grid.GridViewMenuPlugin({}));
         this.gridConfig.enableHdMenu = false;
-        
+
         if (this.stateful) {
             this.gridConfig.stateful = true;
             this.gridConfig.stateId  = this.stateId + '-Grid';
         }
-        
+
         this.grid = new Grid(Ext.applyIf(this.gridConfig, {
             border: false,
             store: this.store,
             sm: this.selectionModel,
             view: view
         }));
-        
+
         // init various grid / sm listeners
         this.grid.on('keydown',     this.onKeyDown,         this);
         this.grid.on('rowclick',    this.onRowClick,        this);
         this.grid.on('rowdblclick', this.onRowDblClick,     this);
         this.grid.on('newentry',    this.onStoreNewEntry,   this);
         this.grid.on('headerclick', this.onHeaderClick,   this);
-        
+
         this.grid.on('rowcontextmenu', function(grid, row, e) {
             e.stopEvent();
             var selModel = grid.getSelectionModel();
@@ -868,14 +865,14 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 this.updateOnSelectionChange = this.updateDetailsPanelOnCtxMenu;
                 selModel.selectRow(row);
             }
-            
+
             this.getContextMenu().showAt(e.getXY());
             // reset preview update
             this.updateOnSelectionChange = true;
         }, this);
-        
+
     },
-    
+
     /**
      * executed after outer panel rendering process
      */
@@ -883,7 +880,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         Tine.widgets.grid.GridPanel.superclass.afterRender.apply(this, arguments);
         this.initialLoad();
     },
-    
+
     /**
      * trigger store load with grid related options
      * 
@@ -893,90 +890,84 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * @param {Object} options
      */
     loadGridData: function(options) {
-       var options = options || {};
-       
+        var options = options || {};
+
         Ext.applyIf(options, {
             callback:           Ext.emptyFn,
             scope:              this,
             params:             {},
-            
+
             preserveCursor:     true, 
             preserveSelection:  true, 
             preserveScroller:   true, 
             removeStrategy:     'default'
         });
-        
+
         if (options.preserveCursor && this.usePagingToolbar) {
             options.params.start = this.pagingToolbar.cursor;
         }
-        
+
         this.store.load(options);
     },
-    
+
     /**
      * get action toolbar
      * 
      * @return {Ext.Toolbar}
      */
     getActionToolbar: function() {
-        try {
-            if (! this.actionToolbar) {
-                var additionalItems = this.getActionToolbarItems();
-                
-                this.actionToolbar = new Ext.Toolbar({
-                    items: [{
-                        xtype: 'buttongroup',
-    //                    columns: 3 + (Ext.isArray(additionalItems) ? additionalItems.length : 0),
-                        plugins: [{
-                            ptype: 'ux.itemregistry',
-                            key:   this.app.appName + '-GridPanel-ActionToolbar-leftbtngrp'
-                        }],
-                        items: [
-                            Ext.apply(new Ext.SplitButton(this.action_addInNewWindow), {
-                                scale: 'medium',
-                                rowspan: 2,
-                                iconAlign: 'top',
-                                arrowAlign:'right',
-                                menu: new Ext.menu.Menu({
-                                    items: [],
-                                    plugins: [{
-                                        ptype: 'ux.itemregistry',
-                                        key:   'Tine.widgets.grid.GridPanel.addButton'
-                                    }]
-                                })
-                            }),
-                            Ext.apply(new Ext.Button(this.action_editInNewWindow), {
-                                scale: 'medium',
-                                rowspan: 2,
-                                iconAlign: 'top'
-                            }),
-                            Ext.apply(new Ext.Button(this.action_deleteRecord), {
-                                scale: 'medium',
-                                rowspan: 2,
-                                iconAlign: 'top'
-                            }),
-                            Ext.apply(new Ext.Button(this.actions_print), {
-                                scale: 'medium',
-                                rowspan: 2,
-                                iconAlign: 'top'
-                            })
-                        ].concat(Ext.isArray(additionalItems) ? additionalItems : [])
-                    }].concat(Ext.isArray(additionalItems) ? [] : [additionalItems])
-                });
-                
-                if (this.filterToolbar && typeof this.filterToolbar.getQuickFilterField == 'function') {
-                    this.actionToolbar.add('->', this.filterToolbar.getQuickFilterField());
-                } 
-            }
+        if (! this.actionToolbar) {
+            var additionalItems = this.getActionToolbarItems();
 
-            return this.actionToolbar;
+            this.actionToolbar = new Ext.Toolbar({
+                items: [{
+                    xtype: 'buttongroup',
+//                    columns: 3 + (Ext.isArray(additionalItems) ? additionalItems.length : 0),
+                    plugins: [{
+                        ptype: 'ux.itemregistry',
+                        key:   this.app.appName + '-GridPanel-ActionToolbar-leftbtngrp'
+                    }],
+                    items: [
+                        Ext.apply(new Ext.SplitButton(this.action_addInNewWindow), {
+                            scale: 'medium',
+                            rowspan: 2,
+                            iconAlign: 'top',
+                            arrowAlign:'right',
+                            menu: new Ext.menu.Menu({
+                                items: [],
+                                plugins: [{
+                                    ptype: 'ux.itemregistry',
+                                    key:   'Tine.widgets.grid.GridPanel.addButton'
+                                }]
+                            })
+                        }),
+                        Ext.apply(new Ext.Button(this.action_editInNewWindow), {
+                            scale: 'medium',
+                            rowspan: 2,
+                            iconAlign: 'top'
+                        }),
+                        Ext.apply(new Ext.Button(this.action_deleteRecord), {
+                            scale: 'medium',
+                            rowspan: 2,
+                            iconAlign: 'top'
+                        }),
+                        Ext.apply(new Ext.Button(this.actions_print), {
+                            scale: 'medium',
+                            rowspan: 2,
+                            iconAlign: 'top'
+                        })
+                    ].concat(Ext.isArray(additionalItems) ? additionalItems : [])
+                }].concat(Ext.isArray(additionalItems) ? [] : [additionalItems])
+            });
 
-        } catch (e) {
-            Tine.log.err('Tine.widgets.grid.GridPanel::getActionToolbar');
-            Tine.log.err(e.stack ? e.stack : e);
+            if (this.filterToolbar && typeof this.filterToolbar.getQuickFilterField == 'function') {
+                this.actionToolbar.add('->', this.filterToolbar.getQuickFilterField());
+            } 
         }
+
+        return this.actionToolbar;
     },
-    
+
     /**
      * template fn for subclasses to add custom items to action toolbar
      * 
@@ -984,22 +975,22 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      */
     getActionToolbarItems: function() {
         var items = this.actionToolbarItems || [];
-        
+
         if (! Ext.isEmpty(items)) {
             // legacy handling! subclasses should register all actions when initializing actions
             this.actionUpdater.addActions(items);
         }
-        
+
         return items;
     },
-    
+
     /**
      * returns rows context menu
      * 
      * @return {Ext.menu.Menu}
      */
     getContextMenu: function() {
-                
+
         if (! this.contextMenu) {
             var items = [
                 this.action_addInNewWindow,
@@ -1007,11 +998,11 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 this.action_editInNewWindow,
                 this.action_deleteRecord
             ];
-            
+
             if (! this.action_tagsMassAttach.hidden) {
                 items.push('-', this.action_tagsMassAttach, this.action_tagsMassDetach);
             }
-            
+
             // lookup additional items
             items = items.concat(this.getContextMenuItems());
 
@@ -1023,7 +1014,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                     key:   this.app.appName + '-GridPanel-ContextMenu-New'
                 }]
             });
-            
+
             this.newRecordAction = new Ext.Action({
                 text: this.app.i18n._('New...'),
                 hidden: ! this.newRecordMenu.items.length,
@@ -1031,7 +1022,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 scope: this,
                 menu: this.newRecordMenu
             });
-            
+
             items.push(this.newRecordAction);
 
             // Add to record of another app            
@@ -1042,7 +1033,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                     key:   this.app.appName + '-GridPanel-ContextMenu-Add'
                 }]
             });
-            
+
             this.addToRecordAction = new Ext.Action({
                 text: this.app.i18n._('Add to...'),
                 hidden: ! this.addToRecordMenu.items.length,
@@ -1050,9 +1041,9 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 scope: this,
                 menu: this.addToRecordMenu
             });            
-            
+
             items.push(this.addToRecordAction);
-            
+
             this.contextMenu = new Ext.menu.Menu({
                 items: items,
                 plugins: [{
@@ -1061,10 +1052,10 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 }]
             });
         }
-        
+
         return this.contextMenu;
     },
-    
+
     /**
      * template fn for subclasses to add custom items to context menu
      * 
@@ -1072,17 +1063,15 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      */
     getContextMenuItems: function() {
         var items = this.contextMenuItems || [];
-        
-       
-        
+
         if (! Ext.isEmpty(items)) {
             // legacy handling! subclasses should register all actions when initializing actions
             this.actionUpdater.addActions(items);
         }
-        
+
         return items;
     },
-    
+
     /**
      * get modlog columns
      * 
@@ -1095,7 +1084,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             { id: 'last_modified_time', header: _('Last Modified Time'),    dataIndex: 'last_modified_time',    renderer: Tine.Tinebase.common.dateRenderer,        hidden: true },
             { id: 'last_modified_by',   header: _('Last Modified By'),      dataIndex: 'last_modified_by',      renderer: Tine.Tinebase.common.usernameRenderer,    hidden: true }
         ];
-        
+
         return result;
     },
 
@@ -1108,7 +1097,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         var modelName = this.recordClass.getMeta('appName') + '_Model_' + this.recordClass.getMeta('modelName'),
             cfConfigs = Tine.widgets.customfields.ConfigManager.getConfigs(this.app, modelName),
             result = [];
-            
+
         Ext.each(cfConfigs, function(cfConfig) {
             result.push({
                 id: cfConfig.id,
@@ -1120,10 +1109,10 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 hidden: true
             });
         }, this);
-        
+
         return result;
     },
-    
+
     /**
      * get custom field filter for filter toolbar
      * 
@@ -1136,10 +1125,10 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         Ext.each(cfConfigs, function(cfConfig) {
             result.push({filtertype: 'tinebase.customfield', app: this.app, cfConfig: cfConfig});
         }, this);
-        
+
         return result;
     },
-    
+
     /**
      * returns filter toolbar
      * @private
@@ -1151,7 +1140,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             this.quickSearchFilterToolbarPlugin = new Tine.widgets.grid.FilterToolbarQuickFilterPlugin();
             plugins.push(this.quickSearchFilterToolbarPlugin);
         }
-        
+
         return new Tine.widgets.grid.FilterPanel(Ext.apply(config, {
             app: this.app,
             recordClass: this.recordClass,
@@ -1161,7 +1150,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             plugins: plugins
         }));
     },
-    
+
     /**
      * return store from grid
      * 
@@ -1170,7 +1159,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
     getStore: function() {
         return this.grid.getStore();
     },
-    
+
     /**
      * return view from grid
      * 
@@ -1179,7 +1168,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
     getView: function() {
         return this.grid.getView();
     },
-    
+
     /**
      * return grid
      * 
@@ -1188,7 +1177,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
     getGrid: function() {
         return this.grid;
     },
-    
+
     /**
      * key down handler
      * @private
@@ -1233,7 +1222,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             }
         }
     },
-    
+
     /**
      * row click handler
      * 
@@ -1251,15 +1240,15 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             });
         }
         */
-        
+
         // fix selection of one record if shift/ctrl key is not pressed any longer
         if(e.button === 0 && !e.shiftKey && !e.ctrlKey) {
             var sm = grid.getSelectionModel();
-            
+
             if (sm.getCount() == 1 && sm.isSelected(row)) {
                 return;
             }
-            
+
             sm.clearSelections();
             sm.selectRow(row, false);
             grid.view.focusRow(row);
@@ -1276,7 +1265,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
     onRowDblClick: function(grid, row, e) {
         this.onEditInNewWindow.call(this, {actionType: 'edit'});
     }, 
-    
+
     /**
      * generic edit in new window handler
      */
@@ -1289,25 +1278,25 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             }
             var selectedRows = this.grid.getSelectionModel().getSelections();
             var selectedRecords = [];
-            
+
             Ext.each(selectedRows,function(el){
                 selectedRecords.push(el.data);
             });
-            
+
             record = selectedRows[0];
         } else {
             record = new this.recordClass(this.recordClass.getDefaultData(), 0);
         }
-        
+
         var useMultiple = ((this.selectionModel.getCount() > 1) && (this.multipleEdit) && (button.actionType == 'edit')),
             selectedRecords = [];
-        
+
         if (useMultiple && ! this.selectionModel.isFilterSelect ) {
             Ext.each(this.selectionModel.getSelections(), function(record) {
                 selectedRecords.push(record.data);
             }, this );
         }
-        
+
         var editDialogClass = this.editDialogClass || Tine[this.app.appName][this.recordClass.getMeta('modelName') + 'EditDialog'],
             config = null,
             popupWindow = editDialogClass.openWindow(Ext.copyTo(
@@ -1326,11 +1315,11 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             }, 'useMultiple,selectedRecords,selectionFilter,record,listeners,copyRecord')
         );
     },
-    
+
     onUpdateMultipleRecords: function() {
         this.store.reload();
     },
-    
+
     /**
      * on update after edit
      * 
@@ -1343,14 +1332,14 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
         } else if (record && Ext.isFunction(record.copy)) {
             record = record.copy();
         }
-        
+
         if (record && Ext.isFunction(record.copy)) {
             var idx = this.getStore().indexOfId(record.id);
             if (idx >=0) {
                 var isSelected = this.getGrid().getSelectionModel().isSelected(idx);
                 this.getStore().removeAt(idx);
                 this.getStore().insert(idx, [record]);
-                
+
                 if (isSelected) {
                     this.getGrid().getSelectionModel().selectRow(idx, true);
                 }
@@ -1359,7 +1348,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             }
             this.addToEditBuffer(record);
         }
-        
+
         if (mode == 'local') {
             this.onStoreUpdate(this.getStore(), record, Ext.data.Record.EDIT);
         } else {
@@ -1368,7 +1357,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             });
         }
     },
-    
+
     /**
      * add record to edit buffer
      * 
@@ -1378,18 +1367,18 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
 
         var recordData = (Ext.isString(record)) ? Ext.decode(record) : record.data,
             id = recordData[this.recordClass.getMeta('idProperty')];
-        
+
         if (this.editBuffer.indexOf(id) === -1) {
             this.editBuffer.push(id);
         }
     },
-    
+
     /**
      * generic delete handler
      */
     onDeleteRecords: function(btn, e) {
         var sm = this.grid.getSelectionModel();
-        
+
         if (sm.isFilterSelect && ! this.filterSelectionDelete) {
             Ext.MessageBox.show({
                 title: _('Not Allowed'), 
@@ -1397,11 +1386,11 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 buttons: Ext.Msg.OK,
                 icon: Ext.MessageBox.INFO
             });
-            
+
             return;
         }
         var records = sm.getSelections();
-        
+
         if (Tine[this.app.appName].registry.containsKey('preferences') 
             && Tine[this.app.appName].registry.get('preferences').containsKey('confirmDelete')
             && Tine[this.app.appName].registry.get('preferences').get('confirmDelete') == 0
@@ -1413,7 +1402,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             if (records.length > 1) {
                 recordNames += ', ...';
             }
-            
+
             var i18nQuestion = this.i18nDeleteQuestion ?
                 this.app.i18n.n_hidden(this.i18nDeleteQuestion[0], this.i18nDeleteQuestion[1], records.length) :
                 String.format(Tine.Tinebase.translation.ngettext('Do you really want to delete the selected record ({0})?',
@@ -1425,7 +1414,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
             }, this);
         }
     },
-    
+
     /**
      * delete records
      * 
@@ -1439,12 +1428,12 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 this.store.remove(record);
             });
         }
-        
+
         if (this.recordProxy) {
             if (this.usePagingToolbar) {
                 this.pagingToolbar.refresh.disable();
             }
-            
+
             var i18nItems = this.app.i18n.n_hidden(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), records.length),
                 recordIds = [].concat(records).map(function(v){ return v.id; });
 
@@ -1456,9 +1445,9 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 }
                 this.deleteMask.show();
             }
-            
+
             this.deleteQueue = this.deleteQueue.concat(recordIds);
-            
+
             var options = {
                 scope: this,
                 success: function() {
@@ -1471,30 +1460,30 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                     Ext.MessageBox.alert(_('Failed'), String.format(_('Could not delete {0}.'), i18nItems)); 
                 }
             };
-            
+
             if (sm.isFilterSelect && this.filterSelectionDelete) {
-               this.recordProxy.deleteRecordsByFilter(sm.getSelectionFilter(), options);
+                this.recordProxy.deleteRecordsByFilter(sm.getSelectionFilter(), options);
             } else {
                 this.recordProxy.deleteRecords(records, options);
             }
         }
     },
-    
+
     /**
      * refresh after delete (hide delete mask or refresh paging toolbar)
      */
     refreshAfterDelete: function(ids) {
         this.deleteQueue = this.deleteQueue.diff(ids);
-        
+
         if (this.deleteMask) {
             this.deleteMask.hide();
         }
-        
+
         if (this.usePagingToolbar) {
             this.pagingToolbar.refresh.show();
         }
     },
-    
+
     /**
      * do something after deletion of records
      * - reload the store
@@ -1503,7 +1492,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      */
     onAfterDelete: function(ids) {
         this.editBuffer = this.editBuffer.diff(ids);
-        
+
         this.loadGridData({
             removeStrategy: 'keepBuffered'
         });
index 33b583f..7d9ce77 100644 (file)
@@ -107,27 +107,22 @@ Tine.widgets.grid.RendererManager = function() {
          * @param {String} category {gridPanel|displayPanel} optional.
          */
         get: function(appName, modelName, fieldName, category) {
-            try  {
-                var appName = Ext.isString(appName) ? appName : appName.appName,
-                    modelName = Ext.isFunction(modelName) ? modelName.getMeta('modelName') : modelName,
-                    categoryKey = [appName, modelName, fieldName, category].join('_'),
-                    genericKey = [appName, modelName, fieldName].join('_');
-                    
-                // check for registered renderer
-                var renderer = renderers[categoryKey] ? renderers[categoryKey] : renderers[genericKey];
+            var appName = Ext.isString(appName) ? appName : appName.appName,
+                modelName = Ext.isFunction(modelName) ? modelName.getMeta('modelName') : modelName,
+                categoryKey = [appName, modelName, fieldName, category].join('_'),
+                genericKey = [appName, modelName, fieldName].join('_');
                 
-                // check for common names
-                if (! renderer) {
-                    renderer = this.getByFieldname(fieldName);
-                }
-                
-                // check for known datatypes
-                if (! renderer) {
-                    renderer = this.getByDataType(appName, modelName, fieldName);
-                }
-            } catch (e) {
-                Tine.log.err('Tine.widgets.grid.RendererManager::get');
-                Tine.log.err(e.stack ? e.stack : e);
+            // check for registered renderer
+            var renderer = renderers[categoryKey] ? renderers[categoryKey] : renderers[genericKey];
+            
+            // check for common names
+            if (! renderer) {
+                renderer = this.getByFieldname(fieldName);
+            }
+            
+            // check for known datatypes
+            if (! renderer) {
+                renderer = this.getByDataType(appName, modelName, fieldName);
             }
             
             return renderer ? renderer : this.defaultRenderer;
@@ -143,17 +138,12 @@ Tine.widgets.grid.RendererManager = function() {
          * @param {String} category {gridPanel|displayPanel} optional.
          */
         register: function(appName, modelName, fieldName, renderer, category) {
-            try  {
-                var appName = Ext.isString(appName) ? appName : appName.appName,
-                    modelName = Ext.isFunction(modelName) ? modelName.getMeta('modelName') : modelName,
-                    categoryKey = [appName, modelName, fieldName, category].join('_'),
-                    genericKey = [appName, modelName, fieldName].join('_');
-                    
-                renderers[category ? categoryKey : genericKey] = renderer;
-            } catch (e) {
-                Tine.log.err('Tine.widgets.grid.RendererManager::register');
-                Tine.log.err(e.stack ? e.stack : e);
-            }
+            var appName = Ext.isString(appName) ? appName : appName.appName,
+                modelName = Ext.isFunction(modelName) ? modelName.getMeta('modelName') : modelName,
+                categoryKey = [appName, modelName, fieldName, category].join('_'),
+                genericKey = [appName, modelName, fieldName].join('_');
+                
+            renderers[category ? categoryKey : genericKey] = renderer;
         }
     };
 }();
\ No newline at end of file
index 0ad423b..93cf38b 100644 (file)
@@ -377,23 +377,18 @@ Tine.widgets.persistentfilter.PickerPanel = Ext.extend(Ext.tree.TreePanel, {
      * save persistent filter
      */
     saveFilter : function() {
-        try {
-            var ftb = this.getFilterToolbar();
-            
-            var record = this.getNewEmptyRecord();
-            
-            record.set('filters', ftb.getAllFilterData());
-            
-            // recheck that current ftb is saveable
-            if (!ftb.isSaveAllowed()) {
-                Ext.Msg.alert(_('Could not save Favorite'), _('Your current view does not support favorites'));
-                return;
-            }
-            this.getEditWindow(record);
-        } catch (e) {
-            Tine.log.err('Tine.widgets.persistentfilter.PickerPanel::saveFilter');
-            Tine.log.err(e.stack ? e.stack : e);
+        var ftb = this.getFilterToolbar();
+        
+        var record = this.getNewEmptyRecord();
+        
+        record.set('filters', ftb.getAllFilterData());
+        
+        // recheck that current ftb is saveable
+        if (!ftb.isSaveAllowed()) {
+            Ext.Msg.alert(_('Could not save Favorite'), _('Your current view does not support favorites'));
+            return;
         }
+        this.getEditWindow(record);
     },
     
     getEditWindow: function(record) {
@@ -476,28 +471,24 @@ Tine.widgets.persistentfilter.PickerPanel = Ext.extend(Ext.tree.TreePanel, {
     
     
     getNewEmptyRecord: function() {
-        try {
-            var model = this.filterModel;
-            if (!model) {
-                var recordClass = this.recordClass || this.treePanel
-                    ? this.treePanel.recordClass
-                    : ftb.store.reader.recordType;
-                model = recordClass.getMeta('appName') + '_Model_' + recordClass.getMeta('modelName') + 'Filter';
-            }
-
-            var record = new Tine.widgets.persistentfilter.model.PersistentFilter({
-                application_id : this.app.id,
-                account_id : Tine.Tinebase.registry.get('currentAccount').accountId,
-                model : model,
-                filters : null,
-                name : null,
-                description : null
-            });
-            
-            return record;
-        } catch (e) {
-            Tine.log.err(e.stack ? e.stack : e);
+        var model = this.filterModel;
+        if (!model) {
+            var recordClass = this.recordClass || this.treePanel
+                ? this.treePanel.recordClass
+                : ftb.store.reader.recordType;
+            model = recordClass.getMeta('appName') + '_Model_' + recordClass.getMeta('modelName') + 'Filter';
         }
+
+        var record = new Tine.widgets.persistentfilter.model.PersistentFilter({
+            application_id : this.app.id,
+            account_id : Tine.Tinebase.registry.get('currentAccount').accountId,
+            model : model,
+            filters : null,
+            name : null,
+            description : null
+        });
+        
+        return record;
     }
 
 });
index 356607b..2be3b0f 100644 (file)
@@ -58,21 +58,17 @@ Tine.widgets.relation.FilterModel = Ext.extend(Tine.widgets.grid.FilterModel, {
         console.log(operator);
         console.log(Tine.Tinebase.data.RecordMgr.get(operator));
         
-        try {
-            if (! filter.sheet) {
-                filter.sheet = new Tine.widgets.grid.FilterToolbar({
-                    recordClass: Tine.Tinebase.data.RecordMgr.get(operator),
-                    defaultFilter: 'query'
-                });
-                
-                this.ftb.addFilterSheet(filter.sheet);
-            }
+        if (! filter.sheet) {
+            filter.sheet = new Tine.widgets.grid.FilterToolbar({
+                recordClass: Tine.Tinebase.data.RecordMgr.get(operator),
+                defaultFilter: 'query'
+            });
             
-            this.ftb.setActiveSheet(filter.sheet);
-            filter.formFields.value.setText(_('Defined by ...'));
-        } catch (e) {
-            console.error(e.stack);
+            this.ftb.addFilterSheet(filter.sheet);
         }
+        
+        this.ftb.setActiveSheet(filter.sheet);
+        filter.formFields.value.setText(_('Defined by ...'));
     },
     
     /**