1 <% include('/elements/header-popup.html', 'Bulk package change') %>
3 <% include('/elements/init_overlib.html') %>
5 <% include('/elements/progress-init.html',
7 [qw( old_pkgpart new_pkgpart keep_dates)],
8 'process/bulk-cust_pkg.cgi',
9 $p.'browse/part_pkg.cgi',
13 <SCRIPT TYPE="text/javascript">
14 function areyousure() {
15 if(confirm('Change these packages?')) {
20 <FORM NAME="OneTrueForm">
21 % #false laziness with bulk-cust_svc.html
22 % $cgi->param('pkgpart') =~ /^(\d+)$/
23 % or die "illegal pkgpart: ". $cgi->param('pkgpart');
25 % my $old_pkgpart = $1;
26 % my $src_part_pkg = qsearchs('part_pkg', { 'pkgpart' => $old_pkgpart } )
27 % or die "unknown pkgpart: $old_pkgpart";
31 <INPUT NAME="old_pkgpart" TYPE="hidden" VALUE="<% $old_pkgpart %>">
32 Change <B><% $src_part_pkg->pkg_comment %></B><BR>
34 to new package definition
35 <SELECT NAME="new_pkgpart">
36 % foreach my $dest_part_pkg ( qsearch('part_pkg', { 'disabled' => '' } ) ) {
37 % # XXX probably no way to prevent packages from violating agent restrictions
38 % # maybe something like what bulk-cust_svc does with changing services
39 % # under specific pkgparts?
41 <OPTION VALUE="<% $dest_part_pkg->pkgpart %>"><% $dest_part_pkg->pkgpart %>: <% $dest_part_pkg->pkg %>
47 <INPUT TYPE="checkbox" NAME="keep_dates" CHECKED> Preserve all billing dates
51 <INPUT TYPE="button" VALUE="Bulk change packages" onclick="areyousure()">
55 <% include('/elements/footer.html') %>
60 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');