<& /elements/header.html, "$action Service Definition" &> <& /elements/menubar.html, 'View all service definitions' => "${p}browse/part_svc.cgi" #" onLoad=\"visualize()\"" &> <& /elements/init_overlib.html &>

Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> <& /elements/tr-input-locale-text.html, 'object' => $part_svc, 'cgi' => $cgi, 'field' => 'svc', 'label' => 'Service', 'curr_value' => $hashref->{svc}, &> %# %# %# %# <& /elements/tr-select-part_svc_class.html, curr_value=>$hashref->{classnum} &>
Service
Self-service access
Disable new orders {disabled} eq 'Y' ? ' CHECKED' : '' %>>
Preserve this service on package cancellation {'preserve'} eq 'Y' ? ' CHECKED' : '' %>> 

Table <% $widget->html %> <& /elements/footer.html &> <%init> 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 #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query"; $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } ) or die "unknown svcpart: $1"; $clone = $part_svc->svcpart; $part_svc->svcpart(''); } elsif ( $cgi->keywords ) { #edit my($query) = $cgi->keywords; $query =~ /^(\d+)$/ or die "malformed query: $query"; $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } ) or die "unknown svcpart: $1"; } else { #adding $part_svc = new FS::part_svc {}; } my $action = $part_svc->svcpart ? 'Edit' : 'Add'; my $hashref = $part_svc->hashref; # my $p_svcdb = $part_svc->svcdb || 'svc_acct'; my @dbs = $hashref->{svcdb} ? ( $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' => 960, 'height' => 400, ); } tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } grep dbdef->table($_), @dbs; my $widget = new HTML::Widgets::SelectLayers( #'selected_layer' => $p_svcdb, 'selected_layer' => $hashref->{svcdb} || 'svc_acct', 'options' => \%svcdb, 'form_name' => 'SvcEditMain', #'form_action' => 'process/part_svc.cgi', 'form_action' => 'part_svc.cgi', #self # 'form_elements' => [qw( svc svcpart classnum selfservice_access # disabled preserve # )], 'html_between' => $help, 'layer_callback' => sub { include('elements/part_svc_column.html', shift, 'part_svc' => $part_svc, 'clone' => $clone ) } );