summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authormark <mark>2011-08-05 07:25:43 +0000
committermark <mark>2011-08-05 07:25:43 +0000
commitf765ad6313abc1dc73bab4d3b617d2754cf85823 (patch)
treea9480e7dcff6f97aab6417feb985c7e9f5b9db64 /httemplate/edit/process
parentac62d1f855e6c6de100872c81956fbbf092fcb88 (diff)
message template localization, #13601
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/msg_template.html26
1 files changed, 25 insertions, 1 deletions
diff --git a/httemplate/edit/process/msg_template.html b/httemplate/edit/process/msg_template.html
index 70d451b72..f43d17216 100644
--- a/httemplate/edit/process/msg_template.html
+++ b/httemplate/edit/process/msg_template.html
@@ -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>