[freeside-commits] freeside/FS/FS Conf.pm, 1.271, 1.272 part_pkg.pm, 1.88, 1.89

Ivan,,, ivan at wavetail.420.am
Sat Mar 28 15:59:38 PDT 2009


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

Modified Files:
	Conf.pm part_pkg.pm 
Log Message:
package selector, split by package class, RT#5077

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -d -r1.271 -r1.272
--- Conf.pm	17 Mar 2009 20:13:26 -0000	1.271
+++ Conf.pm	28 Mar 2009 22:59:36 -0000	1.272
@@ -2712,6 +2712,13 @@
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'disable-cust-pkg_class',
+    'section'     => 'UI',
+    'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
+    'type'        => 'checkbox',
+  },
+
 );
 
 1;

Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- part_pkg.pm	24 Mar 2009 02:36:31 -0000	1.88
+++ part_pkg.pm	28 Mar 2009 22:59:36 -0000	1.89
@@ -1236,9 +1236,31 @@
 =cut
 
 sub curuser_pkgs_sql {
-  #my($class) = shift;
+  my $class = shift;
 
-  my $agentnums = join(',', $FS::CurrentUser::CurrentUser->agentnums);
+  $class->_pkgs_sql( $FS::CurrentUser::CurrentUser->agentnums );
+
+}
+
+=item agent_pkgs_sql AGENT | AGENTNUM, ...
+
+Returns an SQL fragment for searching for packages the provided agent or agents
+can use, either via part_pkg.agentnum directly, or via agent type (see
+L<FS::type_pkgs>).
+
+=cut
+
+sub agent_pkgs_sql {
+  my $class = shift;  #i'm a class method, not a sub (the question is... why??)
+  my @agentnums = map { ref($_) ? $_->agentnum : $_ } @_;
+
+  $class->_pkgs_sql(@agentnums); #is this why
+
+}
+
+sub _pkgs_sql {
+  my( $class, @agentnums ) = @_;
+  my $agentnums = join(',', @agentnums);
 
   "
     (



More information about the freeside-commits mailing list