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

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



Revision: 4066
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4066&view=rev
Author:   einhverfr
Date:     2011-11-25 02:34:21 +0000 (Fri, 25 Nov 2011)
Log Message:
-----------
merge from 1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB/Template.pm
    trunk/LedgerSMB.pm
    trunk/UI/Contact/history_filter.html
    trunk/bin/rp.pl
    trunk/ledgersmb.conf.default
    trunk/sql/modules/Fixes.sql
    trunk/sql/modules/Person.sql
    trunk/templates/demo/pos_invoice.txt
    trunk/templates/xedemo/pos_invoice.txt

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/admin.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-4052
   + /branches/1.3:3711-4065

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/Changelog	2011-11-25 02:34:21 UTC (rev 4066)
@@ -13,6 +13,15 @@
 * Added foreign key of entity_credit_account.language_code (Herman V)
 * Fixed pricelist button (customer/vendor) producing error (Chris T)
 * Fixed date error when processing recurring transactions (Chris T)
+* Exposed LedgerSMB::Sysconfig::tempdir to configuration file (Herman V)
+* Fixed invoice tempfiles never being cleaned up (Herman V)
+* Fixed LedgerSMB.pm warnings during tests (Herman V)
+* Allow log-level to be set from config file (Herman V)
+* Corrected 'Invalid Year-end filter' when exporting trial balance (Chris T)
+* Correcting errors attaching and retriving URL attachments (Chris T)
+* Correcting history.css not found (Chris T)
+* Correcting parse errors in pos_template.txt (Chris T)
+* Corrected Action not defined error on asset import (Chris T)
 
 Changelog for LedgerSMB 1.3.6
 * Including xelatex templates under directory templates/xedemo (Chris T)


Property changes on: trunk/LedgerSMB/Scripts/admin.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4052
/branches/1.3/scripts/admin.pl:3711-3903
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4065
/branches/1.3/scripts/admin.pl:3711-3903


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4052
/branches/1.3/scripts/employee.pl:3842-3843
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4065
/branches/1.3/scripts/employee.pl:3842-3843

Modified: trunk/LedgerSMB/Scripts/file.pm
===================================================================
--- trunk/LedgerSMB/Scripts/file.pm	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/LedgerSMB/Scripts/file.pm	2011-11-25 02:34:21 UTC (rev 4066)
@@ -43,6 +43,11 @@
     $file->get();
 
     my $cgi = CGI::Simple->new();
+    $file->get_mime_type;
+    if ($file->mime_type_text eq 'text/x-uri'){
+        print $cgi->redirect($file->content);
+        return 0;
+    }
 
     print $cgi->header(
           -type       => $file->get_mime_type,
@@ -50,7 +55,6 @@
           -charset    => 'utf-8',
           -attachment => $file->file_name,
     );
-    print $file->content;
 }
 
 =item show_attachment_screen
@@ -86,6 +90,8 @@
     $file->merge($request);
     if ($request->{url}){
 	$file->mime_type_text('text/x-uri');
+        $file->file_name($request->{url});
+        $file->get_mime_type;
         $file->content($request->{url});
     } else {
         use File::MimeInfo;


Property changes on: trunk/LedgerSMB/Scripts/file.pm
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4065
/branches/1.3/scripts/file.pl:3711-4065


Property changes on: trunk/LedgerSMB/Scripts/payment.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4052
/branches/1.3/scripts/payment.pl:3711-4011
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4065
/branches/1.3/scripts/payment.pl:3711-4011


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4052
/branches/1.3/scripts/setup.pl:3711-3967
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4065
/branches/1.3/scripts/setup.pl:3711-3967

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/LedgerSMB/Sysconfig.pm	2011-11-25 02:34:21 UTC (rev 4066)
@@ -67,12 +67,7 @@
 
 # Temporary files stored at"
 our $tempdir = ( $ENV{TEMP} || '/tmp' );
-$ENV{HOME} = $tempdir;
 
-our $cache_template_dir = "$tempdir/lsmb_templates";
-# Backup path
-our $backuppath = $tempdir;
-
 # member file
 our $memberfile = "users/members";
 
@@ -143,13 +138,22 @@
     ${$var} = $config{mail}{$var} if $config{mail}{$var};
 }
 
