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

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



Revision: 4991
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4991&view=rev
Author:   einhverfr
Date:     2012-07-15 08:35:38 +0000 (Sun, 15 Jul 2012)
Log Message:
-----------
correcting issues with file attachments

Modified Paths:
--------------
    trunk/LedgerSMB/File.pm
    trunk/LedgerSMB/Scripts/contact.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/UI/Contact/divs/credit.html
    trunk/UI/Contact/divs/files.html
    trunk/file.pl

Modified: trunk/LedgerSMB/File.pm
===================================================================
--- trunk/LedgerSMB/File.pm	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/LedgerSMB/File.pm	2012-07-15 08:35:38 UTC (rev 4991)
@@ -20,6 +20,7 @@
 use Moose;
 extends 'LedgerSMB::DBObject_Moose';
 use File::MimeInfo;
+binmode STDIN, ':bytes';
 
 =item  attached_by_id
 
@@ -324,7 +325,7 @@
 
 sub commit{
     my ($self) = @_;
-    return $self->dbh->commit;
+    return $LedgerSMB::App_State::DBH->commit;
 }
 
 =back

Modified: trunk/LedgerSMB/Scripts/contact.pm
===================================================================
--- trunk/LedgerSMB/Scripts/contact.pm	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/LedgerSMB/Scripts/contact.pm	2012-07-15 08:35:38 UTC (rev 4991)
@@ -57,9 +57,9 @@
            LedgerSMB::DBObject::Entity::Company->get_by_cc($request->{control_code});
     $entity ||=  LedgerSMB::DBObject::Entity::Person->get_by_cc($request->{control_code});
     my ($company, $person) = (undef, undef);
-    if ($entity->isa('LedgerSMB::DBObject::Entity::Company')){
+    if (eval {$entity->isa('LedgerSMB::DBObject::Entity::Company')}){
        $company = $entity;
-    } elsif ($entity->isa('LedgerSMB::DBObject::Entity::Person')){
+    } elsif (eval {$entity->isa('LedgerSMB::DBObject::Entity::Person')}){
        $person = $entity;
     }
     _main_screen($request, $company, $person);

Modified: trunk/LedgerSMB/Scripts/file.pm
===================================================================
--- trunk/LedgerSMB/Scripts/file.pm	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/LedgerSMB/Scripts/file.pm	2012-07-15 08:35:38 UTC (rev 4991)
@@ -27,6 +27,7 @@
 use LedgerSMB::File::Part;
 use LedgerSMB::File::Entity;
 use LedgerSMB::File::ECA;
+use DBD::Pg qw(:pg_types);
 use strict;
 use CGI::Simple;
 
@@ -111,7 +112,7 @@
         $file->get_mime_type;
         my $fh = $request->{_request}->upload('upload_data');
         my $fdata = join ("", <$fh>);
-        $file->content($fdata);
+        $file->content({value => $fdata, type => => DBD::Pg::PG_BYTEA});
     }
     $request->{content} = $file->content;
     $file->attach;

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/LedgerSMB/Sysconfig.pm	2012-07-15 08:35:38 UTC (rev 4991)
@@ -123,6 +123,7 @@
      $ENV{$var} .= $pathsep . ( join $pathsep, $cfg->val('environment', $var));
 }
 
+warn $ENV{PERL5LIB};
 # Application-specific paths
 for my $var (qw(localepath spool templates images)) {
     ${$var} = $cfg->val('paths', $var) if $cfg->val('paths', $var);

Modified: trunk/UI/Contact/divs/credit.html
===================================================================
--- trunk/UI/Contact/divs/credit.html	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/UI/Contact/divs/credit.html	2012-07-15 08:35:38 UTC (rev 4991)
@@ -3,10 +3,10 @@
 <?lsmb 
 
 FOREACH cl IN credit_list;
-   IF entity_class == 1;
-        account_class_label = text('Vendor');
-   ELSIF  entity_class == 2;
-        account_class_label = text('Customer');
+   IF cl.entity_class == 1;
+        cl.account_class_label = text('Vendor');
+   ELSIF  cl.entity_class == 2;
+        cl.account_class_label = text('Customer');
    END;
    cl.meta_number_href_suffix = 'account_class=' _ cl.entity_class _ 
       '&entity_id=' _ cl.entity_id _ '&meta_number=' _ cl.meta_number _

Modified: trunk/UI/Contact/divs/files.html
===================================================================
--- trunk/UI/Contact/divs/files.html	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/UI/Contact/divs/files.html	2012-07-15 08:35:38 UTC (rev 4991)
@@ -1,5 +1,6 @@
 <div class="container" id="files_div">
-<?lsmb callback="contact.pl?action=get&id=" _ entity_id _
+<?lsmb callback="contact.pl?action=get&entity_class=" _ 
+                credit_act.entity_class _ "&entity_id=" _ entity_id _
                 "&credit_id=" _ credit_act.id; 
 columns = [{ col_id = 'file_name', name = text('File name'), #'
                type = 'href', href_base="file.pl&action=get"}

Modified: trunk/file.pl
===================================================================
--- trunk/file.pl	2012-07-14 14:17:56 UTC (rev 4990)
+++ trunk/file.pl	2012-07-15 08:35:38 UTC (rev 4991)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl 
 use FindBin;
 BEGIN {
   lib->import($FindBin::Bin) unless $ENV{mod_perl}

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