<!--
Copyright by Thomas Bley 2002-2003
thomas.bley@simple-groupware.de

http://www.simple-groupware.de
-->
<html>
<head>
	<title>Webmail by Thomas Bley - Simple Groupware Solutions - more.groupware</title>
    <meta http-equiv="content-type" content="text/html; charset={$charset}">
	<link rel="SHORTCUT ICON" href="{$imgpathmaster}/favicon.ico">
	<link rel="icon" href="{$imgpathmaster}/favicon.ico" type="image/ico">
    <link rel="stylesheet" type="text/css" href="{$rooturl}modules/general/templates/default/css/Morelogs_Silver.css" />

<style type="text/css">
{literal}
<!--
body {scrollbar-face-color: #E4E4E4; scrollbar-shadow-color: #000000;scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #999999;scrollbar-darkshadow-color: #999999; scrollbar-track-color: #F3F3F3;scrollbar-arrow-color: #000000;
  BORDER-LEFT:#434343 1px solid;
  background-color: #F3F3F3;
}
td {  font-family: Arial, Helvetica,sans-serif; font-size: 10pt; font-variant: normal; text-transform: none; color: #000000}
a:hover {  color: #CC0000; text-decoration: underline}
.lines
{color:#ffffff;
background:#ffffff;}

.lines2
{color:#ffffff;
background:#838899;}
-->

{/literal}
</style>

<script language="JavaScript">
var validate_str='{$hashmap.filter_validate|addslash}';

{literal}
  function validate() {
    form = document.forms['f1'];
	valid=false;

	if (form.elements['match_str'].value != '' || form.elements['spam_flag2'].checked) valid=true;
	if (!form.elements['copy_to_folder'].checked && !form.elements['copy_to_user'].checked && !form.elements['change_flag_to'].checked && !form.elements['mark_as_read'].checked && !form.elements['mark_as_flagged'].checked && !form.elements['delete_message'].checked) valid=false;
	
	if (!valid) alert(validate_str);
	return valid;
  }
{/literal}
</script>

</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="#1F4687" vlink="#1F4687" alink="#1F4687" bgcolor="#F3F3F3">

<br>
<center>
<table border="0" cellpadding="0" cellspacing="0" width="90%" bgcolor="#EFEFF2">
  <tr>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
    <td class="category" width="100%" colspan="7"><img src="{$imgpathmaster}/space.gif" width="100%" height="1"></td>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
    <td class="subnavback" width="10"><img src="{$imgpathmaster}/space.gif" width="10" height="1"></td>
    <td class="subnavback" width="100%" colspan="5" style="font-weight: bold;"><div align="center">{$hashmap.webmail2_settings_filters}</div></td>
    <td class="subnavback" width="10"><img src="{$imgpathmaster}/space.gif" width="10" height="1"></td>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
</tr>
<tr>
  <td class="category" width="1" colspan="2"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
  <td class="category" width="100%" colspan="5"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
  <td class="category" width="1" colspan="2"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
</tr>
<tr>
  <td colspan="8" class="tab"><br></td>
</tr>
<tr>
  <td class="tab" colspan="2"></td>
  <td class="tab">{$hashmap.maillist_account}</td>
  <td class="tab">{$hashmap.filter_match}</td>
  <td class="tab">{$hashmap.filter_action}</td>
  <td class="tab"></td>
  <td class="tab"></td>
  <td class="tab" colspan="2"></td>
</tr>
{section name=item loop=$items}
<tr>
  <td class="tab" colspan="2"></td>
  <td class="lines2" height="1" width="1" colspan="5"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td>
  <td class="tab" colspan="2"></td>
</tr>
<tr>
  <td colspan="8" class="tab"><br></td>
</tr>
<tr>
  <td class="tab" colspan="2"></td>
  <td class="tab" width="35%" valign="top">{$items[item].account_name}</td>
  <td class="tab" width="35%" valign="top">{$items[item].match}</td>
  <td class="tab" valign="top">
    {section name=item2 loop=$items[item].actions}
	  {$items[item].actions[item2]}<br>	
	{/section}    
  </td>
  <td class="tab" align="right" valign="top"><a href="filters.php?action=edit&id={$items[item].id}&{$SESSION}">{$hashmap.edit}</a></td>
  <td class="tab" align="right" valign="top"><a href="filters.php?action=delete&id={$items[item].id}&{$SESSION}" onclick="return confirm('{$hashmap.filter_really_delete|addslash}')">{$hashmap.delete}</a></td>
  <td class="tab" colspan="2"></td>
</tr>
{/section}
<tr>
  <td colspan="9" class="tab"><br></td>
</tr>
</table>




<br>
<table border="0" cellpadding="0" cellspacing="0" width="90%" bgcolor="#EFEFF2">
<tr>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
    <td class="category" width="100%" colspan="6"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
</tr>
<tr>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
    <td class="subnavback" width="100%" colspan="6" style="font-weight: bold"><div align="center">{if $edit_id}{$hashmap.change_filter}{else}{$hashmap.create_filter}{/if}</div></td>
    <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
</tr>
<tr>
  <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
  <td class="category" width="100%" colspan="6"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
  <td class="category" width="1"><img src="{$imgpathmaster}/space.gif" width="1" height="1"></td>
</tr>
<tr>
  <td colspan="8" class="tab"><br></td>
</tr>
<tr>
  <td class="tab"></td>
  <td class="tab" width="10"><img src="{$imgpathmaster}/space.gif" width="10" height="1"></td>
  <td class="tab">{$hashmap.maillist_account}</td>
  <td class="tab">{$hashmap.filter_match}</td>
  <td class="tab"></td>
  <td class="tab">{$hashmap.filter_action}</td>
  <td class="tab" width="10"><img src="{$imgpathmaster}/space.gif" width="10" height="1"></td>
  <td class="tab"></td>
</tr>
<tr>
  <td class="tab" colspan="2"></td>
  <td class="lines2" height="1" width="1" colspan="4"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td>
  <td class="tab" colspan="2"></td>
</tr>
<tr>
  <td colspan="8" class="tab"><br></td>
</tr>
  <form name="f1" action="filters.php" method="POST" onsubmit="return validate();">
  <input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">
  <input type="hidden" name="edit_id" value="{$edit_id}">
  <input type="hidden" name="action" value="change">
  <tr>
    <td class="tab" colspan="2"></td>
    <td class="tab" valign="top" width="50">
	  <select name="account_id">
	    <option value="-1">{$hashmap.filter_all_accounts}
	    {section name=item loop=$accounts}
	    <option value="{$accounts[item][0]}" {if $data.account_id eq $accounts[item][0]}selected{/if}>{$accounts[item][1]|escape:"html"}
	    {/section}
	  </select>
	</td><td class="tab" valign="top" width="100">
	  <table border="0" cellpadding="0" cellspacing="0">
	    <tr>
		  <td>
		    <input type="Radio" name="spam_flag" id="spam_flag1" value="notchecked" {if $data.spam_flag eq "notchecked" || $data.spam_flag eq ""}checked{/if}>
		  </td>
		  <td>
			<input type="text" size="20" name="match_str" id="match_str" value="{$data.match_str|escape:"html"}"><br>
		  </td>
		  <td>
	  		<select name="match_type">
			  <option value="header_subject" {if $data.match_type eq "header_subject"}selected{/if}>{$hashmap.maillist_subject}
			  <option value="header_from" {if $data.match_type eq "header_from"}selected{/if}>{$hashmap.maillist_from}
			  <option value="header_to" {if $data.match_type eq "header_to"}selected{/if}>{$hashmap.maillist_to}
			</select>
		  </td>
		</tr>
		<tr>
		  <td colspan="2">
		    <input type="Radio" name="spam_flag" id="spam_flag2" value="checked" {if $data.spam_flag eq "checked"}checked{/if}>{$hashmap.filter_use_spam_flag}
		  </td>
		</tr>
	  </table>
	</td><td class="tab" valign="top">
	</td><td class="tab" valign="top">

	  <table border="0" cellpadding="0" cellspacing="0" width="250">
	    <tr>
		  <td nowrap><input type="checkbox" name="copy_to_folder" value="checked" {if $data.copy_to_folder eq "checked"}checked{/if}>{$hashmap.filter_copy_to_folder}</td>
		  <td>
			<select name="target_folder">
			  {section name=item loop=$folders}
			  <option value="{$folders[item][0]}" {if $data.target_folder eq $folders[item][0]}selected{/if}>{$folders[item][4]}{$folders[item][5]}
			  {/section}
			</select>
		  </td>
		</tr>
	    <tr>
		  <td nowrap><input type="checkbox" name="copy_to_user" value="checked" {if $data.copy_to_user eq "checked"}checked{/if}>{$hashmap.filter_copy_to_user}</td>
		  <td>
			<select name="target_user">
			  {section name=item loop=$users}
			  <option value="{$users[item][0]}" {if $data.target_user eq $users[item][0]}selected{/if}>{$users[item][1]|escape:"html"}
			  {/section}
			</select>
		  </td>
		</tr>
	    <tr>
		  <td nowrap><input type="checkbox" name="change_flag_to" value="checked" {if $data.change_flag_to eq "checked"}checked{/if}>{$hashmap.filter_change_flag_to}</td>
		  <td>
			<select name="target_flag">
			  <option value="1" {if $data.target_flag eq 1}selected{/if}>{$hashmap.webmail2_maillist_important}
			  <option value="2" {if $data.target_flag eq 2}selected{/if}>{$hashmap.webmail2_maillist_work}
			  <option value="3" {if $data.target_flag eq 3}selected{/if}>{$hashmap.webmail2_maillist_personal}
			  <option value="4" {if $data.target_flag eq 4}selected{/if}>{$hashmap.webmail2_maillist_todo}
			  <option value="5" {if $data.target_flag eq 5}selected{/if}>{$hashmap.webmail2_maillist_later}
			</select>
		  </td>
		</tr>
	    <tr>
		  <td nowrap><input type="checkbox" name="mark_as_read" value="checked" {if $data.mark_as_read eq "checked"}checked{/if}>{$hashmap.filter_mark_as_read}</td>
		</tr>
	    <tr>
		  <td nowrap><input type="checkbox" name="mark_as_flagged" value="checked" {if $data.mark_as_flagged eq "checked"}checked{/if}>{$hashmap.filter_mark_as_flagged}</td>
		</tr>
	    <tr>
		  <td nowrap><input type="checkbox" name="delete_message" value="checked" {if $data.delete_message eq "checked"}checked{/if}>{$hashmap.filter_delete_message_from_inbox}</td>
		</tr>
	  </table>
	</td><td class="tab" colspan="2">
	</td>
  </tr>
  <tr>
    <td colspan="8" class="tab"><br></td>
  </tr>
  <tr>
    <td class="tab" colspan="2"></td>
    <td class="lines2" height="1" width="1" colspan="4"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td>
    <td class="tab" colspan="2"></td>
  </tr>
  <tr>
    <td colspan="8" class="tab"><br></td>
  </tr>
  <tr>
    <td class="tab" colspan="2"></td>
	<td class="tab" colspan="4" valign="top" align="center"><input type="submit" value="{if $edit_id}{$hashmap.change}{else}{$hashmap.create}{/if}" name="submit" class="submit">{if $edit_id}<br><br><a href="filters.php?{$SESSION}">{$hashmap.back}</a>{/if}</td>
    <td class="tab" colspan="2"></td>
  </tr>
  </form>
</table>

</center>

</body>
</html>
