X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Felements%2Ftr-select-reason.html;h=93949ba8c41309f6dc1c3f5d10a469a3dad5868b;hb=43ad727e39a22e746ed6c9a9b53ab2d936581c1b;hp=125874694c409e386e56451a75b582fefdc40285;hpb=92b6628c08e4478e48b6f250320a3e3e93262ec2;p=freeside.git diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 125874694..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 credit 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',