ab419215ec544b4ff9fa5c5305364f7b63a576f7
[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 keep_dates)],
8               'process/bulk-cust_pkg.cgi',
9               $p.'browse/part_pkg.cgi',
10            )
11 %>
12
13 <SCRIPT TYPE="text/javascript">
14 function areyousure() {
15   if(confirm('Change these packages?')) {
16     process();
17   }
18 }
19 </SCRIPT>
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');
24 %
25 %  my $old_pkgpart = $1;
26 %  my $src_part_pkg = qsearchs('part_pkg', { 'pkgpart' => $old_pkgpart } )
27 %    or die "unknown pkgpart: $old_pkgpart";
28 %
29
30
31 <INPUT NAME="old_pkgpart" TYPE="hidden" VALUE="<% $old_pkgpart %>">
32 Change <B><% $src_part_pkg->pkg_comment %></B><BR>
33
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?
40
41   <OPTION VALUE="<% $dest_part_pkg->pkgpart %>"><% $dest_part_pkg->pkgpart %>: <% $dest_part_pkg->pkg %>
42 % } 
43
44 </SELECT>
45 <BR>
46 <BR>
47 <INPUT TYPE="checkbox" NAME="keep_dates" CHECKED> Preserve all billing dates
48 <BR>
49 <BR>
50
51 <INPUT TYPE="button" VALUE="Bulk change packages" onclick="areyousure()">
52
53 </FORM>
54
55 <% include('/elements/footer.html') %>
56
57 <%init>
58
59 die "access denied"
60   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
61
62 </%init>