diff options
Diffstat (limited to 'httemplate/edit/cust_main/first_pkg.html')
-rw-r--r-- | httemplate/edit/cust_main/first_pkg.html | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/httemplate/edit/cust_main/first_pkg.html b/httemplate/edit/cust_main/first_pkg.html index 7c131ea..0de33c0 100644 --- a/httemplate/edit/cust_main/first_pkg.html +++ b/httemplate/edit/cust_main/first_pkg.html @@ -1,9 +1,3 @@ -% if ( $cgi->param('lock_pkgpart') =~ /^([\d, ]+)$/ ) { - - <INPUT TYPE="hidden" NAME="lock_pkgpart" VALUE="<% $1 %>"> - -% } -% % if ( @part_pkg ) { <BR><BR> @@ -34,11 +28,6 @@ if ( scalar(@agents) == 1 ) { # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART $pkgpart = $agents[0]->pkgpart_hashref; $agentnum = $agents[0]->agentnum; -} elsif ( $cgi->param('lock_agentnum') =~ /^(\d+)$/ - && $FS::CurrentUser::CurrentUser->agentnum($1) ) { - $agentnum = $1; - my $agent = (grep { $_->agentnum == $agentnum } @agents)[0]; - $pkgpart = $agent->pkgpart_hashref; } else { #can't know (agent not chosen), so, allow all $agentnum = 'all'; @@ -50,28 +39,9 @@ if ( scalar(@agents) == 1 ) { } #eslaf -my @part_pkg = (); -if ( $cgi->param('lock_pkgpart') =~ /^([\d, ]+)$/ ) { - - my $lock_pkgpart = $1; - - @part_pkg = qsearch({ - 'table' => 'part_pkg', - 'hashref' => { 'disabled' => '' }, - 'extra_sql' => "AND pkgpart IN ($lock_pkgpart)", - 'order_by' => 'ORDER BY pkg', # case? - }); - -} else { - - @part_pkg = - qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case? - -} - my @first_svc = ( 'svc_acct', 'svc_phone' ); -@part_pkg = +my @part_pkg = grep { $_->svcpart(\@first_svc) && ( $pkgpart->{ $_->pkgpart } || $agentnum eq 'all' @@ -80,6 +50,6 @@ my @first_svc = ( 'svc_acct', 'svc_phone' ); ) ) } - @part_pkg; + qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case? </%init> |