Completion and preparation contacts to release.

This commit is contained in:
RainLoop Team 2013-12-10 04:40:21 +04:00
parent 45d34e64f4
commit eeda3dbb85
24 changed files with 505 additions and 236 deletions

View file

@ -17,10 +17,52 @@ function AdminContacts()
this.pdoDsnTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.pdoUserTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.pdoPasswordTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.testing = ko.observable(false);
this.testContactsSuccess = ko.observable(false);
this.testContactsError = ko.observable(false);
this.testContactsCommand = Utils.createCommand(this, function () {
this.testContactsSuccess(false);
this.testContactsError(false);
this.testing(true);
RL.remote().testContacts(this.onTestContactsResponse, {
'ContactsPdoDsn': this.pdoDsn(),
'ContactsPdoUser': this.pdoUser(),
'ContactsPdoPassword': this.pdoPassword()
});
}, function () {
return '' !== this.pdoDsn() && '' !== this.pdoUser();
});
this.onTestContactsResponse = _.bind(this.onTestContactsResponse, this);
}
Utils.addSettingsViewModel(AdminContacts, 'AdminSettingsContacts', 'Contacts', 'contacts');
AdminContacts.prototype.onTestContactsResponse = function (sResult, oData)
{
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
this.testContactsSuccess(true);
}
else
{
this.testContactsError(true);
}
this.testing(false);
};
AdminContacts.prototype.onShow = function ()
{
this.testContactsSuccess(false);
this.testContactsError(false);
};
AdminContacts.prototype.onBuild = function ()
{
var self = this;