adding bib_level filter to the advanced search
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 4 Apr 2008 15:30:43 +0000 (15:30 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 4 Apr 2008 15:30:43 +0000 (15:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9229 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/skin/default/js/adv_global.js
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml

index f9ca20b..d28f5cc 100644 (file)
@@ -1543,6 +1543,9 @@ __PACKAGE__->register_method (
        api_name => 'open-ils.search.biblio.item_type_map.retrieve.all');
 __PACKAGE__->register_method (
        method => 'bib_extras',
+       api_name => 'open-ils.search.biblio.bib_level_map.retrieve.all');
+__PACKAGE__->register_method (
+       method => 'bib_extras',
        api_name => 'open-ils.search.biblio.audience_map.retrieve.all');
 
 sub bib_extras {
@@ -1559,6 +1562,9 @@ sub bib_extras {
        return $e->retrieve_all_config_item_type_map()
                if( $self->api_name =~ /item_type_map/ );
 
+       return $e->retrieve_all_config_bib_level_map()
+               if( $self->api_name =~ /bib_level_map/ );
+
        return $e->retrieve_all_config_audience_map()
                if( $self->api_name =~ /audience_map/ );
 
index 1249948..d8925ef 100644 (file)
@@ -29,6 +29,7 @@ var PARAM_CN                  = "cn";
 var PARAM_LITFORM              = 'lf';
 var PARAM_ITEMFORM     = 'if';
 var PARAM_ITEMTYPE     = 'it';
+var PARAM_BIBLEVEL     = 'bl';
 var PARAM_AUDIENCE     = 'a';
 var PARAM_SEARCHES     = 'ss';
 var PARAM_LANGUAGE     = 'la';
@@ -63,6 +64,7 @@ var CALLNUM;
 var LITFORM;
 var ITEMFORM;
 var ITEMTYPE;
+var BIBLEVEL;
 var AUDIENCE;
 var SEARCHES;
 var LANGUAGE;
@@ -338,6 +340,7 @@ var FETCH_COPY_STAT_CATS            = 'open-ils.circ:open-ils.circ.asset.stat_cat_entries.
 var FETCH_LIT_FORMS                            = 'open-ils.search:open-ils.search.biblio.lit_form_map.retrieve.all';
 var FETCH_ITEM_FORMS                           = 'open-ils.search:open-ils.search.biblio.item_form_map.retrieve.all';
 var FETCH_ITEM_TYPES                           = 'open-ils.search:open-ils.search.biblio.item_type_map.retrieve.all';
+var FETCH_BIB_LEVELS                           = 'open-ils.search:open-ils.search.biblio.bib_level_map.retrieve.all';
 var FETCH_AUDIENCES                            = 'open-ils.search:open-ils.search.biblio.audience_map.retrieve.all';
 var FETCH_HOLD_STATUS                  = 'open-ils.circ:open-ils.circ.hold.status.retrieve';
 var FETCH_NON_CAT_CIRCS                        = 'open-ils.circ:open-ils.circ.open_non_cataloged_circulation.user';
index fd50eba..26870be 100644 (file)
@@ -148,6 +148,7 @@ function initParams() {
        LITFORM = cgi.param(PARAM_LITFORM);
        ITEMFORM        = cgi.param(PARAM_ITEMFORM);
        ITEMTYPE        = cgi.param(PARAM_ITEMTYPE);
+       BIBLEVEL        = cgi.param(PARAM_BIBLEVEL);
        AUDIENCE        = cgi.param(PARAM_AUDIENCE);
        SEARCHES = cgi.param(PARAM_SEARCHES);
        LANGUAGE        = cgi.param(PARAM_LANGUAGE);
@@ -187,6 +188,7 @@ function clearSearchParams() {
        LITFORM     = null;
        ITEMFORM    = null;
        ITEMTYPE    = null;
+       BIBLEVEL    = null;
        AUDIENCE    = null;
        SEARCHES    = null;
        LANGUAGE    = null;
@@ -234,6 +236,7 @@ function getCallnumber() { return CALLNUM; }
 function getLitForm() { return LITFORM; }
 function getItemForm() { return ITEMFORM; }
 function getItemType() { return ITEMTYPE; }
+function getBibLevel() { return BIBLEVEL; }
 function getAudience() { return AUDIENCE; }
 function getSearches() { return SEARCHES; }
 function getLanguage() { return LANGUAGE; }
@@ -371,6 +374,8 @@ function  buildOPACLink(args, slim, ssl) {
                string += _appendParam(ITEMFORM,        PARAM_ITEMFORM, args, getItemForm, string);
        if(getItemType())
                string += _appendParam(ITEMTYPE,        PARAM_ITEMTYPE, args, getItemType, string);
+       if(getBibLevel())
+               string += _appendParam(BIBLEVEL,        PARAM_BIBLEVEL, args, getBibLevel, string);
        if(getLitForm())
                string += _appendParam(LITFORM, PARAM_LITFORM, args, getLitForm, string);
        if(getAudience())
index 1dd7dd9..f844450 100644 (file)
@@ -15,7 +15,9 @@ function advgInit() {
                FETCH_LIT_FORMS, 
                FETCH_ITEM_FORMS, 
                FETCH_ITEM_TYPES, 
-               FETCH_AUDIENCES ];
+               FETCH_AUDIENCES,
+               FETCH_BIB_LEVELS 
+    ];
 
        for( var x in extras ) {
 
@@ -25,6 +27,7 @@ function advgInit() {
                if(x == 1) req.request.sel = $('adv_global_item_form');
                if(x == 2) req.request.sel = $('adv_global_item_type');
                if(x == 3) req.request.sel = $('adv_global_audience');
+               if(x == 4) req.request.sel = $('adv_global_bib_level');
 
                req.callback(advDrawBibExtras);
                req.send();
@@ -137,6 +140,7 @@ function advSubmitGlobal() {
        var itemforms = advGetVisSelectorVals('adv_global_item_form');
        var itemtypes = advGetVisSelectorVals('adv_global_item_type');
        var audiences = advGetVisSelectorVals('adv_global_audience');
+       var biblevels = advGetVisSelectorVals('adv_global_bib_level');
        var languages = getSelectedList($('adv_global_lang')) + '';     
     var limit2avail = $('opac.result.limit2avail').checked ? 1 : ''
 
@@ -149,6 +153,7 @@ function advSubmitGlobal() {
        args.page = MRESULT;
        args[PARAM_ITEMFORM] = itemforms;
        args[PARAM_ITEMTYPE] = itemtypes;
+       args[PARAM_BIBLEVEL] = biblevels;
        args[PARAM_LITFORM]     = litforms;
        args[PARAM_AUDIENCE]    = audiences;
        args[PARAM_LANGUAGE] = languages;
index 33a8372..3f757b0 100644 (file)
@@ -80,6 +80,7 @@ function resultCollectSearchIds( type, method, handler ) {
        if(getAudience()) args.audience  = getAudience().split(/,/);
        if(getLitForm()) args.lit_form  = getLitForm().split(/,/);
        if(getLanguage()) args.language = getLanguage().split(/,/);
+       if(getBibLevel()) args.bib_level        = getBibLevel().split(/,/);
 
        _debug('Search args: ' + js2JSON(args));
        _debug('Raw query: ' + getTerm());
index f09d760..021c6bf 100644 (file)
                                                        </select>
                                                </td>
                                        </tr>
+
+                                       <tr>
+                                               <td align='right'>
+                                                       <span>Bib Level</span>
+                                               </td>
+                                               <td align='left'>
+                                                       <select multiple='multiple' size='3' id='adv_global_bib_level'>
+                                                       </select>       
+                                               </td>
+                                       </tr>
+
                                </tbody>
                        </table>
                </td>