5 if ( $cgi->param('showdisabled') ) {
8 %search = ( 'disabled' => '' );
12 sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') }
13 qsearch('part_svc', \%search );
14 my $total = scalar(@part_svc);
17 <%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %>
20 function part_export_areyousure(href) {
21 if (confirm("Are you sure you want to delete this export?") == true)
22 window.location.href = href;
26 Services are items you offer to your customers.<BR><BR>
28 <FORM METHOD="POST" ACTION="<%= $p %>edit/part_svc.cgi">
29 <A HREF="<%= $p %>edit/part_svc.cgi"><I>Add a new service definition</I></A><% if ( @part_svc ) { %> or <SELECT NAME="clone"><OPTION></OPTION>
30 <% foreach my $part_svc ( @part_svc ) { %>
31 <OPTION VALUE="<%= $part_svc->svcpart %>"><%= $part_svc->svc %></OPTION>
33 </SELECT><INPUT TYPE="submit" VALUE="Clone existing service">
37 <%= $total %> services
38 <%= $cgi->param('showdisabled')
39 ? do { $cgi->param('showdisabled', 0);
40 '( <a href="'. $cgi->self_url. '">hide disabled services</a> )'; }
41 : do { $cgi->param('showdisabled', 1);
42 '( <a href="'. $cgi->self_url. '">show disabled services</a> )'; }
46 <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Service</TH>
50 <TH COLSPAN=2>Modifier</TH>
53 <% foreach my $part_svc ( @part_svc ) {
54 my $hashref = $part_svc->hashref;
55 my $svcdb = $hashref->{svcdb};
56 my @dfields = fields($svcdb);
57 push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge
59 grep { $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag }
62 my $rowspan = scalar(@fields) || 1;
63 my $url = "${p}edit/part_svc.cgi?$hashref->{svcpart}";
67 <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>">
68 <%= $hashref->{svcpart} %></A></TD>
69 <% unless ( $cgi->param('showdisabled') ) { %>
70 <TD ROWSPAN=<%= $rowspan %>>
71 <%= $hashref->{disabled} ? 'DISABLED' : '' %></TD>
73 <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>">
74 <%= $hashref->{svc} %></A></TD>
75 <TD ROWSPAN=<%= $rowspan %>>
76 <%= $hashref->{svcdb} %></TD>
77 <TD ROWSPAN=<%= $rowspan %>><%= itable() %>
80 map { qsearchs('part_export', { exportnum => $_->exportnum } ) } qsearch('export_svc', { svcpart => $part_svc->svcpart } ) ;
81 foreach my $part_export (
82 map { qsearchs('part_export', { exportnum => $_->exportnum } ) }
83 qsearch('export_svc', { svcpart => $part_svc->svcpart } )
87 <TD><A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>"><%= $part_export->exporttype %> to <%= $part_export->machine %></A></TD></TR>
92 foreach my $field ( @fields ) {
93 my $flag = $part_svc->part_svc_column($field)->columnflag;
95 <%= $n1 %><TD><%= $field %></TD><TD>
97 <% if ( $flag eq "D" ) { print "Default"; }
98 elsif ( $flag eq "F" ) { print "Fixed"; }
99 else { print "(Unknown!)"; }
101 </TD><TD><%= $part_svc->part_svc_column($field)->columnvalue%></TD>