X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Fgroupware%2Fpersonal%2Fgroupware%2Fclass_filterEditor.inc;h=e561b8d1a0038aaf7fe8f517acb781eb44ebefdd;hb=f5b9f24c1c352f50488ab8ec5a89dff873e75bea;hp=31ae41c39ae9a7d45a9e0ada3d569624c299d24c;hpb=adb6c1d65910786003f7b49e5deb141c0c01bf88;p=gosa.git diff --git a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc index 31ae41c39..e561b8d1a 100644 --- a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc +++ b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc @@ -1,77 +1,196 @@ config = &$config; + $this->parent = &$parent; + $this->filter = $filter; - var $filterListing = NULL; - var $filterRules = array(); + $this->types = array( + 'OR' => _("At least one of the following conditions has to match"), + 'AND' => _("All conditions have to match")); - function __construct($config, $rules) - { - plugin::plugin($config); - $this->filterRules = $rules; - - $this->filterListing= new sortableListing(); - $this->filterListing->setDeleteable(true); - $this->filterListing->setEditable(true); - $this->filterListing->setColspecs(array('*')); - $this->filterListing->setWidth("100%"); - $this->filterListing->setHeight("200px;"); + $this->actions = array( + "MOVE" => _("move mail to"), + "COPY" => _("copy mail to"), + "FORWARD" => _("forward message to"), + "MARK" => _("mark mail as "), + "DROP" => _("remove mail"), + "REPLY" => _("reply")); + + $this->fields = array( + 'subject' => _("Subject"), + 'from'=> _("From"), + 'body'=> _("Body"), + 'date'=> _("Date"), + 'priority'=> _("Priority"), + 'status'=> _("Status"), + 'to'=> _("To"), + 'cc'=> _("CC"), + 'age'=> _("Age"), + 'size'=> _("Size")); + + $this->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")); } 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__)))); + } - $this->filter = array(); - $this->filter[] = array ( - 'TYPE' => 'AND', - 'NAME' => 'MuellRaus', - 'DESC' => 'Spam loeschen', - 'CONDITIONS' => array ( - array('FIELD' => 'from', - 'COMPARATOR' => 'equals', - 'MATCH' => 'herbert'), - array('FIELD' => 'subject', - 'COMPARATOR' => 'contains', - 'MATCH' => 'advertising'), - ), - 'ACTION' => array ( - array('ACTION'=>'MARK', - 'VALUE' => 'SPAM'), - array('ACTION'=>'MOVE', - 'VALUE' => 'gosa+shared/hickert/trash') - ) - ); - - $this->filter[] = array ( - 'TYPE' => 'OR', - 'NAME' => 'Kunden', - 'DESC' => 'Kunden Mails in Wichtig schieben', - 'CONDITIONS' => array ( - array('FIELD' => 'from', - 'COMPARATOR' => 'contains', - 'MATCH' => 'gonicus'), - array('FIELD' => 'from', - 'COMPARATOR' => 'contains', - 'MATCH' => 'lka'), - ), - 'ACTION' => array ( - array('ACTION'=>'MARK', - 'VALUE' => 'HAM'), - array('ACTION'=>'MOVE', - 'VALUE' => 'gosa+shared/hickert/wichtig') - ) - ); - $smarty = get_smarty(); + function check() + { + $msgs = array(); + return($msgs); + } + function save() + { + // Just return the filter array we've modified + return($this->filter); + } - $smarty->assign('list', $this->filterListing->render()); - return($smarty->fetch(get_template_path('filterEditor.tpl',TRUE,dirname(__FILE__)))); + function renderFilter() + { + $filter = $this->filter; + + $cnt = count($filter['CONDITIONS']); + $str = "