summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/browse')
-rw-r--r--httemplate/browse/deploy_zone.html2
-rw-r--r--httemplate/browse/log_email.html92
-rwxr-xr-xhttemplate/browse/part_pkg.cgi8
3 files changed, 101 insertions, 1 deletions
diff --git a/httemplate/browse/deploy_zone.html b/httemplate/browse/deploy_zone.html
index 02ebb8b8c..a1bd57f15 100644
--- a/httemplate/browse/deploy_zone.html
+++ b/httemplate/browse/deploy_zone.html
@@ -57,7 +57,7 @@
'(cir_speed_down, cir_speed_up)',
],
links => [ $link_fixed, $link_fixed, ],
- align => 'cllllrr',
+ align => 'cllllrrr',
nohtmlheader => 1,
disable_maxselect => 1,
disable_total => 1,
diff --git a/httemplate/browse/log_email.html b/httemplate/browse/log_email.html
new file mode 100644
index 000000000..0f64dd454
--- /dev/null
+++ b/httemplate/browse/log_email.html
@@ -0,0 +1,92 @@
+<% include('/elements/init_overlib.html') %>
+<% include('/browse/elements/browse.html',
+ 'title' => 'Log email condition configuration',
+ 'name_singular' => 'condition',
+ 'html_init' => '<P STYLE="margin-top: 0">'
+ . $add_condition_link
+ . ' | '
+ . $system_log_link
+ . '</P>'
+ . '<SCRIPT>'
+ . $areyousure
+ . '</SCRIPT>',
+ 'query' => $query,
+ 'count_query' => $count_query,
+ 'header' => [ '#',
+ 'Context',
+ 'Min. Level',
+ 'Template',
+ 'To',
+ '',
+ ],
+ 'fields' => [ 'logemailnum',
+ sub { $_[0]->context || '(all)' },
+ sub { $FS::Log::LEVELS[$_[0]->min_level] },
+ 'msgname',
+ 'to_addr',
+ $actions,
+ ],
+ 'sort_fields' => [ 'logemailnum',
+ 'context',
+ 'min_level',
+ 'msgname',
+ 'to_addr',
+ '',
+ ],
+ 'links' => [ $editlink,
+ $editlink,
+ $editlink,
+ $editlink,
+ $editlink,
+ '',
+ ],
+
+ ) %>
+
+<%init>
+
+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 $system_log_link = qq(<A HREF="${p}search/log.html">System Log</A>);
+
+my $query = {
+ 'table' => 'log_email',
+ 'select' => '*',
+ 'addl_from' => 'LEFT JOIN msg_template USING (msgnum)',
+ 'hashref' => { },
+};
+
+my $count_query = "SELECT COUNT(*) FROM log_email";
+
+my $actions = sub {
+ my $log_email = shift;
+ my $logemailnum = $log_email->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/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index 07f104e55..1e8b51030 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -88,6 +88,14 @@ if ( $cgi->param('missing_recur_fee') ) {
)";
}
+if ( $cgi->param('ratenum') =~ /^(\d+)$/ ) {
+ push @where, "EXISTS( SELECT 1 FROM part_pkg_option
+ WHERE optionname LIKE '%ratenum'
+ AND optionvalue = '$1'
+ AND part_pkg_option.pkgpart = part_pkg.pkgpart
+ )";
+}
+
if ( $cgi->param('family') =~ /^(\d+)$/ ) {
$family_pkgpart = $1;
push @where, "family_pkgpart = $1";