From a9a791f0e93cf43f93a4bd720c7681d08d84f18c Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 22 Aug 2013 17:13:49 -0700 Subject: better locale support in message template UI, #24659 --- httemplate/misc/delete-template_content.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 httemplate/misc/delete-template_content.html (limited to 'httemplate/misc/delete-template_content.html') diff --git a/httemplate/misc/delete-template_content.html b/httemplate/misc/delete-template_content.html new file mode 100644 index 000000000..e77878c25 --- /dev/null +++ b/httemplate/misc/delete-template_content.html @@ -0,0 +1,18 @@ +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right(['Edit templates', 'Edit global templates']); + +my ($msgnum, $locale); +$cgi->param('msgnum') =~ /^(\d+)$/ or die "bad msgnum"; +$msgnum = $1; +$cgi->param('locale') =~ /^(\w+)$/ or die "bad locale"; +$locale = $1; +my $content = qsearchs('template_content', + { msgnum => $msgnum, locale => $locale }) + or die "couldn't find $locale version of template #$msgnum"; + +my $error = $content->delete; +my $url = $p.'edit/msg_template.html?msgnum='.$msgnum; +$url .= ";locale=$locale;error=$error" if $error; + +<% $cgi->redirect($url) %> -- cgit v1.2.1