mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Added individual signatures for every identity.
This commit is contained in:
parent
996703311b
commit
1119022916
45 changed files with 1353 additions and 337 deletions
|
|
@ -2098,13 +2098,14 @@ class Actions
|
|||
{
|
||||
$sOrder = $this->StorageProvider()->Get($oAccount,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
|
||||
'accounts_order'
|
||||
'accounts_identities_order'
|
||||
);
|
||||
|
||||
$aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true);
|
||||
if (\is_array($aAccounts) && \is_array($aOrder) && 0 < \count($aOrder))
|
||||
if (isset($aOrder['Accounts']) && \is_array($aOrder['Accounts']) &&
|
||||
1 < \count($aOrder['Accounts']))
|
||||
{
|
||||
$aAccounts = \array_merge(\array_flip($aOrder), $aAccounts);
|
||||
$aAccounts = \array_merge(\array_flip($aOrder['Accounts']), $aAccounts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2174,6 +2175,24 @@ class Actions
|
|||
\array_unshift($aIdentities,
|
||||
\RainLoop\Model\Identity::NewInstanceFromAccount($oAccount));
|
||||
}
|
||||
|
||||
if (1 < \count($aIdentities))
|
||||
{
|
||||
$sOrder = $this->StorageProvider()->Get($oAccount,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
|
||||
'accounts_identities_order'
|
||||
);
|
||||
|
||||
$aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true);
|
||||
if (isset($aOrder['Identities']) && \is_array($aOrder['Identities']) &&
|
||||
1 < \count($aOrder['Identities']))
|
||||
{
|
||||
$aList = $aOrder['Identities'];
|
||||
\usort($aIdentities, function ($a, $b) use ($aList) {
|
||||
return \array_search($a->Id(), $aList) < \array_search($b->Id(), $aList) ? -1 : 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $aIdentities;
|
||||
|
|
@ -2483,19 +2502,24 @@ class Actions
|
|||
*
|
||||
* @throws \MailSo\Base\Exceptions\Exception
|
||||
*/
|
||||
public function DoAccountSortOrder()
|
||||
public function DoAccountsAndIdentitiesSortOrder()
|
||||
{
|
||||
$oAccount = $this->getAccountFromToken();
|
||||
|
||||
$aList = $this->GetActionParam('Accounts', null);
|
||||
if (!\is_array($aList) || 2 > \count($aList))
|
||||
$aAccounts = $this->GetActionParam('Accounts', null);
|
||||
$aIdentities = $this->GetActionParam('Identities', null);
|
||||
|
||||
if (!\is_array($aAccounts) || !\is_array($aIdentities))
|
||||
{
|
||||
return $this->FalseResponse(__FUNCTION__);
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $this->StorageProvider()->Put($oAccount,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, 'accounts_order',
|
||||
\json_encode($aList)
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, 'accounts_identities_order',
|
||||
\json_encode(array(
|
||||
'Accounts' => $aAccounts,
|
||||
'Identities' => $aIdentities
|
||||
))
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -4952,6 +4976,7 @@ class Actions
|
|||
'IsSeen' => in_array('\\seen', $aLowerFlags),
|
||||
'IsFlagged' => in_array('\\flagged', $aLowerFlags),
|
||||
'IsAnswered' => in_array('\\answered', $aLowerFlags),
|
||||
'IsDeleted' => in_array('\\deleted', $aLowerFlags),
|
||||
'IsForwarded' => 0 < strlen($sForwardedFlag) && in_array(strtolower($sForwardedFlag), $aLowerFlags),
|
||||
'IsReadReceipt' => 0 < strlen($sReadReceiptFlag) && in_array(strtolower($sReadReceiptFlag), $aLowerFlags)
|
||||
);
|
||||
|
|
@ -8503,6 +8528,7 @@ class Actions
|
|||
$mResult['IsSeen'] = \in_array('\\seen', $aFlags);
|
||||
$mResult['IsFlagged'] = \in_array('\\flagged', $aFlags);
|
||||
$mResult['IsAnswered'] = \in_array('\\answered', $aFlags);
|
||||
$mResult['IsDeleted'] = \in_array('\\deleted', $aFlags);
|
||||
|
||||
$sForwardedFlag = $this->Config()->Get('labs', 'imap_forwarded_flag', '');
|
||||
$sReadReceiptFlag = $this->Config()->Get('labs', 'imap_read_receipt_flag', '');
|
||||
|
|
|
|||
|
|
@ -29,6 +29,16 @@ class Identity
|
|||
*/
|
||||
private $sBcc;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sSignature;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $bSignatureInsertBefore;
|
||||
|
||||
/**
|
||||
* @param string $sId = ''
|
||||
* @param string $sEmail = ''
|
||||
|
|
@ -42,6 +52,8 @@ class Identity
|
|||
$this->sName = '';
|
||||
$this->sReplyTo = '';
|
||||
$this->sBcc = '';
|
||||
$this->sSignature = '';
|
||||
$this->bSignatureInsertBefore = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -114,6 +126,22 @@ class Identity
|
|||
return $this->sBcc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Signature()
|
||||
{
|
||||
return $this->sSignature;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function SignatureInsertBefore()
|
||||
{
|
||||
return $this->bSignatureInsertBefore;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aData
|
||||
* @param bool $bAjax = false
|
||||
|
|
@ -129,6 +157,9 @@ class Identity
|
|||
$this->sName = isset($aData['Name']) ? $aData['Name'] : '';
|
||||
$this->sReplyTo = !empty($aData['ReplyTo']) ? $aData['ReplyTo'] : '';
|
||||
$this->sBcc = !empty($aData['Bcc']) ? $aData['Bcc'] : '';
|
||||
$this->sSignature = !empty($aData['Signature']) ? $aData['Signature'] : '';
|
||||
$this->bSignatureInsertBefore = isset($aData['SignatureInsertBefore']) ?
|
||||
($bAjax ? '1' === $aData['SignatureInsertBefore'] : !!$aData['SignatureInsertBefore']) : true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -148,7 +179,9 @@ class Identity
|
|||
'Email' => $bAjax ? \MailSo\Base\Utils::IdnToUtf8($this->Email()) : $this->Email(),
|
||||
'Name' => $this->Name(),
|
||||
'ReplyTo' => $this->ReplyTo(),
|
||||
'Bcc' => $this->Bcc()
|
||||
'Bcc' => $this->Bcc(),
|
||||
'Signature' => $this->Signature(),
|
||||
'SignatureInsertBefore' => $this->SignatureInsertBefore()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="messageListItem" data-bind="css: lineAsCcc()">
|
||||
<div class="messageListItem" data-bind="css: lineAsCss()">
|
||||
<div class="sidebarParent">
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="messageListItem e-single-line" data-bind="css: lineAsCcc()">
|
||||
<div class="messageListItem e-single-line" data-bind="css: lineAsCss()">
|
||||
<div class="sidebarParent">
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="messageItem fixIndex" data-bind="css: viewLineAsCcc(), nano: true, attr: {'style': 'top:' + viewBodyTopValue() + 'px' }">
|
||||
<div class="messageItem fixIndex" data-bind="css: viewLineAsCss(), nano: true, attr: {'style': 'top:' + viewBodyTopValue() + 'px' }">
|
||||
<div class="content g-scrollbox" tabindex="0" data-bind="hasfocus: messageDomFocused">
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -11,12 +11,10 @@
|
|||
|
||||
<span class="i18n" data-i18n-text="COMPOSE/BUTTON_SAVE"></span>
|
||||
</a>
|
||||
<a class="btn button-close pull-right" data-tooltip-placement="bottom" data-bind="click: tryToClosePopup, tooltip: 'COMPOSE/BUTTON_CANCEL'">
|
||||
<i class="icon-remove"></i>
|
||||
</a>
|
||||
<a class="btn button-skip pull-right" data-tooltip-placement="bottom" data-bind="command: skipCommand, tooltip: 'COMPOSE/BUTTON_MINIMIZE'">
|
||||
<i class="icon-down"></i>
|
||||
</a>
|
||||
|
||||
<a class="close-custom" data-tooltip-placement="bottom" data-bind="click: tryToClosePopup, tooltip: 'COMPOSE/BUTTON_CANCEL'">×</a>
|
||||
<a class="minimize-custom" data-tooltip-placement="bottom" data-bind="click: skipCommand, tooltip: 'COMPOSE/BUTTON_MINIMIZE'"></a>
|
||||
|
||||
<a class="btn btn-danger button-delete button-delete-transitions" data-bind="command: deleteCommand">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
<span class="i18n" data-i18n-text="CONTACTS/EMPTY_SEARCH"></span>
|
||||
</div>
|
||||
<div class="e-contact-foreach g-ui-user-select-none" data-bind="foreach: contacts, visible: 0 < contacts().length">
|
||||
<div class="e-contact-item g-ui-user-select-none" data-bind="css: lineAsCcc()">
|
||||
<div class="e-contact-item g-ui-user-select-none" data-bind="css: lineAsCss()">
|
||||
<div class="sidebarParent">
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<div class="control-group" data-bind="visible: !owner(), css: {'error': email.hasError}">
|
||||
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_EMAIL"></label>
|
||||
<div class="controls">
|
||||
<input type="email" class="inputEmail input-large"
|
||||
<input type="email" class="inputEmail input-xlarge"
|
||||
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: email, onEnter: addOrEditIdentityCommand, hasfocus: email.focused" />
|
||||
</div>
|
||||
|
|
@ -32,27 +32,55 @@
|
|||
<div class="control-group">
|
||||
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_NAME"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="inputName input-large"
|
||||
<input type="text" class="inputName input-xlarge"
|
||||
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: name, onEnter: addOrEditIdentityCommand, hasfocus: name.focused" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="css: {'error': replyTo.hasError}">
|
||||
<div class="control-group" data-bind="visible: showReplyTo, css: {'error': replyTo.hasError}">
|
||||
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_REPLY_TO"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="inputReplyTo input-large"
|
||||
<input type="text" class="inputReplyTo input-xlarge"
|
||||
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: replyTo, onEnter: addOrEditIdentityCommand, hasfocus: replyTo.focused" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="css: {'error': bcc.hasError}">
|
||||
<div class="control-group" data-bind="visible: showBcc, css: {'error': bcc.hasError}">
|
||||
<label class="i18n control-label" data-i18n-text="POPUPS_IDENTITIES/LABEL_BCC"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="inputBcc input-large"
|
||||
<input type="text" class="inputBcc input-xlarge"
|
||||
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: bcc, onEnter: addOrEditIdentityCommand, hasfocus: bcc.focused" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: !showReplyTo() || !showBcc()">
|
||||
<div class="controls">
|
||||
<span data-bind="visible: !showReplyTo()">
|
||||
<span class="i18n g-ui-link" data-i18n-text="POPUPS_IDENTITIES/LABEL_REPLY_TO"
|
||||
data-bind="click: function () { showReplyTo(true); }"></span>
|
||||
|
||||
</span>
|
||||
<span data-bind="visible: !showBcc()">
|
||||
<span class="i18n g-ui-link" data-i18n-text="POPUPS_IDENTITIES/LABEL_BCC"
|
||||
data-bind="click: function () { showBcc(true); }"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<div data-bind="component: {
|
||||
name: 'Checkbox',
|
||||
params: {
|
||||
label: 'POPUPS_IDENTITIES/LABEL_SIGNATURE_INSERT_BEFORE',
|
||||
value: signatureInsertBefore
|
||||
}
|
||||
}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="e-signature-place" data-bind="initDom: signatureDom"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
<div class="popups">
|
||||
<div class="modal hide b-template-add-content g-ui-user-select-none" data-bind="modal: modalVisibility">
|
||||
<div>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-bind="command: cancelCommand">×</button>
|
||||
<h3>
|
||||
<span data-bind="visible: '' === id()" class="i18n" data-i18n-text="POPUPS_ADD_TEMPLATE/TITLE_ADD_TEMPLATE"></span>
|
||||
<span data-bind="visible: '' !== id()" class="i18n" data-i18n-text="POPUPS_ADD_TEMPLATE/TITLE_UPDATE_TEMPLATE"></span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="alert" data-bind="visible: '' !== submitError()">
|
||||
<button type="button" class="close" data-bind="click: function () { submitError('') }">×</button>
|
||||
<span data-bind="text: submitError"></span>
|
||||
</div>
|
||||
<br />
|
||||
<div class="control-group" data-bind="css: {'error': name.error}">
|
||||
<label class="i18n" data-i18n-text="POPUPS_ADD_TEMPLATE/LABEL_NAME"></label>
|
||||
<input type="text" class="inputName span6" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="textInput: name, onEnter: addTemplateCommand, hasfocus: name.focus" />
|
||||
</div>
|
||||
<div class="control-group" data-bind="css: {'error': body.error}">
|
||||
<label class="i18n" data-i18n-text="POPUPS_ADD_TEMPLATE/LABEL_TEXT"></label>
|
||||
<div class="e-body-place" data-bind="initDom: signatureDom"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn buttonAddAccount" data-bind="command: addTemplateCommand">
|
||||
<i data-bind="visible: '' == id(), css: {'icon-user-add': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
||||
<i data-bind="visible: '' !== id(), css: {'icon-ok': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
||||
|
||||
<span data-bind="visible: '' == id()" class="i18n" data-i18n-text="POPUPS_ADD_TEMPLATE/BUTTON_ADD_TEMPLATE"></span>
|
||||
<span data-bind="visible: '' !== id()" class="i18n" data-i18n-text="POPUPS_ADD_TEMPLATE/BUTTON_UPDATE_TEMPLATE"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<col style="width: 150px" />
|
||||
<col style="width: 1%" />
|
||||
</colgroup>
|
||||
<tbody data-bind="sortable: {data: accounts, options: scrollableOptions()}">
|
||||
<tbody data-bind="sortable: {data: accounts, options: scrollableOptions(), afterMove: accountsAndIdentitiesAfterMove}">
|
||||
<tr class="account-item">
|
||||
<td class="e-action" data-bind="css: {'e-action': canBeEdit}">
|
||||
<span class="account-img icon-user"></span>
|
||||
|
|
@ -49,17 +49,17 @@
|
|||
</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">
|
||||
<tbody data-bind="sortable: {data: identities, options: scrollableOptions(), afterMove: accountsAndIdentitiesAfterMove}">
|
||||
<tr class="identity-item">
|
||||
<td class="e-action">
|
||||
<span class="identity-img icon-user"></span>
|
||||
<i class="icon-braille drag-handle"></i>
|
||||
|
||||
<span class="identity-name" data-bind="text: formattedName()"></span>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
}
|
||||
}"></div>
|
||||
|
||||
<span data-bind="click: testSoundNotification" style="color:red;cursor:pointer">
|
||||
<span data-bind="click: testSoundNotification" style="color:green;cursor:pointer">
|
||||
<i class="icon-right-dir iconsize20"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
<div class="b-settings-templates g-ui-user-select-none">
|
||||
<div class="form-horizontal">
|
||||
<div class="legend">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_TEMPLATES/LEGEND_TEMPLATES"></span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="btn" data-bind="click: addNewTemplate">
|
||||
<i class="icon-user-add"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="SETTINGS_TEMPLATES/BUTTON_ADD_TEMPLATE"></span>
|
||||
</a>
|
||||
<div class="process-place" 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 templates-list" data-bind="i18nUpdate: templates">
|
||||
<colgroup>
|
||||
<col />
|
||||
<col style="width: 150px" />
|
||||
<col style="width: 1%" />
|
||||
</colgroup>
|
||||
<tbody data-bind="sortable: {data: templates, options: scrollableOptions()}">
|
||||
<tr class="template-item">
|
||||
<td class="e-action">
|
||||
<span class="template-img icon-user"></span>
|
||||
<i class="icon-braille drag-handle"></i>
|
||||
|
||||
<span class="template-name" data-bind="text: name"></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(oTemplate) { $root.deleteTemplate(oTemplate); }">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_TEMPLATES/DELETING_ASK"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="delete-template" data-bind="visible: !deleteAccess(), click: function (oTemplate) { $root.templateForDeletion(oTemplate); }">
|
||||
<i class="icon-trash"></i>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue