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

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



Revision: 4321
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4321&view=rev
Author:   einhverfr
Date:     2012-02-16 09:54:38 +0000 (Thu, 16 Feb 2012)
Log Message:
-----------
Correcting load errors in LedgerSMB.pm, LedgerSMB/Form.pm, and LedgerSMB/PE.pm
Moving from Config::Std to Config::General

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/PE.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB.pm
    trunk/Makefile.PL

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-02-16 07:42:22 UTC (rev 4320)
+++ trunk/Changelog	2012-02-16 09:54:38 UTC (rev 4321)
@@ -6,6 +6,7 @@
 * Performance enhancements on menu routines (Chris T and Steven M)
 * Projects and Departments can now have subprojects and Departments (Chris T)
 * Project/department mechanism generalized to support funds, etc (Chris T)
+* Removed the Config::Std dependency and moved to Config::General (Chris T)
 
 Changelog for 1.3 Series
 Initial Release:  Monday, Oct 12 2011

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2012-02-16 07:42:22 UTC (rev 4320)
+++ trunk/LedgerSMB/Form.pm	2012-02-16 09:54:38 UTC (rev 4321)
@@ -2078,18 +2078,20 @@
 
     my $dbh       = $self->{dbh};
     my $class_sth = $dbh->prepare(
-                q|SELECT * FROM business_unit__list_classes('1')|;
+                q|SELECT * FROM business_unit__list_classes('1')|
+    );
     $class_sth->execute;
 
     my $bu_sth    = $dbh->prepare(
                 q|SELECT * 
-                    FROM business_unit__list_by_class(?, ?, ?, 'false')|;
+                    FROM business_unit__list_by_class(?, ?, ?, 'false')|
+    );
 
     while (my $classref = $class_sth->fetchrow_hashref('NAME_lc')){
         push @{$self->{bu_class}}, $classref;
         $bu_sth->execute($classref->{id}, $transdate, $credit_id, '0');
         $self->{b_units}->{$classref->{id}} = [];
-        while my ($buref = $bu_sth->fetchrow_hashref('NAME_lc')){
+        while (my $buref = $bu_sth->fetchrow_hashref('NAME_lc')){
            push @{$self->{b_units}->{$classref->{id}}}, $buref;
         }
     }

Modified: trunk/LedgerSMB/PE.pm
===================================================================
--- trunk/LedgerSMB/PE.pm	2012-02-16 07:42:22 UTC (rev 4320)
+++ trunk/LedgerSMB/PE.pm	2012-02-16 09:54:38 UTC (rev 4321)
@@ -144,7 +144,7 @@
                                       AND coalesce(pr.end_date, current_date)|;
     } elsif ( $form->{status} eq 'inactive' ) {
         $where .= qq| current_date NOT BETWEEN pr.start_date 
-                                   AND coalesce(pr.end_date, current_date)|;|;
+                                   AND coalesce(pr.end_date, current_date)|;
     }
 
     $query .= qq|

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2012-02-16 07:42:22 UTC (rev 4320)
+++ trunk/LedgerSMB/Sysconfig.pm	2012-02-16 09:54:38 UTC (rev 4321)
@@ -9,7 +9,7 @@
 use Cwd;
 
 # use LedgerSMB::Form;
-use Config::Std;
+use Config::General;
 use DBI qw(:sql_types);
 binmode STDOUT, ':utf8';
 binmode STDERR, ':utf8';
@@ -100,7 +100,8 @@
 our %printer;
 
 our %config;
-read_config( 'ledgersmb.conf' => %config ) or die;
+my $cfg_h = new Config::General("ledgersmb.conf") or die;
+%config = $cfg_h->getall;
 # Root variables
 for my $var (
     qw(pathsep logging log_level DBI_TRACE check_max_invoices language auth latex

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2012-02-16 07:42:22 UTC (rev 4320)
+++ trunk/LedgerSMB.pm	2012-02-16 09:54:38 UTC (rev 4321)
@@ -373,6 +373,14 @@
     }
     $self->get_user_info;
 
+    my %date_setting = (
+        'mm/dd/yy' => "SQL, US",
+        'mm-dd-yy' => "POSTGRES, US",
+        'dd/mm/yy' => "SQL, EUROPEAN",
+        'dd-mm-yy' => "POSTGRES, EUROPEAN",
+        'dd.mm.yy' => "GERMAN",
+    );
+
     $self->{dbh}->do("set DateStyle to '".$date_setting{$self->{_user}->{dateformat}}."'");
     #my $locale   = LedgerSMB::Locale->get_handle($self->{_user}->{language})
     # or $self->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n");

Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL	2012-02-16 07:42:22 UTC (rev 4320)
+++ trunk/Makefile.PL	2012-02-16 09:54:38 UTC (rev 4321)
@@ -26,7 +26,7 @@
 requires 'Encode';
 requires 'Time::Local';
 requires 'Cwd';
-requires 'Config::Std';
+requires 'Config::General';
 requires 'MIME::Lite';
 requires 'Template' => '2.14';
 requires 'Error';

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