From 7a1edaf0e681b1076b7500e5bcacca6e3629e043 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 23 Apr 2018 17:09:01 -0700 Subject: bulk customer package edit from multiple source package definitions, RT#79885 --- httemplate/edit/bulk-cust_pkg.html | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'httemplate/edit/bulk-cust_pkg.html') diff --git a/httemplate/edit/bulk-cust_pkg.html b/httemplate/edit/bulk-cust_pkg.html index 2ff38ca53..8a082f47f 100644 --- a/httemplate/edit/bulk-cust_pkg.html +++ b/httemplate/edit/bulk-cust_pkg.html @@ -19,24 +19,18 @@ function areyousure() { }
-% #false laziness with bulk-cust_svc.html -% $cgi->param('pkgpart') =~ /^(\d+)$/ -% or die "illegal pkgpart: ". $cgi->param('pkgpart'); -% -% my $old_pkgpart = $1; -% my $src_part_pkg = qsearchs('part_pkg', { 'pkgpart' => $old_pkgpart } ) -% or die "unknown pkgpart: $old_pkgpart"; -% +% foreach my $src_part_pkg (@src_part_pkg) { + + Change <% $src_part_pkg->pkg_comment |h %>
+% } - -Change <% $src_part_pkg->pkg_comment %>
- +
to new package definition @@ -57,4 +51,18 @@ to new package definition die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my @src_part_pkg = (); +foreach my $pkgpart ( $cgi->multi_param('pkgpart') ) { + + $pkgpart =~ /^(\d+)$/ + or die "illegal pkgpart: $pkgpart"; + + my $old_pkgpart = $1; + my $src_part_pkg = qsearchs('part_pkg', { 'pkgpart' => $old_pkgpart } ) + or die "unknown pkgpart: $old_pkgpart"; + + push @src_part_pkg, $src_part_pkg; + +} + -- cgit v1.2.1