[vhffs-dev] [1767] No more HTML::Template in mail/prefs.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1767
Author:   beuss
Date:     2011-05-17 22:27:49 +0200 (Tue, 17 May 2011)
Log Message:
-----------
No more HTML::Template in mail/prefs.

Modified Paths:
--------------
    trunk/vhffs-panel/Makefile.am
    trunk/vhffs-panel/mail/prefs.pl
    trunk/vhffs-panel/templates/Makefile.am

Added Paths:
-----------
    trunk/vhffs-panel/templates/mail/prefs.tt

Removed Paths:
-------------
    trunk/vhffs-panel/mail/delete.pl
    trunk/vhffs-panel/templates/mail/prefs.tmpl
    trunk/vhffs-panel/templates/mail/prefs_boxes.tmpl
    trunk/vhffs-panel/templates/mail/prefs_forwards.tmpl

Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/Makefile.am	2011-05-17 20:27:49 UTC (rev 1767)
@@ -885,7 +885,6 @@
 	group/index.pl \
 	group/view.pl \
 	mail/create.pl \
-	mail/delete.pl \
 	mail/index.pl \
 	mail/prefs.pl \
 	mailinglist/create.pl \

Deleted: trunk/vhffs-panel/mail/delete.pl
===================================================================
--- trunk/vhffs-panel/mail/delete.pl	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/mail/delete.pl	2011-05-17 20:27:49 UTC (rev 1767)
@@ -1,108 +0,0 @@
-#!%PERL% -w 
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-use utf8;
-use POSIX qw(locale_h);
-use HTML::Template;
-use locale;
-use Locale::gettext;
-use CGI;
-use CGI::Session;
-use strict;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Main;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Services::Mail;
-use Vhffs::Acl;
-use Vhffs::Constants;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
-
-my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
-my $user = $panel->{'user'};
-my $cgi = $panel->{'cgi'};
-my $domain = $cgi->param("name");
-my $sure = $cgi->param("DELETE");
-my $template;
-my $message;
-my $mail = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain );
-
-my $templatedir = $vhffs->get_config->get_templatedir;
-
-$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-
-if( ! defined $domain )
-{
-	$message = gettext( "CGI Error !");
-}
-elsif( !defined $mail )
-{
-    $message = sprintf( gettext("Unable to get information on mail domain %s"), $domain );
-}
-elsif( $mail->get_status != Vhffs::Constants::ACTIVATED )
-{
-	$message = gettext( "This object is not functionnal yet. Please wait creation or moderation.");
-}
-elsif( !$user->can_delete( $mail ) )
-{
-	$message = gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' );
-}
-elsif( $sure == 0 )
-{
-	$message = gettext( "This mail domain will NOT be DELETED" );
-}
-else
-{
-	$mail->set_status( Vhffs::Constants::TO_DELETE );
-
-	if( $mail->commit < 0 )
-	{
-		$message = gettext("Unable to delete this domain");
-	}
-	else
-	{
-		$message = gettext("This mail domain WILL BE DELETED");
-	}
-}
-
-$template->param( MESSAGE => $message );
-$panel->set_refresh_url( "/mail/prefs.pl?name=$domain" );
-$panel->build( $template );
-$panel->display;

Modified: trunk/vhffs-panel/mail/prefs.pl
===================================================================
--- trunk/vhffs-panel/mail/prefs.pl	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/mail/prefs.pl	2011-05-17 20:27:49 UTC (rev 1767)
@@ -32,7 +32,6 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use CGI;
@@ -40,15 +39,8 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Main;
 use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Panel::Template;
-use Vhffs::Panel::Object;
 use Vhffs::Services::Mail;
-use Vhffs::Acl;
 use Vhffs::Constants;
 
 my $panel = new Vhffs::Panel::Main();
