mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 23:17:02 +03:00
Sieve filters (pre release)
This commit is contained in:
parent
63a286a6b6
commit
0152f1583b
38 changed files with 175 additions and 63 deletions
|
|
@ -37,7 +37,8 @@ class Notifications
|
|||
const InvalidRecipients = 303;
|
||||
|
||||
const CantSaveFilters = 351;
|
||||
const FiltersAreNotCorrect = 352;
|
||||
const CantGetFilters = 352;
|
||||
const FiltersAreNotCorrect = 355;
|
||||
|
||||
const CantCreateFolder = 400;
|
||||
const CantRenameFolder = 401;
|
||||
|
|
@ -111,6 +112,7 @@ class Notifications
|
|||
self::CantSendMessage => 'CantSendMessage',
|
||||
self::InvalidRecipients => 'InvalidRecipients',
|
||||
self::CantSaveFilters => 'CantSaveFilters',
|
||||
self::CantGetFilters => 'CantGetFilters',
|
||||
self::FiltersAreNotCorrect => 'FiltersAreNotCorrect',
|
||||
|
||||
self::CantCreateFolder => 'CantCreateFolder',
|
||||
|
|
|
|||
|
|
@ -25,7 +25,20 @@ class Filters extends \RainLoop\Providers\AbstractProvider
|
|||
*/
|
||||
public function Load($oAccount, $bAllowRaw = false)
|
||||
{
|
||||
return $this->IsActive() ? $this->oDriver->Load($oAccount, $bAllowRaw) : array();
|
||||
try
|
||||
{
|
||||
return $this->IsActive() ? $this->oDriver->Load($oAccount, $bAllowRaw) : array();
|
||||
}
|
||||
catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException)
|
||||
{
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException);
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantGetFilters, $oException);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<span class="i18n" data-i18n-text="SETTINGS_FILTERS/LEGEND_FILTERS"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row" data-bind="visible: inited() && !serverError()">
|
||||
<div class="span8">
|
||||
<a class="btn" data-bind="click: addFilter">
|
||||
<i class="icon-plus"></i>
|
||||
|
|
@ -36,6 +36,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" data-bind="visible: serverError">
|
||||
<div class="span8">
|
||||
<div class="alert alert-error g-ui-user-select-none" style="margin-bottom: 0">
|
||||
<i class="icon-warning"></i>
|
||||
|
||||
<span data-bind="text: serverErrorDesc"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<div class="process-place g-ui-user-select-none" data-bind="style: {'visibility': visibility }">
|
||||
|
|
@ -43,7 +52,7 @@
|
|||
|
||||
<span data-bind="text: processText"></span>
|
||||
</div>
|
||||
<div class="control-group" data-bind="css: {'error': filterRaw.error}, visible: filterRaw.allow() && filterRaw.active()">
|
||||
<div class="control-group" data-bind="css: {'error': filterRaw.error}, visible: inited() && filterRaw.allow() && filterRaw.active()">
|
||||
<div class="controls">
|
||||
<pre style="word-break: break-word;" data-bind="visible: '' !== filterRaw.capa()">
|
||||
<b class="i18n" data-i18n-text="SETTINGS_FILTERS/CAPABILITY_LABEL"></b>:
|
||||
|
|
@ -54,7 +63,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<table class="table table-hover list-table g-ui-user-select-none"
|
||||
data-bind="visible: !filterRaw.active() || !filterRaw.active(), i18nUpdate: filters">
|
||||
data-bind="visible: inited() && (!filterRaw.active() || !filterRaw.active()), i18nUpdate: filters">
|
||||
<colgroup>
|
||||
<col style="width: 30px" />
|
||||
<col />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue