[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1710] trunk
- Subject: SF.net SVN: ledger-smb: [1710] trunk
- From: ..hidden..
- Date: Sat, 06 Oct 2007 14:52:40 -0700
Revision: 1710
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1710&view=rev
Author: tetragon
Date: 2007-10-06 14:52:39 -0700 (Sat, 06 Oct 2007)
Log Message:
-----------
Convert auditcontrol screen to template
The radio button bits of the templating are a bit... finicky to work with
Modified Paths:
--------------
trunk/bin/am.pl
Added Paths:
-----------
trunk/UI/am-audit-control.html
Added: trunk/UI/am-audit-control.html
===================================================================
--- trunk/UI/am-audit-control.html (rev 0)
+++ trunk/UI/am-audit-control.html 2007-10-06 21:52:39 UTC (rev 1710)
@@ -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> </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>
Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl 2007-10-06 16:02:18 UTC (rev 1709)
+++ trunk/bin/am.pl 2007-10-06 21:52:39 UTC (rev 1710)
@@ -2054,84 +2054,35 @@
$form->{title} = $locale->text('Audit Control');
AM->closedto( \%myconfig, \%$form );
+ my %checked;
if ( $form->{revtrans} ) {
- $checked{revtransY} = "checked";
+ $checked{revtransY} = 'checked';
+ } else {
+ $checked{revtransN} = 'checked';
}
- else {
- $checked{revtransN} = "checked";
- }
if ( $form->{audittrail} ) {
- $checked{audittrailY} = "checked";
+ $checked{audittrailY} = 'checked';
+ } else {
+ $checked{audittrailN} = '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 {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.