[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2859] trunk/scripts/drafts.pl



Revision: 2859
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2859&view=rev
Author:   einhverfr
Date:     2010-02-07 23:22:20 +0000 (Sun, 07 Feb 2010)

Log Message:
-----------
draft approval now has form validation

Modified Paths:
--------------
    trunk/scripts/drafts.pl

Modified: trunk/scripts/drafts.pl
===================================================================
--- trunk/scripts/drafts.pl	2010-02-07 23:20:09 UTC (rev 2858)
+++ trunk/scripts/drafts.pl	2010-02-07 23:22:20 UTC (rev 2859)
@@ -25,6 +25,10 @@
 
 sub list_drafts_draft_approve {
     my ($request) = @_;
+    if (!$request->close_form){
+        list_drafts($request);
+        exit;
+    }
     my $draft= LedgerSMB::DBObject::Draft->new(base => $request);
     for my $row (1 .. $draft->{rowcount}){
         if ($draft->{"draft_" .$draft->{"row_$row"}}){
@@ -37,6 +41,10 @@
 
 sub list_drafts_draft_delete {
     my ($request) = @_;
+    if (!$request->close_form){
+        list_drafts($request);
+        exit;
+    }
     my $draft= LedgerSMB::DBObject::Draft->new(base => $request);
     for my $row (1 .. $draft->{rowcount}){
         if ($draft->{"draft_" .$draft->{"row_$row"}}){
@@ -50,6 +58,8 @@
 sub list_drafts {
     my ($request) = @_;
     my $draft= LedgerSMB::DBObject::Draft->new(base => $request);
+    $draft->close_form;
+    $draft->open_form;
     my $callback = 'drafts.pl?action=list_drafts';
     for (qw(type reference amount_gy amount_lt)){
         if (defined $draft->{$_}){


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.