+my $modules_loglevel_overrides='';
+my %tmp=%{$config{log4perl_config_modules_loglevel}} if $config{log4perl_config_modules_loglevel};
+for(sort keys %tmp)
+{
+ #print STDERR "Sysconfig key=$_ value=$tmp{$_}\n";
+ $modules_loglevel_overrides=$modules_loglevel_overrides.'log4perl.logger.'.$_.'='.$tmp{$_}."\n";
+}
+#print STDERR localtime()." Sysconfig \$modules_loglevel_overrides=$modules_loglevel_overrides\n";
 # Log4perl configuration
 our $log4perl_config = qq(
     log4perl.rootlogger = $log_level, Basic, Debug
-    #some examples of loglevel setting for modules
-    log4perl.logger.LedgerSMB.DBObject = INFO
-    log4perl.logger.LedgerSMB.Handler = DEBUG
-
+    )
+    .
+    $modules_loglevel_overrides
+    .
+    qq(
     log4perl.appender.Screen = Log::Log4perl::Appender::Screen
     log4perl.appender.Screen.layout = SimpleLayout
     # Filter for debug level
@@ -173,8 +177,16 @@
     log4perl.appender.Basic.layout = PatternLayout
     log4perl.appender.Basic.layout.ConversionPattern = %d - %p %m%n
     log4perl.appender.Basic.Filter = MatchRest
-
 );
+#some examples of loglevel setting for modules
+#FATAL, ERROR, WARN, INFO, DEBUG, TRACE
+#log4perl.logger.LedgerSMB = DEBUG
+#log4perl.logger.LedgerSMB.DBObject = INFO
+#log4perl.logger.LedgerSMB.DBObject.Employee = FATAL
+#log4perl.logger.LedgerSMB.Handler = ERROR
+#log4perl.logger.LedgerSMB.User = WARN
+#log4perl.logger.LedgerSMB.ScriptLib.Company=TRACE
+#print STDERR localtime()." Sysconfig log4perl_config=$log4perl_config\n";
 
 $ENV{PGHOST} = $config{database}{host};
 $ENV{PGPORT} = $config{database}{port};
@@ -183,4 +195,10 @@
 $ENV{PGSSLMODE} = $config{database}{sslmode} if $config{database}{sslmode};
 $ENV{PG_CONTRIB_DIR} = $config{database}{contrib_dir};
 
+$ENV{HOME} = $tempdir;
+
+our $cache_template_dir = "$tempdir/lsmb_templates";
+# Backup path
+our $backuppath = $tempdir;
+
 1;

Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/LedgerSMB/Template.pm	2011-11-25 02:34:21 UTC (rev 4066)
@@ -140,6 +140,8 @@
 use LedgerSMB::Company_Config;
 use LedgerSMB::Locale;
 
