diff --git a/dev/Common/Enums.js b/dev/Common/Enums.js index 71fd923f6..c915a4618 100644 --- a/dev/Common/Enums.js +++ b/dev/Common/Enums.js @@ -128,7 +128,7 @@ 'FLAGGED': 11, 'ALL': 12 }; - + /** * @enum {string} */ @@ -321,7 +321,9 @@ Enums.FilterConditionField = { 'From': 'From', 'Recipient': 'Recipient', - 'Subject': 'Subject' + 'Subject': 'Subject', + 'Header': 'Header', + 'Size': 'Size' }; /** @@ -331,7 +333,9 @@ 'Contains': 'Contains', 'NotContains': 'NotContains', 'EqualTo': 'EqualTo', - 'NotEqualTo': 'NotEqualTo' + 'NotEqualTo': 'NotEqualTo', + 'Over': 'Over', + 'Under': 'Under' }; /** diff --git a/dev/Model/FilterCondition.js b/dev/Model/FilterCondition.js index 9192ea059..e33ee9ade 100644 --- a/dev/Model/FilterCondition.js +++ b/dev/Model/FilterCondition.js @@ -25,11 +25,20 @@ this.value = ko.observable(''); this.value.error = ko.observable(false); + this.valueSecond = ko.observable(''); + this.valueSecond.error = ko.observable(false); + this.template = ko.computed(function () { var sTemplate = ''; - switch (this.type()) + switch (this.field()) { + case Enums.FilterConditionField.Size: + sTemplate = 'SettingsFiltersConditionSize'; + break; + case Enums.FilterConditionField.Header: + sTemplate = 'SettingsFiltersConditionMore'; + break; default: sTemplate = 'SettingsFiltersConditionDefault'; break; @@ -39,6 +48,11 @@ }, this); + this.field.subscribe(function () { + this.value(''); + this.valueSecond(''); + }, this); + this.regDisposables([this.template]); } @@ -52,6 +66,12 @@ return false; } + if (Enums.FilterConditionField.Header === this.field() && '' === this.valueSecond()) + { + this.valueSecond.error(true); + return false; + } + return true; }; @@ -62,6 +82,7 @@ this.field(Utils.pString(oItem['Field'])); this.type(Utils.pString(oItem['Type'])); this.value(Utils.pString(oItem['Value'])); + this.valueSecond(Utils.pString(oItem['ValueSecond'])); return true; } @@ -74,7 +95,8 @@ return { 'Field': this.field(), 'Type': this.type(), - 'Value': this.value() + 'Value': this.value(), + 'ValueSecond': this.valueSecond() }; }; @@ -85,6 +107,7 @@ oClone.field(this.field()); oClone.type(this.type()); oClone.value(this.value()); + oClone.valueSecond(this.valueSecond()); return oClone; }; diff --git a/dev/View/Popup/Filter.js b/dev/View/Popup/Filter.js index c5f5ad428..41465f8ad 100644 --- a/dev/View/Popup/Filter.js +++ b/dev/View/Popup/Filter.js @@ -78,6 +78,7 @@ this.actionTypeOptions = ko.observableArray([]); this.fieldOptions = ko.observableArray([]); this.typeOptions = ko.observableArray([]); + this.typeOptionsSize = ko.observableArray([]); Translator.initOnStartOrLangChange(this.populateOptions, this); @@ -136,7 +137,9 @@ this.fieldOptions([ {'id': Enums.FilterConditionField.From, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_FROM')}, {'id': Enums.FilterConditionField.Recipient, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_RECIPIENTS')}, - {'id': Enums.FilterConditionField.Subject, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_SUBJECT')} + {'id': Enums.FilterConditionField.Subject, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_SUBJECT')}, + {'id': Enums.FilterConditionField.Size, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_SIZE')}, + {'id': Enums.FilterConditionField.Header, 'name': Translator.i18n('POPUPS_FILTER/SELECT_FIELD_HEADER')} ]); this.typeOptions([ @@ -145,6 +148,11 @@ {'id': Enums.FilterConditionType.EqualTo, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_EQUAL_TO')}, {'id': Enums.FilterConditionType.NotEqualTo, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_NOT_EQUAL_TO')} ]); + + this.typeOptionsSize([ + {'id': Enums.FilterConditionType.Over, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_OVER')}, + {'id': Enums.FilterConditionType.Under, 'name': Translator.i18n('POPUPS_FILTER/SELECT_TYPE_UNDER')} + ]); }; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php index 0ac538b24..cbb5312bc 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Driver.php @@ -47,6 +47,11 @@ abstract class Driver */ protected $bTypedPrefix; + /** + * @var string + */ + protected $sNewLine; + /** * @var int */ @@ -79,6 +84,7 @@ abstract class Driver { $this->sDatePattern = 'H:i:s'; $this->sName = 'INFO'; + $this->sNewLine = "\r\n"; $this->bTimePrefix = true; $this->bTypedPrefix = true; $this->bGuidPrefix = true; @@ -246,15 +252,44 @@ abstract class Driver return isset($this->aPrefixes[$iType]) ? $sName.$this->aPrefixes[$iType].': ' : ''; } + /** + * @param string|array $mDesc + * @param bool $bDiplayCrLf = false + * + * @return string + */ + protected function localWriteImplementation($mDesc, $bDiplayCrLf = false) + { + if ($bDiplayCrLf) + { + if (\is_array($mDesc)) + { + foreach ($mDesc as &$sLine) + { + $sLine = \strtr($sLine, array("\r" => '\r', "\n" => '\n'.$this->sNewLine)); + $sLine = \rtrim($mDesc); + } + } + else + { + $mDesc = \strtr($mDesc, array("\r" => '\r', "\n" => '\n'.$this->sNewLine)); + $mDesc = \rtrim($mDesc); + } + } + + return $this->writeImplementation($mDesc); + } + /** * @final * @param string $sDesc * @param int $iType = \MailSo\Log\Enumerations\Type::INFO * @param string $sName = '' + * @param bool $bDiplayCrLf = false * * @return bool */ - final public function Write($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '') + final public function Write($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '', $bDiplayCrLf = false) { $bResult = true; if (!$this->bFlushCache && ($this->bWriteOnErrorOnly || $this->bWriteOnPhpErrorOnly || 0 < $this->iWriteOnTimeoutOnly)) @@ -285,18 +320,18 @@ abstract class Driver if (isset($this->aCache[0]) && empty($this->aCache[0])) { $this->aCache[0] = $sFlush; - array_unshift($this->aCache, ''); + \array_unshift($this->aCache, ''); } else { - array_unshift($this->aCache, $sFlush); + \array_unshift($this->aCache, $sFlush); } $this->aCache[] = '--- FlushLogCache: Trigger'; $this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName); $this->bFlushCache = true; - $bResult = $this->writeImplementation($this->aCache); + $bResult = $this->localWriteImplementation($this->aCache, $bDiplayCrLf); $this->aCache = array(); } else if (0 < $this->iWriteOnTimeoutOnly && \time() - APP_START_TIME > $this->iWriteOnTimeoutOnly) @@ -305,18 +340,18 @@ abstract class Driver if (isset($this->aCache[0]) && empty($this->aCache[0])) { $this->aCache[0] = $sFlush; - array_unshift($this->aCache, ''); + \array_unshift($this->aCache, ''); } else { - array_unshift($this->aCache, $sFlush); + \array_unshift($this->aCache, $sFlush); } $this->aCache[] = '--- FlushLogCache: Trigger'; $this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName); $this->bFlushCache = true; - $bResult = $this->writeImplementation($this->aCache); + $bResult = $this->localWriteImplementation($this->aCache, $bDiplayCrLf); $this->aCache = array(); } else @@ -326,13 +361,21 @@ abstract class Driver } else { - $bResult = $this->writeImplementation( - $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName)); + $bResult = $this->localWriteImplementation( + $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName), $bDiplayCrLf); } return $bResult; } + /** + * @return string + */ + public function GetNewLine() + { + return $this->sNewLine; + } + /** * @final * @return bool diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/File.php b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/File.php index 942df84f0..b3c3678c1 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/File.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/File.php @@ -23,23 +23,18 @@ class File extends \MailSo\Log\Driver */ private $sLoggerFileName; - /** - * @var string - */ - private $sCrLf; - /** * @access protected * * @param string $sLoggerFileName - * @param string $sCrLf = "\r\n" + * @param string $sNewLine = "\r\n" */ - protected function __construct($sLoggerFileName, $sCrLf = "\r\n") + protected function __construct($sLoggerFileName, $sNewLine = "\r\n") { parent::__construct(); $this->sLoggerFileName = $sLoggerFileName; - $this->sCrLf = $sCrLf; + $this->sNewLine = $sNewLine; } /** @@ -52,13 +47,13 @@ class File extends \MailSo\Log\Driver /** * @param string $sLoggerFileName - * @param string $sCrLf = "\r\n" + * @param string $sNewLine = "\r\n" * * @return \MailSo\Log\Drivers\File */ - public static function NewInstance($sLoggerFileName, $sCrLf = "\r\n") + public static function NewInstance($sLoggerFileName, $sNewLine = "\r\n") { - return new self($sLoggerFileName, $sCrLf); + return new self($sLoggerFileName, $sNewLine); } /** @@ -86,11 +81,11 @@ class File extends \MailSo\Log\Driver */ private function writeToLogFile($mDesc) { - if (is_array($mDesc)) + if (\is_array($mDesc)) { - $mDesc = \implode($this->sCrLf, $mDesc); + $mDesc = \implode($this->sNewLine, $mDesc); } - - return \error_log($mDesc.$this->sCrLf, 3, $this->sLoggerFileName); + + return \error_log($mDesc.$this->sNewLine, 3, $this->sLoggerFileName); } } diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/Inline.php b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/Inline.php index 529a3106b..817ffbb5b 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/Inline.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/Inline.php @@ -18,11 +18,6 @@ namespace MailSo\Log\Drivers; */ class Inline extends \MailSo\Log\Driver { - /** - * @var string - */ - private $sNewLine; - /** * @var bool */ diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php index 475d8c39c..4ea1dc978 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Log/Logger.php @@ -296,11 +296,13 @@ class Logger extends \MailSo\Base\Collection * @param string $sDesc * @param int $iType = \MailSo\Log\Enumerations\Type::INFO * @param string $sName = '' - * @param bool $bSearchWords = false + * @param bool $bSearchSecretWords = true + * @param bool $bDiplayCrLf = false * * @return bool */ - public function Write($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '', $bSearchWords = false) + public function Write($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO, + $sName = '', $bSearchSecretWords = true, $bDiplayCrLf = false) { if (isset($this->aForbiddenTypes[$iType]) && true === $this->aForbiddenTypes[$iType]) { @@ -313,7 +315,7 @@ class Logger extends \MailSo\Base\Collection $aLoggers = array(); $iResult = 1; - if ($bSearchWords && !$this->bShowSecter && 0 < \count($this->aSecretWords)) + if ($bSearchSecretWords && !$this->bShowSecter && 0 < \count($this->aSecretWords)) { $sDesc = \str_replace($this->aSecretWords, '*******', $sDesc); } @@ -321,7 +323,7 @@ class Logger extends \MailSo\Base\Collection $aLoggers =& $this->GetAsArray(); foreach ($aLoggers as /* @var $oLogger \MailSo\Log\Driver */ $oLogger) { - $iResult &= $oLogger->Write($sDesc, $iType, $sName); + $iResult &= $oLogger->Write($sDesc, $iType, $sName, $bDiplayCrLf); } return (bool) $iResult; @@ -332,12 +334,14 @@ class Logger extends \MailSo\Base\Collection * @param int $iType = \MailSo\Log\Enumerations\Type::INFO * @param string $sName = '' * @param bool $bSearchSecretWords = false + * @param bool $bDiplayCrLf = false * * @return bool */ - public function WriteDump($oValue, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '', $bSearchSecretWords = false) + public function WriteDump($oValue, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '', + $bSearchSecretWords = false, $bDiplayCrLf = false) { - return $this->Write(\print_r($oValue, true), $iType, $sName, $bSearchSecretWords); + return $this->Write(\print_r($oValue, true), $iType, $sName, $bSearchSecretWords, $bDiplayCrLf); } /** @@ -345,10 +349,12 @@ class Logger extends \MailSo\Base\Collection * @param int $iType = \MailSo\Log\Enumerations\Type::NOTICE * @param string $sName = '' * @param bool $bSearchSecretWords = true + * @param bool $bDiplayCrLf = false * * @return bool */ - public function WriteException($oException, $iType = \MailSo\Log\Enumerations\Type::NOTICE, $sName = '', $bSearchSecretWords = true) + public function WriteException($oException, $iType = \MailSo\Log\Enumerations\Type::NOTICE, $sName = '', + $bSearchSecretWords = true, $bDiplayCrLf = false) { if ($oException instanceof \Exception) { @@ -359,7 +365,7 @@ class Logger extends \MailSo\Base\Collection $oException->__LOGINNED__ = true; - return $this->Write((string) $oException, $iType, $sName, $bSearchSecretWords); + return $this->Write((string) $oException, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf); } return false; @@ -370,10 +376,12 @@ class Logger extends \MailSo\Base\Collection * @param int $iType = \MailSo\Log\Enumerations\Type::NOTICE * @param string $sName = '' * @param bool $bSearchSecretWords = true + * @param bool $bDiplayCrLf = false * * @return bool */ - public function WriteMixed($mData, $iType = null, $sName = '', $bSearchSecretWords = true) + public function WriteMixed($mData, $iType = null, $sName = '', + $bSearchSecretWords = true, $bDiplayCrLf = false) { $iType = null === $iType ? \MailSo\Log\Enumerations\Type::INFO : $iType; if (\is_array($mData) || \is_object($mData)) @@ -381,16 +389,16 @@ class Logger extends \MailSo\Base\Collection if ($mData instanceof \Exception) { $iType = null === $iType ? \MailSo\Log\Enumerations\Type::NOTICE : $iType; - return $this->WriteException($mData, $iType, $sName, $bSearchSecretWords); + return $this->WriteException($mData, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf); } else { - return $this->WriteDump($mData, $iType, $sName, $bSearchSecretWords); + return $this->WriteDump($mData, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf); } } else { - return $this->Write($mData, $iType, $sName, $bSearchSecretWords); + return $this->Write($mData, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf); } return false; diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php index 1eec18afe..3812b6911 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php @@ -557,11 +557,11 @@ abstract class NetClient * * @return void */ - protected function writeLog($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO) + protected function writeLog($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO, $bDiplayCrLf = false) { if ($this->oLogger) { - $this->oLogger->Write($sDesc, $iDescType, $this->getLogName()); + $this->oLogger->Write($sDesc, $iDescType, $this->getLogName(), true, $bDiplayCrLf); } } @@ -573,7 +573,7 @@ abstract class NetClient */ protected function writeLogWithCrlf($sDesc, $iDescType = \MailSo\Log\Enumerations\Type::INFO) { - $this->writeLog(\strtr($sDesc, array("\r" => '\r', "\n" => '\n')), $iDescType); + $this->writeLog($sDesc, $iDescType, true); } /** diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Classes/FilterCondition.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Classes/FilterCondition.php index b56e92fdf..173d66dfa 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Classes/FilterCondition.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Classes/FilterCondition.php @@ -19,6 +19,11 @@ class FilterCondition */ private $sValue; + /** + * @var string + */ + private $sValueSecond; + public function __construct() { $this->Clear(); @@ -29,6 +34,7 @@ class FilterCondition $this->sField = \RainLoop\Providers\Filters\Enumerations\ConditionField::FROM; $this->sType = \RainLoop\Providers\Filters\Enumerations\ConditionType::EQUAL_TO; $this->sValue = ''; + $this->sValueSecond = ''; } /** @@ -55,6 +61,14 @@ class FilterCondition return $this->sValue; } + /** + * @return string + */ + public function ValueSecond() + { + return $this->sValueSecond; + } + /** * @param array $aData * @@ -70,7 +84,8 @@ class FilterCondition $this->sType = isset($aData['Type']) ? $aData['Type'] : \RainLoop\Providers\Filters\Enumerations\ConditionType::EQUAL_TO; - $this->sValue = isset($aData['Value']) ? $aData['Value'] : ''; + $this->sValue = isset($aData['Value']) ? (string) $aData['Value'] : ''; + $this->sValueSecond = isset($aData['ValueSecond']) ? (string) $aData['ValueSecond'] : ''; return true; } @@ -88,7 +103,8 @@ class FilterCondition return array( 'Field' => $this->Field(), 'Type' => $this->Type(), - 'Value' => $this->Value() + 'Value' => $this->Value(), + 'ValueSecond' => $this->ValueSecond() ); } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionField.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionField.php index 7853ba457..e78f95402 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionField.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionField.php @@ -7,4 +7,6 @@ class ConditionField const FROM = 'From'; const RECIPIENT = 'Recipient'; const SUBJECT = 'Subject'; + const HEADER = 'Header'; + const SIZE = 'Size'; } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionType.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionType.php index 96b6c4113..126bdf642 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionType.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/Enumerations/ConditionType.php @@ -8,4 +8,6 @@ class ConditionType const NOT_EQUAL_TO = 'NotEqualTo'; const CONTAINS = 'Contains'; const NOT_CONTAINS = 'NotContains'; + const OVER = 'Over'; + const UNDER = 'Under'; } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php index 4d14d2b16..dfc15af1c 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php @@ -163,12 +163,23 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface { $sResult = ''; $sTypeWord = ''; + $bTrue = true; $sValue = \trim($oCondition->Value()); - if (0 < strlen($sValue)) + $sValueSecond = \trim($oCondition->ValueSecond()); + + if (0 < \strlen($sValue) || + (0 < \strlen($sValue) && 0 < \strlen($sValueSecond) && + \RainLoop\Providers\Filters\Enumerations\ConditionField::HEADER === $oCondition->Field())) { switch ($oCondition->Type()) { + case \RainLoop\Providers\Filters\Enumerations\ConditionType::OVER: + $sTypeWord = ':over'; + break; + case \RainLoop\Providers\Filters\Enumerations\ConditionType::UNDER: + $sTypeWord = ':under'; + break; case \RainLoop\Providers\Filters\Enumerations\ConditionType::NOT_EQUAL_TO: $sResult .= 'not '; case \RainLoop\Providers\Filters\Enumerations\ConditionType::EQUAL_TO: @@ -179,6 +190,10 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface case \RainLoop\Providers\Filters\Enumerations\ConditionType::CONTAINS: $sTypeWord = ':contains'; break; + default: + $bTrue = false; + $sResult = '/* @Error: unknown type value */ false'; + break; } switch ($oCondition->Field()) @@ -192,26 +207,43 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface case \RainLoop\Providers\Filters\Enumerations\ConditionField::SUBJECT: $sResult .= 'header '.$sTypeWord.' ["Subject"]'; break; + case \RainLoop\Providers\Filters\Enumerations\ConditionField::HEADER: + $sResult .= 'header '.$sTypeWord.' ["'.$this->quote($sValueSecond).'"]'; + break; + case \RainLoop\Providers\Filters\Enumerations\ConditionField::SIZE: + $sResult .= 'size '.$sTypeWord; + break; + default: + $bTrue = false; + $sResult = '/* @Error: unknown field value */ false'; + break; } - if (\in_array($oCondition->Field(), array( - \RainLoop\Providers\Filters\Enumerations\ConditionField::FROM, - \RainLoop\Providers\Filters\Enumerations\ConditionField::RECIPIENT - )) && false !== \strpos($sValue, ',')) + if ($bTrue) { - $self = $this; - $aValue = \array_map(function ($sValue) use ($self) { - return '"'.$self->quote(\trim($sValue)).'"'; - }, \explode(',', $sValue)); + if (\in_array($oCondition->Field(), array( + \RainLoop\Providers\Filters\Enumerations\ConditionField::FROM, + \RainLoop\Providers\Filters\Enumerations\ConditionField::RECIPIENT + )) && false !== \strpos($sValue, ',')) + { + $self = $this; + $aValue = \array_map(function ($sValue) use ($self) { + return '"'.$self->quote(\trim($sValue)).'"'; + }, \explode(',', $sValue)); - $sResult .= ' ['.\trim(\implode(', ', $aValue)).']'; - } - else - { - $sResult .= ' "'.$this->quote($sValue).'"'; - } + $sResult .= ' ['.\trim(\implode(', ', $aValue)).']'; + } + else if (\RainLoop\Providers\Filters\Enumerations\ConditionField::SIZE === $oCondition->Field()) + { + $sResult .= ' '.$this->quote($sValue); + } + else + { + $sResult .= ' "'.$this->quote($sValue).'"'; + } - $sResult = \preg_replace('/[\s]+/u', ' ', $sResult); + $sResult = \preg_replace('/[\s]+/u', ' ', $sResult); + } } else { diff --git a/rainloop/v/0.0.0/app/templates/Views/User/SettingsFiltersConditionMore.html b/rainloop/v/0.0.0/app/templates/Views/User/SettingsFiltersConditionMore.html new file mode 100644 index 000000000..61ac82ede --- /dev/null +++ b/rainloop/v/0.0.0/app/templates/Views/User/SettingsFiltersConditionMore.html @@ -0,0 +1,14 @@ +
+ +   + +   + +   + +   + + + +
\ No newline at end of file diff --git a/rainloop/v/0.0.0/app/templates/Views/User/SettingsFiltersConditionSize.html b/rainloop/v/0.0.0/app/templates/Views/User/SettingsFiltersConditionSize.html new file mode 100644 index 000000000..0830dc800 --- /dev/null +++ b/rainloop/v/0.0.0/app/templates/Views/User/SettingsFiltersConditionSize.html @@ -0,0 +1,12 @@ +
+ +   + +   + +   + + + +
\ No newline at end of file