diff options
author | ivan <ivan> | 2005-11-16 13:14:47 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-11-16 13:14:47 +0000 |
commit | d6edb7f296db6befc54396c001e64e67a79fe40b (patch) | |
tree | 72b8a3426361908897901c94aa4728e05483302b /httemplate/edit | |
parent | 8b23ffdf168ec698194834f37c3d84eeede01d4a (diff) |
bulk svcpart change
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/bulk-cust_svc.html | 97 | ||||
-rw-r--r-- | httemplate/edit/process/bulk-cust_svc.cgi | 3 |
2 files changed, 100 insertions, 0 deletions
diff --git a/httemplate/edit/bulk-cust_svc.html b/httemplate/edit/bulk-cust_svc.html new file mode 100644 index 000000000..332b5b67c --- /dev/null +++ b/httemplate/edit/bulk-cust_svc.html @@ -0,0 +1,97 @@ +<%= header( 'Bulk customer service change', + menubar( + 'Main Menu' => $p, + ), + ) +%> + +<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT> +<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT> +<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT> + +<%= include('/elements/progress-init.html', + 'OneTrueForm', + [qw( old_svcpart new_svcpart pkgpart )], + 'process/bulk-cust_svc.cgi', + $p.'browse/part_svc.cgi', + ) +%> + +<FORM NAME="OneTrueForm"> + +<% + $cgi->param('svcpart') =~ /^(\d+)$/ + or die "illegal svcpart: ". $cgi->param('svcpart'); + + my $old_svcpart = $1; + my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } ) + or die "unknown svcpart: $old_svcpart"; +%> + +<INPUT NAME="old_svcpart" TYPE="hidden" VALUE="<%= $old_svcpart %>"> +Change <!-- customer +<B><%= $src_part_svc->svcpart %>: <%= $src_part_svc->svc %></B> services +<BR> +--> + +<SELECT NAME="pkgpart"> + +<% my $num_cust_svc = $src_part_svc->num_cust_svc; %> +<% if ( $num_cust_svc > 1 ) { %> + <OPTION VALUE="">all <%= $num_cust_svc %> <%= $src_part_svc->svc %> services +<% } else { %> + <OPTION VALUE="">the <%= $num_cust_svc %> <%= $src_part_svc->svc %> service +<% } %> + +<% + my $num_unlinked = $src_part_svc->num_cust_svc(0); + if ( $num_unlinked ) { +%> + <OPTION VALUE="0">the <%= $num_unlinked %> unlinked <%= $src_part_svc->svc %> services + +<% } %> + +<% foreach my $schwartz ( + grep { $_->[1] } + map { [ $_, $src_part_svc->num_cust_svc($_->pkgpart) ] } + qsearch('part_pkg', {} ) + ) { + my( $part_pkg, $num_cust_svc ) = @$schwartz; +%> + <OPTION VALUE="<%= $part_pkg->pkgpart %>">the <%= $num_cust_svc %> + <%= $src_part_svc->svc %> service<%= $num_cust_svc > 1 ? 's in' : ' in a' %> + <%= $part_pkg->pkg %> package<%= $num_cust_svc > 1 ? 's' : '' %> +<% } %> +</SELECT> +<BR> + +to new service definition +<SELECT NAME="new_svcpart"> +<% foreach my $dest_part_svc ( + grep { $_->svcpart != $old_svcpart + && $_->svcdb eq $src_part_svc->svcdb + } + qsearch('part_svc', { 'disabled' => '' } ) + ) { +%> + <OPTION VALUE="<%= $dest_part_svc->svcpart %>"><%= $dest_part_svc->svcpart %>: <%= $dest_part_svc->svc %> + +<% } %> +</SELECT> +<BR> + +<BR> + +<SCRIPT TYPE="text/javascript"> +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()">'; +</SCRIPT> + +<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' );"> + +</FORM> + +</BODY> +</HTML> + + + diff --git a/httemplate/edit/process/bulk-cust_svc.cgi b/httemplate/edit/process/bulk-cust_svc.cgi new file mode 100644 index 000000000..dd9d1dbd2 --- /dev/null +++ b/httemplate/edit/process/bulk-cust_svc.cgi @@ -0,0 +1,3 @@ +<% + my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process_bulk_cust_svc', $cgi; +%><%= $server->process %> |