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

SF.net SVN: ledger-smb: [1565] trunk



Revision: 1565
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1565&view=rev
Author:   tetragon
Date:     2007-09-11 08:46:25 -0700 (Tue, 11 Sep 2007)

Log Message:
-----------
Fixing "options" display

Modified Paths:
--------------
    trunk/UI/gl-report.html
    trunk/bin/gl.pl

Modified: trunk/UI/gl-report.html
===================================================================
--- trunk/UI/gl-report.html	2007-09-11 15:28:05 UTC (rev 1564)
+++ trunk/UI/gl-report.html	2007-09-11 15:46:25 UTC (rev 1565)
@@ -20,7 +20,7 @@
   </tr>
   <tr><td colspan="<?lsmb columns.size ?>"> </td></tr>
   <tr>
-    <td><?lsmb options ?></td>
+    <td><?lsmb FOREACH option IN options; option ?><br /><?lsmb END ?></td>
   </tr>
   <tr>
     <td>

Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl	2007-09-11 15:28:05 UTC (rev 1564)
+++ trunk/bin/gl.pl	2007-09-11 15:46:25 UTC (rev 1565)
@@ -452,6 +452,7 @@
         'I' => $locale->text('Income'),
         'E' => $locale->text('Expense'),
     );
+    my @options;
 
     $form->{title} = $locale->text('General Ledger');
 
@@ -464,98 +465,83 @@
     if ( $form->{accno} ) {
         $href .= "&accno=" . $form->escape( $form->{accno} );
         $callback .= "&accno=" . $form->escape( $form->{accno}, 1 );
-        $option =
-          $locale->text('Account')
+        push @options, $locale->text('Account')
           . " : $form->{accno} $form->{account_description}";
     }
     if ( $form->{gifi_accno} ) {
         $href     .= "&gifi_accno=" . $form->escape( $form->{gifi_accno} );
         $callback .= "&gifi_accno=" . $form->escape( $form->{gifi_accno}, 1 );
-        $option   .= "\n<br>" if $option;
-        $option .=
-          $locale->text('GIFI')
+        push @options, $locale->text('GIFI')
           . " : $form->{gifi_accno} $form->{gifi_account_description}";
     }
     if ( $form->{source} ) {
         $href     .= "&source=" . $form->escape( $form->{source} );
         $callback .= "&source=" . $form->escape( $form->{source}, 1 );
-        $option   .= "\n<br>" if $option;
-        $option   .= $locale->text('Source') . " : $form->{source}";
+        push @options, $locale->text('Source') . " : $form->{source}";
     }
     if ( $form->{memo} ) {
         $href     .= "&memo=" . $form->escape( $form->{memo} );
         $callback .= "&memo=" . $form->escape( $form->{memo}, 1 );
-        $option   .= "\n<br>" if $option;
-        $option   .= $locale->text('Memo') . " : $form->{memo}";
+        push @options, $locale->text('Memo') . " : $form->{memo}";
     }
     if ( $form->{reference} ) {
         $href     .= "&reference=" . $form->escape( $form->{reference} );
         $callback .= "&reference=" . $form->escape( $form->{reference}, 1 );
-        $option   .= "\n<br>" if $option;
-        $option   .= $locale->text('Reference') . " : $form->{reference}";
+        push @options, $locale->text('Reference') . " : $form->{reference}";
     }
     if ( $form->{department} ) {
         $href .= "&department=" . $form->escape( $form->{department} );
         $callback .= "&department=" . $form->escape( $form->{department}, 1 );
         ($department) = split /--/, $form->{department};
-        $option .= "\n<br>" if $option;
-        $option .= $locale->text('Department') . " : $department";
+        push @options, $locale->text('Department') . " : $department";
     }
 
     if ( $form->{description} ) {
         $href     .= "&description=" . $form->escape( $form->{description} );
         $callback .= "&description=" . $form->escape( $form->{description}, 1 );
-        $option   .= "\n<br>" if $option;
-        $option   .= $locale->text('Description') . " : $form->{description}";
+        push @options, $locale->text('Description') . " : $form->{description}";
     }
     if ( $form->{notes} ) {
         $href     .= "&notes=" . $form->escape( $form->{notes} );
         $callback .= "&notes=" . $form->escape( $form->{notes}, 1 );
-        $option   .= "\n<br>" if $option;
-        $option   .= $locale->text('Notes') . " : $form->{notes}";
+        push @options, $locale->text('Notes') . " : $form->{notes}";
     }
 
     if ( $form->{datefrom} ) {
         $href     .= "&datefrom=$form->{datefrom}";
         $callback .= "&datefrom=$form->{datefrom}";
-        $option   .= "\n<br>" if $option;
-        $option .=
-            $locale->text('From') . " "
+        push @options, $locale->text('From') . " "
           . $locale->date( \%myconfig, $form->{datefrom}, 1 );
     }
     if ( $form->{dateto} ) {
         $href     .= "&dateto=$form->{dateto}";
         $callback .= "&dateto=$form->{dateto}";
+        my $option = $locale->text('To') . " "
+          . $locale->date( \%myconfig, $form->{dateto}, 1 );
         if ( $form->{datefrom} ) {
-            $option .= " ";
+            $options[$#options] .= " $option";
         }
         else {
-            $option .= "\n<br>" if $option;
+            push @options, $option;
         }
-        $option .=
-            $locale->text('To') . " "
-          . $locale->date( \%myconfig, $form->{dateto}, 1 );
     }
 
     if ( $form->{amountfrom} ) {
         $href     .= "&amountfrom=$form->{amountfrom}";
         $callback .= "&amountfrom=$form->{amountfrom}";
-        $option   .= "\n<br>" if $option;
-        $option .=
-            $locale->text('Amount') . " >= "
+        push @options, $locale->text('Amount') . " >= "
           . $form->format_amount( \%myconfig, $form->{amountfrom}, 2 );
     }
     if ( $form->{amountto} ) {
         $href     .= "&amountto=$form->{amountto}";
         $callback .= "&amountto=$form->{amountto}";
+        my $option .= $form->format_amount( \%myconfig, $form->{amountto}, 2 );
         if ( $form->{amountfrom} ) {
-            $option .= " <= ";
+            $options[$#options] .= " <= $option";
         }
         else {
-            $option .= "\n<br>" if $option;
-            $option .= $locale->text('Amount') . " <= ";
+            push @options, $locale->text('Amount') . " <= $option";
         }
-        $option .= $form->format_amount( \%myconfig, $form->{amountto}, 2 );
     }
 
     @columns =
@@ -803,9 +789,9 @@
         );
     }
     $template->render({
-        form => $form,
+        form => \%$form,
         buttons => ..hidden..,
-        options => $option,
+        options => ..hidden..,
         columns => ..hidden..,
         heading => \%column_header,
         rows => ..hidden..,


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