summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: def1242)
raw | patch | inline | side by side (parent: def1242)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Sep 2010 08:15:48 +0000 (08:15 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Sep 2010 08:15:48 +0000 (08:15 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19538 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/groupware/personal/groupware/class_filterManager.inc | patch | blob | history | |
gosa-plugins/groupware/personal/groupware/filterManager.tpl | patch | blob | history |
diff --git a/gosa-plugins/groupware/personal/groupware/class_filterManager.inc b/gosa-plugins/groupware/personal/groupware/class_filterManager.inc
index c1a64dc82e5731d3d4a6cc68a30b4c4d29e88f17..bc3132708d7f99940c3992dd35e987cccb081dec 100644 (file)
$this->filter = array();
- $this->filter[] = array (
- 'STATUS' => 'EXISTS',
- '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 (
- 'STATUS' => 'NEW',
- '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')
- )
- );
-
}
function execute()
switch($filter['STATUS']){
case 'NEW' : $img = image('images/lists/element.png[new]');break;
+ case 'MODIFIED' : $img = image('images/lists/element.png[new]');break;
case 'EXISTS' : $img = image('images/lists/element.png');break;
default : $img = "";
}
}
}
+ // Add new filter
+ if(isset($_POST['addFilter'])){
+ $filter = array (
+ 'STATUS' => 'NEW',
+ 'TYPE' => 'AND',
+ 'NAME' => _('name'),
+ 'DESC' => _('description'),
+ 'CONDITIONS' => array (
+ array('FIELD' => 'from',
+ 'COMPARATOR' => 'equals',
+ 'MATCH' => 'example@domain.com'),
+ array('FIELD' => 'subject',
+ 'COMPARATOR' => 'contains',
+ 'MATCH' => _('advertising')),
+ ),
+ 'ACTION' => array (
+ array('ACTION'=>'MARK',
+ 'VALUE' => 'SPAM'),
+ array('ACTION'=>'MOVE',
+ 'VALUE' => '')
+ )
+ );
+ $this->filterEditor = new filterEditor($this->config,$this->parent, $filter);
+ }
// Close filter editor
if(isset($_POST['filterEditor_cancel']) && $this->filterEditor instanceOf filterEditor){
msg_dialog::displayChecks($msgs);
}else{
$filter = $this->filterEditor->save();
- $this->filter[$this->currentFilter] = $filter;
+ if($filter['STATUS'] == 'NEW'){
+ $this->filter[] = $filter;
+ }else{
+ if($filter['STATUS'] != 'NEW') $filter['STATUS'] = 'MODIFIED';
+ $this->filter[$this->currentFilter] = $filter;
+ }
$this->filterEditor = NULL;
$this->currentFilter = NULL;
}
diff --git a/gosa-plugins/groupware/personal/groupware/filterManager.tpl b/gosa-plugins/groupware/personal/groupware/filterManager.tpl
index e4f13ae72deb10d294a82151fd17b7c11ee12594..d45154592420357201d30661d48569d68caf787d 100644 (file)
<h3>{t}Available filter rules {/t}</h3>
{$list}
-<select name='filterTemplate' size=1>
- <option>Mails von bestimmten Sendern in einen Ordner verschieben</option>
- <option>Mails von bekannten Sender (Adressbuch) in Ordner verschieben</option>
- <option>Mails löschen (Alle und immer!)</option>
- <option>Bla</option>
- <option>Manuelle Regel</option>
-</select>
+
<button name='addFilter'>{msgPool type='addButton'}</button>