Add "search by journal title" quick search option user/dbs/journal_title_search
authorDan Scott <dscott@laurentian.ca>
Tue, 21 Feb 2012 16:38:29 +0000 (11:38 -0500)
committerDan Scott <dscott@laurentian.ca>
Tue, 21 Feb 2012 16:38:29 +0000 (11:38 -0500)
Limits the search field to "title" with a bib level of "s" to force a
periodical search.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/opac/skin/default/js/search_bar.js
Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml

index fc327f6..370edbd 100644 (file)
@@ -17,6 +17,7 @@
 <!ENTITY common.enter.accesskey "E">
 <!ENTITY common.enter_barcode.description 'Enter the item barcode:'>
 <!ENTITY common.title "Title">
+<!ENTITY common.journal.title "Journal Title">
 <!ENTITY common.author "Author">
 <!ENTITY common.subject "Subject">
 <!ENTITY common.series "Series">
index 5015818..c4df646 100644 (file)
@@ -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'))) ) {
index 588030c..d1927b9 100644 (file)
@@ -1,6 +1,7 @@
 <select id='search_type_selector'>
        <option value='keyword' selected='selected'>&common.keyword;</option>
        <option value='title'>&common.title;</option>
+       <option value='title' id='jtitle'>&common.journal.title;</option>
        <option value='author'>&common.author;</option>
        <option value='subject'>&common.subject;</option>
        <option value='series'>&common.series;</option>