-<% include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %>
+<% include('/elements/header.html', 'Service Definition Listing') %>
<SCRIPT>
function part_export_areyousure(href) {
% $cgi->param('showdisabled', ( 1 ^ $cgi->param('showdisabled') ) );
<% include('/elements/table-grid.html') %>
-% my $bgcolor1 = '#eeeeee';
+% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
<TH CLASS="grid" BGCOLOR="#cccccc">Field</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Label</TH>
+
<TH COLSPAN=2 CLASS="grid" BGCOLOR="#cccccc">Modifier</TH>
</TR>
% 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 }
+% grep { my $col = $part_svc->part_svc_column($_);
+% my $def = FS::part_svc->svc_table_fields($svcdb)->{$_};
+% $svc_x->pvf($_)
+% or $_ ne 'svcnum' && (
+% $col->columnflag || ( $col->columnlabel !~ /^\S*$/
+% && $col->columnlabel ne $def->{'label'}
+% )
+% )
+% }
% @dfields ;
% my $rowspan = scalar(@fields) || 1;
% my $url = "${p}edit/part_svc.cgi?". $part_svc->svcpart;
%
<TR>
- <TD><A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>"><% $part_export->exportnum %>: <% $part_export->exporttype %> to <% $part_export->machine %></A></TD>
+ <TD><A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>">
+<% $part_export->exportnum %>:
+% if ($part_export->exportname) {
+<B><% $part_export->exportname %></B> (
+% }
+<% $part_export->exporttype %> to <% $part_export->machine %>
+% if ($part_export->exportname) {
+)
+% }
+</A></TD>
</TR>
% }
</TD>
% unless ( @fields ) {
-% for ( 1..3 ) {
+% for ( 1..4 ) {
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>"</TD>
% }
% }
%
% my($n1)='';
% foreach my $field ( @fields ) {
-% my $formatter =
-% FS::part_svc->svc_table_fields($svcdb)->{$field}->{format}
-% || sub { shift };
-% my $flag = $part_svc->part_svc_column($field)->columnflag;
%
+% #a few lines of false laziness w/edit/part_svc.cgi
+% my $def = FS::part_svc->svc_table_fields($svcdb)->{$field};
+% my $formatter = $def->{format} || sub { shift };
+%
+% my $part_svc_column = $part_svc->part_svc_column($field);
+% my $label = $part_svc_column->columnlabel || $def->{'label'};
+% my $flag = $part_svc_column->columnflag;
<% $n1 %>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $field %></TD>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $label %></TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $flag{$flag} %></TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
% my $value = &$formatter($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" %>
+% if ( $flag =~ /^[MAH]$/ ) {
+% my $select_table = ($flag eq 'H') ? 'hardware_class' : 'inventory_class';
+% $select_class{$value} ||=
+% qsearchs($select_table, { 'classnum' => $value } );
+%
+ <% $select_class{$value}
+ ? $select_class{$value}->classname
+ : "WARNING: $select_table.classnum $value not found" %>
% } else {
<% $value %>
'M' => 'Manual selected from inventory',
#'A' => 'Automatically fill in from inventory',
'A' => 'Automatically filled in from inventory',
+ 'H' => 'Selected from hardware class',
'X' => 'Excluded',
);
@part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc;
}
-my %inventory_class = ();
+my %select_class = ();
</%init>