added ability to toggle metarecord vs records as default display in opac
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Sep 2006 03:41:26 +0000 (03:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Sep 2006 03:41:26 +0000 (03:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5968 dcc99617-32d9-48b4-a31d-7c20da2025e4

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/js/rresult.js
Open-ILS/web/opac/skin/default/js/search_bar.js
Open-ILS/web/opac/skin/default/js/sidebar.js
Open-ILS/web/opac/skin/default/js/sidebar_extras.js
Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml

index 1457b2f..437f7cd 100644 (file)
@@ -1,5 +1,7 @@
 /* Export some constants  ----------------------------------------------------- */
 
+var SHOW_MR_DEFAULT = false; /* true if we show metarecords by default */
+
 /* URL param names */
 var PARAM_TERM                 = "t";                  /* search term */
 var PARAM_STYPE                = "tp";                 /* search type */
index fabaf47..bd16c99 100644 (file)
@@ -426,7 +426,12 @@ function buildTitleDetailLink(rec, link) {
 function buildSearchLink(type, string, linknode, trunc) {
        if(!trunc) trunc = 65;
        var args = {};
-       args.page = MRESULT;
+       if( SHOW_MR_DEFAULT) {
+               args.page = MRESULT;
+       } else {
+               args.page = RRESULT;
+               args[PARAM_RTYPE] = type;
+       }
        args[PARAM_OFFSET] = 0;
        args[PARAM_TERM] = string;
        args[PARAM_STYPE] = type;
index 44d9a67..3faa547 100644 (file)
@@ -5,8 +5,9 @@ var COOKIE_NOGROUP_RECORDS = 'grpt';
 
 function advgInit() {
 
-       if( cookieManager.read(COOKIE_NOGROUP_RECORDS) )
-               $('adv_group_titles').checked = false;
+       /* XXX */
+       if( cookieManager.read(COOKIE_NOGROUP_RECORDS) || SHOW_MR_DEFAULT )
+               $('adv_group_titles').checked = true;
 
        $n($('adv_global_tbody'), 'term').focus();
 
@@ -122,9 +123,9 @@ function advSubmitGlobal() {
        }
 
        if($('adv_group_titles').checked ) 
-               cookieManager.write(COOKIE_NOGROUP_RECORDS,'');
+               cookieManager.write(COOKIE_NOGROUP_RECORDS,'1',-1);
        else
-               cookieManager.write(COOKIE_NOGROUP_RECORDS,'1', '+10m');
+               cookieManager.write(COOKIE_NOGROUP_RECORDS,'');
 
 
        goTo(buildOPACLink(args));
index 8c92156..865acb9 100644 (file)
@@ -70,6 +70,7 @@ function resultCollectSearchIds( type, method, handler ) {
        args.depth    = getDepth();
        args.limit    = limit;
        args.offset   = getOffset();
+       args.visiblity_limit = 3000;
 
        if(sort) args.sort = sort;
        if(sortdir) args.sort_dir = sortdir;
@@ -114,7 +115,20 @@ function resultSetHitInfo() {
 
        try{searchTimer.stop()}catch(e){}
 
-       if( findCurrentPage() == MRESULT ) {
+       //if( findCurrentPage() == MRESULT ) {
+       if( findCurrentPage() == MRESULT || 
+
+               (findCurrentPage() == RRESULT &&
+                       (
+                               getRtype() == RTYPE_TITLE ||
+                               getRtype() == RTYPE_AUTHOR ||
+                               getRtype() == RTYPE_SUBJECT ||
+                               getRtype() == RTYPE_SERIES ||
+                               getRtype() == RTYPE_KEYWORD 
+                       )
+
+               ) ) {
+
                if(getHitCount() <= lowHitCount && getTerm())
                        runEvt('result', 'lowHits');
        }
index e3a91fe..7fd0532 100644 (file)
@@ -317,12 +317,11 @@ function rresultDoRecordMultiSearch() {
 
 function rresultFilterSearchResults(r) {
        var result = r.getResultObject();
-
-//     _debug("SEARCH RETURNED: \n" + js2JSON(result) + '\n\n');
-
        var ids = [];
-       for( var i = 0; i != result.ids.length; i++ ) 
-               ids.push(result.ids[i][0]);
+       if( result.count > 0 ) {
+               for( var i = 0; i != result.ids.length; i++ ) 
+                       ids.push(result.ids[i][0]);
+       }
        _rresultHandleIds( ids, result.count );
 }
 
index 9f15a71..9dfac6e 100644 (file)
@@ -56,10 +56,16 @@ function searchBarSubmit() {
        text = text.replace(/'/,'');
 
        var args = {};
-       args.page                               = MRESULT;
-       //args[PARAM_OFFSET]    = 0;
-       args[PARAM_TERM]                = text;
+
+       if(SHOW_MR_DEFAULT) {
+               args.page                               = MRESULT;
+       } else {
+               args.page                               = RRESULT;
+               args[PARAM_RTYPE]               = _ts.options[_ts.selectedIndex].value;
+       }
+
        args[PARAM_STYPE]               = _ts.options[_ts.selectedIndex].value;
+       args[PARAM_TERM]                = text;
        args[PARAM_LOCATION] = depthSelGetNewLoc();
        args[PARAM_DEPTH]               = d;
        args[PARAM_FORM]                = _fs.options[_fs.selectedIndex].value;
index 3280b50..5db5f6a 100644 (file)
@@ -23,14 +23,17 @@ function initSideBar() {
        if( page == RRESULT ) {
                unHideMe($("sidebar_results_wrapper"));
                unHideMe(G.ui.sidebar[MRESULT]);
-               $("sidebar_title_group_results").setAttribute("href", prevMResults());
+               if( getRtype() == RTYPE_MRID )
+                       $("sidebar_title_group_results").setAttribute("href", prevMResults());
        }
 
        if( page == RDETAIL ) {
                unHideMe($("sidebar_results_wrapper"));
-               $("sidebar_title_group_results").setAttribute("href", prevMResults());
+               if( getRtype() == RTYPE_MRID )
+                       $("sidebar_title_group_results").setAttribute("href", prevMResults());
                unHideMe(G.ui.sidebar[MRESULT]);
-               $("sidebar_title_results").setAttribute("href", prevRResults());
+               if(getRtype())
+                       $("sidebar_title_results").setAttribute("href", prevRResults());
                unHideMe(G.ui.sidebar[RRESULT]);
        }
 
index 22f89cc..7263954 100644 (file)
@@ -88,7 +88,9 @@ function resultDrawSidebarTrees( stype, treeName, items, wrapperNode, destNode )
        if(found) {
                unHideMe(wrapperNode);
 //             if(IE) resultFireXRefSingle(treeName, xrefCache, stype);
-               resultFireXRefBatch(treeName, xrefCache, stype);
+
+               /* XXX */ // disabled auth lookups for now
+               //resultFireXRefBatch(treeName, xrefCache, stype);
        }
 }
 
@@ -149,7 +151,12 @@ function resultFireXRefReq( treeName, stype, item ) {
 
 function resultQuickLink( term, type ) {
        var args = {};
-       args.page = MRESULT;
+       if(SHOW_MR_DEFAULT) {
+               args.page = MRESULT;
+       } else {
+               args.page = RRESULT;
+               args[PARAM_RTYPE] = type;
+       }
        args[PARAM_OFFSET] = 0;
        args[PARAM_TERM] = term;
        args[PARAM_STYPE] = type;
index 7a188fd..4b7490a 100644 (file)
                                                                <tr>
                                                                        <td colspan='2' align='center'>
                                                                                <span>Group Formats and Editions</span>
+                                                                               <!--
                                                                                <input id='adv_group_titles' type='checkbox' checked='checked'> </input>
+                                                                               -->
+                                                                               <input id='adv_group_titles' type='checkbox'> </input>
                                                                        </td>
                                                                </tr>
                                                        </tbody>