[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1820] trunk/bin/jc.pl
- Subject: SF.net SVN: ledger-smb: [1820] trunk/bin/jc.pl
- From: ..hidden..
- Date: Thu, 25 Oct 2007 09:57:06 -0700
Revision: 1820
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1820&view=rev
Author: tetragon
Date: 2007-10-25 09:57:04 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
Change forms that use class confirm to template
Modified Paths:
--------------
trunk/bin/jc.pl
Modified: trunk/bin/jc.pl
===================================================================
--- trunk/bin/jc.pl 2007-10-25 00:36:53 UTC (rev 1819)
+++ trunk/bin/jc.pl 2007-10-25 16:57:04 UTC (rev 1820)
@@ -1217,45 +1217,42 @@
sub resave {
+ my %hiddens;
+ my @buttons;
if ( $form->{print_and_save} ) {
$form->{nextsub} = "print_and_save";
+ @buttons = ({
+ name => 'action',
+ value => 'print_and_save',
+ text => $locale->text('Print and Save Transaction'),
+ });
$msg =
$locale->text('You are printing and saving an existing transaction!');
}
else {
$form->{nextsub} = "save";
+ @buttons = ({
+ name => 'action',
+ value => 'save',
+ text => $locale->text('Save Transaction'),
+ });
$msg = $locale->text('You are saving an existing transaction!');
}
- $form->{resave} = 1;
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-|;
-
delete $form->{action};
-
- $form->hide_form;
-
- print qq|
-<h2 class=confirm>| . $locale->text('Warning!') . qq|</h2>
-
-<h4>$msg</h4>
-
-<button name="action" class="submit" type="submit" value="continue">|
- . $locale->text('Continue')
- . qq|</button>
-</form>
-
-</body>
-</html>
-|;
-
+ $hiddens{$_} = $form->{$_} foreach keys %$form;
+ $hiddens{resave} = 1;
+ $form->{title} = $locale->text('Warning!');
+ my $template = LedgerSMB::Template->new_UI(
+ user => \%myconfig,
+ locale => $locale,
+ template => 'form-confirmation');
+ $template->render({
+ form => $form,
+ buttons => ..hidden..,
+ hiddens => \%hiddens,
+ query => $msg,
+ });
}
sub print_and_save {
@@ -1283,39 +1280,35 @@
sub delete_timecard {
- $form->header;
-
- $employee = $form->{employee};
+ my $employee = $form->{employee};
$employee =~ s/--.*//g;
- $projectnumber = $form->{projectnumber};
+ my $projectnumber = $form->{projectnumber};
$projectnumber =~ s/--.*//g;
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-|;
-
delete $form->{action};
+ $form->{title} = $locale->text('Confirm!');
- $form->hide_form;
-
- print qq|
-<h2 class=confirm>| . $locale->text('Confirm!') . qq|</h2>
-
-<h4>| . $locale->text('Are you sure you want to delete time card for') . qq|
-<p>$form->{transdate}
-<br>$employee
-<br>$projectnumber
-</h4>
-
-<p>
-<button name="action" class="submit" type="submit" value="yes">|
- . $locale->text('Yes')
- . qq|</button>
-</form>
-|;
-
+ my %hiddens;
+ $hiddens{$_} = $form->{$_} foreach keys %$form;
+ my @buttons = ({
+ name => 'action',
+ value => 'yes_delete_timecard',
+ text => $locale->text('Delete Timecard'),
+ });
+ my $template = LedgerSMB::Template->new_UI(
+ user => \%myconfig,
+ locale => $locale,
+ template => 'form-confirmation');
+ $template->render({
+ form => $form,
+ buttons => ..hidden..,
+ hiddens => \%hiddens,
+ query => $locale->text(
+ 'Are you sure you want to delete time card for [_1] [_2] [_3]',
+ $form->{transdate},
+ $employee,
+ $projectnumber),
+ });
}
sub delete { &{"delete_$form->{type}"} }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.