}
- var holds = elem( "a",
- {
- href:"javascript:void(0)",
- style: "text-decoration:underline"
- }, {}, "Place Hold" );
-
-
- var type = "M";
- if(instanceOf(this, RecordResultPage))
- type = "T";
-
- var win;
- var user = UserSession.instance();
- if(user.verifySession()) {
- win = new HoldsWindow(record.doc_id(),
- type, user.userObject, user.userObject, user.session_id);
- } else {
- win = new HoldsWindow(record.doc_id(),
- type, null, null, null);
- }
+ var holddiv = null;
+ if(instanceOf(this, RecordResultPage)) {
+ var holds = elem( "a",
+ {
+ href:"javascript:void(0)",
+ style: "text-decoration:underline"
+ }, {}, "Place Hold" );
+
+
+ var type = "M";
+ if(instanceOf(this, RecordResultPage))
+ type = "T";
+
+ var win;
+ var user = UserSession.instance();
+ if(user.verifySession()) {
+ win = new HoldsWindow(record.doc_id(),
+ type, user.userObject, user.userObject, user.session_id);
+ } else {
+ win = new HoldsWindow(record.doc_id(),
+ type, null, null, null);
+ }
+
+
+ holds.onclick = function() { win.toggle(holds); }
+ holddiv = elem("div");
+
+ //if(instanceOf(this,RecordResultPage))
+ holddiv.setAttribute("style", "float:right");
+
+ holddiv.appendChild(holds);
+ //var space = elem("span", {style:"padding:5px"},null, " ");
+ //c.appendChild(space)
+ //c.appendChild(mktext(" "))
+ //c.appendChild(holddiv)
+ }
- holds.onclick = function() { win.toggle(holds); }
- var holddiv = elem("div");
-
- //if(instanceOf(this,RecordResultPage))
- holddiv.setAttribute("style", "float:right");
-
- holddiv.appendChild(holds);
- //var space = elem("span", {style:"padding:5px"},null, " ");
- //c.appendChild(space)
- //c.appendChild(mktext(" "))
- //c.appendChild(holddiv)
-
var tab = elem("table",{style:"float:right"});
var tr = tab.insertRow(0);
var tc = tr.insertCell(0);
tc.setAttribute("nowrap", "nowrap");
tc3.setAttribute("nowrap", "nowrap");
- tc.appendChild(marcd);
+ if(holddiv) tc.appendChild(holddiv);
tc2.appendChild(mktext(" "));
- tc3.appendChild(holddiv);
+ tc3.appendChild(marcd);
+
c.appendChild(tab);
+var PopupBoxId = 0;
+
+
function LoginDialog(logged_in_callback) {
this.callback = logged_in_callback;
- this.rand = Math.random();
+ this.rand = PopupBoxId++;
}
+
+
/* node is the element the dialog should popup under */
LoginDialog.prototype.display = function(node) {
}
}
+/* expand search if results are too low... */
+MRResultPage.prototype.buildExpandSearchLinks = function() {
+
+ /*
+ var string = paramObj.__mr_search_query;
+ var stype = paramObj.__mr_search_type;
+ var location = paramObj.__mr_search_location;
+ var depth = paramObj.__mr_search_depth;
+ */
+
+ var div = elem("div");
+}
+
MRResultPage.prototype.doMRSearch = function() {
MRResultPage.prototype.collectRecords = function() {
+ debug("Collecting records...");
var i = this.searchOffset;
var row = getById("hourglass_row");
if(row)
row.parentNode.removeChild(row);
+ /* ------------------------------------------------- */
+
+ /*
+ var ids = new Array();
+ while( i < (this.searchOffset + this.hitsPerPage) )
+ ids.push(this.recordIDs[i++]);
+
+ debug("Retrieving IDs " + ids);
+
+ var request = new RemoteRequest( "open-ils.search",
+ "open-ils.search.biblio.metarecord.mods_slim.batch.retrieve", ids );
+ this.requestBatch.add(request);
+ var obj = this;
+
+
+ request.setCompleteCallback(
+ function(req) {
+ var records = req.getResultObject();
+ //alert(records);
+
+ for(var i = 0; i!= records.length; i++) {
+ var rec = records[i];
+ debug("Displaying recocord " + rec.doc_id());
+ obj.displayRecord( rec, obj.searchOffset, i );
+ obj.doCopyCount( rec, obj.searchOffset, i );
+ }
+ obj.requestBatch.remove(request);
+ }
+ );
+ request.send();
+ return;
+ */
+ /* ------------------------------------------------- */
+
+
while( i < (this.searchOffset + this.hitsPerPage) ) {
var id = this.recordIDs[i];
MyOPACSPage.prototype._drawHolds = function() {
- var holds = this.grabHolds();
var table = this.infoTable;
var row = table.insertRow(table.rows.length);
add_css_class(cell, "my_opac_info_table_header");
cell.appendChild(mktext("Cancel"));
+ /* ---------------------------------------- */
+ row = table.insertRow(table.rows.length);
+ cell = row.insertCell(row.cells.length);
+ cell.appendChild(mktext("Retrieving holds..."));
+ /* ---------------------------------------- */
+
+ var holds = this.grabHolds();
+ table.firstChild.removeChild(table.firstChild.childNodes[1]);
+
for( var idx = 0; idx != holds.length; idx++ ) {
+ debug("Displaying hold " + holds[idx].id());
_doCallbackDance(table, holds[idx]);
}
+
}
function _doCallbackDance(table, hold) {
}
-
function _drawHoldsRow(table, hold, record) {
if(record == null || record.length == 0) return;
add_css_class(cell, "my_opac_profile_cell");
cell.style.width = "35%";
- cell.appendChild(mktext(record.title()));
+
+ var prefix = "http://" + globalRootURL + ":" + globalPort + globalRootPath;
+ var tl = elem("a",
+ {href:prefix + "?sub_frame=1&target=record_detail&record="+encodeURIComponent(record.doc_id())},
+ null, record.title());
+ tl.setAttribute("target","_top");
+ //cell.appendChild(mktext(record.title()));
+ cell.appendChild(tl);
+
cell = row.insertCell(row.cells.length);
+ var al = elem("a",
+ {href:prefix + "?sub_frame=1&target=mr_result"+
+ "&mr_search_query="+encodeURIComponent(record.author())+
+ "&mr_search_type=author"},
+ null, record.author());
+ al.setAttribute("target","_top");
add_css_class(cell, "my_opac_profile_cell");
- cell.appendChild(mktext(record.author()));
+
+ //cell.appendChild(mktext(record.author()));
+ cell.appendChild(al);
cell = row.insertCell(row.cells.length);
add_css_class(cell, "my_opac_profile_cell");
function ucFieldPut (fieldname, fieldval) {
var i = this.namepos(fieldname)
-if (i >=0) {
- this.fields[i] = fieldval
- return true
-} else {
- return false
+
+if(i < 0) {
+ i = this.fieldnames.length;
+ this.fieldnames[i] = fieldname;
}
+
+this.fields[i] = fieldval
+return true
}
function ucNamePos(fieldname) {
function ucRead() {
var search = this.name + "="
var CookieString = document.cookie
+ if(CookieString == null) CookieString = "";
this.rawValue = null
this.found = false
if (CookieString.length > 0) {
while(i < arguments.length) {
var object = js2JSON(arguments[i++]);
this.params += "¶m=" + encodeURIComponent(object);
+ debug("Remote Request adding param => " + object);
}
if(!this.params) { this.params = ""; }
'application/x-www-form-urlencoded');
}
- debug("Remote Request sending..." + data);
+ //alert("Sending from " + location.href + " to " + url + " data [" + data + "]");
this.xmlhttp.send( data );
this.sendCount += 1;
debug("Remote Request done sending");
if(org) this.orgUnit = org;
else this.orgUnit = findOrgUnit(this.userObject.home_ou());
- if(!paramObj.__depth)
+ if(!paramObj.__depth && this.orgUnit)
globalSelectedDepth = findOrgDepth(this.orgUnit.ou_type());
- if(!paramObj.__location)
+ if(!paramObj.__location && this.orgUnit)
globalPage.updateSelectedLocation(this.orgUnit);
+
globalPage.updateCurrentLocation(this.orgUnit);
return;
-
}
/* if callback exists, call is asynchronous and
the returned item is passed to the callback... */
function fetchRecord(id, callback) {
+
var req = new RemoteRequest(
"open-ils.search",
"open-ils.search.biblio.record.mods_slim.retrieve",
var offsety = y + height;
var offsetx = xpos;
-/*
- if(IE) {
- offsety = parseInt(offsety) + 15;
- offsetx = parseInt(offsetx) + 8;
- }
-*/
+ if(IE) offsety += 15;
debug("getXYOffset y: " + offsety + " x: " + offsetx );
return [offsetx, offsety];
/* return [ x, y ] for the window */
function getWindowSize() {
+
var doc = getDocument();
var win = getWindow();
- if (IE)
- return [doc.body.offsetWidth, doc.body.offsetHeight ];
- return [ win.innerWidth, win.innerHeight ];
+ var x, y;
+
+ if (IE) {
+
+ if(doc.documentElement.offsetWidth != null) { /* IE 6 standards compliant */
+ x = doc.documentElement.offsetWidth;
+ y = doc.documentElement.offsetHeight;
+
+ } else {
+ x = doc.body.offsetWidth;
+ y = doc.body.offsetHeight;
+ }
+
+ } else {
+ x = win.innerWidth;
+ y = win.innerHeight;
+ }
+ return [x, y];
}
+
+
var wx = W[0];
var wy = W[1];
-
var x = getObjectWidth(this.div);
var y = getObjectHeight(this.div);