[freeside-commits] freeside/httemplate/edit/cust_main first_pkg.html, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Mon Oct 11 02:37:00 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/edit/cust_main
In directory wavetail.420.am:/tmp/cvs-serv25045/edit/cust_main
Modified Files:
first_pkg.html
Log Message:
add lock_agentnum and lock_pkgpart parameters to new customer page, RT#9782
Index: first_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main/first_pkg.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- first_pkg.html 12 Apr 2009 06:09:11 -0000 1.1
+++ first_pkg.html 11 Oct 2010 09:36:58 -0000 1.2
@@ -1,3 +1,9 @@
+% if ( $cgi->param('lock_pkgpart') =~ /^([\d, ]+)$/ ) {
+
+ <INPUT TYPE="hidden" NAME="lock_pkgpart" VALUE="<% $1 %>">
+
+% }
+%
% if ( @part_pkg ) {
<BR><BR>
@@ -28,6 +34,11 @@
# $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 +50,28 @@
}
#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' );
-my @part_pkg =
+ at part_pkg =
grep { $_->svcpart(\@first_svc)
&& ( $pkgpart->{ $_->pkgpart }
|| $agentnum eq 'all'
@@ -50,6 +80,6 @@
)
)
}
- qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case?
+ @part_pkg;
</%init>
More information about the freeside-commits
mailing list