diff options
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/browse/discount.html | 31 | ||||
| -rw-r--r-- | httemplate/browse/log_email.html | 44 | ||||
| -rw-r--r-- | httemplate/edit/log_email.html | 11 | ||||
| -rw-r--r-- | httemplate/edit/msg_template.html | 6 | ||||
| -rw-r--r-- | httemplate/misc/delete-log_email.html | 14 | ||||
| -rw-r--r-- | httemplate/search/cust_bill_pkg_discount.html | 6 | ||||
| -rwxr-xr-x | httemplate/search/report_cust_main.html | 4 | ||||
| -rw-r--r-- | httemplate/view/prospect_main.html | 4 |
8 files changed, 76 insertions, 44 deletions
diff --git a/httemplate/browse/discount.html b/httemplate/browse/discount.html index d3cf873d0..5ed43cf0e 100644 --- a/httemplate/browse/discount.html +++ b/httemplate/browse/discount.html @@ -1,10 +1,9 @@ <% include( 'elements/browse.html', 'title' => 'Discounts', 'name' => 'discounts', - 'menubar' => [ 'Add a new discount' => - $p.'edit/discount.html', - ], - 'query' => { 'table' => 'discount', }, + 'menubar' => \@menubar, + 'query' => \%query, + 'order_by_sql' => { description => 'discountnum' }, 'count_query' => 'SELECT COUNT(*) FROM discount', 'disableable' => 1, 'disabled_statuspos' => 1, @@ -13,9 +12,7 @@ 'classname', 'description', ], - 'links' => [ $link, - $link, - ], + 'links' => \@links ) %> <%init> @@ -23,6 +20,24 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -my $link = [ "${p}edit/discount.html?", 'discountnum' ]; +my @links = ( + [ "${p}edit/discount.html?", 'discountnum' ], + [ "${p}edit/discount_class.html?", 'classnum' ], +); + +# Fixes disableable, because discount and discount_class tables +# both contain a 'disabled' column +local $FS::Record::qsearch_qualify_columns = 1; + +my %query = ( + select => 'discount.*, discount_class.*', + table => 'discount', + addl_from => 'LEFT JOIN discount_class USING(classnum)', +); + +my @menubar = ( + 'Add a new discount' => $p.'edit/discount.html', + 'Discount classes' => $p.'browse/discount_class.html', +); </%init> diff --git a/httemplate/browse/log_email.html b/httemplate/browse/log_email.html index 007ea6f74..fe583dc62 100644 --- a/httemplate/browse/log_email.html +++ b/httemplate/browse/log_email.html @@ -6,10 +6,7 @@ . $add_condition_link . ' | ' . $system_log_link - . '</P>' - . '<SCRIPT>' - . $areyousure - . '</SCRIPT>', + . '</P>', 'query' => $query, 'count_query' => $count_query, 'header' => [ '#', @@ -43,6 +40,23 @@ ) %> +<script> + function areyousure_delete_log_email(logemailnum) { + if ( confirm( 'Delete log email condition #' + logemailnum )) { + <% + include( + '/elements/popup_link_onclick.html' => { + js_action => qq( '${fsurl}/misc/delete-log_email.html?logemailnum=' + logemailnum ), + actionlabel => 'Delete log email condition', + nofalse => 1, + } + ) + %> + return; + } + } +</script> + <%init> my $curuser = $FS::CurrentUser::CurrentUser; @@ -50,11 +64,7 @@ my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right([ 'View system logs', 'Configuration' ]); -my $add_condition_link = include('/elements/popup_link.html', - 'action' => $p.'edit/log_email.html?popup=1', - 'label' => 'Add log email condition', - 'actionlabel' => 'Add log email condition', -); +my $add_condition_link = qq( <a href="${fsurl}edit/log_email.html">Add log email condition</a> ); my $system_log_link = qq(<A HREF="${p}search/log.html">System Log</A>); @@ -68,24 +78,10 @@ my $query = { my $count_query = "SELECT COUNT(*) FROM log_email"; my $actions = sub { - my $log_email = shift; - my $logemailnum = $log_email->logemailnum; + my $logemailnum = shift->logemailnum; 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} - } -} -EOF - my $editlink = [ $p.'edit/log_email.html?logemailnum=', 'logemailnum' ]; </%init> diff --git a/httemplate/edit/log_email.html b/httemplate/edit/log_email.html index 19b415d4d..b79aba986 100644 --- a/httemplate/edit/log_email.html +++ b/httemplate/edit/log_email.html @@ -8,6 +8,12 @@ 'labels' => { '' => '(all)', map { $_ => $_ } @contexts }, 'curr_value' => scalar($cgi->param('context')), }, + { 'field' => 'context_height', + 'type' => 'checkbox', + 'postfix' => 'Only match most specific context', + 'value' => 1, + 'curr_value' => scalar($cgi->param('context_height')), + }, { 'field' => 'min_level', 'type' => 'select', 'options' => [ &FS::Log::levelnums ], @@ -24,6 +30,7 @@ ], 'labels' => { 'context' => 'Context', + 'context_height' => '', 'min_level' => 'Min. Level', 'to_addr' => 'To', 'msgnum' => 'Message', @@ -44,6 +51,10 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]); my $msgnum = $cgi->param('msgnum'); + +# XXX This attempt to set a default message isn't working, not sure why +# $msgnum gets set correctly, but isn't selected in the popup window...fix later + unless ($msgnum) { my ($msg_template) = qsearch('msg_template',{ msgname => 'System log' }); # doesn't seem worth having a config just for the default selected template diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 0478a8066..17e9966de 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -305,6 +305,11 @@ my %substitutions = ( '$payinfo' => 'Card/account# (masked)', '$payinfo_end' => 'Card/account last 4 digits', ], + 'system_log' => [ + '$loglevel' => 'Log event severity level', + '$logcontext' => 'Log event context', + '$logmessage' => 'Log event message text' + ], ); tie my %sections, 'Tie::IxHash', ( @@ -319,6 +324,7 @@ tie my %sections, 'Tie::IxHash', ( 'svc_domain'=> 'Domain service fields', 'svc_phone' => 'Phone service fields', 'svc_broadband' => 'Broadband service fields', +'system_log' => 'System log fields', ); my $widget = new HTML::Widgets::SelectLayers( diff --git a/httemplate/misc/delete-log_email.html b/httemplate/misc/delete-log_email.html index cc17b15a0..5a6bdc083 100644 --- a/httemplate/misc/delete-log_email.html +++ b/httemplate/misc/delete-log_email.html @@ -3,7 +3,7 @@ % } else { <H1>Log email condition deleted</H1> <SCRIPT> -window.top.location.reload(); +window.top.location = "<% $fsurl %>browse/log_email.html"; </SCRIPT> % } @@ -11,10 +11,12 @@ window.top.location.reload(); die "access denied" unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]); -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; + my $error; + my $logemailnum = $cgi->param('logemailnum'); + if ( $logemailnum && $logemailnum =~ /^\d+$/ ) { + if ( my $log_email = FS::log_email->by_key( $logemailnum ) ) { + $error = $log_email->delete; + } + } </%init> diff --git a/httemplate/search/cust_bill_pkg_discount.html b/httemplate/search/cust_bill_pkg_discount.html index 691a11e60..9ddc97da2 100644 --- a/httemplate/search/cust_bill_pkg_discount.html +++ b/httemplate/search/cust_bill_pkg_discount.html @@ -39,8 +39,8 @@ Parameters: # Standard discount, not a waived setup fee my $discount = qsearchs('discount',{ discountnum => $_[0]->discountnum - }); - return $discount->description; + }) || return 'Bad discountnum '.$_[0]->pkgdiscountnum; + return encode_entities $discount->description; } else { return 'Waive setup fee'; } @@ -53,7 +53,7 @@ Parameters: my $discount = qsearchs('discount',{ discountnum => $_[0]->discountnum }); - return $discount->classname; + return encode_entities $discount->classname; } else { return 'n/a'; } diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html index e1ce26dcb..9edd3ee5c 100755 --- a/httemplate/search/report_cust_main.html +++ b/httemplate/search/report_cust_main.html @@ -104,7 +104,9 @@ <DIV STYLE="display:inline-block; vertical-align:baseline"> <INPUT TYPE="radio" NAME="all_tags" VALUE="0" CHECKED> Any of these <BR> - <INPUT TYPE="radio" NAME="all_tags" VALUE="1"> All of these + <INPUT TYPE="radio" NAME="all_tags" VALUE="all"> All of these + <BR> + <INPUT TYPE="radio" NAME="all_tags" VALUE="none"> None of these </DIV> </TD> </TR> diff --git a/httemplate/view/prospect_main.html b/httemplate/view/prospect_main.html index 66abffcdd..ac56fa7a2 100644 --- a/httemplate/view/prospect_main.html +++ b/httemplate/view/prospect_main.html @@ -41,8 +41,8 @@ % foreach my $contact ( $prospect_main->contact ) { <TR> - <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD> - <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD> + <TD ALIGN="right"><% $contact->contact_classname |h %> Contact</TD> + <TD BGCOLOR="#FFFFFF"><% $contact->line |h %></TD> </TR> %} |
