Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel/Record.js') (more/less context) (show 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 ffb45de..ecb6c37 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js | |||
@@ -618,53 +618,55 @@ console.log("Record.processData - currentVersionParameters", currentVersionParam | |||
618 | return deferredResult; | 618 | return deferredResult; |
619 | }, | 619 | }, |
620 | 620 | ||
621 | //------------------------------------------------------------------------- | 621 | //------------------------------------------------------------------------- |
622 | 622 | ||
623 | 'syncDirectLoginReferenceValues': function() { | 623 | 'syncDirectLoginReferenceValues': function() { |
624 | //MochiKit.Logging.logDebug(">>> Record.syncDirectLoginReferenceValues"); | 624 | //MochiKit.Logging.logDebug(">>> Record.syncDirectLoginReferenceValues"); |
625 | MochiKit.Iter.forEach(MochiKit.Base.values(this.directLogins()), function(aDirectLogin) { | 625 | MochiKit.Iter.forEach(MochiKit.Base.values(this.directLogins()), function(aDirectLogin) { |
626 | aDirectLogin.record().user().synchronizeDirectLogin(aDirectLogin); | 626 | aDirectLogin.record().user().synchronizeDirectLogin(aDirectLogin); |
627 | }); | 627 | }); |
628 | 628 | ||
629 | MochiKit.Iter.forEach(this.removedDirectLogins(), function(aDirectLogin) { | 629 | MochiKit.Iter.forEach(this.removedDirectLogins(), function(aDirectLogin) { |
630 | aDirectLogin.record().user().removeDirectLogin(aDirectLogin); | 630 | aDirectLogin.record().user().removeDirectLogin(aDirectLogin); |
631 | }); | 631 | }); |
632 | 632 | ||
633 | this.resetRemovedDirectLogins(); | 633 | this.resetRemovedDirectLogins(); |
634 | //MochiKit.Logging.logDebug("<<< Record.syncDirectLoginReferenceValues"); | 634 | //MochiKit.Logging.logDebug("<<< Record.syncDirectLoginReferenceValues"); |
635 | }, | 635 | }, |
636 | 636 | ||
637 | //------------------------------------------------------------------------- | 637 | //------------------------------------------------------------------------- |
638 | 638 | ||
639 | 'saveChanges': function() { | 639 | 'saveChanges': function() { |
640 | var result; | 640 | var result; |
641 | 641 | ||
642 | if (this.isBrandNew() == false) { | 642 | // if (this.isBrandNew() == false) { |
643 | result = this.user().saveRecords([this], 'updateData'); | 643 | // result = this.user().saveRecords([this], 'updateData'); |
644 | } else { | 644 | // } else { |
645 | result = this.user().saveRecords([this], 'addNewRecords'); | 645 | // result = this.user().saveRecords([this], 'addNewRecords'); |
646 | } | 646 | // } |
647 | |||
648 | result = this.user().saveRecords([this]); | ||
647 | 649 | ||
648 | return result; | 650 | return result; |
649 | }, | 651 | }, |
650 | 652 | ||
651 | /* | 653 | /* |
652 | 'saveChanges': function() { | 654 | 'saveChanges': function() { |
653 | var deferredResult; | 655 | var deferredResult; |
654 | varresult; | 656 | varresult; |
655 | 657 | ||
656 | Clipperz.NotificationCenter.notify(this.user(), 'updatedSection', 'records', true); | 658 | Clipperz.NotificationCenter.notify(this.user(), 'updatedSection', 'records', true); |
657 | //MochiKit.Logging.logDebug(">>> Record.saveChanges"); | 659 | //MochiKit.Logging.logDebug(">>> Record.saveChanges"); |
658 | //MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.saveChanges"); | 660 | //MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.saveChanges"); |
659 | if (this.headerNotes() != null) { | 661 | if (this.headerNotes() != null) { |
660 | this.setNotes(this.headerNotes()); | 662 | this.setNotes(this.headerNotes()); |
661 | } | 663 | } |
662 | this.syncDirectLoginReferenceValues(); | 664 | this.syncDirectLoginReferenceValues(); |
663 | this.currentVersion().createNewVersion(); | 665 | this.currentVersion().createNewVersion(); |
664 | 666 | ||
665 | result = {'records': [{}]}; | 667 | result = {'records': [{}]}; |
666 | 668 | ||
667 | deferredResult = new MochiKit.Async.Deferred(); | 669 | deferredResult = new MochiKit.Async.Deferred(); |
668 | deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveCard_collectRecordInfo'); | 670 | deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveCard_collectRecordInfo'); |
669 | deferredResult.addCallback(MochiKit.Base.method(this, 'updateKey')); | 671 | deferredResult.addCallback(MochiKit.Base.method(this, 'updateKey')); |
670 | 672 | ||