[freeside-commits] freeside/httemplate/edit/process msg_template.html, 1.2, 1.3

Mark Wells mark at wavetail.420.am
Thu Jul 28 15:23:58 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv21107/httemplate/edit/process

Modified Files:
	msg_template.html 
Log Message:
message template localization, #13601

Index: msg_template.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/msg_template.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- msg_template.html	22 Jul 2010 16:47:43 -0000	1.2
+++ msg_template.html	28 Jul 2011 22:23:56 -0000	1.3
@@ -1,13 +1,37 @@
 <% include( 'elements/process.html',  
               'table'       => 'msg_template',
               'viewall_dir' => 'browse',
+              #'popup_reload'=> 1,
+              'debug'       => 1,
+              'precheck_callback' => \&precheck_callback,
+              'args_callback' => \&args_callback,
           )
 %>
 <%init>
-
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Edit templates')
   ||     $FS::CurrentUser::CurrentUser->access_right('Edit global templates')
   ||     $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
+sub precheck_callback {
+  my $cgi = shift;
+  # validate some fields
+  $cgi->param('locale') =~ /^(\w*)$/;
+  my $locale = $1;
+  return mt('Language required') if $locale eq 'new'; # the user didn't choose
+  die "unknown locale $locale" if ( $locale and 
+                                    !FS::Locales->locale_info($locale) );
+}
+
+sub args_callback {
+  my ($cgi, $object) = @_;
+  my %content;
+  $cgi->param('locale') =~ /^(\w*)$/;
+  $content{'locale'} = $1;
+  # no validation of these; they can contain just about anything
+  $content{'subject'} = $cgi->param('subject') || '';
+  $content{'body'} = $cgi->param('body') || '';
+  return %content;
+}
+
 </%init>



More information about the freeside-commits mailing list