Add "search by journal title" quick search option
authorDan Scott <dan@coffeecode.net>
Mon, 30 May 2011 18:18:22 +0000 (14:18 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 31 Jul 2012 17:24:43 +0000 (13:24 -0400)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/web/opac/skin/default/js/search_bar.js
Open-ILS/web/opac/skin/default/xml/common/stypes_selector.xml

index be0239e..b86d6df 100644 (file)
@@ -68,6 +68,11 @@ function searchBarInit() {
        setSelector(_ts,        getStype());
        setSelector(_fs,        getItemType());
 
+       /* If searching for journal title, set it to journal title */
+       if (getStype() == 'title' && getBibLevel() == 's') {
+               dojo.byId('jtitle').selected = true;
+       }
+
        depthSelInit();
 
 
@@ -114,6 +119,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>