summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de3ee06)
raw | patch | inline | side by side (parent: de3ee06)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Mar 2007 07:22:24 +0000 (07:22 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Mar 2007 07:22:24 +0000 (07:22 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5754 594d385d-05f5-0310-b6e9-bd551577e9d8
include/sieve/class_My_Tree.inc | patch | blob | history | |
include/sieve/class_sieveElement_If.inc | patch | blob | history | |
include/sieve/class_sieveElements.inc | patch | blob | history | |
include/sieve/templates/element_allof.tpl | [new file with mode: 0644] | patch | blob |
include/sieve/templates/element_anyof.tpl | [new file with mode: 0644] | patch | blob |
include/sieve/templates/element_boolean.tpl | patch | blob | history | |
include/sieve/templates/element_exists.tpl | patch | blob | history | |
include/sieve/templates/element_header.tpl | patch | blob | history | |
include/sieve/templates/element_size.tpl | patch | blob | history | |
include/sieve/templates/element_vacation.tpl | [new file with mode: 0644] | patch | blob |
index 922156017b8d2e834833a613ce734938c090d4a1..bca523f2c9a84df06f383d7780e42adeaf2b3d5c 100644 (file)
{
foreach($this->pap as $key => $obj){
- if(in_array(get_class($obj),array("sieve_if"))){
+ if(in_array(get_class($obj),array("sieve_if","sieve_vacation"))){
$this->pap[$key]->save_object();
}
}
index 03934e4603e8bf963a60a520f5a60caf6956fab3..0b8c5caadfc8f68d4c91e397148b2b5794b442f5 100644 (file)
case "allof" :
{
+ if(isset($_POST['toggle_inverse_'.$element_id])){
+ $parsed[$key]['Inverse'] = !$parsed[$key]['Inverse'];
+ }
foreach($data as $key2 => $dat){
if(($key2 === "Inverse") && ($key2 == "Inverse")){
continue;
case "anyof" :
{
+ if(isset($_POST['toggle_inverse_'.$element_id])){
+ $parsed[$key]['Inverse'] = !$parsed[$key]['Inverse'];
+ }
foreach($data as $key2 => $dat){
if(($key2 === "Inverse") && ($key2 == "Inverse")){
continue;
break;
}
+
+ /*******************
+ * Envelope
+ *******************/
+
case "envelope":
{
$address_parts = $this->address_parts;
$smarty->assign("match_type", $data['Match_type']);
$smarty->assign("operator" , preg_replace("/\"/","",$data['Match_type_value']));
$smarty->assign("comparator", $data['Comparator']);
-
$keys = "";
foreach($data['Key_List'] as $key){
- $keys .= $key."\n";
+ $keys .= $key.", ";
}
-
+ $keys = preg_replace("/,$/","",trim($keys));
+
$values = "";
foreach($data['Value_List'] as $key){
- $values .= $key."\n";
+ $values .= $key.", ";
}
+ $values = preg_replace("/,$/","",trim($values));
$smarty->assign("keys",$keys);
$smarty->assign("values",$values);
-
$smarty->assign("ID" , $element_id);
$ret .= $smarty->fetch(get_template_path("templates/element_envelope.tpl",TRUE,dirname(__FILE__)));
break;
}
+
+ /*******************
+ * Address
+ *******************/
+
case "address" :
{
$address_parts = $this->address_parts;
case "allof" :
{
- $ret = "<table width='100%' cellspacing=0 cellpadding=0>
- <tr>
- <td style='text-align:center; vertical-align: middle; width:45px;
- background-color: #BDBDBD; border: solid 1px #EEEEEE'>".
- "<b>".$str_inverse._("All of")."</b>".
- "<img alt='' class='center' src='images/select_ogroup.png'>".
- "</td>";
- $ret.= " <td style='background-color:#BDBDBD ; border: solid 1px #EEEEEE'>";
-
+ $Contents = "";
foreach($data as $key => $dat){
if(($key === "Inverse") && ($key == "Inverse")){
continue;
}
- $ret.= $this->get_as_html($dat, ($id +1),$key);
+ $Contents .= $this->get_as_html($dat, ($id +1),$key);
}
- $ret.= " </td>
- </tr>
- </table>";
+ $smarty = get_smarty();
+ $smarty->assign("Inverse",$Inverse);
+ $smarty->assign("Contents",$Contents);
+ $smarty->assign("ID" , $element_id);
+ $ret .= $smarty->fetch(get_template_path("templates/element_allof.tpl",TRUE,dirname(__FILE__)));
break ;
}
case "anyof" :
{
- $ret = "<table width='100%' cellspacing=0 cellpadding=0>
- <tr>
- <td style='text-align:center; vertical-align: middle; width:45px;
- background-color: #AAAAAA; border: solid 1px #EEEEEE'>".
- "<b>".$str_inverse._("Any of")."</b>".
- "<img alt='' class='center' src='images/select_department.png'>".
- "</td>";
- $ret.= " <td style='background-color: #AAAAAA ; border: solid 1px #EEEEEE'>";
+ $Contents = "";
foreach($data as $key => $dat){
if(($key === "Inverse") && ($key == "Inverse")){
continue;
}
- $ret.= $this->get_as_html($dat, ($id + 1),$key);
+ $Contents .= $this->get_as_html($dat, ($id +1),$key);
}
+ $smarty = get_smarty();
+ $smarty->assign("Inverse",$Inverse);
+ $smarty->assign("Contents",$Contents);
+ $smarty->assign("ID" , $element_id);
+ $ret .= $smarty->fetch(get_template_path("templates/element_anyof.tpl",TRUE,dirname(__FILE__)));
+ break ;
+ }
+ default :
+ {
+ $ret = "<table width='100%' cellspacing=0 cellpadding=0>
+ <tr>
+ <td style='background-color: #FEDCA9 ; border: solid 1px #EEEEEE'>";
+ $ret.= $key."<br>";
$ret.= " </td>
</tr>
</table>";
- break ;
}
- default :
- {
- $ret = "<table width='100%' cellspacing=0 cellpadding=0>
- <tr>
- <td style='background-color: #FEDCA9 ; border: solid 1px #EEEEEE'>";
- $ret.= $key."<br>";
- $ret.= " </td>
- </tr>
- </table>";
-
- }
}
}
return($ret);
index 768a4dfc67646dff31bc64f75c6d4197a3b5a798..1c62f35fa0bf62c6283a15bbe59c6d5211e93121 100644 (file)
var $subject = FALSE;
var $from = "";
var $mime = "";
- var $hanlde = "";
+ var $handle = "";
var $reason = "";
var $addresses= array();
+ var $object_id= -1;
+ var $Expert = FALSE;
- function sieve_vacation($data)
+ function sieve_vacation($data,$object_id)
{
/* Usage: vacation [":days" number] [":subject" string]
[":from" string] [":addresses" string-list]
return($str."\n");
}
+
+ function save_object()
+ {
+ /* Get release date */
+ if(isset($_POST['vacation_release_'.$this->object_id])){
+ $this->days = $_POST['vacation_release_'.$this->object_id];
+ }
+
+ /* Check if we want to toggle the expert mode */
+ if(isset($_POST['Toggle_Expert_'.$this->object_id])){
+ $this->Expert = !$this->Expert;
+ }
+
+ /* Get release date */
+ if(isset($_POST['vacation_receiver_'.$this->object_id])){
+ $vr = stripslashes ($_POST['vacation_receiver_'.$this->object_id]);
+ $tmp = array();
+ $tmp2 = split(",",$vr);
+ foreach($tmp2 as $val){
+ $tmp[] = "\"".trim(preg_replace("/\"/","",$val))."\"";
+ }
+ $this->addresses = $tmp;
+ }
+
+ /* Get reason */
+ if(isset($_POST['vacation_reason_'.$this->object_id])){
+ $vr = stripslashes ($_POST['vacation_reason_'.$this->object_id]);
+ $this->reason = "\"".trim(preg_replace("/\"/","",$vr))."\"";
+ }
+ }
+
function execute()
{
- $str ="";
- $str .="<b>"._("Vacation message")."</b>";
- foreach($this->addresses as $addr){
- $str .="<br><input type='text' value='".$addr."' style='width:50%;'>";
+ $Addresses = "";
+ foreach($this->addresses as $key){
+ $Addresses .= $key.", ";
}
- $str .="<br><textarea style='width:100%;height:60px;'>".$this->reason."</textarea>";
-
- return($str);
+ $Addresses = preg_replace("/,$/","",trim($Addresses));
+
+ $smarty = get_smarty();
+ $smarty->assign("Reason",$this->reason);
+ $smarty->assign("Addresses",$Addresses);
+ $smarty->assign("Subject",$this->subject);
+ $smarty->assign("Days",$this->days);
+ $smarty->assign("ID",$this->object_id);
+ $smarty->assign("Expert",$this->Expert);
+ return($smarty->fetch(get_template_path("templates/element_vacation.tpl",TRUE,dirname(__FILE__))));
}
}
diff --git a/include/sieve/templates/element_allof.tpl b/include/sieve/templates/element_allof.tpl
--- /dev/null
@@ -0,0 +1,15 @@
+<table width='100%' cellspacing=0 cellpadding=0>
+ <tr>
+ <td style='text-align:center; vertical-align: middle; width:45px;background-color: #BDBDBD; border: solid 1px #EEEEEE'>
+ {if $Inverse}
+ <input type='submit' name='toggle_inverse_{$ID}' value='{t}Not{/t}'>
+ {else}
+ <input type='submit' name='toggle_inverse_{$ID}' value='{t}-{/t}'>
+ {/if}
+ <img alt='' class='center' src='images/select_ogroup.png'>
+ </td>
+ <td style='background-color:#BDBDBD ; border: solid 1px #EEEEEE'>
+ {$Contents}
+ </td>
+ </tr>
+</table>
diff --git a/include/sieve/templates/element_anyof.tpl b/include/sieve/templates/element_anyof.tpl
--- /dev/null
@@ -0,0 +1,15 @@
+<table width='100%' cellspacing=0 cellpadding=0>
+ <tr>
+ <td style='text-align:center; vertical-align: middle; width:45px;background-color: #AAAAAA; border: solid 1px #EEEEEE'>
+ {if $Inverse}
+ <input type='submit' name='toggle_inverse_{$ID}' value='{t}Not{/t}'>
+ {else}
+ <input type='submit' name='toggle_inverse_{$ID}' value='{t}-{/t}'>
+ {/if}
+ <img alt='' class='center' src='images/select_department.png'>
+ </td>
+ <td style='background-color:#BDBDBD ; border: solid 1px #EEEEEE'>
+ {$Contents}
+ </td>
+ </tr>
+</table>
diff --git a/include/sieve/templates/element_boolean.tpl b/include/sieve/templates/element_boolean.tpl
index 61578ddb714f1a015a15be1dee3f00f4fa15bded..47a97c1b28b84a0a8252ef776b77f5b64f349099 100755 (executable)
-<b>{t}Bool{/t}</b>
-<select name='boolean_{$ID}' title='{t}Boolean value{/t}'>
- {html_options options=$values selected=$selected}
-</select>
-<input type='submit' value='{t}update{/t}'>
-<br>
+<table cellspacing=0 cellpadding=2 style='background-color:#DDDDFF;width:100%; border: solid 1px #CCCCCC'>
+ <tr>
+ <td>
+ <b>{t}Bool{/t}</b>
+ <select name='boolean_{$ID}' title='{t}Boolean value{/t}'>
+ {html_options options=$values selected=$selected}
+ </select>
+ <input type='submit' value='{t}update{/t}'>
+ <br>
+ </td>
+ </tr>
+</table>
diff --git a/include/sieve/templates/element_exists.tpl b/include/sieve/templates/element_exists.tpl
index 164313af5cf6254104e762d15904640a627366fc..626cf875cb25190d7bbe8dbb73869ac7be5666b9 100644 (file)
-<b>{t}Exists{/t}</b>
-<table >
+<table cellspacing=0 cellpadding=2 style='background-color:#EEEEDD;width:100%; border: solid 1px #CCCCCC'>
<tr>
<td style='vertical-align:top;'>
+ <b>{t}Exists{/t}</b>
{if $LastError != ""}
<font color='red'>{$LastError}</font>
<br>
diff --git a/include/sieve/templates/element_header.tpl b/include/sieve/templates/element_header.tpl
index c88466f1aed4918ff3e70fb9eb2f83106ec8288c..fe7f472cdee440461b7ce21d11ec29378cce995f 100755 (executable)
-
-<table>
+<table cellspacing=0 cellpadding=2 style='background-color:#EEEEDD;width:100%; border: solid 1px #CCCCCC'>
{if $Expert}
<tr>
<td style='vertical-align:top;'>
{t}If{/t}
- <b>{t}Envelope{/t}</b>
+ <b>{t}Header{/t}</b>
{if $Inverse}
<input type='submit' name='toggle_inverse_{$ID}' value='{t}Not{/t}'>
index c589de5bfa809ca25afc8e45dbed6dbdd0f6d0eb..def994dff2b4cd3bdbba0924fa09c7ccbabb4b1c 100644 (file)
-<b>{t}Size{/t}</b>
-<table>
+<table cellspacing=0 cellpadding=2 style='background-color:#EEEEDD;width:100%; border: solid 1px #CCCCCC'>
<tr>
<td>
+<b>{t}Size{/t}</b>
{if $LastError != ""}
<font color='red'>{$LastError}</font>
<br>
diff --git a/include/sieve/templates/element_vacation.tpl b/include/sieve/templates/element_vacation.tpl
--- /dev/null
@@ -0,0 +1,38 @@
+
+<table cellspacing=0 cellpadding=2 style='background-color:#EEEEDD;width:100%; border: solid 1px #CCCCCC'>
+
+
+ {if $Expert}
+ <tr>
+ <td>
+ {t}Release date{/t}
+ <input type='text' name='vacation_release_{$ID}' value='{$Days}'>
+
+ </td>
+ <td>
+ {t}Receiver{/t}
+ </td>
+ <td style='width:50%;'>
+ <textarea name='vacation_receiver_{$ID}' style='width:100%;height:20px;'>{$Addresses}</textarea>
+ </td>
+ <td style='text-align:right; vertical-align:top;'>
+ <input type='submit' name='Toggle_Expert_{$ID}' value='{t}Normal mode{/t}'>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <textarea name='vacation_reason_{$ID}' style='width:100%;height:60px;'>{$Reason}</textarea>
+ </td>
+ </tr>
+ {else}
+ <tr>
+ <td>
+ <textarea name='vacation_reason_{$ID}' style='width:100%;height:60px;'>{$Reason}</textarea>
+ </td>
+ <td width='10%' style='vertical-align:top;'>
+ <input type='submit' name='Toggle_Expert_{$ID}' value='{t}Expert mode{/t}'>
+ </td>
+ </tr>
+ {/if}
+</table>
+