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

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



Revision: 3894
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3894&view=rev
Author:   einhverfr
Date:     2011-10-19 23:32:23 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
modifications for date handling, array handling

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject.pm
    trunk/LedgerSMB.pm
    trunk/dists/source/build.sh

Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm	2011-10-19 22:00:51 UTC (rev 3893)
+++ trunk/LedgerSMB/DBObject.pm	2011-10-19 23:32:23 UTC (rev 3894)
@@ -291,65 +291,21 @@
     my ($self, $value) = @_;
     return @$value if ref $value eq 'ARRAY';
     return if !defined $value;
-    my $next;
-    my $separator;
-    my @return_array;
-
-    while ($value ne '{}') {
-        $next = "";
-        $separator = "";
-        if ($value =~ /^\{"/){
-            $value =~ s/^\{"(([^"]|\\")*[^\\])"/\{/;
-            $next = $1;
-            $next =~ /(.)$/;
-            $value =~ s/^{,/{/;
-
-        } elsif ($value =~ /^{({+)/){
-            my $open_braces = $1;
-            $next = [];
-            my $close_braces = $open_braces;
-            $close_braces =~ s/{/}/g;
-            $value =~ s/^{($open_braces[^}]*$close_braces),?/{/;
-            my $parse_next = $1;
-            @$next = $self->_parse_array($parse_next);
-        } else {
-            $value =~ s/^\{([^,]*)(,|\})/\{/;
-            $next = $1;
-            $separator = $2;
-        }
-        $value .= '}' if $separator eq '}';
-        $next =~ s/\\\\/\\/g;
-        $next =~ s/\\"/"/g;
-        push @return_array, $next;
-    }
-    return @return_array;
+    # No longer needed since we require DBD::Pg 2.x 
 }
 
 sub _db_array_scalars {
     my $self = shift @_;
     my @args = @_;
-    for my $arg (@args){
-        $arg =~ s/(["{},])/\\$1/g;
-        if ($arg =~ /(\s|\\)/){
-           $arg = qq|"$arg"|;
-        }
-    }
-    return $self->_db_array_literal(@args);
+    return ..hidden..; 
+    # No longer needed since we require DBD::Pg 2.x
 }
 
 sub _db_array_literal {
     my $self = shift @_;
     my @args = @_;
-    my $return_string = '{}';
-    for my $arg (@args){
-        if ($return_string eq '{}'){
-            $return_string = "{$arg}";
-        }
-        else {
-            $return_string =~ s/\}$/,$arg\}/
-        }
-    }
-    return $return_string;
+    return ..hidden..;
+    # No longer needed since we require DBD::Pg 2.x
 }
 
 1;

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2011-10-19 22:00:51 UTC (rev 3893)
+++ trunk/LedgerSMB.pm	2011-10-19 23:32:23 UTC (rev 3894)
@@ -338,16 +338,7 @@
        $logger->debug("LedgerSMB::new: session_check completed OK");
     }
     $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})
 #    $self->{_locale} = LedgerSMB::Locale->get_handle('en') # temporary
      or $self->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n");
@@ -796,6 +787,10 @@
             if ($types[$_] == 3 or $types[$_] == 2) {
                 $ref->{$names[$_]} = Math::BigFloat->new($ref->{$names[$_]});
             }
+            #    DATE                TIMESTAMP
+            if ($types[$_] == 91 or $types[$_] == 11){
+                $ref->{$names[$_]} = LedgerSMB::PGDate->from_db($ref->{$names[$_]});
+            }
         }
         push @results, $ref;
     }

Modified: trunk/dists/source/build.sh
===================================================================
--- trunk/dists/source/build.sh	2011-10-19 22:00:51 UTC (rev 3893)
+++ trunk/dists/source/build.sh	2011-10-19 23:32:23 UTC (rev 3894)
@@ -2,7 +2,7 @@
 
 # Simple script to prepare for release
 
-version="1.4-snapshot20111012";
+version="1.4-snapshot20111019";
 build_d="../release";
 
 if test -d $build_d/ledgersmb; then

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