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

SF.net SVN: ledger-smb:[2858] trunk/bin/gl.pl



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

Log Message:
-----------
Gl now has form validation

Modified Paths:
--------------
    trunk/bin/gl.pl

Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl	2010-02-07 23:13:37 UTC (rev 2857)
+++ trunk/bin/gl.pl	2010-02-07 23:20:09 UTC (rev 2858)
@@ -162,7 +162,8 @@
 sub display_form
 {
     #Add General Ledger Transaction
-   
+    $form->close_form;
+    $form->open_form; 
     my ($init) = @_; 
     # Form header part begins -------------------------------------------
     if (@{$form->{all_department}}){
@@ -237,6 +238,7 @@
 
   $hiddens{sessionid}=$form->{sessionid};
   $hiddens{callback}=$form->{callback};
+  $hiddens{form_id}= $form->{form_id};
   $transdate = $form->datetonum( \%myconfig, $form->{transdate} );
   $closedto  = $form->datetonum( \%myconfig, $form->{closedto} );
   my @buttons;
@@ -1097,7 +1099,10 @@
 }
 
 sub post {
-
+    if (!$form->close_form){
+        &update;
+        exit;
+    };
     $form->isblank( "transdate", $locale->text('Transaction Date missing!') );
 
     $transdate = $form->datetonum( \%myconfig, $form->{transdate} );


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