summaryrefslogtreecommitdiffstats
path: root/extensions/ProdCompSearch/lib/WebService.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-04-17 06:56:18 +0200
committerByron Jones <glob@mozilla.com>2015-04-17 06:56:18 +0200
commit09de3de190a692dfbc2533ceee8f31648905b91a (patch)
treeb551eb1643bf54f614b3810b0c84bec90d0b411b /extensions/ProdCompSearch/lib/WebService.pm
parente9bfbbb9c07d902499bb0901a0cd67fe9279bf3b (diff)
downloadbugzilla-09de3de190a692dfbc2533ceee8f31648905b91a.tar.gz
bugzilla-09de3de190a692dfbc2533ceee8f31648905b91a.tar.xz
Bug 1154730: rewrite product/component searching to use jquery-ui instead of yui
Diffstat (limited to 'extensions/ProdCompSearch/lib/WebService.pm')
-rw-r--r--extensions/ProdCompSearch/lib/WebService.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/extensions/ProdCompSearch/lib/WebService.pm b/extensions/ProdCompSearch/lib/WebService.pm
index b9a03eb27..3bf0e1377 100644
--- a/extensions/ProdCompSearch/lib/WebService.pm
+++ b/extensions/ProdCompSearch/lib/WebService.pm
@@ -15,10 +15,31 @@ use base qw(Bugzilla::WebService);
use Bugzilla::Error;
use Bugzilla::Util qw(detaint_natural trick_taint trim);
+#############
+# Constants #
+#############
+
use constant PUBLIC_METHODS => qw(
prod_comp_search
);
+sub rest_resources {
+ return [
+ qr{^/prod_comp_search/(.*)$}, {
+ GET => {
+ method => 'prod_comp_search',
+ params => sub {
+ return { search => $_[0] }
+ }
+ }
+ }
+ ]
+}
+
+##################
+# Public Methods #
+##################
+
sub prod_comp_search {
my ($self, $params) = @_;
my $user = Bugzilla->user;
@@ -104,6 +125,10 @@ sub prod_comp_search {
return { products => $products };
}
+###################
+# Private Methods #
+###################
+
sub _build_terms {
my ($query, $product, $component) = @_;
my $dbh = Bugzilla->dbh();