[freeside-commits] freeside/FS/FS part_pkg.pm,1.99,1.100

Ivan,,, ivan at wavetail.420.am
Sat Dec 19 11:10:46 PST 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv30039

Modified Files:
	part_pkg.pm 
Log Message:
fix package order to really display only those pacakges available

Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- part_pkg.pm	4 Nov 2009 01:00:33 -0000	1.99
+++ part_pkg.pm	19 Dec 2009 19:10:44 -0000	1.100
@@ -1378,15 +1378,16 @@
 
   "
     (
-      agentnum IS NOT NULL
-      OR
-      0 < ( SELECT COUNT(*)
-              FROM type_pkgs
-                LEFT JOIN agent_type USING ( typenum )
-                LEFT JOIN agent AS typeagent USING ( typenum )
-              WHERE type_pkgs.pkgpart = part_pkg.pkgpart
-                AND typeagent.agentnum IN ($agentnums)
-          )
+      ( agentnum IS NOT NULL AND agentnum IN ($agentnums) )
+      OR ( agentnum IS NULL
+           AND EXISTS ( SELECT 1
+                          FROM type_pkgs
+                            LEFT JOIN agent_type USING ( typenum )
+                            LEFT JOIN agent AS typeagent USING ( typenum )
+                          WHERE type_pkgs.pkgpart = part_pkg.pkgpart
+                            AND typeagent.agentnum IN ($agentnums)
+                      )
+         )
     )
   ";
 



More information about the freeside-commits mailing list