+my $logger = Log::Log4perl->get_logger('LedgerSMB::Template');
+
 sub new {
 	my $class = shift;
 	my $self = {};
@@ -278,9 +280,12 @@
 	$format->can('process')->($self, $cleanvars);
 	#return $format->can('postprocess')->($self);
 	my $post = $format->can('postprocess')->($self);
+        $logger->debug("\$format=$format \$self->{'noauto'}=$self->{'noauto'} \$self->{rendered}=$self->{rendered}");
 	if (!$self->{'noauto'}) {
 		# Clean up
+                $logger->debug("before self output");
 		$self->output(%$vars);
+                $logger->debug("after self output,but does not seem to return here!");
 		if ($self->{rendered}) {
 			unlink($self->{rendered}) or
 				throw Error::Simple 'Unable to delete output file';
@@ -331,6 +336,7 @@
 		while (my $line = <DATA>){
 			$data .= $line;
 		}
+	        unlink($self->{rendered}) or throw Error::Simple 'Unable to delete output file';
 	}
 
 	my $format = "LedgerSMB::Template::$self->{format}";

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/LedgerSMB.pm	2011-11-25 02:34:21 UTC (rev 4066)
@@ -463,8 +463,11 @@
 
 sub is_run_mode {
     my $self = shift @_;
-    my $mode = lc shift @_;
+    #avoid 'uninitialized' warnings in tests
+    my $mode = shift @_;
     my $rc   = 0;
+    if(! $mode){return $rc;}
+    $mode=lc $mode;
     if ( $mode eq 'cgi' && $ENV{GATEWAY_INTERFACE} ) {
         $rc = 1;
     }
@@ -754,6 +757,7 @@
 }
 
 sub finalize_request {
+    $logger->debug("throwing CancelFurtherProcessing()");#if trying to follow flow of request
     throw CancelFurtherProcessing();
 }
 

Modified: trunk/UI/Contact/history_filter.html
===================================================================
--- trunk/UI/Contact/history_filter.html	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/UI/Contact/history_filter.html	2011-11-25 02:34:21 UTC (rev 4066)
@@ -1,6 +1,6 @@
 <?lsmb INCLUDE "ui-header.html" 
        stylesheet = stylesheet
-       include_stylesheet = ['history.css'] ?>
+       # include_stylesheet = ['UI/Contact/history.css'] ?>
 <?lsmb PROCESS 'elements.html' ?>
  
 <body> 

Modified: trunk/bin/rp.pl
===================================================================
--- trunk/bin/rp.pl	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/bin/rp.pl	2011-11-25 02:34:21 UTC (rev 4066)
@@ -610,7 +610,7 @@
 
     $form->{callback} = "$form->{script}?action=generate_trial_balance";
     for (
-        qw(login path sessionid nextsub fromdate todate month year interval l_heading l_subtotal all_accounts accounttype title)
+        qw(login path sessionid nextsub fromdate todate month year interval l_heading l_subtotal all_accounts accounttype title ignore_yearend)
       )
     {
         $form->{callback} .= "&$_=$form->{$_}";
@@ -640,6 +640,7 @@
         department => $form->{department},
         projectnumber => $form->{projectnumber},
         project_id => $form->{project_id},
+        ignore_yearend => $form->{ignore_yearend},
     );
 
     my @options;

Modified: trunk/ledgersmb.conf.default
===================================================================
--- trunk/ledgersmb.conf.default	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/ledgersmb.conf.default	2011-11-25 02:34:21 UTC (rev 4066)
@@ -1,5 +1,7 @@
 auth : DB
 logging  : 0
+#Be aware of tempdir setting.If client_browser and server_apache on same machine, sharing tmp-dir , problems 'Permission denied' if server tries to write temp-file wich already exists as client-owned
+tempdir : /tmp/ledgersmb
 
 # Set language for login and admin pages
 language : 
@@ -92,3 +94,7 @@
 contrib_dir = /usr/share/pgsql/contrib/
 # sslmode can be require, allow, prefer, or disable.  Defaults to prefer.
 sslmode = prefer
+
+[log4perl_config_modules_loglevel]
+LedgerSMB : INFO
+LedgerSMB.DBObject = INFO

Modified: trunk/sql/modules/Fixes.sql
===================================================================
--- trunk/sql/modules/Fixes.sql	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/sql/modules/Fixes.sql	2011-11-25 02:34:21 UTC (rev 4066)
@@ -24,6 +24,11 @@
 UPDATE menu_attribute SET value = 'partsgroup' WHERE node_id = 91 and attribute = 'type';
 UPDATE menu_attribute SET value = 'pricegroup' WHERE node_id = 92 and attribute = 'type';
 
+-- Very restrictive because some people still have Asset handling installed from
+-- Addons and so the node_id and id values may not match.  Don't want to break
+-- what is working! --CT
+UPDATE menu_attribute SET value = 'begin_import' WHERE id = 631 and value = 'import' and node_id = '235'; 
+
 COMMIT;
 
 BEGIN;

Modified: trunk/sql/modules/Person.sql
===================================================================
--- trunk/sql/modules/Person.sql	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/sql/modules/Person.sql	2011-11-25 02:34:21 UTC (rev 4066)
@@ -12,6 +12,11 @@
 COMMENT ON FUNCTION person__get_my_entity_id() IS
 $$ Returns the entity_id of the current, logged in user.$$;
 
+CREATE OR REPLACE FUNCTION person__list_languages() 
+RETURNS SETOF language AS
+$$ SELECT * FROM language ORDER BY code ASC $$ language sql;
+COMMENT ON FUNCTION person__list_languages() IS
+$$ Returns a list of languages ordered by code$$;
 
 CREATE OR REPLACE FUNCTION person__list_salutations() 
 RETURNS SETOF salutation AS


Property changes on: trunk/sql/upgrade/1.2-1.3-manual.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4052
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710
   + /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4065
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

Modified: trunk/templates/demo/pos_invoice.txt
===================================================================
--- trunk/templates/demo/pos_invoice.txt	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/templates/demo/pos_invoice.txt	2011-11-25 02:34:21 UTC (rev 4066)
@@ -7,39 +7,38 @@
 Printed: <?lsmb dateprinted ?>
 
   Qty Description                 Amount
-<?lsmb foreach number ?>
-<?lsmb qty FILTER format('%5.5s') ?>       <?lsmb description FILTER format('%-18.18s') ?> <?lsmb linetotal FILTER format('%9.9s') ?>
-      <?lsmb number ?> @ <?lsmb sellprice ?>/<?lsmb unit ?>
-<?lsmb end number ?>
+<?lsmb FOREACH number ?><?lsmb loop_count = loop.count - 1 ?>
+<?lsmb qty FILTER format('%5.5s') ?>       <?lsmb description.loop_count FILTER format('%-18.18s') ?> <?lsmb linetotal.loop_count FILTER format('%9.9s') ?>
+      <?lsmb number.loop_count ?> @ <?lsmb sellprice.loop_count ?>/<?lsmb unit.loop_count ?>
+<?lsmb END # number ?>
 
 Number of items: <?lsmb totalqty ?>
-<?lsmb if taxincluded ?>
+<?lsmb IF taxincluded ?>
                          ---------------
                         Total: <?lsmb invtotal FILTER format('%9.9s') ?>
-<?lsmb end taxincluded ?>
-<?lsmb if not taxincluded ?>
+<?lsmb ELSE ?>
                             ------------
                      Subtotal: <?lsmb subtotal FILTER format('%9.9s') ?>
-<?lsmb end taxincluded ?>
-<?lsmb foreach tax ?>
-<?lsmb taxdescription FILTER format('%-23.23s') ?> @ <?lsmb taxrate FILTER format('%2.2s') ?>%: <?lsmb tax FILTER format('%9.9s') ?>
-<?lsmb end tax ?>
-<?lsmb foreach payment ?>
-                         Paid: <?lsmb payment FILTER format('%9.9s') ?> <?lsmb currency ?>
-<?lsmb end payment ?>
-<?lsmb if change ?>
+<?lsmb END # taxincluded ?>
+<?lsmb FOREACH tax ?><?lsmb loop_count = loop.count - 1 ?>
+<?lsmb taxdescription.loop_count FILTER format('%-23.23s') ?> @ <?lsmb taxrate.loop_count FILTER format('%2.2s') ?>%: <?lsmb tax.loop_count FILTER format('%9.9s') ?>
+<?lsmb END # tax ?>
+<?lsmb FOREACH payment ?><?lsmb loop_count = loop.count - 1 ?>
+                         Paid: <?lsmb payment.loop_count FILTER format('%9.9s') ?> <?lsmb currency.loop_count ?>
+<?lsmb END # payment ?>
+<?lsmb IF change ?>
                        Change: <?lsmb change FILTER format('%9.9s') ?>
-<?lsmb end change ?>
-<?lsmb if total ?>
+<?lsmb END # change ?>
+<?lsmb IF total ?>
                   Balance Due: <?lsmb total FILTER format('%9.9s') ?>
-<?lsmb end total ?>
-<?lsmb if discount ?>
+<?lsmb END # total ?>
+<?lsmb IF discount ?>
 
 <?lsmb discount ?> % Discount applied
-<?lsmb end discount ?>
+<?lsmb END # discount ?>
 
    Thank you for your valued business!
 
-<?lsmb if taxincluded ?>
+<?lsmb IF taxincluded ?>
 Taxes are included in price.
-<?lsmb end taxincluded ?>
+<?lsmb END # taxincluded ?>

Modified: trunk/templates/xedemo/pos_invoice.txt
===================================================================
--- trunk/templates/xedemo/pos_invoice.txt	2011-11-25 01:42:29 UTC (rev 4065)
+++ trunk/templates/xedemo/pos_invoice.txt	2011-11-25 02:34:21 UTC (rev 4066)
@@ -7,39 +7,38 @@
 Printed: <?lsmb dateprinted ?>
 
   Qty Description                 Amount
-<?lsmb foreach number ?>
-<?lsmb qty FILTER format('%5.5s') ?>       <?lsmb description FILTER format('%-18.18s') ?> <?lsmb linetotal FILTER format('%9.9s') ?>
-      <?lsmb number ?> @ <?lsmb sellprice ?>/<?lsmb unit ?>
-<?lsmb end number ?>
+<?lsmb FOREACH number ?><?lsmb loop_count = loop.count - 1 ?>
+<?lsmb qty FILTER format('%5.5s') ?>       <?lsmb description.loop_count FILTER format('%-18.18s') ?> <?lsmb linetotal.loop_count FILTER format('%9.9s') ?>
+      <?lsmb number.loop_count ?> @ <?lsmb sellprice.loop_count ?>/<?lsmb unit.loop_count ?>
+<?lsmb END # number ?>
 
 Number of items: <?lsmb totalqty ?>
-<?lsmb if taxincluded ?>
+<?lsmb IF taxincluded ?>
                          ---------------
                         Total: <?lsmb invtotal FILTER format('%9.9s') ?>
-<?lsmb end taxincluded ?>
-<?lsmb if not taxincluded ?>
+<?lsmb ELSE ?>
                             ------------
                      Subtotal: <?lsmb subtotal FILTER format('%9.9s') ?>
-<?lsmb end taxincluded ?>
-<?lsmb foreach tax ?>
-<?lsmb taxdescription FILTER format('%-23.23s') ?> @ <?lsmb taxrate FILTER format('%2.2s') ?>%: <?lsmb tax FILTER format('%9.9s') ?>
-<?lsmb end tax ?>
-<?lsmb foreach payment ?>
-                         Paid: <?lsmb payment FILTER format('%9.9s') ?> <?lsmb currency ?>
-<?lsmb end payment ?>
-<?lsmb if change ?>
+<?lsmb END # taxincluded ?>
+<?lsmb FOREACH tax ?><?lsmb loop_count = loop.count - 1 ?>
+<?lsmb taxdescription.loop_count FILTER format('%-23.23s') ?> @ <?lsmb taxrate.loop_count FILTER format('%2.2s') ?>%: <?lsmb tax.loop_count FILTER format('%9.9s') ?>
+<?lsmb END # tax ?>
+<?lsmb FOREACH payment ?><?lsmb loop_count = loop.count - 1 ?>
+                         Paid: <?lsmb payment.loop_count FILTER format('%9.9s') ?> <?lsmb currency.loop_count ?>
+<?lsmb END # payment ?>
+<?lsmb IF change ?>
                        Change: <?lsmb change FILTER format('%9.9s') ?>
-<?lsmb end change ?>
-<?lsmb if total ?>
+<?lsmb END # change ?>
+<?lsmb IF total ?>
                   Balance Due: <?lsmb total FILTER format('%9.9s') ?>
-<?lsmb end total ?>
-<?lsmb if discount ?>
+<?lsmb END # total ?>
+<?lsmb IF discount ?>
 
 <?lsmb discount ?> % Discount applied
-<?lsmb end discount ?>
+<?lsmb END # discount ?>
 
    Thank you for your valued business!
 
-<?lsmb if taxincluded ?>
+<?lsmb IF taxincluded ?>
 Taxes are included in price.
-<?lsmb end taxincluded ?>
+<?lsmb END # taxincluded ?>

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