X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fmsg_template.html;h=889b10731e1408bcd945c74b40e215f1a892832e;hb=90e15da7354b55cc5461b58ac087096ed47e0240;hp=68725e243a2d57b13882d397720b25bf67af8b80;hpb=99af479c12baf1f7da52e06841f0ac4f4832d766;p=freeside.git diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 68725e243..889b10731 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -1,22 +1,9 @@ -<% include( 'elements/edit.html', - 'name_singular' => 'template', - 'table' => 'msg_template', - 'viewall_dir' => 'browse', - 'fields' => [ 'msgname', - 'subject', - { field=>'body', type=>'htmlarea', width=>763 }, - ], - 'labels' => { 'msgnum' => 'Template', - 'msgname' => 'Template name', - 'subject' => 'Message subject', - 'body' => 'Message template', - }, - ) -%> <%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Edit templates') - || $FS::CurrentUser::CurrentUser->access_right('Edit global templates'); - +my $msgclass = 'email'; +if ( $cgi->param('msgnum') =~ /^(\d+)$/ ) { + my $msg_template = FS::msg_template->by_key($1) + or die "unknown msgnum $1"; + $msgclass = $msg_template->msgclass; +} +print $cgi->redirect($fsurl."edit/msg_template/$msgclass.html?".$cgi->query_string);