@@ -69,11 +61,9 @@
 my $mail = Vhffs::Services::Mail::get_by_mxdomain( $vhffs , $domain );
 
 unless( defined $mail ) {
-	$template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
-	$template->param( MESSAGE => sprintf( gettext('Unable to get information on mail domain %s'), $domain ) );
+    $panel->render('misc/message.tt', { message => sprintf( gettext('Unable to get information on mail domain %s'), $domain ) } );
 } elsif( ! $user->can_view($mail) ) {
-	$template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
-	$template->param( MESSAGE => gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' ) );
+    $panel->render('misc/message.tt', { message => gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' ) } );
 } else {
     my $catchall_type = lc($mail_config->{allowed_catchall});
     $catchall_type = 'domain' unless(defined $catchall_type and $catchall_type ne '');
@@ -94,79 +84,23 @@
         add_forward();
     }
 
-	$template = new Vhffs::Panel::Template( filename => $templatedir."/panel/mail/prefs.tmpl",
-        die_on_bad_params => 0, global_vars => 1);
+    my $vars = {
+        mail => $mail,
+        catchall_type => $catchall_type,
+        novirus => ($mail_config->{'use_novirus'} eq 'yes' ),
+        nospam => ($mail_config->{'use_novirus'} eq 'yes' )
+    };
 
+	my @sorted_boxes = sort { $a->{local_part} cmp $b->{local_part} } (values %{$mail->get_boxes});
+    $vars->{sorted_boxes} = \@sorted_boxes;
+	my @sorted_forwards = sort { $a->{local_part} cmp $b->{local_part} } (values %{$mail->get_forwards});
+    $vars->{sorted_forwards} = \@sorted_forwards;
+
     $panel->set_title( gettext("Mail Administration for domain ") );
-	$template->param( VALUE_DOMAIN => $mail->get_domain );
+    $panel->render('mail/prefs.tt', $vars);
 
-    $template->param( CATCHALL_TYPE => $catchall_type );
-	$template->param( SUBTITLE_CATCHALL => gettext("Catchall address") );
-	$template->param( VALUE_CATCHALL => $mail->get_catchall );
-	$template->param( TEXT_CATCHALL_EXPLAIN => gettext("Enter a mail address to catch all email for this domain") );
-	$template->param( TEXT_CATCHALL => gettext("Catchall mail") );
-
-
-	$template->param( SUBTITLE_ACCOUNTS => gettext("Accounts") );
-	$template->param( TEXT_ACCOUNTS_LIST => gettext("List all accounts") );
-	$template->param( TEXT_ACCOUNTS_ADD => gettext("Add an account") );
-	
-	$template->param( TEXT_ACCOUNT_LOCALPART => gettext("Local Part for this account") );
-	$template->param( TEXT_ACCOUNT_PASSWORD => gettext("Password") );
-
-
-	
-	$template->param( SUBTITLE_FORWARDS => gettext("Forwards") );
-	$template->param( TEXT_FORWARD_LIST => gettext("List all forwardings for this domain") );
-	$template->param( TEXT_FORWARD_ADD => gettext("Add a forward on this domain") );
-	
-	$template->param( TEXT_FORWARD_FORM_LOCALPART => gettext("Local Part") );
-	$template->param( TEXT_FORWARD_FORM_FORWARD => gettext("Forward mail") );
-
-
-
-#	$template->param( TEXT_SEND => gettext("Modify") );
-	$template->param( TEXT_CHANGE_CATCHALL => gettext("Change catchall forward") );
-	$template->param( TEXT_ADD_ACCOUNT => gettext("Add a popbox to this domain") );
-	$template->param( TEXT_ADD_FORWARD => gettext("Add a forward on this domain") );
-
-
-	$template->param( TEXT_DELETE_MAIL => gettext("Delete this mail domain") );
-	$template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. This mail area will be DESTROYED.") );
-	$template->param( ASK_DELETE_WEB => gettext("Are you SURE you want DELETE this Mail Area ?") );
-	$template->param( YES => gettext("Yes I'm sure of what I do") );
-	$template->param( NO => gettext("No, I'm not sure, I prefer to keep this project.") );
-	$template->param( TEXT_DELETE => gettext("Delete") );
-
-    $template->param( VALUE_OID => $mail->get_oid );
-    $template->param( TEXT_ACL_ADMIN => gettext("Admin Rights on this object (ACL)") );
-    $template->param( EXPLAIN_ADMIN_ACL => gettext("You can Manage rights on this service for each user in the VHFFS database. Please read help before manage it.") );
-    $template->param( ADMIN_ACL => gettext( "Ok, go to ACL admin" ) );
-
-
-
-	my $output = "";
-	my @boxes = sort { $a->{local_part} cmp $b->{local_part} } (values %{$mail->get_boxes});
-	foreach my $bo ( @boxes )  {
-		$bo->{active} = ($bo->{state} == Vhffs::Constants::ACTIVATED);
-		$bo->{statestr} = Vhffs::Functions::status_string_from_status_id($bo->{state});
-	}
-
-    $template->param( BOXES => ( \@boxes ) );
-    $template->param( ANTIVIRUS_FEATURE => ($mail_config->{'use_novirus'} eq 'yes' ) );
-    $template->param( ANTISPAM_FEATURE => ($mail_config->{'use_nospam'} eq 'yes' ) );
-
-	my @forwards = sort { $a->{local_part} cmp $b->{local_part} } (values %{$mail->get_forwards});
-    $template->param( FORWARDS => ( \@forwards ) );
-
-	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $mail );
-	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
-$panel->build( $template );
-$panel->display;
-
-
 # Action handling subs
 
 sub update_catchall {

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/templates/Makefile.am	2011-05-17 20:27:49 UTC (rev 1767)
@@ -68,9 +68,6 @@
 	dns/list_srv_sub.tmpl \
 	dns/list_txt_sub.tmpl \
 	dns/prefs.tmpl \
-	mail/prefs_boxes.tmpl \
-	mail/prefs_forwards.tmpl \
-	mail/prefs.tmpl \
 	menu/context.tmpl \
 	menu/context-group.tmpl \
 	menu/context-modo.tmpl \
@@ -107,6 +104,7 @@
 	layouts/anonymous.tt \
 	layouts/panel.tt \
 	mail/create.tt \
+	mail/prefs.tt \
 	mailinglist/create.tt \
 	mailinglist/prefs.tt \
 	menu/admin.tt \

Deleted: trunk/vhffs-panel/templates/mail/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/mail/prefs.tmpl	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/templates/mail/prefs.tmpl	2011-05-17 20:27:49 UTC (rev 1767)
@@ -1,124 +0,0 @@
-<tmpl_unless expr="CATCHALL_TYPE eq 'none'">
-<h2><TMPL_VAR ESCAPE=1 NAME="SUBTITLE_CATCHALL"></h2>
-
-<form method="post" action="/mail/prefs.pl" accept-charset="utf-8">
-	<p><TMPL_VAR ESCAPE=1 NAME="TEXT_CATCHALL_EXPLAIN"></p>
-
-	<p>
-		<label for="catchall">
-			<TMPL_VAR ESCAPE=1 NAME="TEXT_CATCHALL"> :
-		</label>
-        <TMPL_IF EXPR="CATCHALL_TYPE eq 'open'">
-		<input type="text" name="catchall" id="catchall" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_CATCHALL">" />
-        <tmpl_else>
-        <select name="catchall" id="catchall">
-            <option value="">---</option>
-        <TMPL_LOOP NAME="boxes">
-	    <TMPL_IF NAME="ACTIVE">
-	            <option <TMPL_IF EXPR="VALUE_CATCHALL eq (sprintf('%s@%s', LOCAL_PART, DOMAIN))">selected="selected"</TMPL_IF> value="<TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">"><TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">@<TMPL_VAR ESCAPE=1 NAME="DOMAIN"></option>
-	    </TMPL_IF>
-        </TMPL_LOOP>
-        </select>
-        </TMPL_IF>
-	</p>
-	<p class="button" id="buttonModify">
-		<input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_DOMAIN">" />
-		<input type="submit" name="modify_catchall_submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_CHANGE_CATCHALL">"/>
-	</p>
-</form>
-</tmpl_unless>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="SUBTITLE_ACCOUNTS"></h2>
-
-<h3><TMPL_VAR ESCAPE=1 NAME="TEXT_ACCOUNTS_LIST"></h3>
-<TMPL_INCLUDE NAME="prefs_boxes.tmpl">
-
-<h3><TMPL_VAR ESCAPE=1 NAME="TEXT_ACCOUNTS_ADD"></h3>
-
-<form method="post" action="prefs.pl" accept-charset="utf-8">
-	<p>
-		<label for="new_box_localpart">
-			<TMPL_VAR ESCAPE=1 NAME="TEXT_ACCOUNT_LOCALPART">:
-		</label>
-		<input type="text" name="localpart" id="new_box_localpart" />@<TMPL_VAR ESCAPE=1 NAME="VALUE_DOMAIN">
-	</p>
-	<p>
-		<label for="new_box_password">
-			<TMPL_VAR ESCAPE=1 NAME="TEXT_ACCOUNT_PASSWORD">:
-		</label>
-		<input type="password" name="box_password" id="new_box_password" />
-	</p>
-	<p class="button">
-		<input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_DOMAIN">" />				
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_ADD_ACCOUNT">" name="add_box_submit"/>
-	</p>
-</form>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="SUBTITLE_FORWARDS"></h2>
-
-<h3><TMPL_VAR ESCAPE=1 NAME="TEXT_FORWARD_LIST"></h3>
-<TMPL_INCLUDE NAME="prefs_forwards.tmpl">
-
-<h3><TMPL_VAR ESCAPE=1 NAME="TEXT_FORWARD_ADD"></h3>
-<form method="post" action="prefs.pl" accept-charset="utf-8">
-	<p>
-		<label for="new_forward_localpart">
-			<TMPL_VAR ESCAPE=1 NAME="TEXT_FORWARD_FORM_LOCALPART">:
-		</label>
-		<input type="text" name="localpart" id="new_forward_localpart" />@<TMPL_VAR ESCAPE=1 NAME="VALUE_DOMAIN">
-	</p>
-	<p>
-		<label for="new_forward_forward">
-			<TMPL_VAR ESCAPE=1 NAME="TEXT_FORWARD_FORM_FORWARD">:
-		</label>
-		<input type="text" name="forward" id="new_forward_forward" />
-	</p>
-	<p class="button">
-		<input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_DOMAIN">" />
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_ADD_FORWARD">" name="add_forward_submit"/>
-	</p>
-</form>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_ACL_ADMIN"></h2>
-		
-<form method="post" action="../acl/view.pl" accept-charset="utf-8">
-	<p><TMPL_VAR ESCAPE=1 NAME="EXPLAIN_ADMIN_ACL"></p>
-
-	<input type="hidden" name="target_oid" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_OID">" />
-	<p class="button" id="buttonAclAdmin">
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="ADMIN_ACL">" />
-	</p>
-</form>
-
-<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_DELETE_MAIL"></h2>
-
-<form method="post" action="delete.pl" accept-charset="utf-8">
-	<fieldset class="delete">
-		<legend>
-			<TMPL_VAR ESCAPE=1 NAME="ASK_DELETE_WEB">:
-		</legend>
-
-		<p class="warning"><TMPL_VAR ESCAPE=1 NAME="TEXT_BEFORE_DELETE"></p>
-		<p>
-			<input type="radio" name="DELETE" id="DELETE_NO"  value="0" checked="checked" />
-			<label for="DELETE_NO">
-				<TMPL_VAR ESCAPE=1 NAME="NO">
-			</label>
-		</p>
-		<p>
-			<input type="radio" name="DELETE" id="DELETE_YES" value="1" />
-			<label for="DELETE_YES">
-				<TMPL_VAR ESCAPE=1 NAME="YES">
-			</label>
-		</p>
-	</fieldset>
-	
-	<p class="button" id="buttonDelete">
-		<input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="VALUE_DOMAIN">" />
-		<input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_DELETE">" />
-	</p>
-				
-</form>
-
-
-<TMPL_VAR ESCAPE=0 NAME="ADMIN_PART">

Added: trunk/vhffs-panel/templates/mail/prefs.tt
===================================================================
--- trunk/vhffs-panel/templates/mail/prefs.tt	                        (rev 0)
+++ trunk/vhffs-panel/templates/mail/prefs.tt	2011-05-17 20:27:49 UTC (rev 1767)
@@ -0,0 +1,125 @@
+[% UNLESS catchall_type == 'none' %]
+<h2>[% 'Catchall address' | i18n | html %]</h2>
+
+<form method="post" action="/mail/prefs.pl" accept-charset="utf-8">
+	<p>[% 'Catchall address receive all emails for which no box nor forward exists on this domain.' | i18n | html %]</p>
+[% IF catchall_type == 'open' %]
+	<p>
+		<label for="catchall">[% 'Catchall destination address:' | i18n | html %]</label>
+		<input type="text" name="catchall" id="catchall" value="[% mail.get_catchall | html %]" />
+    </p>
+[% ELSE %]
+    <p>[% 'To avoid blacklisting issues due to spam forwarding, catchall address are restricted to boxes belongin to this mail domain.' | i18n | html %]</p>
+	<p>
+		<label for="catchall">[% 'Catchall destination address:' | i18n | html %]</label>
+        <select name="catchall" id="catchall">
+            <option value="">---</option>
+[% FOREACH b IN sorted_boxes %]
+[% IF b.state == constants.object_statuses.ACTIVATED %]
+[% SET address = b.local_part _ '@' _ b.domain %]
+	            <option[% ' selected="selected"' IF mail.get_catchall == address %] value="[% b.local_part | html %]">[% address | html %]</option>
+[% END %]
+[% END # b IN sorted_boxes %]
+        </select>
+	</p>
+[% END # catchall_type == 'open' %]
+	<p class="button" id="buttonModify">
+		<input type="hidden" name="name" value="[% mail.get_domain | html %]" />
+		<input type="submit" name="modify_catchall_submit" value="[% 'Change catchall forward' | i18n | html %]"/>
+	</p>
+</form>
+[% END # catchall_type == 'none' %]
+
+<h2>[% 'Accounts' | i18n | html %]</h2>
+
+<h3>[% 'Existing accounts' | i18n | html %]</h3>
+[% FOREACH b IN sorted_boxes %]
+<fieldset>
+<legend>[% b.local_part _ '@' _ b.domain | html %]</legend>
+[% IF b.state == constants.object_statuses.ACTIVATED %]
+		<form method="post" action="prefs.pl" accept-charset="utf-8">
+                <p>[% 'New password:' | i18n | html %]<input type="password" name="box_password" value=""/></p>
+[% IF nospam %]
+                <p>[% 'Enable antispam?' | i18n | html %]
+                  <input type="radio" name="use_antispam"[% ' checked="checked"' IF b.nospam %] value="yes"/>&nbsp;[% 'Yes' | i18n | html %]
+                  <input type="radio" name="use_antispam"[% ' checked="checked"' UNLESS b.nospam %] value="no"/>&nbsp;[% 'No' | i18n | html %]</p>
+[% END %]
+[% IF novirus %]
+                <p>[% 'Enable antivirus?' | i18n | html %]
+                  <input type="radio" name="use_antivirus"[% ' checked="checked"' IF b.novirus %] value="yes"/>&nbsp;[% 'Yes' | i18n | html %]
+                  <input type="radio" name="use_antivirus"[% ' checked="checked"' UNLESS b.novirus %] value="no"/>&nbsp;[% 'No' | i18n | html %]</p>
+[% END %]
+                <p><input type="submit" name="update_box_submit" value="[% 'Update' | i18n | html %]"/>&nbsp;<input type="submit" name="delete_box_submit" value="[% 'Delete this mail account' | i18n | html %]"/></p>
+			<input type="hidden" name="localpart" value="[% b.local_part | html %]" />
+			<input type="hidden" name="name" value="[% b.domain | html %]" />
+		</form>
+[% ELSE %]
+    <p>[% b.state | stringify_status | html %]</p>
+[% END # b.state == constants.object_statuses.ACTIVATED %]
+</fieldset>
+[% END # b IN sorted_boxes %]
+
+<h3>[% 'Add an account' | i18n | html %]</h3>
+
+<form method="post" action="prefs.pl" accept-charset="utf-8">
+	<p>
+		<label for="new_box_localpart">[% 'Local part (left side of the @):' | i18n | html %]</label>
+		<input type="text" name="localpart" id="new_box_localpart" />@[% mail.get_domain | html %]
+	</p>
+	<p>
+		<label for="new_box_password">[% 'Password:' | i18n | html %]</label>
+		<input type="password" name="box_password" id="new_box_password" />
+	</p>
+	<p class="button">
+		<input type="hidden" name="name" value="[% mail.get_domain | html %]" />
+		<input type="submit" value="[% 'Add mailbox' | i18n | html %]" name="add_box_submit"/>
+	</p>
+</form>
+
+<h2>[% 'Forwards' | i18n | html %]</h2>
+
+<h3>[% 'Existing forwards' | i18n | html %]</h3>
+
+[% FOREACH f IN sorted_forwards %]
+<fieldset>
+<legend>[% f.local_part _ '@' _ f.domain | html %]</legend>
+    <form method="post" action="prefs.pl" accept-charset="utf-8">
+		<p>
+            <input type="text" name="forward" value="[% f.remote_name | html %]" /></p>
+        <p><input type="submit" value="[% 'Update forward' | i18n | html %]"
+        name="update_forward_submit"/>&nbsp;<input type="submit"
+            value="[% 'Delete forward' | i18n | html %]"
+            name="delete_forward_submit"/></p>
+		<input type="hidden" name="localpart" value="[% f.local_part | html %]" />
+		<input type="hidden" name="name" value="[% f.domain | html %]" />
+    </form>
+</fieldset>
+[% END %]
+
+<h3>[% 'Add forward' | i18n | html %]</h3>
+<form method="post" action="prefs.pl" accept-charset="utf-8">
+	<p>
+		<label for="new_forward_localpart">[% 'Local part (left side of the @):' | i18n | html %]</label>
+		<input type="text" name="localpart" id="new_forward_localpart" />@[% mail.domain | html %]
+	</p>
+	<p>
+		<label for="new_forward_forward">[% 'Forward to address:' | i18n | html %]</label>
+		<input type="text" name="forward" id="new_forward_forward" />
+	</p>
+	<p class="button">
+		<input type="hidden" name="name" value="[% mail.domain | html %]" />
+		<input type="submit" value="[% 'Add forward' | i18n | html %]" name="add_forward_submit"/>
+	</p>
+</form>
+
+[% INCLUDE 'acl/form.tt' 
+    object = mail %]
+
+[% INCLUDE 'object/delete.tt'
+    type = 'mail'
+    oid = mail.get_oid %]
+
+[% IF current_user.is_admin %]
+    [% INCLUDE 'admin/object/edit.tt' 
+        object = mail %]
+[% END %]

Deleted: trunk/vhffs-panel/templates/mail/prefs_boxes.tmpl
===================================================================
--- trunk/vhffs-panel/templates/mail/prefs_boxes.tmpl	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/templates/mail/prefs_boxes.tmpl	2011-05-17 20:27:49 UTC (rev 1767)
@@ -1,25 +0,0 @@
-<TMPL_LOOP NAME="BOXES">
-<fieldset>
-<legend><TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">@<TMPL_VAR ESCAPE=1 NAME="DOMAIN"></legend>
-	<TMPL_IF NAME="ACTIVE">
-		<form method="post" action="prefs.pl" accept-charset="utf-8">
-                <p><TMPL_I18N KEY="Change Password">: <input type="password" name="box_password" value=""/></p>
-                <TMPL_IF NAME="antispam_feature">
-                <p><TMPL_I18N KEY="Enable anti-spam">:
-                  <input type="radio" name="use_antispam" <TMPL_IF NAME="nospam">checked="checked"</TMPL_IF> value="yes"/>&nbsp;<TMPL_I18N KEY="Yes">
-                  <input type="radio" name="use_antispam" <tmpl_unless name="nospam">checked="checked"</tmpl_unless> value="no"/>&nbsp;<TMPL_I18N KEY="No"></p>
-                </TMPL_IF>
-                <TMPL_IF NAME="antivirus_feature">
-                <p><TMPL_I18N KEY="Enable anti-virus">:
-                  <input type="radio" name="use_antivirus" <TMPL_IF NAME="novirus">checked="checked"</TMPL_IF> value="yes"/>&nbsp;<TMPL_I18N KEY="Yes">
-                  <input type="radio" name="use_antivirus" <tmpl_unless name="novirus">checked="checked"</tmpl_unless> value="no"/>&nbsp;<TMPL_I18N KEY="No"></p>
-                </TMPL_IF>
-                <p><input type="submit" name="update_box_submit" value="<TMPL_I18N KEY="Update">"/>&nbsp;<input type="submit" name="delete_box_submit" value="<TMPL_I18N KEY="Delete this mail account">"/></p>
-			<input type="hidden" name="localpart" value="<TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">" />
-			<input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="DOMAIN">" />
-		</form>
-	<tmpl_else>
-		<TMPL_VAR ESCAPE=1 NAME="STATESTR">
-	</TMPL_IF>
-</fieldset>
-</TMPL_LOOP>

Deleted: trunk/vhffs-panel/templates/mail/prefs_forwards.tmpl
===================================================================
--- trunk/vhffs-panel/templates/mail/prefs_forwards.tmpl	2011-05-17 16:44:09 UTC (rev 1766)
+++ trunk/vhffs-panel/templates/mail/prefs_forwards.tmpl	2011-05-17 20:27:49 UTC (rev 1767)
@@ -1,15 +0,0 @@
-<TMPL_LOOP NAME="FORWARDS">
-<fieldset>
-<legend><TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">@<TMPL_VAR ESCAPE=1 NAME="DOMAIN"></legend>
-    <form method="post" action="prefs.pl" accept-charset="utf-8">
-		<p>
-            <input type="text" name="forward" value="<TMPL_VAR ESCAPE=1 NAME="REMOTE_NAME">" /></p>
-        <p><input type="submit" value="<TMPL_I18N KEY="Change Forward">"
-            name="update_forward_submit"/>&nbsp;<input type="submit"
-            value="<TMPL_I18N KEY="Delete this forward">"
-            name="delete_forward_submit"/></p>
-		<input type="hidden" name="localpart" value="<TMPL_VAR ESCAPE=1 NAME="LOCAL_PART">" />
-		<input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="DOMAIN">" />
-    </form>
-</fieldset>
-</TMPL_LOOP>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/