mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: compose/send mail AdditionalAccount failed
This commit is contained in:
parent
8a351e5763
commit
5f4c7c5c5b
5 changed files with 35 additions and 30 deletions
|
|
@ -97,15 +97,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.e-identity {
|
.e-identity {
|
||||||
|
|
||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
text-decoration: none;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
line-height: @baseLineHeight;
|
||||||
|
padding: 4px 0;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
&.multiply {
|
&.multiply {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-bottom: 1px dashed var(--main-color);
|
border-bottom: 1px dashed var(--main-color);
|
||||||
}
|
}
|
||||||
|
&.multiply::after {
|
||||||
|
content: '▼';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
|
|
|
||||||
|
|
@ -1111,19 +1111,6 @@ class Actions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetIdentityByID(Model\Account $oAccount, string $sID, bool $bFirstOnEmpty = false): ?Model\Identity
|
|
||||||
{
|
|
||||||
$aIdentities = $this->GetIdentities($oAccount);
|
|
||||||
|
|
||||||
foreach ($aIdentities as $oIdentity) {
|
|
||||||
if ($oIdentity && $sID === $oIdentity->Id()) {
|
|
||||||
return $oIdentity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $bFirstOnEmpty && isset($aIdentities[0]) ? $aIdentities[0] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setConfigFromParams(Config\Application $oConfig, string $sParamName, string $sConfigSector, string $sConfigName, string $sType = 'string', ?callable $mStringCallback = null): void
|
public function setConfigFromParams(Config\Application $oConfig, string $sParamName, string $sConfigSector, string $sConfigName, string $sType = 'string', ?callable $mStringCallback = null): void
|
||||||
{
|
{
|
||||||
$sValue = $this->GetActionParam($sParamName, '');
|
$sValue = $this->GetActionParam($sParamName, '');
|
||||||
|
|
|
||||||
|
|
@ -224,21 +224,19 @@ trait Accounts
|
||||||
*/
|
*/
|
||||||
public function DoAccountsAndIdentities(): array
|
public function DoAccountsAndIdentities(): array
|
||||||
{
|
{
|
||||||
$oAccount = $this->getMainAccountFromToken();
|
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, array(
|
return $this->DefaultResponse(__FUNCTION__, array(
|
||||||
'Accounts' => \array_map(
|
'Accounts' => \array_map(
|
||||||
'MailSo\\Base\\Utils::IdnToUtf8',
|
'MailSo\\Base\\Utils::IdnToUtf8',
|
||||||
\array_keys($this->GetAccounts($oAccount))
|
\array_keys($this->GetAccounts($this->getMainAccountFromToken()))
|
||||||
),
|
),
|
||||||
'Identities' => $this->GetIdentities($oAccount)
|
'Identities' => $this->GetIdentities($this->getAccountFromToken())
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Identity[]
|
* @return Identity[]
|
||||||
*/
|
*/
|
||||||
public function GetIdentities(MainAccount $oAccount): array
|
public function GetIdentities(Account $oAccount): array
|
||||||
{
|
{
|
||||||
// A custom name for a single identity is also stored in this system
|
// A custom name for a single identity is also stored in this system
|
||||||
$allowMultipleIdentities = $this->GetCapa(false, Capa::IDENTITIES, $oAccount);
|
$allowMultipleIdentities = $this->GetCapa(false, Capa::IDENTITIES, $oAccount);
|
||||||
|
|
@ -281,4 +279,17 @@ trait Accounts
|
||||||
return $identities;
|
return $identities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetIdentityByID(Account $oAccount, string $sID, bool $bFirstOnEmpty = false): ?Identity
|
||||||
|
{
|
||||||
|
$aIdentities = $this->GetIdentities($oAccount);
|
||||||
|
|
||||||
|
foreach ($aIdentities as $oIdentity) {
|
||||||
|
if ($oIdentity && $sID === $oIdentity->Id()) {
|
||||||
|
return $oIdentity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $bFirstOnEmpty && isset($aIdentities[0]) ? $aIdentities[0] : null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,19 +22,22 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td data-i18n="GLOBAL/FROM"></td>
|
<td data-i18n="GLOBAL/FROM"></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown" style="display:inline-block" data-bind="registerBootstrapDropdown: true, openDropdownTrigger: identitiesDropdownTrigger">
|
|
||||||
<a class="dropdown-toggle e-identity" href="#" tabindex="-1"
|
|
||||||
id="identity-label-id" role="button"
|
|
||||||
data-bind="text: currentIdentityView, css: {'multiply': 1 < identitiesOptions().length }">
|
|
||||||
</a>
|
|
||||||
<!-- ko if: 1 < identitiesOptions().length -->
|
<!-- ko if: 1 < identitiesOptions().length -->
|
||||||
|
<div class="dropdown" style="display:inline-block" data-bind="registerBootstrapDropdown: true, openDropdownTrigger: identitiesDropdownTrigger">
|
||||||
|
<a class="dropdown-toggle e-identity multiply" href="#" tabindex="-1"
|
||||||
|
id="identity-label-id" role="button"
|
||||||
|
data-bind="text: currentIdentityView">
|
||||||
|
</a>
|
||||||
<ul class="dropdown-menu" role="menu" aria-labelledby="identity-label-id" data-bind="foreach: identitiesOptions">
|
<ul class="dropdown-menu" role="menu" aria-labelledby="identity-label-id" data-bind="foreach: identitiesOptions">
|
||||||
<li role="presentation">
|
<li role="presentation">
|
||||||
<a tabindex="-1" href="#" data-bind="click: function (oIdentity) { $root.selectIdentity(oIdentity); return true; }, text: optText"></a>
|
<a tabindex="-1" href="#" data-bind="click: function (oIdentity) { $root.selectIdentity(oIdentity); return true; }, text: optText"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- /ko -->
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- /ko -->
|
||||||
|
<!-- ko if: 2 > identitiesOptions().length -->
|
||||||
|
<span class="e-identity" data-bind="text: currentIdentityView"></span>
|
||||||
|
<!-- /ko -->
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<a class="btn" data-i18n="GLOBAL/BCC"
|
<a class="btn" data-i18n="GLOBAL/BCC"
|
||||||
data-bind="visible: !showBcc(), click: function () { showBcc(true); }"></a>
|
data-bind="visible: !showBcc(), click: function () { showBcc(true); }"></a>
|
||||||
|
|
|
||||||
2
vendors/bootstrap/less/dropdowns.less
vendored
2
vendors/bootstrap/less/dropdowns.less
vendored
|
|
@ -55,7 +55,7 @@
|
||||||
// Links within the dropdown menu
|
// Links within the dropdown menu
|
||||||
a {
|
a {
|
||||||
background-color: var(--dropdown-menu-bg-color, #fff);
|
background-color: var(--dropdown-menu-bg-color, #fff);
|
||||||
color: var(--main-color, @dropdownLinkColor);
|
color: var(--dropdown-menu-color, @dropdownLinkColor);
|
||||||
display: block;
|
display: block;
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue