summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/part_pkg.pm26
2 files changed, 31 insertions, 2 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index f765fc721..b6fea5413 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2712,6 +2712,13 @@ worry that config_items is freeside-specific and icky.
'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;
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 81696fcfa..8cf7d0ca1 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -1236,9 +1236,31 @@ L<FS::type_pkgs>).
=cut
sub curuser_pkgs_sql {
- #my($class) = shift;
+ my $class = shift;
+
+ $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
+
+}
- my $agentnums = join(',', $FS::CurrentUser::CurrentUser->agentnums);
+sub _pkgs_sql {
+ my( $class, @agentnums ) = @_;
+ my $agentnums = join(',', @agentnums);
"
(