X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_svc.cgi;h=007c246295f42394fd67b2b7593624b02410703d;hb=e710e07e4451b7c615fb477799dc64bf3490248c;hp=8ca0196497f58d1c9d84da016e2ec5d571dde495;hpb=9f2280fbce022ab9bcfc46fe94483730b0aeb0f8;p=freeside.git diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 8ca019649..007c24629 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,34 +1,59 @@ -<% 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 &> + +
- Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> -

-Service
-{disabled} eq 'Y' ? ' CHECKED' : '' %>> Disable new orders
-{'preserve'} eq 'Y' ? ' CHECKED' : '' %>> Preserve this service on package cancellation
+Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> + + + + + + +<& /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' : '' %>> 
+
- -% #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 @@ -71,6 +96,18 @@ Service
% ? ( $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, @@ -79,14 +116,16 @@ Service
% '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!!; % -% $html .= $svcdb_info; +% #$html .= $svcdb_info; % % my $columns = 3; % my $count = 0; @@ -105,12 +144,7 @@ Service
% && qsearchs( 'export_svc', { % exportnum => $part_export->exportnum, % svcpart => $clone || $part_svc->svcpart }); -% $html .= '>'.$part_export->exportnum. ': '; -% $html .= $part_export->exportname . '
' -% if ( $part_export->exportname ); -% $html .= $part_export->exporttype. ' to '. $part_export->machine; -% $html .= '
' if ( $part_export->exportname ); -% $html .= ''; +% $html .= '>'. $part_export->label_html. ''; % $count++; % $html .= '' unless $count % $columns; % } @@ -139,7 +173,11 @@ Service
% ) % } 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 % % @@ -257,6 +295,7 @@ Service
% % $html .= include('/elements/select-table.html', % 'element_name' => "${layer}__${field}_classnum", +% 'id' => "${layer}__${field}_classnum", % 'element_etc' => ( $is_inv % ? $disabled % : $nodisplay @@ -320,7 +359,9 @@ Service
% '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 'communigate_pro-accessmodes' ) { @@ -337,6 +378,7 @@ Service
% $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', % ); @@ -370,7 +412,9 @@ Service
% % $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', @@ -388,9 +432,8 @@ Service
% % }, % ); -% -% +
Table <% $widget->html %> <% include('/elements/footer.html') %> @@ -400,6 +443,7 @@ Table <% $widget->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 @@ -437,66 +481,6 @@ my %communigate_fields = ( #'svc_cert' => { map { $_=>1 } qw( ) }, ); -my $svcdb_info = ' - - - - - - - - - - - - -
GenericAccessTelephony
-
    -
  • svc_acct: Accounts - anything with a username (mailbox, shell, RADIUS, etc.) -
  • svc_hardware: Equipment supplied to customers -
  • svc_external: Externally-tracked service -
-
-
    -
  • svc_dsl: DSL -
  • svc_broadband: Wireless broadband -
  • svc_dish: DISH Network -
-
-
    -
  • svc_phone: Customer phone number -
  • svc_pbx: Customer PBX -
-
-
- - - - - - - - -
HostingColocation
-
    -
  • svc_domain: Domain -
  • svc_cert: Certificate -
  • svc_forward: Mail forwarding -
  • svc_mailinglist: Mailing list -
  • svc_www: Virtual domain website -
-
-
    -
  • svc_port: Customer router/switch port -
-
- -'; - 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