[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2856] trunk
- Subject: SF.net SVN: ledger-smb:[2856] trunk
- From: ..hidden..
- Date: Sun, 07 Feb 2010 22:47:07 +0000
Revision: 2856
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2856&view=rev
Author: einhverfr
Date: 2010-02-07 22:47:03 +0000 (Sun, 07 Feb 2010)
Log Message:
-----------
Adding form validation to multiple payments interface
Modified Paths:
--------------
trunk/UI/payments/payments_detail.html
trunk/scripts/payment.pl
Modified: trunk/UI/payments/payments_detail.html
===================================================================
--- trunk/UI/payments/payments_detail.html 2010-02-07 22:37:43 UTC (rev 2855)
+++ trunk/UI/payments/payments_detail.html 2010-02-07 22:47:03 UTC (rev 2856)
@@ -29,6 +29,11 @@
} ?>
<?lsmb INCLUDE input element_data = {
type = "hidden"
+ name = "form_id"
+ value = form_id
+ } ?>
+ <?lsmb INCLUDE input element_data = {
+ type = "hidden"
name = "account_class"
value = account_class
Modified: trunk/scripts/payment.pl
===================================================================
--- trunk/scripts/payment.pl 2010-02-07 22:37:43 UTC (rev 2855)
+++ trunk/scripts/payment.pl 2010-02-07 22:47:03 UTC (rev 2856)
@@ -109,6 +109,8 @@
my $rows = [];
my $payment = LedgerSMB::DBObject::Payment->new({'base' => $request});
my @search_results = $payment->search;
+ $payment->close_form;
+ $payment->open_form;
my $template = LedgerSMB::Template->new(
user => $request->{_user},
locale => $request->{_locale},
@@ -234,37 +236,19 @@
get_search_criteria($payment);
}
-sub check_job {
- my ($request) = @_;
- my $payment = LedgerSMB::DBObject::Payment->new({'base' => $request});
- $payment->check_job;
- my $template = LedgerSMB::Template->new(
- user => $request->{_user},
- locale => $request->{_locale},
- path => 'UI/payments',
- template => 'check_job',
- format => 'HTML',
- );
- $template->render($payment);
-}
sub post_payments_bulk {
my ($request) = @_;
my $payment = LedgerSMB::DBObject::Payment->new({'base' => $request});
- $payment->post_bulk();
- my $template;
- if ($payment->{queue_payments}){
- $payment->{job_label} = 'Payments';
- $template = LedgerSMB::Template->new(
- user => $request->{_user},
- locale => $request->{_locale},
- path => 'UI/payments',
- template => 'check_job',
- format => 'HTML',
- );
+ if ($payment->close_form){
+ $payment->post_bulk();
} else {
- payments($request);
+ $payment->{notice} =
+ $payment->{_locale}->text('Data not saved. Please try again.');
+ display_payments($request);
}
+ my $template;
+ payments($request);
$template->render($payment);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.