summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UI/am-audit-control.html49
-rw-r--r--bin/am.pl93
2 files changed, 71 insertions, 71 deletions
diff --git a/UI/am-audit-control.html b/UI/am-audit-control.html
new file mode 100644
index 00000000..f78fb860
--- /dev/null
+++ b/UI/am-audit-control.html
@@ -0,0 +1,49 @@
+<?lsmb INCLUDE 'ui-header.html' ?>
+<?lsmb PROCESS elements.html ?>
+<body>
+<form method="post" action="<?lsmb form.script ?>">
+<table width="100%">
+ <tr><th class="listtop"><?lsmb text('Audit Control') ?></th></tr>
+ <tr><td>&nbsp;</td></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align="right"><?lsmb text('Enforce transaction reversal for all dates') ?></th>
+ <td>
+<?lsmb PROCESS input element_data={type => 'radio', name => 'revtrans', label => text('Yes'), value => 1, ${checked.revtransY} => checked.revtransY} ?>
+<?lsmb PROCESS input element_data={type => 'radio', name => 'revtrans', label => text('No'), value => 0, ${checked.revtransN} => checked.revtransN} ?>
+ </td>
+ </tr>
+ <tr>
+ <th align="right"><?lsmb text('Close Books up to') ?></th>
+ <td><input class="date" name="closedto" size="11" title="<?lsmb user.dateformat ?>" value="<?lsmb form.closedto ?>" /></td>
+ </tr>
+ <tr>
+ <th align="right"><?lsmb text('Activate Audit trail') ?></th>
+ <td>
+<?lsmb PROCESS input element_data={type => 'radio', name => 'audittrail', label => text('Yes'), value => 1, ${checked.audittrailY} => checked.audittrailY} ?>
+<?lsmb PROCESS input element_data={type => 'radio', name => 'audittrail', label => text('No'), value => 0, ${checked.audittrailN} => checked.audittrailN} ?>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<hr size="3" noshade="noshade" />
+
+<br />
+
+<?lsmb FOREACH hidden IN hiddens.keys;
+ PROCESS input element_data={
+ type => 'hidden',
+ name => hidden,
+ value => hiddens.item(hidden)
+ }; END;
+PROCESS button element_data={name => 'action', value => 'doclose' text => text('Continue')} ?>
+
+</form>
+
+</body>
+</html>
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 {