Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel/Record.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/DataModel/Record.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Record.js b/frontend/beta/js/Clipperz/PM/DataModel/Record.js index 9e496de..d6ebb39 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js @@ -616,69 +616,71 @@ console.log("Record.processData - currentVersionParameters", currentVersionParam aResult['version'] = Clipperz.PM.Crypto.encryptingFunctions.currentVersion; return aResult; }, result); //MochiKit.Logging.logDebug("--- Record.encryptedData - 6"); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.encryptedData - 5: " + res); return res;}); deferredResult.callback(); //MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.encryptedData"); return deferredResult; }, //------------------------------------------------------------------------- 'syncDirectLoginReferenceValues': function() { //MochiKit.Logging.logDebug(">>> Record.syncDirectLoginReferenceValues"); MochiKit.Iter.forEach(MochiKit.Base.values(this.directLogins()), function(aDirectLogin) { aDirectLogin.record().user().synchronizeDirectLogin(aDirectLogin); }); MochiKit.Iter.forEach(this.removedDirectLogins(), function(aDirectLogin) { aDirectLogin.record().user().removeDirectLogin(aDirectLogin); }); this.resetRemovedDirectLogins(); //MochiKit.Logging.logDebug("<<< Record.syncDirectLoginReferenceValues"); }, //------------------------------------------------------------------------- 'saveChanges': function() { var result; - if (this.isBrandNew() == false) { - result = this.user().saveRecords([this], 'updateData'); - } else { - result = this.user().saveRecords([this], 'addNewRecords'); - } +// if (this.isBrandNew() == false) { +// result = this.user().saveRecords([this], 'updateData'); +// } else { +// result = this.user().saveRecords([this], 'addNewRecords'); +// } + + result = this.user().saveRecords([this]); return result; }, /* 'saveChanges': function() { var deferredResult; var result; Clipperz.NotificationCenter.notify(this.user(), 'updatedSection', 'records', true); //MochiKit.Logging.logDebug(">>> Record.saveChanges"); //MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.saveChanges"); if (this.headerNotes() != null) { this.setNotes(this.headerNotes()); } this.syncDirectLoginReferenceValues(); this.currentVersion().createNewVersion(); result = {'records': [{}]}; deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveCard_collectRecordInfo'); deferredResult.addCallback(MochiKit.Base.method(this, 'updateKey')); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveCard_encryptUserData'); deferredResult.addCallback(MochiKit.Base.method(this.user(), 'encryptedData')); deferredResult.addCallback(function(aResult, res) { aResult['user'] = res; return aResult; }, result); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveCard_encryptRecordData'); |