-<% include('/elements/header.html', "$action Service Definition",
+<& /elements/header.html, "$action Service Definition",
menubar('View all service definitions' => "${p}browse/part_svc.cgi"),
#" onLoad=\"visualize()\""
- )
-%>
+&>
+
+<& /elements/init_overlib.html &>
+
+<BR>
<FORM NAME="dummy">
- Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %>
-<BR><BR>
-Service <INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"><BR>
-<INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<% $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>> Disable new orders<BR>
-<INPUT TYPE="checkbox" NAME="preserve" VALUE="Y"<% $hashref->{'preserve'} eq 'Y' ? ' CHECKED' : '' %>> Preserve this service on package cancellation<BR>
+<FONT CLASS="fsinnerbox-title">Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %></FONT>
+<TABLE CLASS="fsinnerbox">
+<TR>
+ <TD ALIGN="right">Service</TD>
+ <TD><INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"></TD>
+<TR>
+
+<& /elements/tr-select-part_svc_class.html, curr_value=>$hashref->{classnum} &>
+
+<TR>
+ <TD ALIGN="right">Self-service access</TD>
+ <TD>
+ <SELECT NAME="selfservice_access">
+% tie my %selfservice_access, 'Tie::IxHash', #false laziness w/browse/part_svc
+% '' => 'Yes',
+% 'hidden' => 'Hidden',
+% 'readonly' => 'Read-only',
+% ;
+% for (keys %selfservice_access) {
+ <OPTION VALUE="<% $_ %>"
+ <% $_ eq $hashref->{'selfservice_access'} ? 'SELECTED' : '' %>
+ ><% $selfservice_access{$_} %>
+% }
+ </SELECT>
+ </TD>
+</TR>
+
+
+<TR>
+ <TD ALIGN="right">Disable new orders</TD>
+ <TD><INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<% $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>></TD>
+</TR>
+
+<TR>
+ <TD ALIGN="right">Preserve this service on package cancellation</TD>
+ <TD><INPUT TYPE="checkbox" NAME="preserve" VALUE="Y"<% $hashref->{'preserve'} eq 'Y' ? ' CHECKED' : '' %>> </TD>
+</TR>
+
+</TABLE>
+
<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $hashref->{svcpart} %>">
<BR>
-
-% #YUCK. false laziness w/part_svc.pm. go away virtual fields, please
% my %vfields;
-% foreach my $svcdb ( FS::part_svc->svc_tables() ) {
-% eval "use FS::$svcdb;";
-% my $self = "FS::$svcdb"->new;
-% $vfields{$svcdb} = {};
-% foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them
-% my $pvf = $self->pvf($field);
-% $vfields{$svcdb}->{$field} = $pvf;
-% #warn "\$vfields{$svcdb}->{$field} = $pvf";
-% } #next $field
-% } #next $svcdb
-%
% #code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm
% # and generalize the subs
% # condition sub is tested to see whether to disable display of this choice
% ? ( $hashref->{svcdb} )
% : FS::part_svc->svc_tables();
%
+% my $help = '';
+% unless ( $hashref->{svcpart} ) {
+% $help = ' '.
+% include('/elements/popup_link.html',
+% 'action' => $p.'docs/part_svc-table.html',
+% 'label' => 'help',
+% 'actionlabel' => 'Service table help',
+% 'width' => 763,
+% #'height' => 400,
+% );
+% }
+%
% tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } grep dbdef->table($_), @dbs;
% my $widget = new HTML::Widgets::SelectLayers(
% #'selected_layer' => $p_svcdb,
% 'form_name' => 'dummy',
% #'form_action' => 'process/part_svc.cgi',
% 'form_action' => 'part_svc.cgi', #self
-% 'form_text' => [ qw( svc svcpart ) ],
-% 'form_checkbox' => [ 'disabled', 'preserve' ],
+% 'form_elements' => [qw( svc svcpart classnum selfservice_access
+% disabled preserve
+% )],
+% 'html_between' => $help,
% 'layer_callback' => sub {
% my $layer = shift;
%
% my $html = qq!<INPUT TYPE="hidden" NAME="svcdb" VALUE="$layer">!;
%
-% $html .= $svcdb_info;
+% #$html .= $svcdb_info;
%
% my $columns = 3;
% my $count = 0;
% && qsearchs( 'export_svc', {
% exportnum => $part_export->exportnum,
% svcpart => $clone || $part_svc->svcpart });
-% $html .= '>'.$part_export->exportnum. ': ';
-% $html .= $part_export->exportname . '<DIV ALIGN="right"><FONT SIZE=-1>'
-% if ( $part_export->exportname );
-% $html .= $part_export->exporttype. ' to '. $part_export->machine;
-% $html .= '</FONT></DIV>' if ( $part_export->exportname );
-% $html .= '</TD>';
+% $html .= '>'. $part_export->label_html. '</TD>';
% $count++;
% $html .= '</TR><TR>' unless $count % $columns;
% }
% )
% } fields($layer);
% }
-% push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge
+% push @fields, 'usergroup'
+% if $layer eq 'svc_acct'
+% or ( $layer eq 'svc_broadband' and
+% $conf->exists('svc_broadband-radius') ); # double kludge
+% # (but we do want to check the config, right?)
% $part_svc->svcpart($clone) if $clone; #haha, undone below
%
%
%
% $html .= include('/elements/select-table.html',
% 'element_name' => "${layer}__${field}_classnum",
+% 'id' => "${layer}__${field}_classnum",
% 'element_etc' => ( $is_inv
% ? $disabled
% : $nodisplay
% qq!<TEXTAREA NAME="${layer}__${field}">!. encode_entities($value).
% '</TEXTAREA>';
%
-% } elsif ( $def->{type} eq 'select-svc_pbx.html' ) {
-%
-% $html .= include('/elements/select-svc_pbx.html',
-% 'curr_value' => $value,
-% 'element_name' => "${layer}__${field}",
-% 'element_etc' => $disabled,
-% 'multiple' => ($flag eq 'S'),
-% );
+% } elsif ( $def->{type} =~ /select-(.*?).html/ ) {
%
-% } elsif ( $def->{type} eq 'select-lnp_status.html' ) {
-%
-% $html .= include('/elements/select-lnp_status.html',
+% $html .= include("/elements/".$def->{type},
% 'curr_value' => $value,
% 'element_name' => "${layer}__${field}",
% 'element_etc' => $disabled,
-% 'multiple' => ($flag eq 'S'),
+% 'multiple' => ($def->{multiple} ||
+% $flag eq 'S'),
+% # allow the table def to force 'multiple'
% );
%
-% } elsif ( $def->{type} eq 'radius_usergroup_selector' ) {
-%
-% #XXX disable the RADIUS usergroup selector? ugh it sure does need
-% #an overhaul, people have dum group problems because of it
-%
-% $html .= FS::svc_acct::radius_usergroup_selector(
-% [ split(',', $value) ], "${layer}__${field}" );
-%
% } elsif ( $def->{type} eq 'communigate_pro-accessmodes' ) {
%
% $html .= include('/elements/communigate_pro-accessmodes.html',
% $html .= include('/elements/select-hardware_class.html',
% 'curr_value' => $value,
% 'element_name' => "${layer}__${field}_classnum",
+% 'id' => "${layer}__${field}_classnum",
% 'element_etc' => $flag ne 'H' && $nodisplay,
% 'empty_label' => 'Select hardware class',
% );
%
% $html .= include('/elements/progress-init.html',
% $layer, #form name
-% [ qw(svc svcpart disabled preserve exportnum),
+% [ qw(svc svcpart classnum selfservice_access
+% disabled preserve
+% exportnum),
% @fields ],
% 'process/part_svc.cgi',
% $p.'browse/part_svc.cgi',
%
% },
% );
-%
-%
+<BR>
Table <% $widget->html %>
<% include('/elements/footer.html') %>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $conf = FS::Conf->new;
my $part_svc;
my $clone = '';
if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone
#'svc_cert' => { map { $_=>1 } qw( ) },
);
-my $svcdb_info = '
-<TABLE>
- <TR>
- <TH ALIGN="left">Generic</TH>
- <TH ALIGN="left">Access</TH>
- <TH ALIGN="left">Telephony</TH>
-<!-- <TH>Hosting</TH>
- <TH>Colocation</TH>
--->
- </TR>
- <TR>
- <TD VALIGN="top">
- <UL STYLE="margin:0">
- <LI><B>svc_acct</B>: Accounts - anything with a username (mailbox, shell, RADIUS, etc.)
- <LI><B>svc_hardware</B>: Equipment supplied to customers
- <LI><B>svc_external</B>: Externally-tracked service
- </UL>
- </TD>
- <TD VALIGN="top">
- <UL STYLE="margin:0">
- <LI><B>svc_dsl</B>: DSL
- <LI><B>svc_broadband</B>: Wireless broadband
- <LI><B>svc_dish</B>: DISH Network
- </UL>
- </TD>
- <TD VALIGN="top">
- <UL STYLE="margin:0">
- <LI><B>svc_phone</B>: Customer phone number
- <LI><B>svc_pbx</B>: Customer PBX
- </UL>
- </TD>
- </TR>
-</TABLE>
-<BR>
-<TABLE>
- <TR>
- <TH ALIGN="left">Hosting</TH>
- <TH ALIGN="left">Colocation</TH>
- </TR>
- <TD VALIGN="top">
- <UL STYLE="margin:0">
- <LI><B>svc_domain</B>: Domain
- <LI><B>svc_cert</B>: Certificate
- <LI><B>svc_forward</B>: Mail forwarding
- <LI><B>svc_mailinglist</B>: Mailing list
- <LI><B>svc_www</B>: Virtual domain website
- </UL>
- </TD>
- <TD VALIGN="top">
- <UL STYLE="margin:0">
- <LI><B>svc_port</B>: Customer router/switch port
- </UL>
- </TD>
- </TR>
-<TABLE>
-<!-- <LI>svc_charge - One-time charges (Partially unimplemented)
- <LI>svc_wo - Work orders (Partially unimplemented)
--->
-';
-
my $mod_info = '
For the selected table, you can give fields default or fixed (unchangable)
values, or select an inventory class to manually or automatically fill in