%
%
%#code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm
%my %flag = (
% '' => '',
% 'D' => 'Default',
% 'F' => 'Fixed (unchangeable)',
% 'S' => 'Selectable choice',
% #'M' => 'Manual selection from inventory',
% 'M' => 'Manual selected from inventory',
% #'A' => 'Automatically fill in from inventory',
% 'A' => 'Automatically filled in from inventory',
% 'X' => 'Excluded',
%);
%
%my %search;
%if ( $cgi->param('showdisabled') ) {
% %search = ();
%} else {
% %search = ( 'disabled' => '' );
%}
%
%my @part_svc =
% sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') }
% qsearch('part_svc', \%search );
%my $total = scalar(@part_svc);
%
%my %num_active_cust_svc = map { $_->svcpart => $_->num_cust_svc } @part_svc;
%
%if ( $cgi->param('orderby') eq 'active' ) {
% @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=>
% $num_active_cust_svc{$a->svcpart} } @part_svc;
%} elsif ( $cgi->param('orderby') eq 'svc' ) {
% @part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc;
%}
%
%my %inventory_class = ();
%
%
<% include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %>
Service definitions are the templates for items you offer to your customers.
<% $total %> service definitions
<% $cgi->param('showdisabled')
? do { $cgi->param('showdisabled', 0);
'( hide disabled services )'; }
: do { $cgi->param('showdisabled', 1);
'( show disabled services )'; }
%>
% $cgi->param('showdisabled', ( 1 ^ $cgi->param('showdisabled') ) );
<% include('/elements/table-grid.html') %>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
# |
% if ( $cgi->param('showdisabled') ) {
Status |
% }
Service |
Table |
Customer Services |
Export |
Field |
Modifier |
% foreach my $part_svc ( @part_svc ) {
% my $svcdb = $part_svc->svcdb;
% my $svc_x = "FS::$svcdb"->new( { svcpart => $part_svc->svcpart } );
% my @dfields = $svc_x->fields;
% push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge
% my @fields =
% grep { $svc_x->pvf($_)
% or $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag }
% @dfields ;
% my $rowspan = scalar(@fields) || 1;
% my $url = "${p}edit/part_svc.cgi?". $part_svc->svcpart;
%
% if ( $bgcolor eq $bgcolor1 ) {
% $bgcolor = $bgcolor2;
% } else {
% $bgcolor = $bgcolor1;
% }
CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $part_svc->svcpart %>
|
% if ( $cgi->param('showdisabled') ) {
CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $part_svc->disabled
? 'Disabled'
: 'Enabled'
%>
|
% }
CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $part_svc->svc %> |
CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $svcdb %> |
CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $num_active_cust_svc{$part_svc->svcpart} %> <% $num_active_cust_svc{$part_svc->svcpart} ? FS::UI::Web::svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart ) : '' %>active
% if ( $num_active_cust_svc{$part_svc->svcpart} ) {
[ change ]
% }
|
CLASS="inv" BGCOLOR="<% $bgcolor %>">
|
% unless ( @fields ) {
% for ( 1..3 ) {
% }
% }
%
% my($n1)='';
% foreach my $field ( @fields ) {
% my $flag = $part_svc->part_svc_column($field)->columnflag;
%
<% $n1 %>
| <% $field %> |
<% $flag{$flag} %> |
% my $value = $part_svc->part_svc_column($field)->columnvalue;
% if ( $flag =~ /^[MA]$/ ) {
% $inventory_class{$value}
% ||= qsearchs('inventory_class', { 'classnum' => $value } );
%
<% $inventory_class{$value}
? $inventory_class{$value}->classname
: "WARNING: inventory_class.classnum $value not found" %>
% } else {
<% $value %>
% }
|
% $n1="
";
% }
%
% }