X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pkg.cgi;h=dd1ed335fb61756ef98cf84813cf58cc83217e02;hb=e0a26680d75fc2000bde195eba7946805a3aaa28;hp=7a0432c5d677c77edd96742a4c5859039832d119;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi index 7a0432c5d..dd1ed335f 100755 --- a/httemplate/edit/cust_pkg.cgi +++ b/httemplate/edit/cust_pkg.cgi @@ -1,52 +1,14 @@ -% -% -%my %pkg = (); -%my %comment = (); -%my %all_pkg = (); -%my %all_comment = (); -%#foreach (qsearch('part_pkg', { 'disabled' => '' })) { -%# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); -%# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -%#} -%foreach (qsearch('part_pkg', {} )) { -% $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); -% $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -% next if $_->disabled; -% $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); -% $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -%} -% -%my($custnum, %remove_pkg); -%if ( $cgi->param('error') ) { -% $custnum = $cgi->param('custnum'); -% %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg'); -%} else { -% my($query) = $cgi->keywords; -% $query =~ /^(\d+)$/; -% $custnum = $1; -% %remove_pkg = (); -%} -% -%my $p1 = popurl(1); -% -% <% include('/elements/header.html', "Add/Edit Packages", '') %> -% if ( $cgi->param('error') ) { - - Error: <% $cgi->param('error') %> -% } +<% include('/elements/error.html') %>
- + -% + %#current packages %my @cust_pkg = qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ); -% %if (@cust_pkg) { -% - Current packages - select to remove (services are moved to a new package below) @@ -150,3 +112,39 @@ Order new packages <% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages'); + +my %pkg = (); +my %comment = (); +my %all_pkg = (); +my %all_comment = (); +#foreach (qsearch('part_pkg', { 'disabled' => '' })) { +# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); +# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); +#} +foreach (qsearch('part_pkg', {} )) { + $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); + $all_comment{ $_ -> getfield('pkgpart') } = $_->custom_comment; + next if $_->disabled; + $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); + $comment{ $_ -> getfield('pkgpart') } = $_->custom_comment; +} + +my($custnum, %remove_pkg); +if ( $cgi->param('error') ) { + $custnum = $cgi->param('custnum'); + %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg'); +} else { + my($query) = $cgi->keywords; + $query =~ /^(\d+)$/; + $custnum = $1; + %remove_pkg = (); +} + +my $p1 = popurl(1); + +