3 unless $FS::CurrentUser::CurrentUser->access_right(['Edit templates', 'Edit global templates']);
6 $cgi->param('msgnum') =~ /^(\d+)$/ or die "bad msgnum";
8 $cgi->param('locale') =~ /^(\w+)$/ or die "bad locale";
10 my $content = qsearchs('template_content',
11 { msgnum => $msgnum, locale => $locale })
12 or die "couldn't find $locale version of template #$msgnum";
14 my $error = $content->delete;
15 my $url = $p.'edit/msg_template.html?msgnum='.$msgnum;
16 $url .= ";locale=$locale;error=$error" if $error;
18 <% $cgi->redirect($url) %>