% % $cgi->param('class') =~ /^(\w)$/ or die "illegal class"; % my $class=$1; % % my $classname = $FS::reason_type::class_name{$class}; % % my (@types) = qsearch( 'reason_type', { 'class' => $class } ); % % unless (scalar(@types)) { % print $cgi->redirect( "reason_type.html?class=$class" ); % } <% include( 'elements/edit.html', 'name' => ucfirst($classname) . ' Reason', 'table' => 'reason', 'labels' => { 'reasonnum' => ucfirst($classname) . ' Reason', 'reason_type' => ucfirst($classname) . ' Reason type', 'reason' => ucfirst($classname) . ' Reason', 'disabled' => 'Disabled', 'class' => '', }, 'fields' => [ { 'field' => 'reason_type', 'type' => 'select', #XXX use something more sane than a hashref #then fix tr-select.html 'value' => { 'vcolumn' => 'typenum', 'ccolumn' => 'type', 'values' => \@types, }, }, 'reason', { 'field' => 'class', 'type' => 'hidden', 'value' => $class, }, { 'field' => 'disabled', 'type' => 'checkbox', 'value' => 'Y' }, ], 'viewall_url' => $p . "browse/reason.html?class=$class", ) %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration');