X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=b9474636dd8419192233a45b5e0c6141e4a010a2;hb=998b32d356338772484814a477d9efb159206b8d;hp=145874774895b55a6bf2f735ef8066a204bf7c81;hpb=c473d21fdd01251030b0a90d67d85d1bedfd76ba;p=freeside.git
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index 145874774..b9474636d 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -1,60 +1,293 @@
-
-<%= header('Service Part Listing', menubar( 'Main Menu' => $p) ) %>
+<% include('/elements/header.html', 'Service Definition Listing') %>
- Services are items you offer to your customers.
-
Service | -Table | -Field | -Modifier | -||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
> - <%= $hashref->{svcpart} %> | -> - <%= $hashref->{svc} %> | -> - <%= $hashref->{svcdb} %> | - -<% my($n1)=''; - my($row); - foreach $row ( @rows ) { - my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); -%> - <%= $n1 %><%= $row %> | -<% if ( $flag eq "D" ) { print "Default"; } - elsif ( $flag eq "F" ) { print "Fixed"; } - else { print "(Unknown!)"; } -%> - | <%= $part_svc->getfield($svcdb."__".$row) %> | -<% $n1="||||||||||
# | + +% if ( $cgi->param('showdisabled') ) { +Status | +% } + +Service | + +Table | + +Customer Services |
+
+ Customer Self-service |
+
+ Export | + +Field | + +Label | + +Modifier | + +Required | +|||||
Add new service | + +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 %>
+
+% # any alternate names of the service
+% my %msgcat = map { $_->locale => $_ } $part_svc->part_svc_msgcat;
+% my %labels = map { $_ => FS::Locales->description($_) } keys %msgcat;
+% my @locales = sort { $labels{$a} cmp $labels{$b} } keys %msgcat;
+% if ( @locales ) {
+ + +% foreach my $locale (@locales) { + <% $labels{$locale} %>: <% $msgcat{$locale}->get('svc') %> + +% } + +% } + |
+
+ CLASS="grid" BGCOLOR="<% $bgcolor %>"> + <% $svcdb %> | + + CLASS="grid" BGCOLOR="<% $bgcolor %>">
+% my $svcurl_active = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=0");
+% my $svcurl_cancel = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=1");
+ <% $num_cust_svc_active{$part_svc->svcpart} %> <% $num_cust_svc_active{$part_svc->svcpart} ? $svcurl_active : '' %>active<% $num_cust_svc_active{$part_svc->svcpart} ? '' : '' %>
+% if ( $num_cust_svc_cancelled{$part_svc->svcpart} ) {
+ <% $num_cust_svc_cancelled{$part_svc->svcpart} %> <% $svcurl_cancel %>cancelled +% } +% if ( $num_cust_svc{$part_svc->svcpart} ) { + [ change ] +% } + + |
+
+% tie my %selfservice_access, 'Tie::IxHash', #false laziness w/edit/part_svc.cgi
+% '' => 'Yes',
+% 'hidden' => 'Hidden',
+% 'readonly' => 'Read-only',
+% ;
+ CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="center"> + <% $selfservice_access{$part_svc->selfservice_access} %> | + + CLASS="inv" BGCOLOR="<% $bgcolor %>">
+
|
+
+% unless ( @fields ) {
+% for ( 1..5 ) {
+ +% } +% } +% +% my($n1)=''; +% foreach my $field ( sort @fields ) { +% +% #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 %> + | <% $field %> | +<% $label %> | +<% $flag{$flag} %> | +
+% my $value = &$formatter($part_svc->part_svc_column($field)->columnvalue);
+% if ( $flag =~ /^[MAH]$/ ) {
+% my $select_table = ($flag eq 'H') ? 'hardware_class' : 'inventory_class';
+% foreach my $classnum ( split(',', $value) ) {
+% $select_class{$classnum} =
+% qsearchs($select_table, { 'classnum' => $classnum } );
+%
+ <% $select_class{$classnum}
+ ? $select_class{$classnum}->classname
+ : "WARNING: $select_table.classnum $classnum not found" %> +% } +% } else { + + <% $value %> +% } + + |
+ +% if ($part_svc_column->required) { + Yes +% } + | +% $n1="||
+ <% emt('Password editing restricted.') %> + | +