mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Identities refactoring and improvements (Reply-To and BCC)
This commit is contained in:
parent
3e01887f85
commit
493191375f
43 changed files with 578 additions and 1051 deletions
|
|
@ -581,7 +581,7 @@
|
||||||
var
|
var
|
||||||
sId = Utils.pString(oIdentityData['Id']),
|
sId = Utils.pString(oIdentityData['Id']),
|
||||||
sEmail = Utils.pString(oIdentityData['Email']),
|
sEmail = Utils.pString(oIdentityData['Email']),
|
||||||
oIdentity = new IdentityModel(sId, sEmail, sId !== sAccountEmail)
|
oIdentity = new IdentityModel(sId, sEmail)
|
||||||
;
|
;
|
||||||
|
|
||||||
oIdentity.name(Utils.pString(oIdentityData['Name']));
|
oIdentity.name(Utils.pString(oIdentityData['Name']));
|
||||||
|
|
@ -1410,7 +1410,6 @@
|
||||||
require('Stores/User/App').populate();
|
require('Stores/User/App').populate();
|
||||||
require('Stores/User/Settings').populate();
|
require('Stores/User/Settings').populate();
|
||||||
require('Stores/User/Notification').populate();
|
require('Stores/User/Notification').populate();
|
||||||
require('Stores/User/Identity').populate();
|
|
||||||
require('Stores/User/Account').populate();
|
require('Stores/User/Account').populate();
|
||||||
|
|
||||||
var
|
var
|
||||||
|
|
@ -1528,10 +1527,7 @@
|
||||||
self.contactsSync();
|
self.contactsSync();
|
||||||
}, iContactsSyncInterval * 60000 + 5000);
|
}, iContactsSyncInterval * 60000 + 5000);
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities))
|
self.accountsAndIdentities(true);
|
||||||
{
|
|
||||||
self.accountsAndIdentities(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
_.delay(function () {
|
_.delay(function () {
|
||||||
var sF = Data.currentFolderFullNameRaw();
|
var sF = Data.currentFolderFullNameRaw();
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,7 @@
|
||||||
'Sieve': 'SIEVE',
|
'Sieve': 'SIEVE',
|
||||||
'Filters': 'FILTERS',
|
'Filters': 'FILTERS',
|
||||||
'AttachmentThumbnails': 'ATTACHMENT_THUMBNAILS',
|
'AttachmentThumbnails': 'ATTACHMENT_THUMBNAILS',
|
||||||
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS',
|
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS'
|
||||||
'AdditionalIdentities': 'ADDITIONAL_IDENTITIES'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -149,7 +148,8 @@
|
||||||
'FolderListSize': 4,
|
'FolderListSize': 4,
|
||||||
'MessageListSize': 5,
|
'MessageListSize': 5,
|
||||||
'LastReplyAction': 6,
|
'LastReplyAction': 6,
|
||||||
'LastSignMe': 7
|
'LastSignMe': 7,
|
||||||
|
'ComposeLastIdentityID': 8
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
this.count = ko.observable(iCount || 0);
|
this.count = ko.observable(iCount || 0);
|
||||||
|
|
||||||
this.deleteAccess = ko.observable(false);
|
this.deleteAccess = ko.observable(false);
|
||||||
this.canBeDalete = ko.observable(Utils.isUnd(bCanBeDelete) ? true : !!bCanBeDelete);
|
this.canBeDeleted = ko.observable(Utils.isUnd(bCanBeDelete) ? true : !!bCanBeDelete);
|
||||||
this.canBeEdit = this.canBeDalete;
|
this.canBeEdit = this.canBeDeleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(AccountModel.prototype, AbstractModel.prototype);
|
_.extend(AccountModel.prototype, AbstractModel.prototype);
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
this.regDisposables([this.actionNoStop, this.actionTemplate]);
|
this.regDisposables([this.actionNoStop, this.actionTemplate]);
|
||||||
|
|
||||||
this.deleteAccess = ko.observable(false);
|
this.deleteAccess = ko.observable(false);
|
||||||
this.canBeDalete = ko.observable(true);
|
this.canBeDeleted = ko.observable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(FilterModel.prototype, AbstractModel.prototype);
|
_.extend(FilterModel.prototype, AbstractModel.prototype);
|
||||||
|
|
|
||||||
|
|
@ -15,41 +15,35 @@
|
||||||
/**
|
/**
|
||||||
* @param {string} sId
|
* @param {string} sId
|
||||||
* @param {string} sEmail
|
* @param {string} sEmail
|
||||||
* @param {boolean=} bCanBeDelete = true
|
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function IdentityModel(sId, sEmail, bCanBeDelete)
|
function IdentityModel(sId, sEmail)
|
||||||
{
|
{
|
||||||
AbstractModel.call(this, 'IdentityModel');
|
AbstractModel.call(this, 'IdentityModel');
|
||||||
|
|
||||||
this.id = sId;
|
this.id = ko.observable(sId);
|
||||||
this.email = ko.observable(sEmail);
|
this.email = ko.observable(sEmail);
|
||||||
this.name = ko.observable('');
|
this.name = ko.observable('');
|
||||||
|
|
||||||
this.replyTo = ko.observable('');
|
this.replyTo = ko.observable('');
|
||||||
this.bcc = ko.observable('');
|
this.bcc = ko.observable('');
|
||||||
|
|
||||||
this.deleteAccess = ko.observable(false);
|
this.deleteAccess = ko.observable(false);
|
||||||
this.canBeDalete = ko.observable(bCanBeDelete);
|
this.canBeDeleted = ko.computed(function () {
|
||||||
|
return '' !== this.id();
|
||||||
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(IdentityModel.prototype, AbstractModel.prototype);
|
_.extend(IdentityModel.prototype, AbstractModel.prototype);
|
||||||
|
|
||||||
IdentityModel.prototype.formattedName = function ()
|
IdentityModel.prototype.formattedName = function ()
|
||||||
{
|
{
|
||||||
var sName = this.name();
|
var
|
||||||
return '' === sName ? this.email() : sName + ' <' + this.email() + '>';
|
sName = this.name(),
|
||||||
};
|
sEmail = this.email()
|
||||||
|
;
|
||||||
|
|
||||||
IdentityModel.prototype.formattedNameForCompose = function ()
|
return ('' !== sName) ? sName + ' (' + sEmail + ')' : sEmail;
|
||||||
{
|
|
||||||
var sName = this.name();
|
|
||||||
return '' === sName ? this.email() : sName + ' (' + this.email() + ')';
|
|
||||||
};
|
|
||||||
|
|
||||||
IdentityModel.prototype.formattedNameForEmail = function ()
|
|
||||||
{
|
|
||||||
var sName = this.name();
|
|
||||||
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = IdentityModel;
|
module.exports = IdentityModel;
|
||||||
|
|
|
||||||
|
|
@ -608,6 +608,16 @@
|
||||||
return MessageModel.emailsToLine(this.bcc, bFriendlyView, bWrapWithLink);
|
return MessageModel.emailsToLine(this.bcc, bFriendlyView, bWrapWithLink);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {boolean} bFriendlyView
|
||||||
|
* @param {boolean=} bWrapWithLink = false
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
MessageModel.prototype.replyToToLine = function (bFriendlyView, bWrapWithLink)
|
||||||
|
{
|
||||||
|
return MessageModel.emailsToLine(this.replyTo, bFriendlyView, bWrapWithLink);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
@ -867,6 +877,7 @@
|
||||||
'popupTo': this.toToLine(false),
|
'popupTo': this.toToLine(false),
|
||||||
'popupCc': this.ccToLine(false),
|
'popupCc': this.ccToLine(false),
|
||||||
'popupBcc': this.bccToLine(false),
|
'popupBcc': this.bccToLine(false),
|
||||||
|
'popupReplyTo': this.replyToToLine(false),
|
||||||
'popupSubject': this.subject(),
|
'popupSubject': this.subject(),
|
||||||
'popupIsHtml': this.isHtml(),
|
'popupIsHtml': this.isHtml(),
|
||||||
'popupDate': this.fullFormatDateValue(),
|
'popupDate': this.fullFormatDateValue(),
|
||||||
|
|
|
||||||
|
|
@ -59,17 +59,6 @@
|
||||||
'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts');
|
'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.AdditionalIdentities))
|
|
||||||
{
|
|
||||||
kn.addSettingsViewModel(require('Settings/User/Identities'),
|
|
||||||
'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
kn.addSettingsViewModel(require('Settings/User/Identity'),
|
|
||||||
'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.Sieve))
|
if (Settings.capa(Enums.Capa.Sieve))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/User/Filters'),
|
kn.addSettingsViewModel(require('Settings/User/Filters'),
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
this.capaUserBackground = CapaAdminStore.userBackground;
|
this.capaUserBackground = CapaAdminStore.userBackground;
|
||||||
this.capaGravatar = CapaAdminStore.gravatar;
|
this.capaGravatar = CapaAdminStore.gravatar;
|
||||||
this.capaAdditionalAccounts = CapaAdminStore.additionalAccounts;
|
this.capaAdditionalAccounts = CapaAdminStore.additionalAccounts;
|
||||||
this.capaAdditionalIdentities = CapaAdminStore.additionalIdentities;
|
|
||||||
this.capaAttachmentThumbnails = CapaAdminStore.attachmentThumbnails;
|
this.capaAttachmentThumbnails = CapaAdminStore.attachmentThumbnails;
|
||||||
|
|
||||||
this.allowLanguagesOnSettings = AppAdminStore.allowLanguagesOnSettings;
|
this.allowLanguagesOnSettings = AppAdminStore.allowLanguagesOnSettings;
|
||||||
|
|
@ -106,12 +105,6 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
self.capaAdditionalIdentities.subscribe(function (bValue) {
|
|
||||||
Remote.saveAdminConfig(null, {
|
|
||||||
'CapaAdditionalIdentities': bValue ? '1' : '0'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
self.capaGravatar.subscribe(function (bValue) {
|
self.capaGravatar.subscribe(function (bValue) {
|
||||||
Remote.saveAdminConfig(null, {
|
Remote.saveAdminConfig(null, {
|
||||||
'CapaGravatar': bValue ? '1' : '0'
|
'CapaGravatar': bValue ? '1' : '0'
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
AccountStore = require('Stores/User/Account'),
|
AccountStore = require('Stores/User/Account'),
|
||||||
|
IdentityStore = require('Stores/User/Identity'),
|
||||||
|
|
||||||
Remote = require('Storage/User/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
@ -23,6 +24,7 @@
|
||||||
function AccountsUserSettings()
|
function AccountsUserSettings()
|
||||||
{
|
{
|
||||||
this.accounts = AccountStore.accounts;
|
this.accounts = AccountStore.accounts;
|
||||||
|
this.identities = IdentityStore.identities;
|
||||||
|
|
||||||
this.processText = ko.computed(function () {
|
this.processText = ko.computed(function () {
|
||||||
return AccountStore.accounts.loading() ? Translator.i18n('SETTINGS_ACCOUNTS/LOADING_PROCESS') : '';
|
return AccountStore.accounts.loading() ? Translator.i18n('SETTINGS_ACCOUNTS/LOADING_PROCESS') : '';
|
||||||
|
|
@ -45,6 +47,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]});
|
]});
|
||||||
|
|
||||||
|
this.identityForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
|
||||||
|
function (oPrev) {
|
||||||
|
if (oPrev)
|
||||||
|
{
|
||||||
|
oPrev.deleteAccess(false);
|
||||||
|
}
|
||||||
|
}, function (oNext) {
|
||||||
|
if (oNext)
|
||||||
|
{
|
||||||
|
oNext.deleteAccess(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]});
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountsUserSettings.prototype.scrollableOptions = function ()
|
AccountsUserSettings.prototype.scrollableOptions = function ()
|
||||||
|
|
@ -56,17 +72,27 @@
|
||||||
|
|
||||||
AccountsUserSettings.prototype.addNewAccount = function ()
|
AccountsUserSettings.prototype.addNewAccount = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Account'));
|
||||||
};
|
};
|
||||||
|
|
||||||
AccountsUserSettings.prototype.editAccount = function (oAccountItem)
|
AccountsUserSettings.prototype.editAccount = function (oAccountItem)
|
||||||
{
|
{
|
||||||
if (oAccountItem && oAccountItem.canBeEdit())
|
if (oAccountItem && oAccountItem.canBeEdit())
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'), [oAccountItem]);
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Account'), [oAccountItem]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AccountsUserSettings.prototype.addNewIdentity = function ()
|
||||||
|
{
|
||||||
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
|
||||||
|
};
|
||||||
|
|
||||||
|
AccountsUserSettings.prototype.editIdentity = function (oIdentity)
|
||||||
|
{
|
||||||
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {AccountModel} oAccountToRemove
|
* @param {AccountModel} oAccountToRemove
|
||||||
*/
|
*/
|
||||||
|
|
@ -110,18 +136,47 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {IdentityModel} oIdentityToRemove
|
||||||
|
*/
|
||||||
|
AccountsUserSettings.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||||
|
{
|
||||||
|
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
||||||
|
{
|
||||||
|
this.identityForDeletion(null);
|
||||||
|
|
||||||
|
if (oIdentityToRemove)
|
||||||
|
{
|
||||||
|
IdentityStore.identities.remove(function (oIdentity) {
|
||||||
|
return oIdentityToRemove === oIdentity;
|
||||||
|
});
|
||||||
|
|
||||||
|
Remote.identityDelete(function () {
|
||||||
|
require('App/User').accountsAndIdentities();
|
||||||
|
}, oIdentityToRemove.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
AccountsUserSettings.prototype.onBuild = function (oDom)
|
AccountsUserSettings.prototype.onBuild = function (oDom)
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
oDom
|
oDom
|
||||||
.on('click', '.account-item .e-action', function () {
|
.on('click', '.accounts-list .account-item .e-action', function () {
|
||||||
var oAccountItem = ko.dataFor(this);
|
var oAccountItem = ko.dataFor(this);
|
||||||
if (oAccountItem)
|
if (oAccountItem)
|
||||||
{
|
{
|
||||||
self.editAccount(oAccountItem);
|
self.editAccount(oAccountItem);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.on('click', '.identities-list .identity-item .e-action', function () {
|
||||||
|
var oIdentityItem = ko.dataFor(this);
|
||||||
|
if (oIdentityItem)
|
||||||
|
{
|
||||||
|
self.editIdentity(oIdentityItem);
|
||||||
|
}
|
||||||
|
})
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,226 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
_ = require('_'),
|
|
||||||
ko = require('ko'),
|
|
||||||
|
|
||||||
Enums = require('Common/Enums'),
|
|
||||||
Utils = require('Common/Utils'),
|
|
||||||
HtmlEditor = require('Common/HtmlEditor'),
|
|
||||||
Translator = require('Common/Translator'),
|
|
||||||
|
|
||||||
AccountStore = require('Stores/User/Account'),
|
|
||||||
IdentityStore = require('Stores/User/Identity'),
|
|
||||||
|
|
||||||
Remote = require('Storage/User/Remote')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function IdentitiesUserSettings()
|
|
||||||
{
|
|
||||||
this.editor = null;
|
|
||||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
|
||||||
|
|
||||||
this.accountEmail = AccountStore.email;
|
|
||||||
|
|
||||||
this.displayName = AccountStore.displayName;
|
|
||||||
this.signature = AccountStore.signature;
|
|
||||||
this.replyTo = AccountStore.replyTo;
|
|
||||||
|
|
||||||
this.signatureDom = ko.observable(null);
|
|
||||||
|
|
||||||
this.defaultIdentityIDTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
|
|
||||||
this.identities = IdentityStore.identities;
|
|
||||||
this.defaultIdentityID = IdentityStore.defaultIdentityID;
|
|
||||||
|
|
||||||
this.identitiesOptions = ko.computed(function () {
|
|
||||||
|
|
||||||
var
|
|
||||||
aList = IdentityStore.identities(),
|
|
||||||
aResult = []
|
|
||||||
;
|
|
||||||
|
|
||||||
if (0 < aList.length)
|
|
||||||
{
|
|
||||||
aResult.push({
|
|
||||||
'id': AccountStore.email.peek(),
|
|
||||||
'name': this.formattedAccountIdentity(),
|
|
||||||
'seporator': false
|
|
||||||
});
|
|
||||||
|
|
||||||
aResult.push({
|
|
||||||
'id': '---',
|
|
||||||
'name': '---',
|
|
||||||
'seporator': true,
|
|
||||||
'disabled': true
|
|
||||||
});
|
|
||||||
|
|
||||||
_.each(aList, function (oItem) {
|
|
||||||
aResult.push({
|
|
||||||
'id': oItem.id,
|
|
||||||
'name': oItem.formattedNameForEmail(),
|
|
||||||
'seporator': false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return aResult;
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this.processText = ko.computed(function () {
|
|
||||||
return IdentityStore.identities.loading() ? Translator.i18n('SETTINGS_IDENTITIES/LOADING_PROCESS') : '';
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this.visibility = ko.computed(function () {
|
|
||||||
return '' === this.processText() ? 'hidden' : 'visible';
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this.identityForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
|
|
||||||
function (oPrev) {
|
|
||||||
if (oPrev)
|
|
||||||
{
|
|
||||||
oPrev.deleteAccess(false);
|
|
||||||
}
|
|
||||||
}, function (oNext) {
|
|
||||||
if (oNext)
|
|
||||||
{
|
|
||||||
oNext.deleteAccess(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
IdentitiesUserSettings.prototype.formattedAccountIdentity = function ()
|
|
||||||
{
|
|
||||||
var
|
|
||||||
sDisplayName = AccountStore.displayName.peek(),
|
|
||||||
sEmail = AccountStore.email.peek()
|
|
||||||
;
|
|
||||||
|
|
||||||
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
|
|
||||||
};
|
|
||||||
|
|
||||||
IdentitiesUserSettings.prototype.addNewIdentity = function ()
|
|
||||||
{
|
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
|
|
||||||
};
|
|
||||||
|
|
||||||
IdentitiesUserSettings.prototype.editIdentity = function (oIdentity)
|
|
||||||
{
|
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {IdentityModel} oIdentityToRemove
|
|
||||||
*/
|
|
||||||
IdentitiesUserSettings.prototype.deleteIdentity = function (oIdentityToRemove)
|
|
||||||
{
|
|
||||||
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
|
||||||
{
|
|
||||||
this.identityForDeletion(null);
|
|
||||||
|
|
||||||
if (oIdentityToRemove)
|
|
||||||
{
|
|
||||||
IdentityStore.identities.remove(function (oIdentity) {
|
|
||||||
return oIdentityToRemove === oIdentity;
|
|
||||||
});
|
|
||||||
|
|
||||||
Remote.identityDelete(function () {
|
|
||||||
require('App/User').accountsAndIdentities();
|
|
||||||
}, oIdentityToRemove.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
IdentitiesUserSettings.prototype.onFocus = function ()
|
|
||||||
{
|
|
||||||
if (!this.editor && this.signatureDom())
|
|
||||||
{
|
|
||||||
var
|
|
||||||
self = this,
|
|
||||||
sSignature = AccountStore.signature()
|
|
||||||
;
|
|
||||||
|
|
||||||
this.editor = new HtmlEditor(self.signatureDom(), function () {
|
|
||||||
AccountStore.signature(
|
|
||||||
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
|
|
||||||
);
|
|
||||||
}, function () {
|
|
||||||
if (':HTML:' === sSignature.substr(0, 6))
|
|
||||||
{
|
|
||||||
self.editor.setHtml(sSignature.substr(6), false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
self.editor.setPlain(sSignature, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
IdentitiesUserSettings.prototype.onBuild = function (oDom)
|
|
||||||
{
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
oDom
|
|
||||||
.on('click', '.identity-item .e-action', function () {
|
|
||||||
var oIdentityItem = ko.dataFor(this);
|
|
||||||
if (oIdentityItem)
|
|
||||||
{
|
|
||||||
self.editIdentity(oIdentityItem);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
;
|
|
||||||
|
|
||||||
_.delay(function () {
|
|
||||||
|
|
||||||
var
|
|
||||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
|
|
||||||
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
|
|
||||||
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self),
|
|
||||||
f4 = Utils.settingsSaveHelperSimpleFunction(self.defaultIdentityIDTrigger, self)
|
|
||||||
;
|
|
||||||
|
|
||||||
IdentityStore.defaultIdentityID.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f4, {
|
|
||||||
'DefaultIdentityID': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
AccountStore.displayName.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f1, {
|
|
||||||
'DisplayName': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
AccountStore.replyTo.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f2, {
|
|
||||||
'ReplyTo': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
AccountStore.signature.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f3, {
|
|
||||||
'Signature': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}, 50);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = IdentitiesUserSettings;
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
_ = require('_'),
|
|
||||||
ko = require('ko'),
|
|
||||||
|
|
||||||
Enums = require('Common/Enums'),
|
|
||||||
Utils = require('Common/Utils'),
|
|
||||||
HtmlEditor = require('Common/HtmlEditor'),
|
|
||||||
|
|
||||||
AccountStore = require('Stores/User/Account'),
|
|
||||||
|
|
||||||
Remote = require('Storage/User/Remote')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function IdentityUserSettings()
|
|
||||||
{
|
|
||||||
this.editor = null;
|
|
||||||
|
|
||||||
this.displayName = AccountStore.displayName;
|
|
||||||
this.signature = AccountStore.signature;
|
|
||||||
this.replyTo = AccountStore.replyTo;
|
|
||||||
|
|
||||||
this.signatureDom = ko.observable(null);
|
|
||||||
|
|
||||||
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
|
||||||
}
|
|
||||||
|
|
||||||
IdentityUserSettings.prototype.onFocus = function ()
|
|
||||||
{
|
|
||||||
if (!this.editor && this.signatureDom())
|
|
||||||
{
|
|
||||||
var
|
|
||||||
self = this,
|
|
||||||
sSignature = AccountStore.signature()
|
|
||||||
;
|
|
||||||
|
|
||||||
this.editor = new HtmlEditor(self.signatureDom(), function () {
|
|
||||||
AccountStore.signature(
|
|
||||||
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
|
|
||||||
);
|
|
||||||
}, function () {
|
|
||||||
if (':HTML:' === sSignature.substr(0, 6))
|
|
||||||
{
|
|
||||||
self.editor.setHtml(sSignature.substr(6), false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
self.editor.setPlain(sSignature, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
IdentityUserSettings.prototype.onBuild = function ()
|
|
||||||
{
|
|
||||||
var self = this;
|
|
||||||
_.delay(function () {
|
|
||||||
|
|
||||||
var
|
|
||||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
|
|
||||||
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
|
|
||||||
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
|
|
||||||
;
|
|
||||||
|
|
||||||
AccountStore.displayName.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f1, {
|
|
||||||
'DisplayName': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
AccountStore.replyTo.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f2, {
|
|
||||||
'ReplyTo': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
AccountStore.signature.subscribe(function (sValue) {
|
|
||||||
Remote.saveSettings(f3, {
|
|
||||||
'Signature': sValue
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}, 50);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = IdentityUserSettings;
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
@ -494,10 +494,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
|
* @param {string} sIdentityID
|
||||||
* @param {string} sMessageFolder
|
* @param {string} sMessageFolder
|
||||||
* @param {string} sMessageUid
|
* @param {string} sMessageUid
|
||||||
* @param {string} sDraftFolder
|
* @param {string} sDraftFolder
|
||||||
* @param {string} sFrom
|
|
||||||
* @param {string} sTo
|
* @param {string} sTo
|
||||||
* @param {string} sCc
|
* @param {string} sCc
|
||||||
* @param {string} sBcc
|
* @param {string} sBcc
|
||||||
|
|
@ -510,17 +510,18 @@
|
||||||
* @param {string} sReferences
|
* @param {string} sReferences
|
||||||
* @param {boolean} bMarkAsImportant
|
* @param {boolean} bMarkAsImportant
|
||||||
*/
|
*/
|
||||||
RemoteUserStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder,
|
RemoteUserStorage.prototype.saveMessage = function (fCallback, sIdentityID, sMessageFolder, sMessageUid, sDraftFolder,
|
||||||
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bMarkAsImportant)
|
sTo, sCc, sBcc, sReplyTo, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bMarkAsImportant)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SaveMessage', {
|
this.defaultRequest(fCallback, 'SaveMessage', {
|
||||||
|
'IdentityID': sIdentityID,
|
||||||
'MessageFolder': sMessageFolder,
|
'MessageFolder': sMessageFolder,
|
||||||
'MessageUid': sMessageUid,
|
'MessageUid': sMessageUid,
|
||||||
'DraftFolder': sDraftFolder,
|
'DraftFolder': sDraftFolder,
|
||||||
'From': sFrom,
|
|
||||||
'To': sTo,
|
'To': sTo,
|
||||||
'Cc': sCc,
|
'Cc': sCc,
|
||||||
'Bcc': sBcc,
|
'Bcc': sBcc,
|
||||||
|
'ReplyTo': sReplyTo,
|
||||||
'Subject': sSubject,
|
'Subject': sSubject,
|
||||||
'TextIsHtml': bTextIsHtml ? '1' : '0',
|
'TextIsHtml': bTextIsHtml ? '1' : '0',
|
||||||
'Text': sText,
|
'Text': sText,
|
||||||
|
|
@ -554,13 +555,14 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
|
* @param {string} sIdentityID
|
||||||
* @param {string} sMessageFolder
|
* @param {string} sMessageFolder
|
||||||
* @param {string} sMessageUid
|
* @param {string} sMessageUid
|
||||||
* @param {string} sSentFolder
|
* @param {string} sSentFolder
|
||||||
* @param {string} sFrom
|
|
||||||
* @param {string} sTo
|
* @param {string} sTo
|
||||||
* @param {string} sCc
|
* @param {string} sCc
|
||||||
* @param {string} sBcc
|
* @param {string} sBcc
|
||||||
|
* @param {string} sReplyTo
|
||||||
* @param {string} sSubject
|
* @param {string} sSubject
|
||||||
* @param {boolean} bTextIsHtml
|
* @param {boolean} bTextIsHtml
|
||||||
* @param {string} sText
|
* @param {string} sText
|
||||||
|
|
@ -571,18 +573,19 @@
|
||||||
* @param {boolean} bRequestReadReceipt
|
* @param {boolean} bRequestReadReceipt
|
||||||
* @param {boolean} bMarkAsImportant
|
* @param {boolean} bMarkAsImportant
|
||||||
*/
|
*/
|
||||||
RemoteUserStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder,
|
RemoteUserStorage.prototype.sendMessage = function (fCallback, sIdentityID, sMessageFolder, sMessageUid, sSentFolder,
|
||||||
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences,
|
sTo, sCc, sBcc, sReplyTo, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences,
|
||||||
bRequestReadReceipt, bMarkAsImportant)
|
bRequestReadReceipt, bMarkAsImportant)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SendMessage', {
|
this.defaultRequest(fCallback, 'SendMessage', {
|
||||||
|
'IdentityID': sIdentityID,
|
||||||
'MessageFolder': sMessageFolder,
|
'MessageFolder': sMessageFolder,
|
||||||
'MessageUid': sMessageUid,
|
'MessageUid': sMessageUid,
|
||||||
'SentFolder': sSentFolder,
|
'SentFolder': sSentFolder,
|
||||||
'From': sFrom,
|
|
||||||
'To': sTo,
|
'To': sTo,
|
||||||
'Cc': sCc,
|
'Cc': sCc,
|
||||||
'Bcc': sBcc,
|
'Bcc': sBcc,
|
||||||
|
'ReplyTo': sReplyTo,
|
||||||
'Subject': sSubject,
|
'Subject': sSubject,
|
||||||
'TextIsHtml': bTextIsHtml ? '1' : '0',
|
'TextIsHtml': bTextIsHtml ? '1' : '0',
|
||||||
'Text': sText,
|
'Text': sText,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
function CapaAdminStore()
|
function CapaAdminStore()
|
||||||
{
|
{
|
||||||
this.additionalAccounts = ko.observable(false);
|
this.additionalAccounts = ko.observable(false);
|
||||||
this.additionalIdentities = ko.observable(false);
|
|
||||||
this.gravatar = ko.observable(false);
|
this.gravatar = ko.observable(false);
|
||||||
this.attachmentThumbnails = ko.observable(false);
|
this.attachmentThumbnails = ko.observable(false);
|
||||||
this.sieve = ko.observable(false);
|
this.sieve = ko.observable(false);
|
||||||
|
|
@ -31,7 +30,6 @@
|
||||||
CapaAdminStore.prototype.populate = function()
|
CapaAdminStore.prototype.populate = function()
|
||||||
{
|
{
|
||||||
this.additionalAccounts(Settings.capa(Enums.Capa.AdditionalAccounts));
|
this.additionalAccounts(Settings.capa(Enums.Capa.AdditionalAccounts));
|
||||||
this.additionalIdentities(Settings.capa(Enums.Capa.AdditionalIdentities));
|
|
||||||
this.gravatar(Settings.capa(Enums.Capa.Gravatar));
|
this.gravatar(Settings.capa(Enums.Capa.Gravatar));
|
||||||
this.attachmentThumbnails(Settings.capa(Enums.Capa.AttachmentThumbnails));
|
this.attachmentThumbnails(Settings.capa(Enums.Capa.AttachmentThumbnails));
|
||||||
this.sieve(Settings.capa(Enums.Capa.Sieve));
|
this.sieve(Settings.capa(Enums.Capa.Sieve));
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@
|
||||||
// this.incLogin = ko.observable('');
|
// this.incLogin = ko.observable('');
|
||||||
// this.outLogin = ko.observable('');
|
// this.outLogin = ko.observable('');
|
||||||
|
|
||||||
this.displayName = ko.observable('');
|
|
||||||
this.replyTo = ko.observable('');
|
|
||||||
this.signature = ko.observable('');
|
this.signature = ko.observable('');
|
||||||
|
|
||||||
this.accounts = ko.observableArray([]);
|
this.accounts = ko.observableArray([]);
|
||||||
|
|
@ -70,9 +68,7 @@
|
||||||
// this.incLogin(Settings.settingsGet('IncLogin'));
|
// this.incLogin(Settings.settingsGet('IncLogin'));
|
||||||
// this.outLogin(Settings.settingsGet('OutLogin'));
|
// this.outLogin(Settings.settingsGet('OutLogin'));
|
||||||
|
|
||||||
this.displayName(Settings.settingsGet('DisplayName'));
|
// this.signature(Settings.settingsGet('Signature'));
|
||||||
this.replyTo(Settings.settingsGet('ReplyTo'));
|
|
||||||
this.signature(Settings.settingsGet('Signature'));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = new AccountUserStore();
|
module.exports = new AccountUserStore();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,9 @@
|
||||||
|
|
||||||
this.projectHash(Settings.settingsGet('ProjectHash'));
|
this.projectHash(Settings.settingsGet('ProjectHash'));
|
||||||
|
|
||||||
|
this.contactsAutosave(!!Settings.settingsGet('ContactsAutosave'));
|
||||||
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
||||||
|
|
||||||
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
||||||
|
|
||||||
this.devEmail = Settings.settingsGet('DevEmail');
|
this.devEmail = Settings.settingsGet('DevEmail');
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var
|
var
|
||||||
ko = require('ko'),
|
ko = require('ko')
|
||||||
|
|
||||||
Settings = require('Storage/Settings')
|
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -14,17 +12,10 @@
|
||||||
*/
|
*/
|
||||||
function IdentityUserStore()
|
function IdentityUserStore()
|
||||||
{
|
{
|
||||||
this.defaultIdentityID = ko.observable('');
|
|
||||||
|
|
||||||
this.identities = ko.observableArray([]);
|
this.identities = ko.observableArray([]);
|
||||||
this.identities.loading = ko.observable(false).extend({'throttle': 100});
|
this.identities.loading = ko.observable(false).extend({'throttle': 100});
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentityUserStore.prototype.populate = function ()
|
|
||||||
{
|
|
||||||
this.defaultIdentityID(Settings.settingsGet('DefaultIdentityID'));
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = new IdentityUserStore();
|
module.exports = new IdentityUserStore();
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
@import "FolderSystem.less";
|
@import "FolderSystem.less";
|
||||||
@import "Filter.less";
|
@import "Filter.less";
|
||||||
@import "Languages.less";
|
@import "Languages.less";
|
||||||
@import "AddAccount.less";
|
@import "Account.less";
|
||||||
@import "OpenPgpKey.less";
|
@import "OpenPgpKey.less";
|
||||||
@import "TwoFactor.less";
|
@import "TwoFactor.less";
|
||||||
@import "Identity.less";
|
@import "Identity.less";
|
||||||
|
|
@ -85,8 +85,6 @@
|
||||||
@import "Settings.less";
|
@import "Settings.less";
|
||||||
@import "SettingsGeneral.less";
|
@import "SettingsGeneral.less";
|
||||||
@import "SettingsAccounts.less";
|
@import "SettingsAccounts.less";
|
||||||
@import "SettingsIdentity.less";
|
|
||||||
@import "SettingsIdentities.less";
|
|
||||||
@import "SettingsOpenPGP.less";
|
@import "SettingsOpenPGP.less";
|
||||||
@import "SettingsFolders.less";
|
@import "SettingsFolders.less";
|
||||||
@import "SettingsThemes.less";
|
@import "SettingsThemes.less";
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-img {
|
.account-img, .identity-img {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
@ -35,6 +35,14 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.identity-name {
|
||||||
|
display: inline-block;
|
||||||
|
word-break: break-all;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 22px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-item {
|
.account-item {
|
||||||
|
|
@ -67,4 +75,31 @@
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.identity-item {
|
||||||
|
|
||||||
|
.e-action {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-delete {
|
||||||
|
margin-right: 15px;
|
||||||
|
margin-top: 5px;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-access {
|
||||||
|
&.button-delete {
|
||||||
|
visibility: visible;
|
||||||
|
margin-right: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-identity {
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
|
|
||||||
.b-settings-identities {
|
|
||||||
|
|
||||||
.process-place {
|
|
||||||
text-align: center;
|
|
||||||
width: 600px;
|
|
||||||
padding: 14px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.e-signature-place {
|
|
||||||
display: inline-block;
|
|
||||||
width: 680px;
|
|
||||||
width: 730px;
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-table {
|
|
||||||
|
|
||||||
width: 600px;
|
|
||||||
|
|
||||||
td {
|
|
||||||
padding: 4px 8px;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.identity-img {
|
|
||||||
font-size: 12px;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.identity-name {
|
|
||||||
display: inline-block;
|
|
||||||
word-break: break-all;
|
|
||||||
box-sizing: border-box;
|
|
||||||
line-height: 22px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.identity-item {
|
|
||||||
|
|
||||||
.e-action {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-delete {
|
|
||||||
margin-right: 15px;
|
|
||||||
margin-top: 5px;
|
|
||||||
visibility: hidden;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-access {
|
|
||||||
&.button-delete {
|
|
||||||
visibility: visible;
|
|
||||||
margin-right: 0;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-identity {
|
|
||||||
cursor: pointer;
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
.b-settings-identity {
|
|
||||||
.e-signature-place {
|
|
||||||
display: inline-block;
|
|
||||||
width: 680px;
|
|
||||||
width: 730px;
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function AddAccountPopupView()
|
function AccountPopupView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Popups', 'PopupsAddAccount');
|
AbstractView.call(this, 'Popups', 'PopupsAccount');
|
||||||
|
|
||||||
this.isNew = ko.observable(true);
|
this.isNew = ko.observable(true);
|
||||||
|
|
||||||
|
|
@ -89,10 +89,10 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/Popup/AddAccount', 'PopupsAddAccountViewModel'], AddAccountPopupView);
|
kn.extendAsViewModel(['View/Popup/Account', 'View/Popup/AddAccount', 'PopupsAddAccountViewModel'], AccountPopupView);
|
||||||
_.extend(AddAccountPopupView.prototype, AbstractView.prototype);
|
_.extend(AccountPopupView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
AddAccountPopupView.prototype.clearPopup = function ()
|
AccountPopupView.prototype.clearPopup = function ()
|
||||||
{
|
{
|
||||||
this.isNew(true);
|
this.isNew(true);
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
this.submitError('');
|
this.submitError('');
|
||||||
};
|
};
|
||||||
|
|
||||||
AddAccountPopupView.prototype.onShow = function (oAccount)
|
AccountPopupView.prototype.onShow = function (oAccount)
|
||||||
{
|
{
|
||||||
this.clearPopup();
|
this.clearPopup();
|
||||||
if (oAccount && oAccount.canBeEdit())
|
if (oAccount && oAccount.canBeEdit())
|
||||||
|
|
@ -116,11 +116,11 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AddAccountPopupView.prototype.onFocus = function ()
|
AccountPopupView.prototype.onFocus = function ()
|
||||||
{
|
{
|
||||||
this.emailFocus(true);
|
this.emailFocus(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = AddAccountPopupView;
|
module.exports = AccountPopupView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
Data = require('Storage/User/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/User/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Remote = require('Storage/User/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
Local = require('Storage/Client'),
|
||||||
|
|
||||||
ComposeAttachmentModel = require('Model/ComposeAttachment'),
|
ComposeAttachmentModel = require('Model/ComposeAttachment'),
|
||||||
|
|
||||||
|
|
@ -48,7 +49,30 @@
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Popups', 'PopupsCompose');
|
AbstractView.call(this, 'Popups', 'PopupsCompose');
|
||||||
|
|
||||||
var self = this;
|
var
|
||||||
|
self = this,
|
||||||
|
fEmailOutInHelper = function (self, oIdentity, sName, bIn) {
|
||||||
|
if (oIdentity && self && oIdentity[sName]() && (bIn ? true : self[sName]()))
|
||||||
|
{
|
||||||
|
var
|
||||||
|
sIdentityEmail = oIdentity[sName](),
|
||||||
|
aList = Utils.trim(self[sName]()).split(/[,]/)
|
||||||
|
;
|
||||||
|
|
||||||
|
aList = _.filter(aList, function (sEmail) {
|
||||||
|
sEmail = Utils.trim(sEmail);
|
||||||
|
return sEmail && Utils.trim(sIdentityEmail) !== sEmail;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (bIn)
|
||||||
|
{
|
||||||
|
aList.push(sIdentityEmail);
|
||||||
|
}
|
||||||
|
|
||||||
|
self[sName](aList.join(','));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
this.oEditor = null;
|
this.oEditor = null;
|
||||||
this.aDraftInfo = null;
|
this.aDraftInfo = null;
|
||||||
|
|
@ -58,8 +82,6 @@
|
||||||
|
|
||||||
this.triggerForResize = _.bind(this.triggerForResize, this);
|
this.triggerForResize = _.bind(this.triggerForResize, this);
|
||||||
|
|
||||||
this.bCapaAdditionalIdentities = Settings.capa(Enums.Capa.AdditionalIdentities);
|
|
||||||
|
|
||||||
this.allowContacts = !!AppStore.contactsIsAllowed();
|
this.allowContacts = !!AppStore.contactsIsAllowed();
|
||||||
|
|
||||||
this.bSkipNextHide = false;
|
this.bSkipNextHide = false;
|
||||||
|
|
@ -76,8 +98,8 @@
|
||||||
this.to.focusTrigger = ko.observable(false);
|
this.to.focusTrigger = ko.observable(false);
|
||||||
this.cc = ko.observable('');
|
this.cc = ko.observable('');
|
||||||
this.bcc = ko.observable('');
|
this.bcc = ko.observable('');
|
||||||
|
|
||||||
this.replyTo = ko.observable('');
|
this.replyTo = ko.observable('');
|
||||||
|
|
||||||
this.subject = ko.observable('');
|
this.subject = ko.observable('');
|
||||||
this.isHtml = ko.observable(false);
|
this.isHtml = ko.observable(false);
|
||||||
|
|
||||||
|
|
@ -97,6 +119,7 @@
|
||||||
|
|
||||||
this.showCc = ko.observable(false);
|
this.showCc = ko.observable(false);
|
||||||
this.showBcc = ko.observable(false);
|
this.showBcc = ko.observable(false);
|
||||||
|
this.showReplyTo = ko.observable(false);
|
||||||
|
|
||||||
this.cc.subscribe(function (aValue) {
|
this.cc.subscribe(function (aValue) {
|
||||||
if (false === self.showCc() && 0 < aValue.length)
|
if (false === self.showCc() && 0 < aValue.length)
|
||||||
|
|
@ -112,6 +135,13 @@
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
this.replyTo.subscribe(function (aValue) {
|
||||||
|
if (false === self.showReplyTo() && 0 < aValue.length)
|
||||||
|
{
|
||||||
|
self.showReplyTo(true);
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
|
||||||
this.draftFolder = ko.observable('');
|
this.draftFolder = ko.observable('');
|
||||||
this.draftUid = ko.observable('');
|
this.draftUid = ko.observable('');
|
||||||
this.sending = ko.observable(false);
|
this.sending = ko.observable(false);
|
||||||
|
|
@ -168,68 +198,63 @@
|
||||||
|
|
||||||
this.composeEditorArea = ko.observable(null);
|
this.composeEditorArea = ko.observable(null);
|
||||||
|
|
||||||
this.identities = IdentityStore.identities;
|
this.identities = AccountStore.identities;
|
||||||
this.defaultIdentityID = IdentityStore.defaultIdentityID;
|
|
||||||
this.currentIdentityID = ko.observable('');
|
|
||||||
|
|
||||||
this.currentIdentityString = ko.observable('');
|
|
||||||
this.currentIdentityResultEmail = ko.observable('');
|
|
||||||
|
|
||||||
this.identitiesOptions = ko.computed(function () {
|
this.identitiesOptions = ko.computed(function () {
|
||||||
|
return _.map(IdentityStore.identities(), function (oItem) {
|
||||||
var aList = [{
|
return {
|
||||||
'optValue': AccountStore.email(),
|
'optValue': oItem.id(),
|
||||||
'optText': this.formattedFrom(false)
|
'optText': oItem.formattedName()
|
||||||
}];
|
};
|
||||||
|
|
||||||
_.each(IdentityStore.identities(), function (oItem) {
|
|
||||||
aList.push({
|
|
||||||
'optValue': oItem.id,
|
|
||||||
'optText': oItem.formattedNameForCompose()
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return aList;
|
|
||||||
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
ko.computed(function () {
|
this.currentIdentityID = ko.observable(
|
||||||
|
Local.get(Enums.ClientSideKeyName.ComposeLastIdentityID, ''));
|
||||||
|
|
||||||
|
this.currentIdentity = ko.computed(function () {
|
||||||
|
|
||||||
var
|
var
|
||||||
sResult = '',
|
|
||||||
sResultEmail = '',
|
|
||||||
oItem = null,
|
oItem = null,
|
||||||
aList = IdentityStore.identities(),
|
sID = this.currentIdentityID(),
|
||||||
sID = this.currentIdentityID()
|
aList = IdentityStore.identities()
|
||||||
;
|
;
|
||||||
|
|
||||||
if (this.bCapaAdditionalIdentities && sID && sID !== AccountStore.email())
|
if (Utils.isArray(aList))
|
||||||
{
|
{
|
||||||
oItem = _.find(aList, function (oItem) {
|
oItem = _.find(aList, function (oItem) {
|
||||||
return oItem && sID === oItem['id'];
|
return oItem && sID === oItem.id();
|
||||||
});
|
});
|
||||||
|
|
||||||
sResult = oItem ? oItem.formattedNameForCompose() : '';
|
if (!oItem)
|
||||||
sResultEmail = oItem ? oItem.formattedNameForEmail() : '';
|
|
||||||
|
|
||||||
if ('' === sResult && aList[0])
|
|
||||||
{
|
{
|
||||||
this.currentIdentityID(aList[0]['id']);
|
oItem = _.find(aList, function (oItem) {
|
||||||
return '';
|
return oItem && '' === oItem.id();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!oItem)
|
||||||
|
{
|
||||||
|
oItem = aList[0] ? aList[0] : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === sResult)
|
return oItem ? oItem : null;
|
||||||
{
|
|
||||||
sResult = this.formattedFrom(false);
|
}, this);
|
||||||
sResultEmail = this.formattedFrom(true);
|
|
||||||
|
this.currentIdentity.extend({'toggleSubscribe': [this,
|
||||||
|
function (oIdentity) {
|
||||||
|
fEmailOutInHelper(this, oIdentity, 'bcc');
|
||||||
|
fEmailOutInHelper(this, oIdentity, 'replyTo');
|
||||||
|
}, function (oIdentity) {
|
||||||
|
fEmailOutInHelper(this, oIdentity, 'bcc', true);
|
||||||
|
fEmailOutInHelper(this, oIdentity, 'replyTo', true);
|
||||||
}
|
}
|
||||||
|
]});
|
||||||
|
|
||||||
this.currentIdentityString(sResult);
|
this.currentIdentityView = ko.computed(function () {
|
||||||
this.currentIdentityResultEmail(sResultEmail);
|
var oItem = this.currentIdentity();
|
||||||
|
return oItem ? oItem.formattedName() : 'unknown';
|
||||||
return sResult;
|
|
||||||
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.to.subscribe(function (sValue) {
|
this.to.subscribe(function (sValue) {
|
||||||
|
|
@ -336,13 +361,14 @@
|
||||||
|
|
||||||
Remote.sendMessage(
|
Remote.sendMessage(
|
||||||
this.sendMessageResponse,
|
this.sendMessageResponse,
|
||||||
|
this.currentIdentityID(),
|
||||||
this.draftFolder(),
|
this.draftFolder(),
|
||||||
this.draftUid(),
|
this.draftUid(),
|
||||||
sSentFolder,
|
sSentFolder,
|
||||||
this.currentIdentityResultEmail(),
|
|
||||||
sTo,
|
sTo,
|
||||||
this.cc(),
|
this.cc(),
|
||||||
this.bcc(),
|
this.bcc(),
|
||||||
|
this.replyTo(),
|
||||||
this.subject(),
|
this.subject(),
|
||||||
this.oEditor ? this.oEditor.isHtml() : false,
|
this.oEditor ? this.oEditor.isHtml() : false,
|
||||||
this.oEditor ? this.oEditor.getData(true) : '',
|
this.oEditor ? this.oEditor.getData(true) : '',
|
||||||
|
|
@ -374,13 +400,14 @@
|
||||||
|
|
||||||
Remote.saveMessage(
|
Remote.saveMessage(
|
||||||
this.saveMessageResponse,
|
this.saveMessageResponse,
|
||||||
|
this.currentIdentityID(),
|
||||||
this.draftFolder(),
|
this.draftFolder(),
|
||||||
this.draftUid(),
|
this.draftUid(),
|
||||||
FolderStore.draftFolder(),
|
FolderStore.draftFolder(),
|
||||||
this.currentIdentityResultEmail(),
|
|
||||||
this.to(),
|
this.to(),
|
||||||
this.cc(),
|
this.cc(),
|
||||||
this.bcc(),
|
this.bcc(),
|
||||||
|
this.replyTo(),
|
||||||
this.subject(),
|
this.subject(),
|
||||||
this.oEditor ? this.oEditor.isHtml() : false,
|
this.oEditor ? this.oEditor.isHtml() : false,
|
||||||
this.oEditor ? this.oEditor.getData(true) : '',
|
this.oEditor ? this.oEditor.getData(true) : '',
|
||||||
|
|
@ -434,6 +461,7 @@
|
||||||
|
|
||||||
this.showCc.subscribe(this.triggerForResize);
|
this.showCc.subscribe(this.triggerForResize);
|
||||||
this.showBcc.subscribe(this.triggerForResize);
|
this.showBcc.subscribe(this.triggerForResize);
|
||||||
|
this.showReplyTo.subscribe(this.triggerForResize);
|
||||||
|
|
||||||
this.dropboxEnabled = SocialStore.dropbox.enabled;
|
this.dropboxEnabled = SocialStore.dropbox.enabled;
|
||||||
this.dropboxApiKey = SocialStore.dropbox.apiKey;
|
this.dropboxApiKey = SocialStore.dropbox.apiKey;
|
||||||
|
|
@ -538,7 +566,7 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
this.oEditor.getData(),
|
this.oEditor.getData(),
|
||||||
this.currentIdentityResultEmail(),
|
this.currentIdentity(),
|
||||||
this.to(),
|
this.to(),
|
||||||
this.cc(),
|
this.cc(),
|
||||||
this.bcc()
|
this.bcc()
|
||||||
|
|
@ -566,18 +594,23 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ComposePopupView.prototype.findIdentityIdByMessage = function (sComposeType, oMessage)
|
ComposePopupView.prototype.findIdentityByMessage = function (sComposeType, oMessage)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
oIDs = {},
|
sDefaultIdentityID = Local.get(Enums.ClientSideKeyName.ComposeLastIdentityID, ''),
|
||||||
sResult = '',
|
aIdentities = IdentityStore.identities(),
|
||||||
sEmail = '',
|
oResultIdentity = null,
|
||||||
|
oIdentitiesCache = {},
|
||||||
|
|
||||||
fFindHelper = function (oItem) {
|
fFindHelper = function (oItem) {
|
||||||
if (oItem && oItem.email && oIDs[oItem.email])
|
if (oResultIdentity)
|
||||||
{
|
{
|
||||||
sEmail = oItem.email;
|
return true;
|
||||||
sResult = oIDs[oItem.email];
|
}
|
||||||
|
|
||||||
|
if (!oResultIdentity && oItem && oItem.email && oIdentitiesCache[oItem.email])
|
||||||
|
{
|
||||||
|
oResultIdentity = oIdentitiesCache[oItem.email];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -585,14 +618,9 @@
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
if (this.bCapaAdditionalIdentities)
|
_.each(aIdentities, function (oItem) {
|
||||||
{
|
oIdentitiesCache[oItem.email()] = oItem;
|
||||||
_.each(IdentityStore.identities(), function (oItem) {
|
});
|
||||||
oIDs[oItem.email()] = oItem['id'];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
oIDs[AccountStore.email()] = AccountStore.email();
|
|
||||||
|
|
||||||
if (oMessage)
|
if (oMessage)
|
||||||
{
|
{
|
||||||
|
|
@ -612,18 +640,26 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === sResult)
|
if (!oResultIdentity)
|
||||||
{
|
{
|
||||||
sResult = IdentityStore.defaultIdentityID();
|
oResultIdentity = _.find(aIdentities, function (oItem) {
|
||||||
|
return oItem.id() === sDefaultIdentityID;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === sResult)
|
if (!oResultIdentity && '' !== sDefaultIdentityID)
|
||||||
{
|
{
|
||||||
sResult = AccountStore.email();
|
oResultIdentity = _.find(aIdentities, function (oItem) {
|
||||||
sEmail = sResult;
|
return oItem.id() === '';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return [sResult, sEmail];
|
if (!oResultIdentity)
|
||||||
|
{
|
||||||
|
oResultIdentity = aIdentities[0] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return oResultIdentity;
|
||||||
};
|
};
|
||||||
|
|
||||||
ComposePopupView.prototype.selectIdentity = function (oIdentity)
|
ComposePopupView.prototype.selectIdentity = function (oIdentity)
|
||||||
|
|
@ -631,28 +667,10 @@
|
||||||
if (oIdentity)
|
if (oIdentity)
|
||||||
{
|
{
|
||||||
this.currentIdentityID(oIdentity.optValue);
|
this.currentIdentityID(oIdentity.optValue);
|
||||||
|
Local.set(Enums.ClientSideKeyName.ComposeLastIdentityID, oIdentity.optValue);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {boolean=} bHeaderResult = false
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
ComposePopupView.prototype.formattedFrom = function (bHeaderResult)
|
|
||||||
{
|
|
||||||
var
|
|
||||||
sDisplayName = AccountStore.displayName(),
|
|
||||||
sEmail = AccountStore.email()
|
|
||||||
;
|
|
||||||
|
|
||||||
return '' === sDisplayName ? sEmail :
|
|
||||||
((Utils.isUnd(bHeaderResult) ? false : !!bHeaderResult) ?
|
|
||||||
'"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>' :
|
|
||||||
sDisplayName + ' (' + sEmail + ')')
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
ComposePopupView.prototype.sendMessageResponse = function (sResult, oData)
|
ComposePopupView.prototype.sendMessageResponse = function (sResult, oData)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
|
|
@ -964,7 +982,7 @@
|
||||||
sReplyTitle = '',
|
sReplyTitle = '',
|
||||||
aResplyAllParts = [],
|
aResplyAllParts = [],
|
||||||
oExcludeEmail = {},
|
oExcludeEmail = {},
|
||||||
oIdResult = null,
|
oIdentity = null,
|
||||||
mEmail = AccountStore.email(),
|
mEmail = AccountStore.email(),
|
||||||
sSignature = AccountStore.signature(),
|
sSignature = AccountStore.signature(),
|
||||||
aDownloads = [],
|
aDownloads = [],
|
||||||
|
|
@ -1000,15 +1018,21 @@
|
||||||
oExcludeEmail[mEmail] = true;
|
oExcludeEmail[mEmail] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
oIdResult = this.findIdentityIdByMessage(sComposeType, oMessage);
|
oIdentity = this.findIdentityByMessage(sComposeType, oMessage);
|
||||||
if (oIdResult && oIdResult[0])
|
if (oIdentity)
|
||||||
{
|
{
|
||||||
oExcludeEmail[oIdResult[1]] = true;
|
oExcludeEmail[oIdentity.email()] = true;
|
||||||
this.currentIdentityID(oIdResult[0]);
|
this.currentIdentityID(oIdentity.id());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.currentIdentityID('');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
||||||
|
this.currentIdentityID.valueHasMutated(); // Populate BBC from Identity
|
||||||
|
|
||||||
if (Utils.isNonEmptyArray(aToEmails))
|
if (Utils.isNonEmptyArray(aToEmails))
|
||||||
{
|
{
|
||||||
this.to(fEmailArrayToStringLineHelper(aToEmails));
|
this.to(fEmailArrayToStringLineHelper(aToEmails));
|
||||||
|
|
@ -1089,6 +1113,7 @@
|
||||||
this.to(fEmailArrayToStringLineHelper(oMessage.to));
|
this.to(fEmailArrayToStringLineHelper(oMessage.to));
|
||||||
this.cc(fEmailArrayToStringLineHelper(oMessage.cc));
|
this.cc(fEmailArrayToStringLineHelper(oMessage.cc));
|
||||||
this.bcc(fEmailArrayToStringLineHelper(oMessage.bcc));
|
this.bcc(fEmailArrayToStringLineHelper(oMessage.bcc));
|
||||||
|
this.replyTo(fEmailArrayToStringLineHelper(oMessage.replyTo));
|
||||||
|
|
||||||
this.bFromDraft = true;
|
this.bFromDraft = true;
|
||||||
|
|
||||||
|
|
@ -1107,6 +1132,7 @@
|
||||||
this.to(fEmailArrayToStringLineHelper(oMessage.to));
|
this.to(fEmailArrayToStringLineHelper(oMessage.to));
|
||||||
this.cc(fEmailArrayToStringLineHelper(oMessage.cc));
|
this.cc(fEmailArrayToStringLineHelper(oMessage.cc));
|
||||||
this.bcc(fEmailArrayToStringLineHelper(oMessage.bcc));
|
this.bcc(fEmailArrayToStringLineHelper(oMessage.bcc));
|
||||||
|
this.replyTo(fEmailArrayToStringLineHelper(oMessage.replyTo));
|
||||||
|
|
||||||
this.subject(sSubject);
|
this.subject(sSubject);
|
||||||
this.prepearMessageAttachments(oMessage, sComposeType);
|
this.prepearMessageAttachments(oMessage, sComposeType);
|
||||||
|
|
@ -1963,6 +1989,7 @@
|
||||||
return 0 === this.to().length &&
|
return 0 === this.to().length &&
|
||||||
0 === this.cc().length &&
|
0 === this.cc().length &&
|
||||||
0 === this.bcc().length &&
|
0 === this.bcc().length &&
|
||||||
|
0 === this.replyTo().length &&
|
||||||
0 === this.subject().length &&
|
0 === this.subject().length &&
|
||||||
bWithoutAttach &&
|
bWithoutAttach &&
|
||||||
(!this.oEditor || '' === this.oEditor.getData())
|
(!this.oEditor || '' === this.oEditor.getData())
|
||||||
|
|
@ -1997,6 +2024,7 @@
|
||||||
|
|
||||||
this.showCc(false);
|
this.showCc(false);
|
||||||
this.showBcc(false);
|
this.showBcc(false);
|
||||||
|
this.showReplyTo(false);
|
||||||
|
|
||||||
Utils.delegateRunOnDestroy(this.attachments());
|
Utils.delegateRunOnDestroy(this.attachments());
|
||||||
this.attachments([]);
|
this.attachments([]);
|
||||||
|
|
|
||||||
|
|
@ -215,25 +215,17 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ComposeOpenPgpPopupView.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc)
|
ComposeOpenPgpPopupView.prototype.onShow = function (fCallback, sText, oIdentity, sTo, sCc, sBcc)
|
||||||
{
|
{
|
||||||
this.clearPopup();
|
this.clearPopup();
|
||||||
|
|
||||||
var
|
var
|
||||||
oEmail = new EmailModel(),
|
aRec = [],
|
||||||
sResultFromEmail = '',
|
oEmail = new EmailModel()
|
||||||
aRec = []
|
|
||||||
;
|
;
|
||||||
|
|
||||||
this.resultCallback = fCallback;
|
this.resultCallback = fCallback;
|
||||||
|
|
||||||
oEmail.clear();
|
|
||||||
oEmail.mailsoParse(sFromEmail);
|
|
||||||
if ('' !== oEmail.email)
|
|
||||||
{
|
|
||||||
sResultFromEmail = oEmail.email;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('' !== sTo)
|
if ('' !== sTo)
|
||||||
{
|
{
|
||||||
aRec.push(sTo);
|
aRec.push(sTo);
|
||||||
|
|
@ -256,7 +248,7 @@
|
||||||
return '' === oEmail.email ? false : oEmail.email;
|
return '' === oEmail.email ? false : oEmail.email;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.from(sResultFromEmail);
|
this.from(oIdentity ? oIdentity.email() : '');
|
||||||
this.to(aRec);
|
this.to(aRec);
|
||||||
this.text(sText);
|
this.text(sText);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Translator = require('Common/Translator'),
|
Translator = require('Common/Translator'),
|
||||||
|
HtmlEditor = require('Common/HtmlEditor'),
|
||||||
|
|
||||||
Remote = require('Storage/User/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
AccountStore = require('Stores/User/Account'),
|
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -30,6 +30,9 @@
|
||||||
this.edit = ko.observable(false);
|
this.edit = ko.observable(false);
|
||||||
this.owner = ko.observable(false);
|
this.owner = ko.observable(false);
|
||||||
|
|
||||||
|
this.editor = null;
|
||||||
|
this.signatureDom = ko.observable(null);
|
||||||
|
|
||||||
this.email = ko.observable('').validateEmail();
|
this.email = ko.observable('').validateEmail();
|
||||||
this.email.focused = ko.observable(false);
|
this.email.focused = ko.observable(false);
|
||||||
this.name = ko.observable('');
|
this.name = ko.observable('');
|
||||||
|
|
@ -39,6 +42,8 @@
|
||||||
this.bcc = ko.observable('').validateSimpleEmail();
|
this.bcc = ko.observable('').validateSimpleEmail();
|
||||||
this.bcc.focused = ko.observable(false);
|
this.bcc.focused = ko.observable(false);
|
||||||
|
|
||||||
|
this.signature = ko.observable('');
|
||||||
|
|
||||||
// this.email.subscribe(function () {
|
// this.email.subscribe(function () {
|
||||||
// this.email.hasError(false);
|
// this.email.hasError(false);
|
||||||
// }, this);
|
// }, this);
|
||||||
|
|
@ -128,6 +133,11 @@
|
||||||
|
|
||||||
this.submitRequest(false);
|
this.submitRequest(false);
|
||||||
this.submitError('');
|
this.submitError('');
|
||||||
|
|
||||||
|
if (this.editor)
|
||||||
|
{
|
||||||
|
this.editor.clear(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -141,18 +151,58 @@
|
||||||
{
|
{
|
||||||
this.edit(true);
|
this.edit(true);
|
||||||
|
|
||||||
this.id = oIdentity.id;
|
this.id = oIdentity.id();
|
||||||
this.name(oIdentity.name());
|
this.name(oIdentity.name());
|
||||||
this.email(oIdentity.email());
|
this.email(oIdentity.email());
|
||||||
this.replyTo(oIdentity.replyTo());
|
this.replyTo(oIdentity.replyTo());
|
||||||
this.bcc(oIdentity.bcc());
|
this.bcc(oIdentity.bcc());
|
||||||
|
|
||||||
this.owner(this.id === AccountStore.email());
|
this.owner(this.id === '');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.id = Utils.fakeMd5();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
IdentityPopupView.prototype.onHide = function ()
|
||||||
|
{
|
||||||
|
this.clearPopup();
|
||||||
|
};
|
||||||
|
|
||||||
|
IdentityPopupView.prototype.setSignature = function (sSignature)
|
||||||
|
{
|
||||||
|
if (this.editor)
|
||||||
|
{
|
||||||
|
if (':HTML:' === sSignature.substr(0, 6))
|
||||||
|
{
|
||||||
|
this.editor.setHtml(sSignature.substr(6), false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.editor.setPlain(sSignature, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IdentityPopupView.prototype.onFocus = function ()
|
IdentityPopupView.prototype.onFocus = function ()
|
||||||
{
|
{
|
||||||
|
if (!this.editor && this.signatureDom())
|
||||||
|
{
|
||||||
|
var self = this;
|
||||||
|
this.editor = new HtmlEditor(self.signatureDom(), function () {
|
||||||
|
self.signature(
|
||||||
|
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
|
||||||
|
);
|
||||||
|
}, function () {
|
||||||
|
self.setSignature(self.signature());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.setSignature(this.signature());
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.owner())
|
if (!this.owner())
|
||||||
{
|
{
|
||||||
this.email.focused(true);
|
this.email.focused(true);
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
{
|
{
|
||||||
if (this.capaAdditionalAccounts())
|
if (this.capaAdditionalAccounts())
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Account'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@
|
||||||
this.viewTo = ko.observable('');
|
this.viewTo = ko.observable('');
|
||||||
this.viewCc = ko.observable('');
|
this.viewCc = ko.observable('');
|
||||||
this.viewBcc = ko.observable('');
|
this.viewBcc = ko.observable('');
|
||||||
|
this.viewReplyTo = ko.observable('');
|
||||||
this.viewDate = ko.observable('');
|
this.viewDate = ko.observable('');
|
||||||
this.viewSize = ko.observable('');
|
this.viewSize = ko.observable('');
|
||||||
this.viewMoment = ko.observable('');
|
this.viewMoment = ko.observable('');
|
||||||
|
|
@ -267,6 +268,7 @@
|
||||||
this.viewTo(oMessage.toToLine(false));
|
this.viewTo(oMessage.toToLine(false));
|
||||||
this.viewCc(oMessage.ccToLine(false));
|
this.viewCc(oMessage.ccToLine(false));
|
||||||
this.viewBcc(oMessage.bccToLine(false));
|
this.viewBcc(oMessage.bccToLine(false));
|
||||||
|
this.viewReplyTo(oMessage.replyToToLine(false));
|
||||||
this.viewDate(oMessage.fullFormatDateValue());
|
this.viewDate(oMessage.fullFormatDateValue());
|
||||||
this.viewSize(oMessage.friendlySize());
|
this.viewSize(oMessage.friendlySize());
|
||||||
this.viewMoment(oMessage.momentDate());
|
this.viewMoment(oMessage.momentDate());
|
||||||
|
|
|
||||||
|
|
@ -232,11 +232,11 @@ abstract class NetClient
|
||||||
$this->bSecure = \MailSo\Net\Enumerations\ConnectionSecurityType::UseSSL(
|
$this->bSecure = \MailSo\Net\Enumerations\ConnectionSecurityType::UseSSL(
|
||||||
$this->iConnectedPort, $this->iSecurityType);
|
$this->iConnectedPort, $this->iSecurityType);
|
||||||
|
|
||||||
$this->sConnectedHost = \in_array(\strtolower(\substr($this->sConnectedHost, 0, 6)), array('ssl://', 'tcp://')) ?
|
if (!\preg_match('/^[a-z0-9._]{2,8}:\/\//i', $this->sConnectedHost))
|
||||||
\substr($this->sConnectedHost, 6) : $this->sConnectedHost;
|
{
|
||||||
|
$this->sConnectedHost = ($this->bSecure ? 'ssl://' : 'tcp://').$this->sConnectedHost;
|
||||||
$this->sConnectedHost = ($this->bSecure ? 'ssl://' : 'tcp://').$this->sConnectedHost;
|
// $this->sConnectedHost = ($this->bSecure ? 'ssl://' : '').$this->sConnectedHost;
|
||||||
// $this->sConnectedHost = ($this->bSecure ? 'ssl://' : '').$this->sConnectedHost;
|
}
|
||||||
|
|
||||||
if (!$this->bSecure && \MailSo\Net\Enumerations\ConnectionSecurityType::SSL === $this->iSecurityType)
|
if (!$this->bSecure && \MailSo\Net\Enumerations\ConnectionSecurityType::SSL === $this->iSecurityType)
|
||||||
{
|
{
|
||||||
|
|
@ -307,21 +307,29 @@ abstract class NetClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function EnableCrypto()
|
||||||
* @param {int} $iCryptoType = STREAM_CRYPTO_METHOD_TLS_CLIENT
|
|
||||||
*/
|
|
||||||
public function EnableCrypto($iCryptoType = STREAM_CRYPTO_METHOD_TLS_CLIENT)
|
|
||||||
{
|
{
|
||||||
|
$bError = true;
|
||||||
if (\is_resource($this->rConnect) &&
|
if (\is_resource($this->rConnect) &&
|
||||||
\MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto'))
|
\MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto'))
|
||||||
{
|
{
|
||||||
if (!@\stream_socket_enable_crypto($this->rConnect, true, $iCryptoType))
|
switch (true)
|
||||||
{
|
{
|
||||||
$this->writeLogException(
|
case defined('STREAM_CRYPTO_METHOD_ANY_CLIENT') &&
|
||||||
new \MailSo\Net\Exceptions\Exception('Cannot enable STARTTLS. [type='.$iCryptoType.']'),
|
@\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_ANY_CLIENT):
|
||||||
\MailSo\Log\Enumerations\Type::ERROR, true);
|
case @\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_TLS_CLIENT):
|
||||||
|
case @\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT):
|
||||||
|
$bError = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($bError)
|
||||||
|
{
|
||||||
|
$this->writeLogException(
|
||||||
|
new \MailSo\Net\Exceptions\Exception('Cannot enable STARTTLS.'),
|
||||||
|
\MailSo\Log\Enumerations\Type::ERROR, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1521,9 +1521,6 @@ class Actions
|
||||||
$aResult['UseThreads'] = (bool) $oConfig->Get('defaults', 'mail_use_threads', false);
|
$aResult['UseThreads'] = (bool) $oConfig->Get('defaults', 'mail_use_threads', false);
|
||||||
$aResult['ReplySameFolder'] = (bool) $oConfig->Get('defaults', 'mail_reply_same_folder', false);
|
$aResult['ReplySameFolder'] = (bool) $oConfig->Get('defaults', 'mail_reply_same_folder', false);
|
||||||
$aResult['ContactsAutosave'] = (bool) $oConfig->Get('defaults', 'contacts_autosave', true);
|
$aResult['ContactsAutosave'] = (bool) $oConfig->Get('defaults', 'contacts_autosave', true);
|
||||||
$aResult['DefaultIdentityID'] = '';
|
|
||||||
$aResult['DisplayName'] = '';
|
|
||||||
$aResult['ReplyTo'] = '';
|
|
||||||
$aResult['Signature'] = '';
|
$aResult['Signature'] = '';
|
||||||
$aResult['EnableTwoFactor'] = false;
|
$aResult['EnableTwoFactor'] = false;
|
||||||
$aResult['ParentEmail'] = '';
|
$aResult['ParentEmail'] = '';
|
||||||
|
|
@ -1557,12 +1554,14 @@ class Actions
|
||||||
$aResult['MPP'] = (int) $oSettings->GetConf('MPP', $aResult['MPP']);
|
$aResult['MPP'] = (int) $oSettings->GetConf('MPP', $aResult['MPP']);
|
||||||
$aResult['SoundNotification'] = (bool) $oSettings->GetConf('SoundNotification', $aResult['SoundNotification']);
|
$aResult['SoundNotification'] = (bool) $oSettings->GetConf('SoundNotification', $aResult['SoundNotification']);
|
||||||
$aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']);
|
$aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']);
|
||||||
$aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']);
|
|
||||||
$aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']);
|
$aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']);
|
||||||
|
$aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']);
|
||||||
|
|
||||||
$aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']);
|
$aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']);
|
||||||
$aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']);
|
$aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']);
|
||||||
|
|
||||||
|
$aResult['Signature'] = $oSettingsLocal->GetConf('Signature', $aResult['Signature']);
|
||||||
|
|
||||||
if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount))
|
if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount))
|
||||||
{
|
{
|
||||||
$aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']);
|
$aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']);
|
||||||
|
|
@ -1574,11 +1573,6 @@ class Actions
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
$aResult['DefaultIdentityID'] = $oSettingsLocal->GetConf('DefaultIdentityID', $oAccount ? $oAccount->Email() : $aResult['DefaultIdentityID']);
|
|
||||||
$aResult['DisplayName'] = $oSettingsLocal->GetConf('DisplayName', $aResult['DisplayName']);
|
|
||||||
$aResult['ReplyTo'] = $oSettingsLocal->GetConf('ReplyTo', $aResult['ReplyTo']);
|
|
||||||
$aResult['Signature'] = $oSettingsLocal->GetConf('Signature', $aResult['Signature']);
|
|
||||||
|
|
||||||
$aResult['EnableTwoFactor'] = !!$oSettings->GetConf('EnableTwoFactor', $aResult['EnableTwoFactor']);
|
$aResult['EnableTwoFactor'] = !!$oSettings->GetConf('EnableTwoFactor', $aResult['EnableTwoFactor']);
|
||||||
|
|
||||||
$aResult['ParentEmail'] = $oAccount->ParentEmail();
|
$aResult['ParentEmail'] = $oAccount->ParentEmail();
|
||||||
|
|
@ -2088,7 +2082,11 @@ class Actions
|
||||||
'accounts'
|
'accounts'
|
||||||
);
|
);
|
||||||
|
|
||||||
$aAccounts = $sAccounts ? @\unserialize($sAccounts) : array();
|
if ('' !== $sAccounts && '{' === \substr($sAccounts, 0, 1))
|
||||||
|
{
|
||||||
|
$aAccounts = @\json_decode($sAccounts, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (\is_array($aAccounts) && 0 < \count($aAccounts))
|
if (\is_array($aAccounts) && 0 < \count($aAccounts))
|
||||||
{
|
{
|
||||||
if (1 === \count($aAccounts))
|
if (1 === \count($aAccounts))
|
||||||
|
|
@ -2135,31 +2133,47 @@ class Actions
|
||||||
{
|
{
|
||||||
$aSubIdentities = array();
|
$aSubIdentities = array();
|
||||||
|
|
||||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
$sData = $this->StorageProvider(true)->Get($oAccount,
|
||||||
if ($oSettingsLocal)
|
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
|
||||||
|
'identities'
|
||||||
|
);
|
||||||
|
|
||||||
|
if ('' !== $sData && '[' === \substr($sData, 0, 1))
|
||||||
{
|
{
|
||||||
$sData = $oSettingsLocal->GetConf('Identities', '');
|
$aSubIdentities = @\json_decode($sData, true);
|
||||||
if ('' !== $sData && '[' === \substr($sData, 0, 1))
|
|
||||||
{
|
|
||||||
$aSubIdentities = @\json_decode($sData, true);
|
|
||||||
$aSubIdentities = \is_array($aSubIdentities) ? $aSubIdentities : array();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 < \count($aSubIdentities))
|
$bHasAccountIdentity = false;
|
||||||
|
|
||||||
|
if (\is_array($aSubIdentities) && 0 < \count($aSubIdentities))
|
||||||
{
|
{
|
||||||
foreach ($aSubIdentities as $aItem)
|
foreach ($aSubIdentities as $aItem)
|
||||||
{
|
{
|
||||||
if (isset($aItem['Id'], $aItem['Email'], $aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']) &&
|
$oItem = \RainLoop\Model\Identity::NewInstance();
|
||||||
$aItem['Id'] !== $oAccount->Email())
|
$oItem->FromJSON($aItem);
|
||||||
{
|
|
||||||
$oItem = \RainLoop\Model\Identity::NewInstance($aItem['Id'], $aItem['Email'],
|
|
||||||
$aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']);
|
|
||||||
|
|
||||||
$aIdentities[] = $oItem;
|
if ($oItem && $oItem->Validate())
|
||||||
|
{
|
||||||
|
if ('' === $oItem->Id())
|
||||||
|
{
|
||||||
|
$oItem->SetEmail($oAccount->Email());
|
||||||
|
$bHasAccountIdentity = true;
|
||||||
|
|
||||||
|
\array_unshift($aIdentities, $oItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
\array_push($aIdentities, $oItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$bHasAccountIdentity)
|
||||||
|
{
|
||||||
|
\array_unshift($aIdentities,
|
||||||
|
\RainLoop\Model\Identity::NewInstanceFromAccount($oAccount));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $aIdentities;
|
return $aIdentities;
|
||||||
|
|
@ -2167,61 +2181,35 @@ class Actions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \RainLoop\Model\Account $oAccount
|
* @param \RainLoop\Model\Account $oAccount
|
||||||
|
* @param string $sID
|
||||||
|
* @param bool $bFirstOnEmpty = false
|
||||||
*
|
*
|
||||||
* @return array
|
* @return \RainLoop\Model\Identity
|
||||||
*/
|
*/
|
||||||
public function GetIdentitiesNew($oAccount)
|
public function GetIdentityByID($oAccount, $sID, $bFirstOnEmpty = false)
|
||||||
{
|
{
|
||||||
$aIdentities = array();
|
$aIdentities = $this->GetIdentities($oAccount);
|
||||||
if ($oAccount)
|
if (\is_array($aIdentities))
|
||||||
{
|
{
|
||||||
$oAccountIdentity = \RainLoop\Model\Identity::NewInstance('', $oAccount->Email());
|
foreach ($aIdentities as $oIdentity)
|
||||||
|
|
||||||
$aSubIdentities = array();
|
|
||||||
|
|
||||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
|
||||||
if ($oSettingsLocal)
|
|
||||||
{
|
{
|
||||||
$sData = $oSettingsLocal->GetConf('Identities', '');
|
if ($oIdentity && $sID === $oIdentity->Id())
|
||||||
if ('' !== $sData && '[' === \substr($sData, 0, 1))
|
|
||||||
{
|
{
|
||||||
$aSubIdentities = @\json_decode($sData, true);
|
return $oIdentity;
|
||||||
$aSubIdentities = \is_array($aSubIdentities) ? $aSubIdentities : array();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 < \count($aSubIdentities))
|
|
||||||
{
|
|
||||||
foreach ($aSubIdentities as $aItem)
|
|
||||||
{
|
|
||||||
if (isset($aItem['Id'], $aItem['Email']))
|
|
||||||
{
|
|
||||||
if (0 < \strlen($aItem['Id']))
|
|
||||||
{
|
|
||||||
$oItem = \RainLoop\Model\Identity::NewInstance($aItem['Id'], $aItem['Email']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$oItem = $oAccountIdentity;
|
|
||||||
}
|
|
||||||
|
|
||||||
$oItem->SetName(isset($aItem['Name']) ? $aItem['Name'] : '');
|
|
||||||
$oItem->SetReplyTo(isset($aItem['ReplyTo']) ? $aItem['ReplyTo'] : '');
|
|
||||||
$oItem->SetBcc(isset($aItem['Bcc']) ? $aItem['Bcc'] : '');
|
|
||||||
$oItem->SetSignature(isset($aItem['Signature']) ? $aItem['Signature'] : '');
|
|
||||||
|
|
||||||
if ('' !== $oItem->Id())
|
|
||||||
{
|
|
||||||
\array_push($aIdentities, $oItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
\array_unshift($aIdentities, $oAccountIdentity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $aIdentities;
|
return $bFirstOnEmpty && \is_array($aIdentities) && isset($aIdentities[0]) ? $aIdentities[0] : null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param \RainLoop\Model\Account $oAccount
|
||||||
|
*
|
||||||
|
* @return \RainLoop\Model\Identity
|
||||||
|
*/
|
||||||
|
public function GetAccountIdentity($oAccount)
|
||||||
|
{
|
||||||
|
return $this->GetIdentityByID($oAccount, '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2246,7 +2234,7 @@ class Actions
|
||||||
$this->StorageProvider()->Put($oAccount,
|
$this->StorageProvider()->Put($oAccount,
|
||||||
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
|
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
|
||||||
'accounts',
|
'accounts',
|
||||||
@\serialize($aAccounts)
|
@\json_encode($aAccounts)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2259,20 +2247,17 @@ class Actions
|
||||||
*/
|
*/
|
||||||
public function SetIdentities($oAccount, $aIdentities = array())
|
public function SetIdentities($oAccount, $aIdentities = array())
|
||||||
{
|
{
|
||||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
$aResult = array();
|
||||||
if ($oSettingsLocal)
|
foreach ($aIdentities as $oItem)
|
||||||
{
|
{
|
||||||
$aResult = array();
|
$aResult[] = $oItem->ToSimpleJSON(false);
|
||||||
foreach ($aIdentities as $oItem)
|
|
||||||
{
|
|
||||||
$aResult[] = $oItem->ToSimpleJSON(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
$oSettingsLocal->SetConf('Identities', @\json_encode($aResult));
|
|
||||||
return $this->SettingsProvider(true)->Save($oAccount, $oSettingsLocal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return $this->StorageProvider(true)->Put($oAccount,
|
||||||
|
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
|
||||||
|
'identities',
|
||||||
|
@\json_encode($aResult)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2443,55 +2428,26 @@ class Actions
|
||||||
{
|
{
|
||||||
$oAccount = $this->getAccountFromToken();
|
$oAccount = $this->getAccountFromToken();
|
||||||
|
|
||||||
if (!$this->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES, $oAccount))
|
$oIdentity = \RainLoop\Model\Identity::NewInstance();
|
||||||
|
if (!$oIdentity->FromJSON($this->GetActionParams(), true))
|
||||||
{
|
{
|
||||||
return $this->FalseResponse(__FUNCTION__);
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidInputArgument);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sId = \trim($this->GetActionParam('Id', ''));
|
$aIdentitiesForSave = array();
|
||||||
$sEmail = \trim($this->GetActionParam('Email', ''));
|
|
||||||
$sName = \trim($this->GetActionParam('Name', ''));
|
|
||||||
$sReplyTo = \trim($this->GetActionParam('ReplyTo', ''));
|
|
||||||
$sBcc = \trim($this->GetActionParam('Bcc', ''));
|
|
||||||
|
|
||||||
if (empty($sEmail))
|
|
||||||
{
|
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
|
|
||||||
}
|
|
||||||
|
|
||||||
$oEditIdentity = null;
|
|
||||||
$aIdentities = $this->GetIdentities($oAccount);
|
$aIdentities = $this->GetIdentities($oAccount);
|
||||||
if (0 < \strlen($sId))
|
foreach ($aIdentities as $oItem)
|
||||||
{
|
{
|
||||||
foreach ($aIdentities as &$oItem)
|
if ($oItem && $oItem->Id() !== $oIdentity->Id())
|
||||||
{
|
{
|
||||||
if ($oItem && $sId === $oItem->Id())
|
$aIdentitiesForSave[] = $oItem;
|
||||||
{
|
|
||||||
$oEditIdentity =& $oItem;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$sId = \md5($sEmail.\microtime(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$oEditIdentity)
|
$aIdentitiesForSave[] = $oIdentity;
|
||||||
{
|
|
||||||
$aIdentities[] = \RainLoop\Model\Identity::NewInstance($sId, $sEmail, $sName, $sReplyTo, $sBcc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$oEditIdentity
|
|
||||||
->SetEmail($sEmail)
|
|
||||||
->SetName($sName)
|
|
||||||
->SetReplyTo($sReplyTo)
|
|
||||||
->SetBcc($sBcc)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aIdentities));
|
return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aIdentitiesForSave));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2503,11 +2459,6 @@ class Actions
|
||||||
{
|
{
|
||||||
$oAccount = $this->getAccountFromToken();
|
$oAccount = $this->getAccountFromToken();
|
||||||
|
|
||||||
if (!$this->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES, $oAccount))
|
|
||||||
{
|
|
||||||
return $this->FalseResponse(__FUNCTION__);
|
|
||||||
}
|
|
||||||
|
|
||||||
$sId = \trim($this->GetActionParam('IdToDelete', ''));
|
$sId = \trim($this->GetActionParam('IdToDelete', ''));
|
||||||
if (empty($sId))
|
if (empty($sId))
|
||||||
{
|
{
|
||||||
|
|
@ -2569,15 +2520,9 @@ class Actions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mIdentities = false;
|
|
||||||
if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES, $oAccount))
|
|
||||||
{
|
|
||||||
$mIdentities = $this->GetIdentities($oAccount);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, array(
|
return $this->DefaultResponse(__FUNCTION__, array(
|
||||||
'Accounts' => $mAccounts,
|
'Accounts' => $mAccounts,
|
||||||
'Identities' => $mIdentities
|
'Identities' => $this->GetIdentities($oAccount)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2663,33 +2608,6 @@ class Actions
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @throws \MailSo\Base\Exceptions\Exception
|
|
||||||
*/
|
|
||||||
public function DoAccountsAndIdentitiesNew()
|
|
||||||
{
|
|
||||||
$oAccount = $this->getAccountFromToken();
|
|
||||||
|
|
||||||
$mAccounts = false;
|
|
||||||
if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount))
|
|
||||||
{
|
|
||||||
$mAccounts = $this->GetAccounts($oAccount);
|
|
||||||
$mAccounts = \array_keys($mAccounts);
|
|
||||||
|
|
||||||
foreach ($mAccounts as $iIndex => $sName)
|
|
||||||
{
|
|
||||||
$mAccounts[$iIndex] = \MailSo\Base\Utils::IdnToUtf8($sName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, array(
|
|
||||||
'Accounts' => $mAccounts,
|
|
||||||
'Identities' => $this->GetIdentitiesNew($oAccount)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \RainLoop\Model\Account $oAccount
|
* @param \RainLoop\Model\Account $oAccount
|
||||||
*/
|
*/
|
||||||
|
|
@ -2879,9 +2797,6 @@ class Actions
|
||||||
case \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS:
|
case \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS:
|
||||||
$this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_additional_accounts', 'bool');
|
$this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_additional_accounts', 'bool');
|
||||||
break;
|
break;
|
||||||
case \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES:
|
|
||||||
$this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_identities', 'bool');
|
|
||||||
break;
|
|
||||||
case \RainLoop\Enumerations\Capa::TWO_FACTOR:
|
case \RainLoop\Enumerations\Capa::TWO_FACTOR:
|
||||||
$this->setConfigFromParams($oConfig, $sParamName, 'security', 'allow_two_factor_auth', 'bool');
|
$this->setConfigFromParams($oConfig, $sParamName, 'security', 'allow_two_factor_auth', 'bool');
|
||||||
break;
|
break;
|
||||||
|
|
@ -2984,7 +2899,6 @@ class Actions
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->setCapaFromParams($oConfig, 'CapaAdditionalAccounts', \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS);
|
$this->setCapaFromParams($oConfig, 'CapaAdditionalAccounts', \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS);
|
||||||
$this->setCapaFromParams($oConfig, 'CapaAdditionalIdentities', \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES);
|
|
||||||
$this->setCapaFromParams($oConfig, 'CapaTwoFactorAuth', \RainLoop\Enumerations\Capa::TWO_FACTOR);
|
$this->setCapaFromParams($oConfig, 'CapaTwoFactorAuth', \RainLoop\Enumerations\Capa::TWO_FACTOR);
|
||||||
$this->setCapaFromParams($oConfig, 'CapaOpenPGP', \RainLoop\Enumerations\Capa::OPEN_PGP);
|
$this->setCapaFromParams($oConfig, 'CapaOpenPGP', \RainLoop\Enumerations\Capa::OPEN_PGP);
|
||||||
$this->setCapaFromParams($oConfig, 'CapaGravatar', \RainLoop\Enumerations\Capa::GRAVATAR);
|
$this->setCapaFromParams($oConfig, 'CapaGravatar', \RainLoop\Enumerations\Capa::GRAVATAR);
|
||||||
|
|
@ -4461,9 +4375,6 @@ class Actions
|
||||||
$this->setSettingsFromParams($oSettingsLocal, 'UseThreads', 'bool');
|
$this->setSettingsFromParams($oSettingsLocal, 'UseThreads', 'bool');
|
||||||
$this->setSettingsFromParams($oSettingsLocal, 'ReplySameFolder', 'bool');
|
$this->setSettingsFromParams($oSettingsLocal, 'ReplySameFolder', 'bool');
|
||||||
|
|
||||||
$this->setSettingsFromParams($oSettingsLocal, 'DefaultIdentityID', 'string');
|
|
||||||
$this->setSettingsFromParams($oSettingsLocal, 'DisplayName', 'string');
|
|
||||||
$this->setSettingsFromParams($oSettingsLocal, 'ReplyTo', 'string');
|
|
||||||
$this->setSettingsFromParams($oSettingsLocal, 'Signature', 'string');
|
$this->setSettingsFromParams($oSettingsLocal, 'Signature', 'string');
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__,
|
return $this->DefaultResponse(__FUNCTION__,
|
||||||
|
|
@ -5204,10 +5115,11 @@ class Actions
|
||||||
*/
|
*/
|
||||||
private function buildMessage($oAccount, $bWithDraftInfo = true)
|
private function buildMessage($oAccount, $bWithDraftInfo = true)
|
||||||
{
|
{
|
||||||
$sFrom = $this->GetActionParam('From', '');
|
$sIdentityID = $this->GetActionParam('IdentityID', '');
|
||||||
$sTo = $this->GetActionParam('To', '');
|
$sTo = $this->GetActionParam('To', '');
|
||||||
$sCc = $this->GetActionParam('Cc', '');
|
$sCc = $this->GetActionParam('Cc', '');
|
||||||
$sBcc = $this->GetActionParam('Bcc', '');
|
$sBcc = $this->GetActionParam('Bcc', '');
|
||||||
|
$sReplyTo = $this->GetActionParam('ReplyTo', '');
|
||||||
$sSubject = $this->GetActionParam('Subject', '');
|
$sSubject = $this->GetActionParam('Subject', '');
|
||||||
$bTextIsHtml = '1' === $this->GetActionParam('TextIsHtml', '0');
|
$bTextIsHtml = '1' === $this->GetActionParam('TextIsHtml', '0');
|
||||||
$bReadReceiptRequest = '1' === $this->GetActionParam('ReadReceiptRequest', '0');
|
$bReadReceiptRequest = '1' === $this->GetActionParam('ReadReceiptRequest', '0');
|
||||||
|
|
@ -5224,26 +5136,23 @@ class Actions
|
||||||
|
|
||||||
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
|
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
|
||||||
|
|
||||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
$oFromIdentity = $this->GetIdentityByID($oAccount, $sIdentityID);
|
||||||
|
if ($oFromIdentity)
|
||||||
if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES, $oAccount))
|
|
||||||
{
|
{
|
||||||
$oMessage->SetFrom(\MailSo\Mime\Email::Parse($sFrom));
|
$oMessage->SetFrom(\MailSo\Mime\Email::NewInstance(
|
||||||
|
$oFromIdentity->Email(), $oFromIdentity->Name()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sDisplayName = \trim($oSettingsLocal->GetConf('DisplayName', ''));
|
$oMessage->SetFrom(\MailSo\Mime\Email::Parse($oAccount->Email()));
|
||||||
$sReplyTo = \trim($oSettingsLocal->GetConf('ReplyTo', ''));
|
}
|
||||||
|
|
||||||
$oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oAccount->Email(), $sDisplayName));
|
if (!empty($sReplyTo))
|
||||||
|
{
|
||||||
if (!empty($sReplyTo))
|
$oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo);
|
||||||
|
if ($oReplyTo && 0 < $oReplyTo->Count())
|
||||||
{
|
{
|
||||||
$oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo);
|
$oMessage->SetReplyTo($oReplyTo);
|
||||||
if ($oReplyTo && $oReplyTo->Count())
|
|
||||||
{
|
|
||||||
$oMessage->SetReplyTo($oReplyTo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5380,7 +5289,9 @@ class Actions
|
||||||
$sSubject = $this->GetActionParam('Subject', '');
|
$sSubject = $this->GetActionParam('Subject', '');
|
||||||
$sText = $this->GetActionParam('Text', '');
|
$sText = $this->GetActionParam('Text', '');
|
||||||
|
|
||||||
if (empty($sReadReceipt) || empty($sSubject) || empty($sText))
|
$oIdentity = $this->GetAccountIdentity($oAccount);
|
||||||
|
|
||||||
|
if (empty($sReadReceipt) || empty($sSubject) || empty($sText) || !$oIdentity)
|
||||||
{
|
{
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
|
||||||
}
|
}
|
||||||
|
|
@ -5390,13 +5301,9 @@ class Actions
|
||||||
|
|
||||||
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
|
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
|
||||||
|
|
||||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
$oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oIdentity->Email(), $oIdentity->Name()));
|
||||||
|
|
||||||
$sDisplayName = \trim($oSettingsLocal->GetConf('DisplayName', ''));
|
|
||||||
$sReplyTo = \trim($oSettingsLocal->GetConf('ReplyTo', ''));
|
|
||||||
|
|
||||||
$oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oAccount->Email(), $sDisplayName));
|
|
||||||
|
|
||||||
|
$sReplyTo = $oIdentity->ReplyTo();
|
||||||
if (!empty($sReplyTo))
|
if (!empty($sReplyTo))
|
||||||
{
|
{
|
||||||
$oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo);
|
$oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo);
|
||||||
|
|
@ -7374,11 +7281,6 @@ class Actions
|
||||||
$aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS;
|
$aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oConfig->Get('webmail', 'allow_identities', true))
|
|
||||||
{
|
|
||||||
$aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_IDENTITIES;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($oConfig->Get('security', 'allow_two_factor_auth', false) &&
|
if ($oConfig->Get('security', 'allow_two_factor_auth', false) &&
|
||||||
($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount())))
|
($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount())))
|
||||||
{
|
{
|
||||||
|
|
@ -8284,6 +8186,14 @@ class Actions
|
||||||
$this->aCurrentActionParams[$sKey] : $mDefault;
|
$this->aCurrentActionParams[$sKey] : $mDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function GetActionParams()
|
||||||
|
{
|
||||||
|
return $this->aCurrentActionParams;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sKey
|
* @param string $sKey
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,4 @@ class Capa
|
||||||
const FILTERS = 'FILTERS';
|
const FILTERS = 'FILTERS';
|
||||||
const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS';
|
const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS';
|
||||||
const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS';
|
const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS';
|
||||||
const ADDITIONAL_IDENTITIES = 'ADDITIONAL_IDENTITIES';
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,35 +30,36 @@ class Identity
|
||||||
private $sBcc;
|
private $sBcc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sId
|
* @param string $sId = ''
|
||||||
* @param string $sEmail
|
* @param string $sEmail = ''
|
||||||
* @param string $sName
|
|
||||||
* @param string $sReplyTo
|
|
||||||
* @param string $sBcc
|
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __construct($sId, $sEmail, $sName, $sReplyTo, $sBcc)
|
protected function __construct($sId = '', $sEmail = '')
|
||||||
{
|
{
|
||||||
$this->sId = $sId;
|
$this->sId = $sId;
|
||||||
$this->sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail, true);
|
$this->sEmail = $sEmail;
|
||||||
$this->sName = \trim($sName);
|
$this->sName = '';
|
||||||
$this->sReplyTo = \trim($sReplyTo);
|
$this->sReplyTo = '';
|
||||||
$this->sBcc = \trim($sBcc);
|
$this->sBcc = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sId
|
* @return \RainLoop\Model\Identity
|
||||||
* @param string $sEmail
|
*/
|
||||||
* @param string $sName = ''
|
public static function NewInstance()
|
||||||
* @param string $sReplyTo = ''
|
{
|
||||||
* @param string $sBcc = ''
|
return new self();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \RainLoop\Model\Account $oAccount
|
||||||
*
|
*
|
||||||
* @return \RainLoop\Model\Identity
|
* @return \RainLoop\Model\Identity
|
||||||
*/
|
*/
|
||||||
public static function NewInstance($sId, $sEmail, $sName = '', $sReplyTo = '', $sBcc = '')
|
public static function NewInstanceFromAccount(\RainLoop\Model\Account $oAccount)
|
||||||
{
|
{
|
||||||
return new self($sId, $sEmail, $sName, $sReplyTo, $sBcc);
|
return new self('', $oAccount->Email());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -69,18 +70,6 @@ class Identity
|
||||||
return $this->sId;
|
return $this->sId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sId
|
|
||||||
*
|
|
||||||
* @return \RainLoop\Model\Identity
|
|
||||||
*/
|
|
||||||
public function SetId($sId)
|
|
||||||
{
|
|
||||||
$this->sId = $sId;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
@ -96,7 +85,7 @@ class Identity
|
||||||
*/
|
*/
|
||||||
public function SetEmail($sEmail)
|
public function SetEmail($sEmail)
|
||||||
{
|
{
|
||||||
$this->sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail, true);
|
$this->sEmail = $sEmail;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
@ -109,18 +98,6 @@ class Identity
|
||||||
return $this->sName;
|
return $this->sName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sName
|
|
||||||
*
|
|
||||||
* @return \RainLoop\Model\Identity
|
|
||||||
*/
|
|
||||||
public function SetName($sName)
|
|
||||||
{
|
|
||||||
$this->sName = $sName;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
@ -129,18 +106,6 @@ class Identity
|
||||||
return $this->sReplyTo;
|
return $this->sReplyTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sReplyTo
|
|
||||||
*
|
|
||||||
* @return \RainLoop\Model\Identity
|
|
||||||
*/
|
|
||||||
public function SetReplyTo($sReplyTo)
|
|
||||||
{
|
|
||||||
$this->sReplyTo = $sReplyTo;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
@ -150,15 +115,25 @@ class Identity
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sBcc
|
* @param array $aData
|
||||||
|
* @param bool $bAjax = false
|
||||||
*
|
*
|
||||||
* @return \RainLoop\Model\Identity
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function SetBcc($sBcc)
|
public function FromJSON($aData, $bAjax = false)
|
||||||
{
|
{
|
||||||
$this->sBcc = $sBcc;
|
if (isset($aData['Id'], $aData['Email']) && !empty($aData['Email']))
|
||||||
|
{
|
||||||
|
$this->sId = $aData['Id'];
|
||||||
|
$this->sEmail = $bAjax ? \MailSo\Base\Utils::IdnToAscii($aData['Email'], true) : $aData['Email'];
|
||||||
|
$this->sName = isset($aData['Name']) ? $aData['Name'] : '';
|
||||||
|
$this->sReplyTo = !empty($aData['ReplyTo']) ? $aData['ReplyTo'] : '';
|
||||||
|
$this->sBcc = !empty($aData['Bcc']) ? $aData['Bcc'] : '';
|
||||||
|
|
||||||
return $this;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -176,4 +151,12 @@ class Identity
|
||||||
'Bcc' => $this->Bcc()
|
'Bcc' => $this->Bcc()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function Validate()
|
||||||
|
{
|
||||||
|
return !empty($this->sEmail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
<meta http-equiv="refresh" content="0; URL=./?/BadBrowser" />
|
<meta http-equiv="refresh" content="0; URL=./?/BadBrowser" />
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<script data-cfasync="false">
|
<script data-cfasync="false">
|
||||||
window.__rlt__ = (new Date).getTime();
|
|
||||||
if (!window.navigator || !window.navigator.cookieEnabled) {
|
if (!window.navigator || !window.navigator.cookieEnabled) {
|
||||||
window.document.location.replace('./?/NoCookie');
|
window.document.location.replace('./?/NoCookie');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,13 +136,6 @@
|
||||||
value: capaAdditionalAccounts
|
value: capaAdditionalAccounts
|
||||||
}
|
}
|
||||||
}"></div>
|
}"></div>
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'Checkbox',
|
|
||||||
params: {
|
|
||||||
label: 'Allow additional identities',
|
|
||||||
value: capaAdditionalIdentities
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,11 @@
|
||||||
|
|
||||||
<span class="bcc" data-bind="text: viewBcc, title: viewBcc"></span>
|
<span class="bcc" data-bind="text: viewBcc, title: viewBcc"></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div data-bind="visible: '' !== viewReplyTo()">
|
||||||
|
<span class="i18n uiLabel labelBcc" data-i18n-text="MESSAGE/LABEL_REPLY_TO"></span>:
|
||||||
|
|
||||||
|
<span class="bcc" data-bind="text: viewReplyTo, title: viewReplyTo"></span>
|
||||||
|
</div>
|
||||||
<div data-bind="visible: '' !== viewDate()">
|
<div data-bind="visible: '' !== viewDate()">
|
||||||
<span class="i18n uiLabel labelBcc" data-i18n-text="MESSAGE/LABEL_DATE"></span>:
|
<span class="i18n uiLabel labelBcc" data-i18n-text="MESSAGE/LABEL_DATE"></span>:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
<div class="dropdown pull-left" data-bind="registrateBootstrapDropdown: true, openDropdownTrigger: identitiesDropdownTrigger">
|
<div class="dropdown pull-left" data-bind="registrateBootstrapDropdown: true, openDropdownTrigger: identitiesDropdownTrigger">
|
||||||
<a class="dropdown-toggle g-ui-dropdown e-identity" href="#" tabindex="-1"
|
<a class="dropdown-toggle g-ui-dropdown e-identity" href="#" tabindex="-1"
|
||||||
id="identity-label-id" role="button" data-toggle="dropdown"
|
id="identity-label-id" role="button" data-toggle="dropdown"
|
||||||
data-bind="text: currentIdentityString, dropdownCloser: true, css: {'multiply': 1 < identitiesOptions().length }">
|
data-bind="text: currentIdentityView, dropdownCloser: true, css: {'multiply': 1 < identitiesOptions().length }">
|
||||||
</a>
|
</a>
|
||||||
<!-- ko if: 1 < identitiesOptions().length -->
|
<!-- ko if: 1 < identitiesOptions().length -->
|
||||||
<ul class="dropdown-menu g-ui-menu" role="menu" aria-labelledby="identity-label-id">
|
<ul class="dropdown-menu g-ui-menu" role="menu" aria-labelledby="identity-label-id">
|
||||||
|
|
@ -90,8 +90,14 @@
|
||||||
<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_CC"
|
<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_CC"
|
||||||
data-bind="visible: !showCc(), click: function () { showCc(true); }"></span>
|
data-bind="visible: !showCc(), click: function () { showCc(true); }"></span>
|
||||||
|
|
||||||
<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_BCC"
|
<span data-bind="visible: !showBcc()">
|
||||||
data-bind="visible: !showBcc(), click: function () { showBcc(true); }"></span>
|
<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_BCC"
|
||||||
|
data-bind="click: function () { showBcc(true); }"></span>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_REPLY_TO"
|
||||||
|
data-bind="visible: !showReplyTo(), click: function () { showReplyTo(true); }"></span>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -124,7 +130,7 @@
|
||||||
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="emailsTags: bcc, autoCompleteSource: emailsSource" />
|
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="emailsTags: bcc, autoCompleteSource: emailsSource" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="e-row reply-to-row" data-bind="visible: false">
|
<div class="e-row reply-to-row" data-bind="visible: showReplyTo">
|
||||||
<div class="e-cell e-label">
|
<div class="e-cell e-label">
|
||||||
<span class="i18n" data-i18n-text="COMPOSE/TITLE_REPLY_TO"></span>
|
<span class="i18n" data-i18n-text="COMPOSE/TITLE_REPLY_TO"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
data-bind="value: name, onEnter: addOrEditIdentityCommand, hasfocus: name.focused" />
|
data-bind="value: name, onEnter: addOrEditIdentityCommand, hasfocus: name.focused" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group" data-bind="css: {'error': replyTo.hasError}" style="display: none">
|
<div class="control-group" data-bind="css: {'error': replyTo.hasError}">
|
||||||
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_REPLY_TO"></label>
|
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_REPLY_TO"></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" class="inputReplyTo input-large"
|
<input type="text" class="inputReplyTo input-large"
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
data-bind="value: replyTo, onEnter: addOrEditIdentityCommand, hasfocus: replyTo.focused" />
|
data-bind="value: replyTo, onEnter: addOrEditIdentityCommand, hasfocus: replyTo.focused" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group" data-bind="css: {'error': bcc.hasError}" style="display: none">
|
<div class="control-group" data-bind="css: {'error': bcc.hasError}">
|
||||||
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_BCC"></label>
|
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_BCC"></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" class="inputBcc input-large"
|
<input type="text" class="inputBcc input-large"
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a class="btn buttonAddAccount" data-bind="command: addOrEditIdentityCommand">
|
<a class="btn buttonAddIdentity" data-bind="command: addOrEditIdentityCommand">
|
||||||
<i data-bind="visible: !edit(), css: {'icon-user-add': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
<i data-bind="visible: !edit(), css: {'icon-user-add': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
||||||
<i data-bind="visible: edit, css: {'icon-ok': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
<i data-bind="visible: edit, css: {'icon-ok': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,10 @@ pre {
|
||||||
<td class="tt i18n" data-i18n-text="MESSAGE/PRINT_LABEL_BCC"></td>
|
<td class="tt i18n" data-i18n-text="MESSAGE/PRINT_LABEL_BCC"></td>
|
||||||
<td class="tv" data-bind="text: popupBcc"></td>
|
<td class="tv" data-bind="text: popupBcc"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr data-bind="visible: '' !== popupReplyTo">
|
||||||
|
<td class="tt i18n" data-i18n-text="MESSAGE/PRINT_LABEL_REPLY_TO"></td>
|
||||||
|
<td class="tv" data-bind="text: popupReplyTo"></td>
|
||||||
|
</tr>
|
||||||
<tr data-bind="visible: '' !== popupDate">
|
<tr data-bind="visible: '' !== popupDate">
|
||||||
<td class="tt i18n" data-i18n-text="MESSAGE/PRINT_LABEL_DATE"></td>
|
<td class="tt i18n" data-i18n-text="MESSAGE/PRINT_LABEL_DATE"></td>
|
||||||
<td class="tv" data-bind="text: popupDate"></td>
|
<td class="tv" data-bind="text: popupDate"></td>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="b-settings-accounts g-ui-user-select-none">
|
<div class="b-settings-accounts g-ui-user-select-none">
|
||||||
<div class="form-horizontal">
|
<div class="form-horizontal">
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/LEGEND_ACCOUNTS"></span>
|
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/LEGEND_ACCOUNTS_AND_IDENTITIES"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="btn" data-bind="click: addNewAccount">
|
<a class="btn" data-bind="click: addNewAccount">
|
||||||
|
|
@ -9,12 +9,18 @@
|
||||||
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/BUTTON_ADD_ACCOUNT"></span>
|
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/BUTTON_ADD_ACCOUNT"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a class="btn" data-bind="click: addNewIdentity">
|
||||||
|
<i class="icon-user-add"></i>
|
||||||
|
|
||||||
|
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/BUTTON_ADD_IDENTITY"></span>
|
||||||
|
</a>
|
||||||
<div class="process-place" data-bind="style: {'visibility': visibility }">
|
<div class="process-place" data-bind="style: {'visibility': visibility }">
|
||||||
<i class="icon-spinner animated"></i>
|
<i class="icon-spinner animated"></i>
|
||||||
|
|
||||||
<span data-bind="text: processText"></span>
|
<span data-bind="text: processText"></span>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-hover list-table" data-bind="i18nUpdate: accounts">
|
<table class="table table-hover list-table accounts-list" data-bind="i18nUpdate: accounts">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col />
|
<col />
|
||||||
<col style="width: 150px" />
|
<col style="width: 150px" />
|
||||||
|
|
@ -29,13 +35,42 @@
|
||||||
<span class="account-name" data-bind="text: email"></span>
|
<span class="account-name" data-bind="text: email"></span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span data-bind="visible: !canBeDalete()"></span>
|
<span data-bind="visible: !canBeDeleted()"></span>
|
||||||
<a class="btn btn-small btn-small-small btn-danger pull-right button-delete button-delete-transitions" data-bind="visible: canBeDalete, css: {'delete-access': deleteAccess}, click: function(oAccount) { $root.deleteAccount(oAccount); }">
|
<a class="btn btn-small btn-small-small btn-danger pull-right button-delete button-delete-transitions" data-bind="visible: canBeDeleted, css: {'delete-access': deleteAccess}, click: function(oAccount) { $root.deleteAccount(oAccount); }">
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/DELETING_ASK"></span>
|
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/DELETING_ASK"></span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="delete-account" data-bind="visible: !deleteAccess() && canBeDalete(), click: function (oAccount) { $root.accountForDeletion(oAccount); }">
|
<span class="delete-account" data-bind="visible: !deleteAccess() && canBeDeleted(), click: function (oAccount) { $root.accountForDeletion(oAccount); }">
|
||||||
|
<i class="icon-trash"></i>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<table class="table table-hover list-table identities-list" data-bind="i18nUpdate: identities">
|
||||||
|
<colgroup>
|
||||||
|
<col />
|
||||||
|
<col style="width: 150px" />
|
||||||
|
<col style="width: 1%" />
|
||||||
|
</colgroup>
|
||||||
|
<tbody data-bind="foreach: identities">
|
||||||
|
<tr class="identity-item">
|
||||||
|
<td class="e-action">
|
||||||
|
<span class="identity-img icon-user"></span>
|
||||||
|
|
||||||
|
<span class="identity-name" data-bind="text: formattedName()"></span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span data-bind="visible: !canBeDeleted()"></span>
|
||||||
|
<a class="btn btn-small btn-small-small btn-danger pull-right button-delete button-delete-transitions" data-bind="visible: canBeDeleted, css: {'delete-access': deleteAccess}, click: function(oIdentity) { $root.deleteIdentity(oIdentity); }">
|
||||||
|
<span class="i18n" data-i18n-text="SETTINGS_ACCOUNTS/DELETING_ASK"></span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="delete-identity" data-bind="visible: !deleteAccess() && canBeDeleted(), click: function (oIdentity) { $root.identityForDeletion(oIdentity); }">
|
||||||
<i class="icon-trash"></i>
|
<i class="icon-trash"></i>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="delete-filter" data-bind="visible: !deleteAccess() && canBeDalete(), click: function (oFilter) { $root.filterForDeletion(oFilter); }">
|
<span class="delete-filter" data-bind="visible: !deleteAccess() && canBeDeleted(), click: function (oFilter) { $root.filterForDeletion(oFilter); }">
|
||||||
<i class="icon-trash"></i>
|
<i class="icon-trash"></i>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
<div class="b-settings-identities">
|
|
||||||
<div class="form-horizontal">
|
|
||||||
<div class="legend g-ui-user-select-none">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LEGEND_IDENTITY"></span>
|
|
||||||
</div>
|
|
||||||
<div class="control-group g-ui-user-select-none" data-bind="if: 0 < identities().length">
|
|
||||||
<label class="control-label" data-bind="i18nUpdate: identities">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_DEFAULT"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'Select',
|
|
||||||
params: {
|
|
||||||
options: identitiesOptions,
|
|
||||||
value: defaultIdentityID,
|
|
||||||
optionsText: 'name',
|
|
||||||
optionsValue: 'id',
|
|
||||||
trigger: defaultIdentityIDTrigger
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group g-ui-user-select-none">
|
|
||||||
<label class="control-label">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_DISPLAY_NAME"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'Input',
|
|
||||||
params: {
|
|
||||||
value: displayName,
|
|
||||||
size: 4,
|
|
||||||
trigger: displayNameTrigger
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="control-group g-ui-user-select-none" style="display: none">
|
|
||||||
<label class="control-label">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_REPLY_TO"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'Input',
|
|
||||||
params: {
|
|
||||||
value: replyTo,
|
|
||||||
size: 4
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>-->
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label g-ui-user-select-none">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_SIGNATURE"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div class="e-signature-place" data-bind="initDom: signatureDom"></div>
|
|
||||||
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'SaveTrigger',
|
|
||||||
params: { value: signatureTrigger, verticalAlign: 'top' }
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<div class="form-horizontal g-ui-user-select-none">
|
|
||||||
<div class="legend">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LEGEND_IDENTITIES"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a class="btn g-ui-user-select-none" data-bind="click: addNewIdentity">
|
|
||||||
<i class="icon-user-add"></i>
|
|
||||||
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/BUTTON_ADD_IDENTITY"></span>
|
|
||||||
</a>
|
|
||||||
<div class="process-place g-ui-user-select-none" data-bind="style: {'visibility': visibility }">
|
|
||||||
<i class="icon-spinner animated"></i>
|
|
||||||
|
|
||||||
<span data-bind="text: processText"></span>
|
|
||||||
</div>
|
|
||||||
<table class="table table-hover list-table g-ui-user-select-none" data-bind="i18nUpdate: identities">
|
|
||||||
<colgroup>
|
|
||||||
<col />
|
|
||||||
<col style="width: 140px" />
|
|
||||||
<col style="width: 1%" />
|
|
||||||
</colgroup>
|
|
||||||
<tbody data-bind="foreach: identities">
|
|
||||||
<tr class="identity-item">
|
|
||||||
<td class="e-action">
|
|
||||||
<span class="identity-img icon-user"></span>
|
|
||||||
<span class="identity-name" data-bind="text: formattedName()"></span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a class="btn btn-small btn-small-small btn-danger pull-right button-delete button-delete-transitions" data-bind="css: {'delete-access': deleteAccess()}, click: function(oIdentity) { $root.deleteIdentity(oIdentity); }">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/DELETING_ASK"></span>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="delete-identity" data-bind="visible: !deleteAccess() && canBeDalete(), click: function (oIdentity) { $root.identityForDeletion(oIdentity); }">
|
|
||||||
<i class="icon-trash"></i>
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
<div class="b-settings-identity">
|
|
||||||
<div class="form-horizontal">
|
|
||||||
<div class="legend g-ui-user-select-none">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LEGEND_IDENTITY"></span>
|
|
||||||
</div>
|
|
||||||
<div class="control-group g-ui-user-select-none">
|
|
||||||
<label class="control-label">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LABEL_DISPLAY_NAME"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'Input',
|
|
||||||
params: {
|
|
||||||
value: displayName,
|
|
||||||
size: 4,
|
|
||||||
trigger: displayNameTrigger
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="control-group g-ui-user-select-none" style="display: none">
|
|
||||||
<label class="control-label">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LABEL_REPLY_TO"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'Input',
|
|
||||||
params: {
|
|
||||||
value: replyTo,
|
|
||||||
size: 4
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>-->
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label g-ui-user-select-none">
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LABEL_SIGNATURE"></span>
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<div class="e-signature-place" data-bind="initDom: signatureDom"></div>
|
|
||||||
|
|
||||||
<div data-bind="component: {
|
|
||||||
name: 'SaveTrigger',
|
|
||||||
params: { value: signatureTrigger, verticalAlign: 'top' }
|
|
||||||
}"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -131,10 +131,12 @@ LABEL_TO = "To"
|
||||||
LABEL_TO_SHORT = "to"
|
LABEL_TO_SHORT = "to"
|
||||||
LABEL_CC = "CC"
|
LABEL_CC = "CC"
|
||||||
LABEL_BCC = "BCC"
|
LABEL_BCC = "BCC"
|
||||||
|
LABEL_REPLY_TO = "Reply-To"
|
||||||
PRINT_LABEL_FROM = "From"
|
PRINT_LABEL_FROM = "From"
|
||||||
PRINT_LABEL_TO = "To"
|
PRINT_LABEL_TO = "To"
|
||||||
PRINT_LABEL_CC = "CC"
|
PRINT_LABEL_CC = "CC"
|
||||||
PRINT_LABEL_BCC = "BCC"
|
PRINT_LABEL_BCC = "BCC"
|
||||||
|
PRINT_LABEL_REPLY_TO = "Reply-To"
|
||||||
PRINT_LABEL_DATE = "Date"
|
PRINT_LABEL_DATE = "Date"
|
||||||
PRINT_LABEL_SUBJECT = "Subject"
|
PRINT_LABEL_SUBJECT = "Subject"
|
||||||
PRINT_LABEL_ATTACHMENTS = "Attachments"
|
PRINT_LABEL_ATTACHMENTS = "Attachments"
|
||||||
|
|
@ -201,7 +203,7 @@ TITLE_FROM = "From"
|
||||||
TITLE_TO = "To"
|
TITLE_TO = "To"
|
||||||
TITLE_CC = "CC"
|
TITLE_CC = "CC"
|
||||||
TITLE_BCC = "BCC"
|
TITLE_BCC = "BCC"
|
||||||
TITLE_REPLY_TO = "Reply To"
|
TITLE_REPLY_TO = "Reply-To"
|
||||||
TITLE_SUBJECT = "Subject"
|
TITLE_SUBJECT = "Subject"
|
||||||
LINK_SHOW_INPUTS = "show all fields"
|
LINK_SHOW_INPUTS = "show all fields"
|
||||||
BUTTON_SEND = "Send"
|
BUTTON_SEND = "Send"
|
||||||
|
|
@ -254,7 +256,9 @@ BUTTON_ADD_IDENTITY = "Add"
|
||||||
BUTTON_UPDATE_IDENTITY = "Update"
|
BUTTON_UPDATE_IDENTITY = "Update"
|
||||||
LABEL_EMAIL = "Email"
|
LABEL_EMAIL = "Email"
|
||||||
LABEL_NAME = "Name"
|
LABEL_NAME = "Name"
|
||||||
LABEL_REPLY_TO = "Reply To"
|
LABEL_REPLY_TO = "Reply-To"
|
||||||
|
LABEL_SIGNATURE = "Signature"
|
||||||
|
LABEL_CC = "Cc"
|
||||||
LABEL_BCC = "Bcc"
|
LABEL_BCC = "Bcc"
|
||||||
|
|
||||||
[POPUPS_CREATE_FOLDER]
|
[POPUPS_CREATE_FOLDER]
|
||||||
|
|
@ -527,9 +531,11 @@ TO_MANY_FOLDERS_DESC_2 = "We have shown only a part of them, to avoid performanc
|
||||||
|
|
||||||
[SETTINGS_ACCOUNTS]
|
[SETTINGS_ACCOUNTS]
|
||||||
LEGEND_ACCOUNTS = "Account List"
|
LEGEND_ACCOUNTS = "Account List"
|
||||||
BUTTON_ADD_ACCOUNT = "Add Account"
|
LEGEND_ACCOUNTS_AND_IDENTITIES = "Accounts and Identities"
|
||||||
|
BUTTON_ADD_ACCOUNT = "Add an Account"
|
||||||
|
BUTTON_ADD_IDENTITY= "Add an Identity"
|
||||||
BUTTON_DELETE = "Delete"
|
BUTTON_DELETE = "Delete"
|
||||||
LOADING_PROCESS = "Updating account list"
|
LOADING_PROCESS = "Updating..."
|
||||||
DELETING_ASK = "Are you sure?"
|
DELETING_ASK = "Are you sure?"
|
||||||
|
|
||||||
[SETTINGS_IDENTITIES]
|
[SETTINGS_IDENTITIES]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue