X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Flog_email.html;h=a81e98b099c321594fb7225855b1dd2bd3e62286;hp=bbce7c7081e76c2b398744f687a3ebbde1506bc1;hb=c49cfd25a8f92c7a2f44b51d72506a21f6b8d09f;hpb=974fceaaca8e1404750a60a4daafb568b1be5159 diff --git a/httemplate/edit/log_email.html b/httemplate/edit/log_email.html index bbce7c708..a81e98b09 100644 --- a/httemplate/edit/log_email.html +++ b/httemplate/edit/log_email.html @@ -8,21 +8,29 @@ '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' => [ 0..7 ], - 'labels' => { map {$_ => $FS::Log::LEVELS[$_]} 0..7 }, + 'options' => [ &FS::Log::levelnums ], + 'labels' => { &FS::Log::levelmap }, 'curr_value' => scalar($cgi->param('min_level')), }, 'to_addr', { 'field' => 'msgnum', 'type' => 'select-msg_template', 'empty_label' => 'Select template', + 'value' => $msgnum, 'required' => 1, }, ], 'labels' => { 'context' => 'Context', + 'context_height' => '', 'min_level' => 'Min. Level', 'to_addr' => 'To', 'msgnum' => 'Message', @@ -33,7 +41,7 @@ ) %> <%once> -my @contexts = sort FS::log_context->contexts; +my @contexts = FS::log_context->contexts; <%init> @@ -42,4 +50,18 @@ my %opts = @_; 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 + # if they've deleted the system-generated one, just default to empty "Select template" + if ($msg_template) { + $msgnum = $msg_template->msgnum; + } +} +