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

SF.net SVN: ledger-smb:[3746] branches/1.3/scripts/setup.pl



Revision: 3746
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3746&view=rev
Author:   einhverfr
Date:     2011-09-25 04:56:12 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
Chart of accounts menues now sorted in database setup wizard

Modified Paths:
--------------
    branches/1.3/scripts/setup.pl

Modified: branches/1.3/scripts/setup.pl
===================================================================
--- branches/1.3/scripts/setup.pl	2011-09-25 04:17:57 UTC (rev 3745)
+++ branches/1.3/scripts/setup.pl	2011-09-25 04:56:12 UTC (rev 3746)
@@ -328,7 +328,7 @@
     closedir(COA); 
 
     $request->{coa_lcs} =[];
-    foreach my $lcs (@coa){
+    foreach my $lcs (sort @coa){
          push @{$request->{coa_lcs}}, {code => $lcs};
     } 
 
@@ -424,20 +424,20 @@
            $template->render($request);
         } else {
             opendir(COA, "sql/coa/$request->{coa_lc}/chart");
-            my @coa = grep !/^(\.|[Ss]ample.*)/, readdir(COA);
+            my @coa = sort (grep !/^(\.|[Ss]ample.*)/, readdir(COA));
             $request->{charts} = [];
-            for my $chart (@coa){
+            for my $chart (sort @coa){
                 push @{$request->{charts}}, {name => $chart};
             }
        }
     } else {
         #COA Directories
         opendir(COA, 'sql/coa');
-        my @coa = grep !/^(\.|[Ss]ample.*)/, readdir(COA);
+        my @coa = sort(grep !/^(\.|[Ss]ample.*)/, readdir(COA));
         closedir(COA); 
 
         $request->{coa_lcs} =[];
-        foreach my $lcs (@coa){
+        foreach my $lcs (sort {$a cmp $b} @coa){
              push @{$request->{coa_lcs}}, {code => $lcs};
         } 
     }

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