From 9890629b3d5a1cb8d93979f32d09edf5951d4f7f Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 25 Sep 2014 11:25:46 -0400 Subject: [PATCH] POC: allow search of authority from within "manage authorities" Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm | 15 +++++++++------ Open-ILS/src/templates/cat/authority/list.tt2 | 4 ++++ Open-ILS/web/js/ui/default/cat/authority/list.js | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm index 873b956498..a09b2dc793 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm @@ -36,7 +36,7 @@ my $U = 'OpenILS::Application::AppUtils'; # set the bootstrap config when this module is loaded my ($bootstrap, $supercat, $actor, $parser, $search, $xslt, $cn_browse_xslt, %browse_types, %qualifier_map); -my $authority_axis_re = qr/^authority\.(\w+)(\.refs)?$/; +my $authority_axis_re = qr/^authority\.(\w+)(\.refs)?(\.search)?$/; my %extra_header_action_per_type = ( marc21 => [ @@ -1640,10 +1640,13 @@ sub string_browse { my $tree; if ($axis =~ /^authority/) { - my ($realaxis, $refs) = ($axis =~ $authority_axis_re); + my ($realaxis, $refs, $search_flag) = ($axis =~ $authority_axis_re); - my $method = "open-ils.supercat.authority.browse_center.by_axis"; - $method .= ".refs" if $refs; + my $how = 'browse_center'; + $how = 'search_rank' if $search_flag; + + my $method = "open-ils.supercat.authority.$how.by_axis"; + $method .= ".refs" if $refs or $search_flag; $tree = $supercat->request( $method, @@ -1723,7 +1726,7 @@ sub string_startwith { my $tree; if ($axis =~ /^authority/) { - my ($realaxis, $refs) = ($axis =~ $authority_axis_re); + my ($realaxis, $refs, $search_flag) = ($axis =~ $authority_axis_re); my $method = "open-ils.supercat.authority.browse_top.by_axis"; $method .= ".refs" if $refs; @@ -2216,7 +2219,7 @@ sub return_auth_response { if ($qualifier eq "id") { $recs = [ int($term) ]; } else { - my ($realaxis, $refs) = ($qualifier =~ $authority_axis_re); + my ($realaxis, $refs, $search_flag) = ($qualifier =~ $authority_axis_re); my $method = "open-ils.supercat.authority.browse_top.by_axis"; $method .= ".refs" if $refs; diff --git a/Open-ILS/src/templates/cat/authority/list.tt2 b/Open-ILS/src/templates/cat/authority/list.tt2 index 9b8aa96fd2..36204a1fe9 100644 --- a/Open-ILS/src/templates/cat/authority/list.tt2 +++ b/Open-ILS/src/templates/cat/authority/list.tt2 @@ -32,6 +32,10 @@ trim="true" /> + + + + diff --git a/Open-ILS/web/js/ui/default/cat/authority/list.js b/Open-ILS/web/js/ui/default/cat/authority/list.js index 4c42b90b4d..01bdb656c5 100644 --- a/Open-ILS/web/js/ui/default/cat/authority/list.js +++ b/Open-ILS/web/js/ui/default/cat/authority/list.js @@ -377,6 +377,7 @@ function displayRecords(parms) { var url = '/opac/extras/browse/marcxml/authority.' + dijit.byId('authAxis').attr('value') + + dijit.byId('searchOrNot').attr('checked') ? '.search' : '' // + '/' + dijit.byId('authOU').attr('value') + '/1' // replace with preceding line if OUs gain some meaning + '/' + encodeURIComponent(dijit.byId('authTerm').attr('value')) -- 2.11.0