Merge branch '2013.03'
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 23 Sep 2013 14:38:17 +0000 (16:38 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 23 Sep 2013 14:38:17 +0000 (16:38 +0200)
tine20/Calendar/js/EventEditDialog.js
tine20/Calendar/js/GridView.js
tine20/Calendar/js/MainScreenCenterPanel.js
tine20/Felamimail/js/MessageEditDialog.js

index 2bb67e2..fcebf46 100644 (file)
@@ -378,13 +378,23 @@ Tine.Calendar.EventEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
         this.validateDtEnd();
     },
     
+    /**
+     * on dt start change
+     * 
+     * @param {} dtStartField
+     * @param {} newValue
+     * @param {} oldValue
+     */
     onDtStartChange: function(dtStartField, newValue, oldValue) {
         if (Ext.isDate(newValue) && Ext.isDate(oldValue)) {
-            var diff = newValue.getTime() - oldValue.getTime();
-            var dtEndField = this.getForm().findField('dtend');
-            var dtEnd = dtEndField.getValue();
+            var dtEndField = this.getForm().findField('dtend'),
+                dtEnd = dtEndField.getValue();
+                
             if (Ext.isDate(dtEnd)) {
-                dtEndField.setValue(dtEnd.add(Date.MILLI, diff));
+                var duration = dtEnd.getTime() - oldValue.getTime(),
+                    newDtEnd = newValue.add(Date.MILLI, duration);
+                
+                dtEndField.setValue(newDtEnd);
             }
         }
     },
index 3684ae2..3bfc849 100644 (file)
@@ -163,7 +163,9 @@ Tine.Calendar.GridView = Ext.extend(Ext.grid.GridPanel, {
                 hidden: true,
                 dataIndex: 'description',
                 renderer: function(description, metaData, record) {
-                    metaData.attr = 'ext:qtip="' + Ext.util.Format.nl2br(Ext.util.Format.htmlEncode(Ext.util.Format.htmlEncode(description))) + '"';
+                    if (metaData) {
+                        metaData.attr = 'ext:qtip="' + Ext.util.Format.nl2br(Ext.util.Format.htmlEncode(Ext.util.Format.htmlEncode(description))) + '"';
+                    }
                     return Ext.util.Format.htmlEncode(description);
                 }
             }/*, {
index edcbe7a..a06a165 100644 (file)
@@ -671,7 +671,7 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
            this.loadMask.show();
         }
         
-        if (event.isRecurInstance() || event.isRecurException() || (event.isRecurBase() && ! event.get('rrule').newrule)) {
+        if (event.id && (event.isRecurInstance() || event.isRecurException() || (event.isRecurBase() && ! event.get('rrule').newrule))) {
             Tine.widgets.dialog.MultiOptionsDialog.openWindow({
                 title: this.app.i18n._('Update Event'),
                 height: 170,
index 042a556..515c1b9 100644 (file)
@@ -656,12 +656,20 @@ Tine.Felamimail.MessageEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
         var account = Tine.Tinebase.appMgr.get('Felamimail').getAccountStore().getById(this.record.get('account_id')),
             folderName = account.get(folderField);
         
+        Tine.log.debug('onSaveInFolder() - Save message in folder ' + folderName);
+        Tine.log.debug(this.record);
+            
         if (! folderName || folderName == '') {
             Ext.MessageBox.alert(
-                this.app.i18n._('Failed'), 
+                _('Failed'),
                 String.format(this.app.i18n._('{0} account setting empty.'), folderField)
             );
-        } else if (this.isValid()) {
+        } else if (this.attachmentGrid.isUploading()) {
+            Ext.MessageBox.alert(
+                _('Failed'),
+                this.app.i18n._('Files are still uploading.')
+            );
+        } else {
             this.loadMask.show();
             this.recordProxy.saveInFolder(this.record, folderName, {
                 scope: this,
@@ -670,11 +678,12 @@ Tine.Felamimail.MessageEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
                     this.purgeListeners();
                     this.window.close();
                 },
-                failure: this.onRequestFailed,
+                failure: Tine.Felamimail.handleRequestException.createInterceptor(function() {
+                        this.loadMask.hide();
+                    }, this
+                ),
                 timeout: 150000 // 3 minutes
             });
-        } else {
-            Ext.MessageBox.alert(_('Errors'), _('Please fix the errors noted.'));
         }
     },
     
@@ -990,7 +999,6 @@ Tine.Felamimail.MessageEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
             result = this.validateRecipients();
         }
         
-        
         return (result && Tine.Felamimail.MessageEditDialog.superclass.isValid.call(this));
     },