X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fmsg_template.html;h=889b10731e1408bcd945c74b40e215f1a892832e;hp=986629cd75a7d33072ddb759edc37ee20f39fb3e;hb=8eb6542c022ac84b125416f3fb0828b278ba600a;hpb=f07729b883f93aab6eaf4dffaa9b725e36c6852a diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 986629cd7..889b10731 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -1,23 +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') - || $FS::CurrentUser::CurrentUser->access_right('Configuration'); - +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);