this.subjectBox.init("Relevant Subjects", true, true, 15);
this.subjectBox.sortByCount();
+ this.seriesBox = new Box();
+ this.seriesBox.init("Relevant Series", true, true, 15);
+ this.seriesBox.sortByCount();
+
this.sidebarBox = getById("record_sidebar_box");
}
}
+ var series = record.series();
+ for( var s in series ) {
+ debug("Found series entry: " + series[s] );
+ this.seriesBox.addItem(
+ this.mkSeriesLink(series[s]), series[s] );
+ }
+
/* requestBatch will only have one request in it when the current
record is the last record requested */
if( this.requestBatch.pending() < 2 )
return href;
}
+AbstractRecordResultPage.prototype.mkSeriesLink = function(series) {
+ var href = createAppElement("a");
+ add_css_class(href,"record_result_sidebar_link");
+
+ href.setAttribute("href",
+ "?target=mr_result&mr_search_type=series&page=0&mr_search_query=" +
+ encodeURIComponent(series) +
+ "&mr_search_depth=" + this.searchDepth +
+ "&mr_search_location=" + this.searchLocation);
+
+ href.appendChild(createAppTextNode(series));
+ return href;
+}
+
AbstractRecordResultPage.prototype.mkSubjectLink = function(sub) {
var href = createAppElement("a");
add_css_class(href,"record_result_sidebar_link");
this.subjectBox.finalize();
this.authorBox.finalize();
+ this.seriesBox.finalize();
this.sidebarBox.appendChild(this.subjectBox.getNode());
this.sidebarBox.appendChild(createAppElement("br"));
+
this.sidebarBox.appendChild(this.authorBox.getNode());
this.sidebarBox.appendChild(createAppElement("br"));
+ this.sidebarBox.appendChild(this.seriesBox.getNode());
+ this.sidebarBox.appendChild(createAppElement("br"));
+
// showMe(this.buttonsBox);
var ses = UserSession.instance().getSessionId();
} else {
+ var method = "open-ils.search.biblio.class.count";
+ if(isXUL())
+ method = method + ".staff";
+
+ debug("Method: " + method);
+
var creq = new RemoteRequest(
- "open-ils.search", "open-ils.search.biblio.class.count",
+ "open-ils.search", method,
this.stype, this.string, this.searchLocation, this.searchDepth );
/* this request grabs the search count. When the counts come back
if( this.hitCount > 5000 )
method = method + ".unordered";
+ if(isXUL())
+ method = method + ".staff";
+
debug("Search method is " + method);
var request = new RemoteRequest(
var orgunit = globalSelectedLocation;
if(!orgunit) orgunit = globalLocation;
+ var method = "open-ils.search.biblio.metarecord.copy_count";
+ if(isXUL())
+ method = method + ".staff";
+
var copy_request = new RemoteRequest(
- "open-ils.search",
- "open-ils.search.biblio.metarecord.copy_count",
+ "open-ils.search", method,
this.searchLocation, record.doc_id() );
copy_request.search_id = search_id;
else
this.session = globalSearchBarChunk.session;
- debug("^^^^^^^^^^^^");
this.reset();
globalSearchBarChunk = this;
SearchBarChunk.prototype.reset = function() {
- debug(" -- reset on SearchBarChunk");
-
if( this.session.connected ) {
- debug(" ****** session is connected");
+ debug("session is connected");
hideMe(this.login_div);
showMe(this.logout_div);
} else {
- debug(" ****** session is not connected");
+ debug("session is not connected");
showMe(this.login_div);
hideMe(this.logout_div);
}
ismoz = true;
var DEBUG = true;
+var WIN_DEBUG = false;
+
+var debugWindow;
function debug(message) {
if(DEBUG) {
try {
dump(" -|*|- Debug: " + message + "\n");
} catch(E) {}
}
+ if(WIN_DEBUG) {
+ if(!debugWindow) {
+ debugWindow = window.open(null,"Debug",
+ "location=0,menubar=0,status=0,resizeable,resize," +
+ "outerHeight=900,outerWidth=700,height=900," +
+ "width=700,scrollbars=1,screenX=100," +
+ "screenY=100,top=100,left=100,alwaysraised" )
+ }
+ debugWindow.document.write("<br/>" + message);
+ }
}
+
/* finds or builds the requested row id, adding any intermediate rows along the way */
function table_row_find_or_create( table, index ) {
for( var x = 0; x <= index; x++ ) {
if(table.rows[x] == null) {
row = tbody.appendChild(createAppElement("tr"));
- //row = table.appendChild(document.createElement("tr"));
- //row = document.createElement("tr");
- //var tbody = table.getElementsByTagName("tbody")[0];
- //debug(tbody);
- //tbody.appendChild(row);
- //table.childNodes[x] = row;
- //table.rows[x] = row;
- //row = table.insertRow(x);
}
}
return row;