1 <% include('/elements/header.html', 'Bulk customer service change') %>
3 <% include('/elements/init_overlib.html') %>
5 <% include('/elements/progress-init.html',
7 [qw( old_svcpart new_svcpart pkgpart noexport )],
8 'process/bulk-cust_svc.cgi',
9 $p.'browse/part_svc.cgi',
13 <FORM NAME="OneTrueForm">
15 % $cgi->param('svcpart') =~ /^(\d+)$/
16 % or die "illegal svcpart: ". $cgi->param('svcpart');
18 % my $old_svcpart = $1;
19 % my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } )
20 % or die "unknown svcpart: $old_svcpart";
24 <INPUT NAME="old_svcpart" TYPE="hidden" VALUE="<% $old_svcpart %>">
26 <B><% $src_part_svc->svcpart %>: <% $src_part_svc->svc %></B> services
30 <SELECT NAME="pkgpart">
31 % my $num_cust_svc = $src_part_svc->num_cust_svc;
32 % if ( $num_cust_svc > 1 ) {
34 <OPTION VALUE="">all <% $num_cust_svc %> <% $src_part_svc->svc %> services
37 <OPTION VALUE="">the <% $num_cust_svc %> <% $src_part_svc->svc %> service
40 % my $num_unlinked = $src_part_svc->num_cust_svc(0);
41 % if ( $num_unlinked ) {
44 <OPTION VALUE="0">the <% $num_unlinked %> unlinked <% $src_part_svc->svc %> services
46 % foreach my $schwartz (
48 % map { [ $_, $src_part_svc->num_cust_svc($_->pkgpart) ] }
49 % qsearch('part_pkg', {} )
51 % my( $part_pkg, $num_cust_svc ) = @$schwartz;
54 <OPTION VALUE="<% $part_pkg->pkgpart %>">the <% $num_cust_svc %>
55 <% $src_part_svc->svc %> service<% $num_cust_svc > 1 ? 's in' : ' in a' %>
56 <% $part_pkg->pkg %> package<% $num_cust_svc > 1 ? 's' : '' %>
62 to new service definition
63 <SELECT NAME="new_svcpart">
64 % foreach my $dest_part_svc (
65 % grep { $_->svcpart != $old_svcpart
66 % && $_->svcdb eq $src_part_svc->svcdb
68 % qsearch('part_svc', { 'disabled' => '' } )
72 <OPTION VALUE="<% $dest_part_svc->svcpart %>"><% $dest_part_svc->svcpart %>: <% $dest_part_svc->svc %>
79 <INPUT TYPE="checkbox" NAME="noexport" VALUE="Y"> Disable exports (provisioning) of changes
82 <SCRIPT TYPE="text/javascript">
83 var confirm_change = '<P ALIGN="center"><B>Bulk customer service change - Are you sure?</B><BR><P ALIGN="CENTER"><INPUT TYPE="button" VALUE="Yes, make changes" onClick="process();"> <INPUT TYPE="BUTTON" VALUE="Cancel" onClick="cClick()">';
86 <INPUT TYPE="button" VALUE="Bulk change customer services" onClick="overlib(confirm_change, CAPTION, 'Confirm bulk customer service change', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 128, TEXTSIZE, 3, BGCOLOR, '#ff0000', CGCOLOR, '#ff0000' );">
90 <% include('/elements/footer.html') %>
95 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');