diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/browse/log_email.html | 9 | ||||
-rw-r--r-- | httemplate/edit/log_email.html | 2 | ||||
-rw-r--r-- | httemplate/misc/delete-log_email.html | 25 | ||||
-rw-r--r-- | httemplate/search/log.html | 2 |
4 files changed, 23 insertions, 15 deletions
diff --git a/httemplate/browse/log_email.html b/httemplate/browse/log_email.html index 007ea6f74..e80b4bc90 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 b79aba986..a81e98b09 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 cc17b15a0..98b25e4c1 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 f6ac9d9be..9be0b7d0a 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; |