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

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



Revision: 3530
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3530&view=rev
Author:   einhverfr
Date:     2011-07-16 00:19:29 +0000 (Sat, 16 Jul 2011)

Log Message:
-----------
correcting 3367111

Modified Paths:
--------------
    trunk/LedgerSMB/AM.pm
    trunk/bin/am.pl

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2011-07-16 00:08:19 UTC (rev 3529)
+++ trunk/LedgerSMB/AM.pm	2011-07-16 00:19:29 UTC (rev 3530)
@@ -1517,12 +1517,17 @@
 sub load_template {
 
     my ( $self, $myconfig, $form ) = @_;
+    my $testval = 0;
 
     $form->{file} ||= lc "$myconfig->{templates}/$form->{template}.$form->{format}";
     $self->check_template_name( \%$myconfig, \%$form );
-    open( TEMPLATE, '<', "$form->{file}" )
-      or $form->error("$form->{file} : $!");
-
+    open( TEMPLATE, '<', "$form->{file}" ) || ($testval = 1);
+    if ($testval == 1 && ($! eq 'No such file or directory')){
+      $form->error('Template not found.  
+         Perhaps you meant to edit the default template instead?');
+    } elsif ($testval == 1){
+       $form->error("$form->{file} : $!");
+    }
     while (<TEMPLATE>) {
         $form->{body} .= $_;
     }

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2011-07-16 00:08:19 UTC (rev 3529)
+++ trunk/bin/am.pl	2011-07-16 00:19:29 UTC (rev 3530)
@@ -1314,7 +1314,9 @@
         $column_data{code} = { text => $ref->{code}, href =>
             qq|$form->{script}?action=display_form&file=$myconfig{templates}/$ref->{code}/$form->{file}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&code=$ref->{code}&callback=$callback|};
         $column_data{description} = $ref->{description};
-
+        if ($ref->{code} eq '.'){
+            $column_data{code}->{text} = $locale->text('Default');
+        }
 	push @rows, \%column_data;
     
     }


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