From e8a09e945986a32f9b7d0a5d546142ada91654ca Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 4 Dec 2007 18:20:58 +0000 Subject: change credit reasons from freetext to new reason/reason type system (#2777) --- httemplate/elements/tr-select-reason.html | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'httemplate/elements/tr-select-reason.html') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 71997c221..23f31ec51 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -53,18 +53,39 @@ +% my @types = qsearch( 'reason_type', { 'class' => $class } ); +% if (scalar(@types) < 1) { # we should never reach this + + +

No reason types. Go add some.

+ + +% }elsif (scalar(@types) == 1) { + + +

Reason Type

+ + +

<% $types[0]->type %> + + + + +% }else{ +

Reason Type

+% } @@ -94,6 +115,9 @@ if ($class eq 'C') { } elsif ($class eq 'S') { $access_right = 'Suspend customer package'; $add_access_right = 'Add on-the-fly suspend reason'; +} elsif ($class eq 'S') { + $access_right = 'Post credit'; + $add_access_right = 'Add on-the-fly credit reason'; } else { die "illegal class: $class"; } @@ -113,7 +137,8 @@ if ($init_reason == -1 || ref($init_reason) ) { } -my $extra_sql = "WHERE class = '$class' ORDER BY reason_type"; +my $extra_sql = "WHERE class = '$class' and (disabled = '' OR disabled is NULL) ". + "ORDER BY reason_type"; my $curuser = $FS::CurrentUser::CurrentUser; -- cgit v1.2.1