1 <% include( 'elements/process.html',
2 'table' => 'msg_template',
3 'viewall_dir' => 'browse',
6 'precheck_callback' => \&precheck_callback,
7 'args_callback' => \&args_callback,
12 unless $FS::CurrentUser::CurrentUser->access_right(['Edit templates','Edit global templates']);
14 sub precheck_callback {
16 # validate some fields
17 $cgi->param('locale') =~ /^(\w*)$/;
19 return mt('Language required') if $locale eq 'new'; # the user didn't choose
20 die "unknown locale $locale" if ( $locale and
21 !FS::Locales->locale_info($locale) );
25 my ($cgi, $object) = @_;
27 $cgi->param('locale') =~ /^(\w*)$/;
28 $content{'locale'} = $1;
29 # no validation of these; they can contain just about anything
30 $content{'subject'} = $cgi->param('subject') || '';
31 $content{'body'} = $cgi->param('body') || '';