summaryrefslogtreecommitdiff
path: root/bin/am.pl
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-06 21:52:39 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-06 21:52:39 +0000
commitc8497c0941805c5df8a2c9999b8defb35c98fcae (patch)
treea2f768d7528f2b8d7f10b5ae541e86886e79e92f /bin/am.pl
parentc521480c08b3aa51cad3dfae1dda4f7608f85358 (diff)
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
Diffstat (limited to 'bin/am.pl')
-rw-r--r--bin/am.pl93
1 files changed, 22 insertions, 71 deletions
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|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=sessionid value=$form->{sessionid}>
-
-<table width=100%>
- <tr><th class=listtop>$form->{title}</th></tr>
- <tr height="5"></tr>
- <tr>
- <td>
- <table>
- <tr>
- <th align="right">|
- . $locale->text('Enforce transaction reversal for all dates')
- . qq|</th>
- <td><input name=revtrans class=radio type=radio value="1" $checked{revtransY}> |
- . $locale->text('Yes')
- . qq| <input name=revtrans class=radio type=radio value="0" $checked{revtransN}> |
- . $locale->text('No')
- . qq|</td>
- </tr>
- <tr>
- <th align="right">| . $locale->text('Close Books up to') . qq|</th>
- <td><input class="date" name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
- </tr>
- <tr>
- <th align="right">| . $locale->text('Activate Audit trail') . qq|</th>
- <td><input name=audittrail class=radio type=radio value="1" $checked{audittrailY}> |
- . $locale->text('Yes')
- . qq| <input name=audittrail class=radio type=radio value="0" $checked{audittrailN}> |
- . $locale->text('No')
- . qq|</td>
- </tr><!-- SC: Disabling audit trail deletion
- <tr>
- <th align="right">| . $locale->text('Remove Audit trail up to') . qq|</th>
- <td><input class="date" name=removeaudittrail size=11 title="$myconfig{dateformat}"></td>
- </tr> -->
- </table>
- </td>
- </tr>
-</table>
-
-<hr size=3 noshade>
-
-<br>
-<input type=hidden name=nextsub value=doclose>
-<input type=hidden name=action value=continue>
-<button type="submit" class="submit" name="action" value="continue">|
- . $locale->text('Continue')
- . qq|</button>
-
-</form>
-
-</body>
-</html>
-|;
-
+ 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 {