add selfservice_access selection to part_svc, RT#15628
[freeside.git] / httemplate / browse / part_svc.cgi
index 4549e44..26d090a 100755 (executable)
@@ -51,6 +51,8 @@ function part_export_areyousure(href) {
 
     <TH CLASS="grid" BGCOLOR="#cccccc"><A HREF="<% do { $cgi->param('orderby', 'active'); $cgi->self_url; } %>"><FONT SIZE=-1>Customer<BR>Services</FONT></A></TH>
 
+    <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Customer<BR>Self-service</FONT></TH>
+
     <TH CLASS="grid" BGCOLOR="#cccccc">Export</TH>
 
     <TH CLASS="grid" BGCOLOR="#cccccc">Field</TH>
@@ -60,12 +62,14 @@ function part_export_areyousure(href) {
     <TH COLSPAN=2 CLASS="grid" BGCOLOR="#cccccc">Modifier</TH>
 
   </TR>
-
+% my $conf = FS::Conf->new;
 % 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
+%     push @dfields, 'usergroup' if $svcdb eq 'svc_acct' #double kludge
+%                                or ($svcdb eq 'svc_broadband' 
+%                                    and $conf->exists('svc_broadband-radius'));
 %     my @fields =
 %       grep { my $col = $part_svc->part_svc_column($_);
 %              my $def = FS::part_svc->svc_table_fields($svcdb)->{$_};
@@ -117,6 +121,14 @@ function part_export_areyousure(href) {
 
     </TD>
 
+% tie my %selfservice_access, 'Tie::IxHash', #false laziness w/edit/part_svc.cgi
+%   ''         => 'Yes',
+%   'hidden'   => 'Hidden',
+%   'readonly' => 'Read-only',
+% ;
+    <TD ROWSPAN=<% $rowspan %> CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="center">
+      <% $selfservice_access{$part_svc->selfservice_access} %></TD>
+
     <TD ROWSPAN=<% $rowspan %> CLASS="inv" BGCOLOR="<% $bgcolor %>">
       <TABLE CLASS="inv">
 %