From c8497c0941805c5df8a2c9999b8defb35c98fcae Mon Sep 17 00:00:00 2001 From: tetragon Date: Sat, 6 Oct 2007 21:52:39 +0000 Subject: Convert auditcontrol screen to template The radio button bits of the templating are a bit... finicky to work with git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1710 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/am.pl | 93 +++++++++++++++------------------------------------------------ 1 file changed, 22 insertions(+), 71 deletions(-) (limited to 'bin') diff --git a/bin/am.pl b/bin/am.pl index 9477e95a..122f0908 100644 --- a/bin/am.pl +++ b/bin/am.pl @@ -2054,84 +2054,35 @@ sub audit_control { $form->{title} = $locale->text('Audit Control'); AM->closedto( \%myconfig, \%$form ); + my %checked; if ( $form->{revtrans} ) { - $checked{revtransY} = "checked"; - } - else { - $checked{revtransN} = "checked"; + $checked{revtransY} = 'checked'; + } else { + $checked{revtransN} = 'checked'; } if ( $form->{audittrail} ) { - $checked{audittrailY} = "checked"; - } - else { - $checked{audittrailN} = "checked"; + $checked{audittrailY} = 'checked'; + } else { + $checked{audittrailN} = 'checked'; } - $form->header; - - print qq| - - -
{script}> - -{path}> -{login}> -{sessionid}> - - - - - - - -
$form->{title}
- - - - - - - - - - - - - -
| - . $locale->text('Enforce transaction reversal for all dates') - . qq| | - . $locale->text('Yes') - . qq| | - . $locale->text('No') - . qq|
| . $locale->text('Close Books up to') . qq|{closedto}>
| . $locale->text('Activate Audit trail') . qq| | - . $locale->text('Yes') - . qq| | - . $locale->text('No') - . qq|
-
- -
- -
- - - - -
- - - -|; - + my %hiddens = ( + path => $form->{path}, + login => $form->{login}, + sessionid => $form->{sessionid}, + ); + my $template = LedgerSMB::Template->new_UI( + user => \%myconfig, + locale => $locale, + template => 'am-audit-control'); + $template->render({ + user => \%myconfig, + form => $form, + checked => \%checked, + hiddens => \%hiddens, + }); } sub doclose { -- cgit v1.2.3