From: hickert Date: Mon, 6 Sep 2010 13:53:03 +0000 (+0000) Subject: Updated filter Editor X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=97be73edb0c4cd502120dd3db6f2e90eb007d2f8;p=gosa.git Updated filter Editor git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19532 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc index 5fc90ef6c..832f3e9a5 100644 --- a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc +++ b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc @@ -12,7 +12,8 @@ class filterEditor extends plugin function execute() { $smarty = get_smarty(); - + $smarty->assign('NAME',set_post($this->filter['NAME'])); + $smarty->assign('DESC',set_post($this->filter['DESC'])); $smarty->assign('filterStr', $this->renderFilter()); return($smarty->fetch(get_template_path('filterEditor.tpl',TRUE,dirname(__FILE__)))); @@ -20,11 +21,117 @@ class filterEditor extends plugin function renderFilter() { - $str = ""; + $filter = $this->filter; + + $actions = array( + "MOVE" => _("move mail to"), + "COPY" => _("copy mail to"), + "FORWARD" => _("forward message to"), + "MARK" => _("mark mail as "), + "DROP" => _("remove mail"), + "REPLY" => _("reply")); + + $fields = array( + 'subject' => _("Subject"), + 'from'=> _("From"), + 'body'=> _("Body"), + 'date'=> _("Date"), + 'priority'=> _("Priority"), + 'status'=> _("Status"), + 'to'=> _("To"), + 'cc'=> _("CC"), + 'age'=> _("Age"), + 'size'=> _("Size")); + + $comparators = array( + "is" => _("is"), + "is not" => _("is not"), + "equal" => _("is equal"), + "not equal" => _("is not equal"), + "is empty" => _("is empty"), + "is not empty" => _("is not empty"), + "contains" => _("contains"), + "contains not" => _("does not contain"), + "is in addressbook" => _("is in the addressbook"), + "is not in addressbook" => _("is not in the addressbook"), + "greater than" => _("is greater than"), + "less than" => _("smaller than")); + + + $cnt = count($filter['CONDITIONS']); + $str = "

"._("Filter conditions")."

"; + $str.= ""; + + $str .= "
"; + $str .= "

"._("Filter actions")."

"; + + $str.= ""; + return($str); } + + function save_object() + { + foreach($this->filter['CONDITIONS'] as $id => $value){ + if(isset($_POST['cField_'.$id])){ + $this->filter['CONDITIONS'][$id]['FIELD'] = get_post('cField_'.$id); + } + if(isset($_POST['cComparator_'.$id])){ + $this->filter['CONDITIONS'][$id]['COMPARATOR'] = get_post('cComparator_'.$id); + } + if(isset($_POST['cMatch_'.$id])){ + $this->filter['CONDITIONS'][$id]['MATCH'] = get_post('cMatch_'.$id); + } + } + foreach($this->filter['ACTION'] as $id => $value){ + if(isset($_POST['cAction_'.$id])){ + $this->filter['ACTION'][$id]['ACTION'] = get_post('cAction_'.$id); + } + if(isset($_POST['cValue_'.$id])){ + $this->filter['ACTION'][$id]['VALUE'] = get_post('cValue_'.$id); + } + } + } } ?> diff --git a/gosa-plugins/groupware/personal/groupware/filterEditor.tpl b/gosa-plugins/groupware/personal/groupware/filterEditor.tpl index c1ad83a6a..9853e2c4e 100644 --- a/gosa-plugins/groupware/personal/groupware/filterEditor.tpl +++ b/gosa-plugins/groupware/personal/groupware/filterEditor.tpl @@ -1,8 +1,18 @@

{t}Filter editor{/t}

+ + + + + + + + + +
:
+
{$filterStr} -