RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / edit / bulk-cust_pkg.html
1 <% include('/elements/header-popup.html', 'Bulk package change') %>
2
3 <% include('/elements/init_overlib.html') %>
4
5 <% include('/elements/progress-init.html',
6               'OneTrueForm',
7               [qw( old_pkgpart new_pkgpart )],
8               'process/bulk-cust_pkg.cgi',
9               $p.'browse/part_pkg.cgi',
10            )
11 %>
12
13 <SCRIPT TYPE="text/javascript">
14 function areyousure() {
15   var warning = 'Change these packages?';
16   if(confirm(warning)) {
17     process();
18   }
19 }
20 </SCRIPT>
21 <FORM NAME="OneTrueForm">
22
23 % foreach my $src_part_pkg (@src_part_pkg) {
24   <INPUT NAME="old_pkgpart" TYPE="hidden" VALUE="<% $src_part_pkg->pkgpart %>">
25   Change <B><% $src_part_pkg->pkg_comment |h %></B><BR>
26 % }
27
28 <BR>
29 to new package definition
30 <SELECT NAME="new_pkgpart">
31 % foreach my $dest_part_pkg ( qsearch('part_pkg', { 'disabled' => '' } ) ) {
32
33   <OPTION VALUE="<% $dest_part_pkg->pkgpart %>"><% $dest_part_pkg->pkgpart %>: <% $dest_part_pkg->pkg |h %>
34 % } 
35
36 </SELECT>
37 <BR>
38 <BR>
39 %#<INPUT TYPE="checkbox" NAME="keep_dates" CHECKED> Preserve all billing dates <I>(strongly recommended)</I>
40 %#<BR>
41 %#<BR>
42
43 <INPUT TYPE="button" VALUE="Bulk change packages" onclick="areyousure()">
44
45 </FORM>
46
47 <% include('/elements/footer.html') %>
48
49 <%init>
50
51 die "access denied"
52   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
53
54 my @src_part_pkg = ();
55 foreach my $pkgpart ( $cgi->multi_param('pkgpart') ) {
56
57   $pkgpart =~ /^(\d+)$/
58     or die "illegal pkgpart: $pkgpart";
59
60   my $old_pkgpart = $1;
61   my $src_part_pkg = qsearchs('part_pkg', { 'pkgpart' => $old_pkgpart } )
62     or die "unknown pkgpart: $old_pkgpart";
63
64   push @src_part_pkg, $src_part_pkg;
65
66 }
67
68 </%init>