[PATCH] more pkg_svc calling updates
Ricardo SIGNES
rjbs+freeside-devel at icgroup.com
Mon Jun 13 13:42:12 PDT 2005
More of the same: these patches make it safer to subclass FS::part_pkg's
pkg_svc method by eliminating qsearches on table pkg_svc.
--
rjbs
-------------- next part --------------
Index: browse/part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/part_pkg.cgi,v
retrieving revision 1.28
diff -u -r1.28 part_pkg.cgi
--- browse/part_pkg.cgi 9 Jun 2005 20:26:08 -0000 1.28
+++ browse/part_pkg.cgi 13 Jun 2005 20:40:20 -0000
@@ -144,9 +144,8 @@
<TD ROWSPAN=<%= $rowspan %>><%= $plandata %></TD>
<%
- my($pkg_svc);
my($n)="";
- foreach $pkg_svc ( @pkg_svc ) {
+ foreach my $pkg_svc ( @pkg_svc ) {
my($svcpart)=$pkg_svc->getfield('svcpart');
my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart });
print $n,qq!<TD><A HREF="${p}edit/part_svc.cgi?$svcpart">!,
Index: view/cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_pkg.cgi,v
retrieving revision 1.13
diff -u -r1.13 cust_pkg.cgi
--- view/cust_pkg.cgi 10 May 2003 06:45:45 -0000 1.13
+++ view/cust_pkg.cgi 13 Jun 2005 20:40:20 -0000
@@ -104,8 +104,9 @@
#list of services this pkgpart includes
my $pkg_svc;
- my %pkg_svc = ();
- foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
+ my %pkg_svc;
+ #foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
+ foreach $pkg_svc ( $cust_pkg->part_pkg->pkg_svc ) {
$pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
}
More information about the freeside-devel
mailing list