summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-reason.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-11-07 12:32:06 -0800
committerIvan Kohler <ivan@freeside.biz>2015-11-07 12:32:06 -0800
commitb3c70d709fd646ef355d49a4e87151c99ee413e9 (patch)
tree93dc04bf9042e8e007aa1d8f61d5746b390c18b4 /httemplate/elements/tr-select-reason.html
parent80f265ee8f2603f0e3f7f5ad6c6c0cf704f98cb8 (diff)
parent59285fa7c07ac86914f3998f2635caf067c07506 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements/tr-select-reason.html')
-rwxr-xr-xhttemplate/elements/tr-select-reason.html19
1 files changed, 3 insertions, 16 deletions
diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html
index 37a34baba..93949ba8c 100755
--- a/httemplate/elements/tr-select-reason.html
+++ b/httemplate/elements/tr-select-reason.html
@@ -6,8 +6,7 @@ Example:
#required
'field' => 'reasonnum',
- 'reason_class' => 'C', # currently 'C', 'R', 'F', 'S' or 'X'
- # for cancel, credit, refund, suspend or void credit
+ 'reason_class' => 'C', # one of those in %FS::reason_type::class_name
#recommended
'cgi' => $cgi, #easiest way for things to be properly "sticky" on errors
@@ -189,20 +188,8 @@ if ( $opt{'cgi'} ) {
my $id = $opt{'id'} || $name;
$id =~ s/\./_/g; # for edit/part_event
-my $add_access_right;
-if ($class eq 'C') {
- $add_access_right = 'Add on-the-fly cancel reason';
-} elsif ($class eq 'S') {
- $add_access_right = 'Add on-the-fly suspend reason';
-} elsif ($class eq 'R') {
- $add_access_right = 'Add on-the-fly credit reason';
-} elsif ($class eq 'F') {
- $add_access_right = 'Add on-the-fly refund reason';
-} elsif ($class eq 'X') {
- $add_access_right = 'Add on-the-fly void reason';
-} else {
- die "illegal class: $class";
-}
+my $add_access_right = $FS::reason_type::class_add_access_right{$class}
+ or die "unknown class: $class";
my @reasons = qsearch({
'table' => 'reason',