X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Freason_type.html;h=09f451c9f01f517833fa292236ab80cc20209440;hp=a8ccbdc85058f1238e9da2443bf9d31f1e32c29d;hb=15777da47bab33e8f0021e6dd9aa6b434fa9be30;hpb=655b4043942c7d361224d283accb4c2a02ef7359 diff --git a/httemplate/browse/reason_type.html b/httemplate/browse/reason_type.html index a8ccbdc85..09f451c9f 100644 --- a/httemplate/browse/reason_type.html +++ b/httemplate/browse/reason_type.html @@ -1,44 +1,3 @@ -% -%$cgi->param('class') =~ /^(\w)$/ or die "illegal class"; -%my $class=$1; -% -%my %classmap = ( 'C' => 'cancel', -% 'S' => 'suspend', -% ); -% -%my $classname = $classmap{$class}; -% -%my $html_init = ucfirst($classname) . -% " reason types allow groups of $classname reasons for reporting purposes." . -% qq!

Add a ! . -% $classname . " reason type

"; -% -%my $reasons_sub = sub { -% my $reason_type = shift; -% -% [ map { -% [ -% { -% 'data' => $_->reason, -% 'align' => 'left', -% 'link' => $p. "edit/reason.html?class=$class&reasonnum=". -% $_->reasonnum, -% }, -% ]; -% } -% $reason_type->enabled_reasons, -% -% ]; -% -%}; -% -%my $where_clause = "WHERE class='$class'"; -%my $count_query = 'SELECT COUNT(*) FROM reason_type '; -%$count_query .= $where_clause; -% -%my $link = [ $p.'edit/reason_type.html?class='.$class.'&typenum=', 'typenum' ]; -% -% <% include( 'elements/browse.html', 'title' => ucfirst($classname) . " Reason Types", 'menubar' => [ ucfirst($classname) . " reasons" => @@ -66,3 +25,48 @@ ], ) %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +$cgi->param('class') =~ /^(\w)$/ or die "illegal class"; +my $class=$1; + +my %classmap = ( 'C' => 'cancel', + 'S' => 'suspend', + ); + +my $classname = $classmap{$class}; + +my $html_init = ucfirst($classname) . + " reason types allow groups of $classname reasons for reporting purposes." . + qq!

Add a ! . + $classname . " reason type

"; + +my $reasons_sub = sub { + my $reason_type = shift; + + [ map { + [ + { + 'data' => $_->reason, + 'align' => 'left', + 'link' => $p. "edit/reason.html?class=$class&reasonnum=". + $_->reasonnum, + }, + ]; + } + $reason_type->enabled_reasons, + + ]; + +}; + +my $where_clause = "WHERE class='$class'"; +my $count_query = 'SELECT COUNT(*) FROM reason_type '; +$count_query .= $where_clause; + +my $link = [ $p.'edit/reason_type.html?class='.$class.'&typenum=', 'typenum' ]; + +