From c7434b2af4d63c792bfb242878d05e202c597a79 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 21 Feb 2012 11:38:29 -0500 Subject: [PATCH] Add "search by journal title" quick search option Limits the search field to "title" with a bib level of "s" to force a periodical search. Signed-off-by: Dan Scott --- Open-ILS/web/opac/locale/en-US/lang.dtd | 1 + Open-ILS/web/opac/skin/default/js/search_bar.js | 10 ++++++++++ Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml | 1 + 3 files changed, 12 insertions(+) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index fc327f6f21..370edbd108 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -17,6 +17,7 @@ + diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js index 5015818058..c4df6465ba 100644 --- a/Open-ILS/web/opac/skin/default/js/search_bar.js +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -68,6 +68,11 @@ function searchBarInit() { setSelector(_ts, getStype()); setSelector(_fs, getForm()); + /* If searching for journal title, set it to journal title */ + if (getStype() == 'title' && getBibLevel() == 's') { + dojo.byId('jtitle').selected = true; + } + depthSelInit(); @@ -112,6 +117,11 @@ function searchBarSubmit(isFilterSort) { args[PARAM_DEPTH] = d; args[PARAM_FORM] = _fs.options[_fs.selectedIndex].value; + /* Set the bib level to 's' for serials if the magic "Journal title" has ben chosen */ + if (_ts.options[_ts.selectedIndex].id == 'jtitle') { + args[PARAM_BIBLEVEL] = 's'; + } + if($('opac.result.limit2avail')) { args[PARAM_AVAIL] = ($('opac.result.limit2avail').checked) ? 1 : ''; if( (val = getSelectorVal($('opac.result.sort'))) ) { diff --git a/Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml b/Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml index 588030c63a..d1927b9f5a 100644 --- a/Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml +++ b/Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml @@ -1,6 +1,7 @@