projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4978a05
)
RT# 38217 Improve delete button on log email page
author
Mitch Jackson
<mitch@freeside.biz>
Tue, 8 Jan 2019 22:19:02 +0000
(17:19 -0500)
committer
Mitch Jackson
<mitch@freeside.biz>
Tue, 8 Jan 2019 22:49:32 +0000
(17:49 -0500)
httemplate/browse/log_email.html
patch
|
blob
|
history
httemplate/edit/log_email.html
patch
|
blob
|
history
httemplate/misc/delete-log_email.html
patch
|
blob
|
history
httemplate/search/log.html
patch
|
blob
|
history
diff --git
a/httemplate/browse/log_email.html
b/httemplate/browse/log_email.html
index
007ea6f
..
e80b4bc
100644
(file)
--- 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',
<% include('/browse/elements/browse.html',
'title' => 'Log email condition configuration',
'name_singular' => 'condition',
@@
-42,6
+41,7
@@
],
) %>
],
) %>
+<% include('/elements/init_overlib.html') %>
<%init>
<%init>
@@
-73,15
+73,10
@@
my $actions = sub {
qq!<A HREF="javascript:areyousure_delete_log_email($logemailnum)">(delete)</A>!;
};
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+'?')) {
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
}
}
EOF
diff --git
a/httemplate/edit/log_email.html
b/httemplate/edit/log_email.html
index
b79aba9
..
a81e98b
100644
(file)
--- a/
httemplate/edit/log_email.html
+++ b/
httemplate/edit/log_email.html
@@
-41,7
+41,7
@@
)
%>
<%once>
)
%>
<%once>
-my @contexts =
sort
FS::log_context->contexts;
+my @contexts = FS::log_context->contexts;
</%once>
<%init>
</%once>
<%init>
diff --git
a/httemplate/misc/delete-log_email.html
b/httemplate/misc/delete-log_email.html
index
cc17b15
..
98b25e4
100644
(file)
--- 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>
% 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>
% }
</SCRIPT>
% }
@@
-11,10
+17,17
@@
window.top.location.reload();
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]);
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]);
+my $error;
my $logemailnum = $cgi->param('logemailnum');
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
(file)
--- a/
httemplate/search/log.html
+++ b/
httemplate/search/log.html
@@
-201,7
+201,7
@@
my %colors = (
my $color_sub = sub { $colors{ $_[0]->level }; };
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;
</%once>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;