1 <% include('/elements/header.html', 'Bulk customer service change') %>
3 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
4 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
5 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
7 <% include('/elements/progress-init.html',
9 [qw( old_svcpart new_svcpart pkgpart )],
10 'process/bulk-cust_svc.cgi',
11 $p.'browse/part_svc.cgi',
15 <FORM NAME="OneTrueForm">
17 % $cgi->param('svcpart') =~ /^(\d+)$/
18 % or die "illegal svcpart: ". $cgi->param('svcpart');
20 % my $old_svcpart = $1;
21 % my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } )
22 % or die "unknown svcpart: $old_svcpart";
26 <INPUT NAME="old_svcpart" TYPE="hidden" VALUE="<% $old_svcpart %>">
28 <B><% $src_part_svc->svcpart %>: <% $src_part_svc->svc %></B> services
32 <SELECT NAME="pkgpart">
33 % my $num_cust_svc = $src_part_svc->num_cust_svc;
34 % if ( $num_cust_svc > 1 ) {
36 <OPTION VALUE="">all <% $num_cust_svc %> <% $src_part_svc->svc %> services
39 <OPTION VALUE="">the <% $num_cust_svc %> <% $src_part_svc->svc %> service
42 % my $num_unlinked = $src_part_svc->num_cust_svc(0);
43 % if ( $num_unlinked ) {
46 <OPTION VALUE="0">the <% $num_unlinked %> unlinked <% $src_part_svc->svc %> services
48 % foreach my $schwartz (
50 % map { [ $_, $src_part_svc->num_cust_svc($_->pkgpart) ] }
51 % qsearch('part_pkg', {} )
53 % my( $part_pkg, $num_cust_svc ) = @$schwartz;
56 <OPTION VALUE="<% $part_pkg->pkgpart %>">the <% $num_cust_svc %>
57 <% $src_part_svc->svc %> service<% $num_cust_svc > 1 ? 's in' : ' in a' %>
58 <% $part_pkg->pkg %> package<% $num_cust_svc > 1 ? 's' : '' %>
64 to new service definition
65 <SELECT NAME="new_svcpart">
66 % foreach my $dest_part_svc (
67 % grep { $_->svcpart != $old_svcpart
68 % && $_->svcdb eq $src_part_svc->svcdb
70 % qsearch('part_svc', { 'disabled' => '' } )
74 <OPTION VALUE="<% $dest_part_svc->svcpart %>"><% $dest_part_svc->svcpart %>: <% $dest_part_svc->svc %>
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');