Skip to content

Commit

Permalink
Target folder is required for spam filter
Browse files Browse the repository at this point in the history
Bug #13917
  • Loading branch information
slusarz committed Mar 18, 2015
1 parent 465ddfc commit 2ba5518
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion ingo/lib/Basic/Spam.php
Expand Up @@ -132,7 +132,12 @@ class Horde_Form_Type_ingo_folders extends Horde_Form_Type {

function isValid(&$var, &$vars, $value, &$message)
{
return true;
if (strlen($value)) {
return true;
}

$message = _("A target folder is required.");
return false;
}

function getFolder()
Expand Down
2 changes: 1 addition & 1 deletion ingo/lib/Form/Spam.php
Expand Up @@ -35,7 +35,7 @@ public function __construct($vars, $title = '', $name = null)
$v = $this->addVariable(_("Spam Level:"), 'level', 'int', true, false, _("Messages with a likely spam score greater than or equal to this number will be treated as spam."));
$v->setHelp('spam-level');

$this->folder_var = $this->addVariable(_("Folder to receive spam:"), 'folder', 'ingo_folders', false);
$this->folder_var = $this->addVariable(_("Folder to receive spam:"), 'folder', 'ingo_folders', true);
$this->folder_var->setHelp('spam-folder');
$this->addHidden('', 'actionID', 'text', false);
$this->addHidden('', 'folder_new', 'text', false);
Expand Down
4 changes: 2 additions & 2 deletions ingo/templates/flist/select.html.php
@@ -1,9 +1,9 @@
<?php
$o = $this->optionTag(null, _("Select target folder:")) .
$o = $this->optionTag('', _("Select target folder:")) .
$this->optionTag(null, '- - - - - - - - - -', false, array('disabled' => true));

if ($this->create) {
$o .= $this->optionTag(null, _("Create new folder"), false, array('class' => 'flistCreate')) .
$o .= $this->optionTag('', _("Create new folder"), false, array('class' => 'flistCreate')) .
$this->optionTag(null, '- - - - - - - - - -', false, array('disabled' => true));
}

Expand Down

0 comments on commit 2ba5518

Please sign in to comment.