From 21367a6c50d7a0f56c4e4a71a69f3e68b02edbb6 Mon Sep 17 00:00:00 2001 From: tetragon Date: Mon, 15 Oct 2007 22:14:50 +0000 Subject: Add confirmation template Rename yes in gl.pl git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1763 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/gl.pl | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'bin/gl.pl') diff --git a/bin/gl.pl b/bin/gl.pl index dffa4c0a..ac46409c 100644 --- a/bin/gl.pl +++ b/bin/gl.pl @@ -51,6 +51,7 @@ use LedgerSMB::Template; require "bin/arap.pl"; +$form->{login} = 'test'; 1; # end of main @@ -1267,35 +1268,36 @@ sub form_footer { sub delete { - $form->header; - - print qq| - - -
{script}> -|; - + my %hiddens; delete $form->{action}; + foreach (keys %$form) { + $hiddens{$_} = $form->{$_} unless ref $form->{$_}; + } - $form->hide_form; - - print qq| -

| . $locale->text('Confirm!') . qq|

- -

| - . $locale->text( 'Are you sure you want to delete Transaction [_1]', + $form->{title} = $locale->text('Confirm!'); + my $query = $locale->text( + 'Are you sure you want to delete Transaction [_1]', $form->{reference} ) - . qq|

- - -
-|; + my @buttons = ({ + name => 'action', + value => 'delete_transaction', + text => $locale->text('Yes'), + }); + my $template = LedgerSMB::Template->new_UI( + user => \%myconfig, + locale => $locale, + template => 'form-confirmation', + ); + $template->render({ + form => $form, + query => $query, + hiddens => \%hiddens, + buttons => \@buttons, + }); } -sub yes { +sub delete_transaction { if ( GL->delete_transaction( \%myconfig, \%$form ) ) { $form->redirect( $locale->text('Transaction deleted!') ); -- cgit v1.2.3