X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fcust_main%2Ffirst_pkg.html;h=ad118b4a95eba2ab7c993c7ccce0a193851eb64b;hb=9b4209f91ad9e3c4cef7deebfb0180f6faf1d0dc;hp=0de33c02585d09af2fbd179cb94c9b230603f456;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git
diff --git a/httemplate/edit/cust_main/first_pkg.html b/httemplate/edit/cust_main/first_pkg.html
index 0de33c025..ad118b4a9 100644
--- a/httemplate/edit/cust_main/first_pkg.html
+++ b/httemplate/edit/cust_main/first_pkg.html
@@ -1,17 +1,22 @@
+% if ( $cgi->param('lock_pkgpart') =~ /^([\d, ]+)$/ ) {
+
+
+
+% }
+%
% if ( @part_pkg ) {
-
- First package
+
+ <% mt('First package') |h %>
<% ntable("#cccccc") %>
- <% include('first_pkg/select-part_pkg.html',
- 'part_pkg' => \@part_pkg,
+ <& first_pkg/select-part_pkg.html,
+ 'part_pkg' => \@part_pkg,
+ 'first_svc' => \@first_svc,
%opt,
- # map { $_ => $opt{$_} } qw( pkgpart_svcpart saved_domsvc )
- )
- %>
+ &>
% }
<%init>
@@ -28,6 +33,11 @@ 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';
@@ -39,9 +49,28 @@ if ( scalar(@agents) == 1 ) {
}
#eslaf
-my @first_svc = ( 'svc_acct', 'svc_phone' );
+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', 'svc_dsl' );
-my @part_pkg =
+@part_pkg =
grep { $_->svcpart(\@first_svc)
&& ( $pkgpart->{ $_->pkgpart }
|| $agentnum eq 'all'
@@ -50,6 +79,6 @@ my @part_pkg =
)
)
}
- qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case?
+ @part_pkg;
%init>
|