summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMitch Jackson <mitch@freeside.biz>2019-01-08 17:19:02 -0500
committerMitch Jackson <mitch@freeside.biz>2019-01-08 17:28:16 -0500
commit0edb6050aeb65200869a12d83d8de794ed384154 (patch)
treeba519d88e5fb57b8907df1daa033f3460071461d /httemplate
parent5702ca6d01cd5c6c3ab457fc272d2476ddb42b1e (diff)
RT# 38217 Improve delete button on log email page
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/log_email.html9
-rw-r--r--httemplate/edit/log_email.html2
-rw-r--r--httemplate/misc/delete-log_email.html25
-rw-r--r--httemplate/search/log.html2
4 files changed, 23 insertions, 15 deletions
diff --git a/httemplate/browse/log_email.html b/httemplate/browse/log_email.html
index 007ea6f..e80b4bc 100644
--- a/httemplate/browse/log_email.html
+++ b/httemplate/browse/log_email.html
@@ -1,4 +1,3 @@
-<% include('/elements/init_overlib.html') %>
<% include('/browse/elements/browse.html',
'title' => 'Log email condition configuration',
'name_singular' => 'condition',
@@ -42,6 +41,7 @@
],
) %>
+<% include('/elements/init_overlib.html') %>
<%init>
@@ -73,15 +73,10 @@ my $actions = sub {
qq!<A HREF="javascript:areyousure_delete_log_email($logemailnum)">(delete)</A>!;
};
-my $areyousure_onclick = include('/elements/popup_link_onclick.html',
- 'js_action' => q(') . $p . q(misc/delete-log_email.html?logemailnum=' + logemailnum),
- 'actionlabel' => 'Delete log email condition',
-);
-
my $areyousure = <<EOF;
function areyousure_delete_log_email(logemailnum) {
if (confirm('Are you sure you want to delete log email condition #'+logemailnum+'?')) {
-${areyousure_onclick}
+ window.top.location = "${fsurl}misc/delete-log_email.html?logemailnum=" + logemailnum;
}
}
EOF
diff --git a/httemplate/edit/log_email.html b/httemplate/edit/log_email.html
index b79aba9..a81e98b 100644
--- a/httemplate/edit/log_email.html
+++ b/httemplate/edit/log_email.html
@@ -41,7 +41,7 @@
)
%>
<%once>
-my @contexts = sort FS::log_context->contexts;
+my @contexts = FS::log_context->contexts;
</%once>
<%init>
diff --git a/httemplate/misc/delete-log_email.html b/httemplate/misc/delete-log_email.html
index cc17b15..98b25e4 100644
--- a/httemplate/misc/delete-log_email.html
+++ b/httemplate/misc/delete-log_email.html
@@ -1,9 +1,15 @@
+<% include("/elements/header.html", 'Log email condition configuration') %>
+<P>
+ <A HREF="<% $p %>search/log.html">System Log</A>
+ | <a href="<% $p %>browse/log_email.html">Log E-Mail Condition</a>
+</p>
+
% if ($error) {
<P STYLE="color: red"><% $error %></P>
% } else {
<H1>Log email condition deleted</H1>
<SCRIPT>
-window.top.location.reload();
+window.top.location = "<% $fsurl %>browse/log_email.html";
</SCRIPT>
% }
@@ -11,10 +17,17 @@ window.top.location.reload();
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]);
+my $error;
my $logemailnum = $cgi->param('logemailnum');
-$logemailnum =~ /^\d+$/ or die "bad logemailnum '$logemailnum'";
-my $log_email = FS::log_email->by_key($logemailnum)
- or die "logemailnum '$logemailnum' not found";
-my $error = $log_email->delete;
-</%init>
+if ( $logemailnum =~ /^\d+$/ ) {
+ if ( my $log_email = FS::log_email->by_key($logemailnum) ) {
+ $error = $log_email->delete;
+ } else {
+ $error = "logemailnum '$logemailnum' not found";
+ }
+} else {
+ $error = "bad logemailnum '$logemailnum'";
+}
+
+</%init>
diff --git a/httemplate/search/log.html b/httemplate/search/log.html
index f6ac9d9..9be0b7d 100644
--- a/httemplate/search/log.html
+++ b/httemplate/search/log.html
@@ -201,7 +201,7 @@ my %colors = (
my $color_sub = sub { $colors{ $_[0]->level }; };
-my @contexts = ('', sort FS::log_context->contexts);
+my @contexts = ('', FS::log_context->contexts);
</%once>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;