summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7627f9e)
raw | patch | inline | side by side (parent: 7627f9e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 6 Sep 2010 12:46:01 +0000 (12:46 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 6 Sep 2010 12:46:01 +0000 (12:46 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19530 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/groupware/personal/groupware/class_filterEditor.inc | [new file with mode: 0644] | patch | blob |
gosa-plugins/groupware/personal/groupware/class_filterManager.inc | patch | blob | history | |
gosa-plugins/groupware/personal/groupware/filterEditor.tpl | [new file with mode: 0644] | patch | blob |
diff --git a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+class filterEditor extends plugin
+{
+ function __construct($config, $parent, $filter)
+ {
+ $this->config = &$config;
+ $this->parent = &$parent;
+ $this->filter = $filter;
+ }
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ return($smarty->fetch(get_template_path('filterEditor.tpl',TRUE,dirname(__FILE__))));
+ }
+}
+?>
diff --git a/gosa-plugins/groupware/personal/groupware/class_filterManager.inc b/gosa-plugins/groupware/personal/groupware/class_filterManager.inc
index 5ee686db8ac79007b0f788bb9ece89a810cb0e20..432767c098190148deb315f6d7aaf2968a6bc098 100644 (file)
$this->filterListing->setEditable(true);
$this->filterListing->setColspecs(array('*'));
$this->filterListing->setWidth("100%");
- $this->filterListing->setHeight("200px;");
+ $this->filterListing->setHeight("150px;");
$this->filterListing->setAcl($this->parent->getacl('mailFilter'));
$this->filter = array();
$this->filter[] = array (
+ 'STATUS' => 'EXISTS',
'TYPE' => 'AND',
'NAME' => 'MuellRaus',
'DESC' => 'Spam loeschen',
);
$this->filter[] = array (
+ 'STATUS' => 'NEW',
'TYPE' => 'OR',
'NAME' => 'Kunden',
'DESC' => 'Kunden Mails in Wichtig schieben',
function execute()
{
+ // Display filter editor while a filter rule is edited
+ if($this->filterEditor instanceOf filterEditor){
+ $this->filterEditor->save_object();
+ return($this->filterEditor->execute());
+ }
+
$smarty = get_smarty();
-
$data = $lData = array();
foreach($this->filter as $key => $filter){
$data[$key] = $filter;
- $lData[$key] = array('data' => array($filter['NAME'], $filter['DESC']));
+
+ switch($filter['STATUS']){
+ case 'NEW' : $img = image('images/lists/element.png[new]');break;
+ case 'EXISTS' : $img = image('images/lists/element.png');break;
+ default : $img = "";
+ }
+
+ $lData[$key] = array('data' => array($img,$filter['NAME'], $filter['DESC']));
}
$this->filterListing->setListData($data,$lData);
$this->filterListing->update();
$key = $action['targets'][0];
$key = $this->filterListing->getKey($key);
if(isset($this->filter[$key])){
-
-
+ $filter = $this->filter[$key];
+ $this->filterEditor = new filterEditor($this->config,$this->parent, $filter);
+ $this->currentFilter = $key;
}
}
+
+ // Close filter editor
+ if(isset($_POST['filterEditor_cancel'])){
+ $this->currentFilter = NULL;
+ $this->filterEditor = NULL;
+ }
+
+ // Save filter modifications and close the dialog
+ if(isset($_POST['filterEditor_ok'])){
+ $this->filterEditor = NULL;
+ $this->currentFilter = NULL;
+ }
}
}
diff --git a/gosa-plugins/groupware/personal/groupware/filterEditor.tpl b/gosa-plugins/groupware/personal/groupware/filterEditor.tpl
--- /dev/null
@@ -0,0 +1,8 @@
+
+asdf
+
+<hr>
+<div class="plugin-actions">
+ <button name='filterEditor_ok'>{msgPool type='okButton'}</button>
+ <button name='filterEditor_cancel'>{msgPool type='cancelButton'}</button>
+</div>