added 'dbg' url param to turn on debugging, in particular this enables request debugging
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Mar 2006 17:10:23 +0000 (17:10 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Mar 2006 17:10:23 +0000 (17:10 +0000)
which spits out srfsh-style requests to the console

fixed bug where the authority searches were fired off before the final copy count request was fired

git-svn-id: svn://svn.open-ils.org/ILS/trunk@3247 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/mresult.js
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/opac/skin/default/js/rresult.js

index e6ce3ea..c8b8dec 100644 (file)
@@ -20,6 +20,7 @@ var PARAM_ADVTYPE             = "adt";                        /* the advanced search type */
 var PARAM_RTYPE                = "rt";
 var PARAM_SORT                 = "s";
 var PARAM_SORT_DIR     = "sd";
+var PARAM_DEBUG                = "dbg";
 
 /* URL param values (see comments above) */
 var TERM;  
@@ -42,6 +43,7 @@ var RTYPE;
 var SORT;
 var SORT_DIR;
 var RLIST;
+var DEBUG;
 
 /* cookie values */
 var SBEXTRAS; 
index a6ec981..9315ced 100644 (file)
@@ -8,11 +8,25 @@ var cookieManager = new HTTP.Cookies();
 var __ilsEvent; /* the last event the occurred */
 
 function Request(type) {
+
        var s = type.split(":");
        if(s[2] == "1" && isXUL()) s[1] += ".staff";
        this.request = new RemoteRequest(s[0], s[1]);
-       for( var x = 1; x!= arguments.length; x++ ) 
+       var p = [];
+
+       for( var x = 1; x!= arguments.length; x++ ) {
+               p.push(arguments[x]);
                this.request.addParam(arguments[x]);
+       }
+
+       if( getDebug() ) {
+               var str = "";
+               for( var i = 0; i != p.length; i++ ) {
+                       if( i > 0 ) str += ", "
+                       str += js2JSON(p[i]);
+               }
+               _debug('request ' + s[0] + ' ' + s[1] + ' ' + str );
+       }
 }
 
 Request.prototype.callback = function(cal) {this.request.setCompleteCallback(cal);}
@@ -87,6 +101,7 @@ function initParams() {
        RTYPE           = cgi.param(PARAM_RTYPE);
        SORT            = cgi.param(PARAM_SORT);
        SORT_DIR        = cgi.param(PARAM_SORT_DIR);
+       DEBUG           = cgi.param(PARAM_DEBUG);
 
        /* set up some sane defaults */
        if(isNaN(LOCATION))     LOCATION        = 1;
@@ -129,6 +144,7 @@ function getAdvType(){return ADVTYPE;}
 function getRtype(){return RTYPE;}
 function getSort(){return SORT;}
 function getSortDir(){return SORT_DIR;}
+function getDebug(){return DEBUG;}
 
 
 function findBasePath() {
index cac31b5..76cbdce 100644 (file)
@@ -182,6 +182,10 @@ function mresultHandleMods(r) {
        var pagePosition = r.userdata;
        runEvt('result', 'recordReceived', rec, pagePosition, true);
        resultCollectCopyCounts(rec, pagePosition, FETCH_MR_COPY_COUNTS);
+       if(resultPageIsDone())  
+               runEvt('result', 'allRecordsReceived', recordsCache);
 }
 
 
+
+
index a2b6348..a6de30c 100644 (file)
@@ -314,14 +314,11 @@ function resultDisplayRecord(rec, pos, is_mr) {
        
        runEvt("result", "recordDrawn", rec.doc_id(), title_link);
 
+       /*
        if(resultPageIsDone())  {
-               //showCanvas();
-               /* hide the 'now loading...' message */
-               /*
-               hideMe(G.ui.common.loading);
-               */
                runEvt('result', 'allRecordsReceived', recordsCache);
        }
+       */
 }
 
 function _resultFindRec(id) {
index 8732803..95b9c49 100644 (file)
@@ -80,6 +80,8 @@ function rresultHandleMods(r) {
        var rec = r.getResultObject();
        runEvt('result', 'recordReceived', rec, r.userdata, false);
        resultCollectCopyCounts(rec, r.userdata, FETCH_R_COPY_COUNTS);
+       if(resultPageIsDone())  
+               runEvt('result', 'allRecordsReceived', recordsCache);
 }