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

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



Revision: 1617
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1617&view=rev
Author:   tetragon
Date:     2007-09-15 21:49:45 -0700 (Sat, 15 Sep 2007)

Log Message:
-----------
Deal with VMethods causing problems with form.sort
Add wrapper for a simpler UI constructor

Modified Paths:
--------------
    trunk/LedgerSMB/Template.pm
    trunk/UI/ca-list-selector.html
    trunk/bin/ca.pl

Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm	2007-09-16 03:45:30 UTC (rev 1616)
+++ trunk/LedgerSMB/Template.pm	2007-09-16 04:49:45 UTC (rev 1617)
@@ -74,6 +74,11 @@
 
 =back
 
+=item new_UI(user => \%myconfig, locale => $locale, template => $file, ...)
+
+Wrapper around the constructor that sets the path to 'UI', format to 'HTML',
+and leaves auto-output enabled.
+
 =item render($hashref)
 
 This command renders the template.  If no_auto_output was not specified during
@@ -144,10 +149,14 @@
 		}
 	}
 
-
 	return $self;
 }
 
+sub new_UI {
+	my $class = shift;
+	return $class->new(@_, no_auto_ouput => 0, format => 'HTML', path => 'UI');
+}
+
 sub _valid_language {
 	my $self = shift;
 	if ($self->{language} =~ m#(/|\\|:|\.\.|^\.)#){

Modified: trunk/UI/ca-list-selector.html
===================================================================
--- trunk/UI/ca-list-selector.html	2007-09-16 03:45:30 UTC (rev 1616)
+++ trunk/UI/ca-list-selector.html	2007-09-16 04:49:45 UTC (rev 1617)
@@ -19,8 +19,7 @@
 <form method="post" action="ca.pl">
 
 <?lsmb FOREACH hidden IN ['accno', 'description', 'sort', 'oldsort', 'accounttype', 'gifi_accno', 'gifi_description'];
-    PROCESS input element_data={type => 'hidden', name => hidden, value => form.$hidden}; END ?>
-
+    PROCESS input element_data={type => 'hidden', name => hidden, value => form.item(hidden)}; END ?>
 <table border="0" width="100%">
   <tr><th class="listtop"><?lsmb form.title ?></th></tr>
   <tr height="5"></tr>

Modified: trunk/bin/ca.pl
===================================================================
--- trunk/bin/ca.pl	2007-09-16 03:45:30 UTC (rev 1616)
+++ trunk/bin/ca.pl	2007-09-16 04:49:45 UTC (rev 1617)
@@ -238,13 +238,10 @@
         value => 'Y',
         text => $locale->text('Subtotal'),
     });
-    $form->{sort} ||= ''; #SC: blah.  Find out why this breaks when undef
-    my $template = LedgerSMB::Template->new(
-        user => \%myconfig, 
+    my $template = LedgerSMB::Template->new_UI(
+        user => \%myconfig,
         locale => $locale,
-        path => 'UI',
-        template => 'ca-list-selector',
-        format => 'HTML');
+        template => 'ca-list-selector');
     $template->render({
         form => $form,
 	includes => ..hidden..,


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