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

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



Revision: 6360
          http://sourceforge.net/p/ledger-smb/code/6360
Author:   einhverfr
Date:     2014-01-03 09:03:50 +0000 (Fri, 03 Jan 2014)
Log Message:
-----------
Fixing stored procedure errors

Modified Paths:
--------------
    trunk/sql/modules/Templates.sql
    trunk/tools/load_templates.pl

Modified: trunk/sql/modules/Templates.sql
===================================================================
--- trunk/sql/modules/Templates.sql	2014-01-03 08:44:56 UTC (rev 6359)
+++ trunk/sql/modules/Templates.sql	2014-01-03 09:03:50 UTC (rev 6360)
@@ -24,23 +24,26 @@
 $$;
 
 CREATE OR REPLACE FUNCTION template__save(
-in_template_name text, in_language_code varchar(6), in_template text
+in_template_name text, in_language_code varchar(6), in_template text,
 in_format text
 ) 
 RETURNS template LANGUAGE PLPGSQL AS
 $$
+DECLARE retval template;
 BEGIN
    UPDATE template SET template = in_template
     WHERE template_name = in_template_name AND format = in_format AND
           language_code IS NOT DISTINCT FROM in_language_code;
           
    IF FOUND THEN
-      RETURN template_get(in_template_name, in_language_code, in_format);
-   END;
+      retval := template_get(in_template_name, in_language_code, in_format);
+      RETURN retval;
+   END IF;
    INSERT INTO template (template_name, language_code, template, format)
    VALUES (in_template_name, language_code, template, in_format);
 
-   RETURN template_get(in_template_name, in_language_code, in_format);
+   retval := template_get(in_template_name, in_language_code, in_format);
+   RETURN retval;
 END;
 $$;
 

Modified: trunk/tools/load_templates.pl
===================================================================
--- trunk/tools/load_templates.pl	2014-01-03 08:44:56 UTC (rev 6359)
+++ trunk/tools/load_templates.pl	2014-01-03 09:03:50 UTC (rev 6360)
@@ -42,7 +42,7 @@
 
 #### ARG HANDLING (before functions because it should be read first)
 #
-my ($script, $to_load, $language, $database) = @_;
+my ($to_load, $language, $database) = @ARGV;
 
 # handle 2-arg form:
 
@@ -77,7 +77,7 @@
     my %args = (
            template_name => $template_name,
            format => $format,
-           template => $template,
+           template => $content,
     );
     $args{language_code} = $language_code if $language_code;
     my $dbtemp = LedgerSMB::Template::DB->new(%args);

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits