author_cell.innerHTML = " ";
author_cell.appendChild(this.mkLink(record.doc_id(), "author", author ));
- var marcd = elem("div");
+ var marcd = null;
if(instanceOf(this, RecordResultPage)) {
var span = createAppElement("span");
span.style.marginLeft = "10px";
author_cell.appendChild(span);
var marcb = elem( "a",
- {
- href:"javascript:void(0)",
- style: "text-decoration:underline"
- }, {}, "View MARC" );
+ { href:"javascript:void(0)",
+ style: "text-decoration:underline;"
+ }, null, "View MARC" );
debug("Setting up view marc callback with record " + record.doc_id());
var func = buildViewMARCWindow(record);
marcb.onclick = func;
- marcd = elem( "div", { style: "float:right" } );
+ marcd = elem( "div", { style: "float:right;font-size:x-small;" } );
marcd.appendChild(marcb);
- //author_cell.appendChild(marcd);
- //misc_row.insertCell(misc_row.cells.length).appendChild(marcd);
- //c.appendChild(marcd);
-
-
}
var holddiv = null;
if(holddiv) tc.appendChild(holddiv);
tc2.appendChild(mktext(" "));
- tc3.appendChild(marcd);
+ if(marcd) tc3.appendChild(marcd);
c.appendChild(tab);
for( var idx = 0; idx != holds.length; idx++ ) {
debug("Displaying hold " + holds[idx].id());
- _doCallbackDance(table, holds[idx]);
+ _doCallbackDance(table, holds[idx], this.user.session_id, this);
}
}
-function _doCallbackDance(table, hold) {
+function _doCallbackDance(table, hold, session_id, obj) {
if(hold == null) return;
debug("Setting holds callback with hold " + hold.id() );
- var func = function(rec) {_drawHoldsRow(table, hold, rec)};
+ var func = function(rec) {_drawHoldsRow(table, hold, rec, session_id, obj)};
/* grab the record that is held */
if(hold.hold_type() == "M")
}
-function _drawHoldsRow(table, hold, record) {
+function _drawHoldsRow(table, hold, record, session_id, obj) {
if(record == null || record.length == 0) return;
debug("In holds callback with hold " + hold );
cell = row.insertCell(row.cells.length);
var a = elem("a",{href:"javascript:void(0);",
style:"text-decoration:underline"},null, "Cancel");
- a.onclick = function(){_cancelHoldRequest(hold);};
+ a.onclick = function(){_cancelHoldRequest(hold, a, session_id, obj);};
add_css_class(cell, "my_opac_profile_cell");
cell.appendChild(a);
}
-function _cancelHoldRequest(hold) {
- alert("Canceling hold " + hold.id());
+
+function _cancelHoldRequest(hold, node, session_id, obj) {
+ var box = new PopupBox(node);
+ box.title("Cancel Hold");
+ box.addText("Are you sure you wish to cancel the hold?");
+ var but = elem("input",{type:"submit",value:"Cancel Hold"});
+ var can = elem("input",{type:"submit",value:"Do not Cancel Hold"});
+ box.makeGroup([but, can]);
+ but.onclick = function(){
+ _cancelHold(hold, session_id); box.hide(); obj.draw("holds");};
+ can.onclick = function() { box.hide(); };
+ box.show();
}
+function _cancelHold(hold, session_id) {
+ var req = new RemoteRequest(
+ "open-ils.circ", "open-ils.circ.hold.cancel",
+ session_id, hold );
+
+ req.send(true);
+ if(req.getResultObject())
+ alert("Hold successfully cancelled");
+}
+
+
+
function _buildChangeEmailNotify(hold) {
var a = elem("a",{href:"javascript:void(0);",
style:"text-decoration:underline"},null, hold.email_notify());
}
+RecordDetailPage.prototype.buildContextMenu = function(record) {
+
+ var menu_name = "record_detail_menu";
+ var menu = globalMenuManager.buildMenu(menu_name);
+
+ globalMenuManager.setContext(getById("record_detail_main_box"), menu);
+ var func = buildViewMARCWindow(record);
+ menu.addItem("View MARC", func);
+
+ if(isXUL())
+ xulEvtRecordDetailDisplayed( menu, record );
+ getDocument().body.appendChild(menu.getNode());
+}
+
+
RecordDetailPage.instance = function() {
if( globalRecordDetailPage != null )
return globalRecordDetailPage;
if(!orgUnit) orgUnit = globalLocation;
this.drawCopyTrees(orgUnit, record);
+ this.buildContextMenu(record);
}
/* sets up the cover art image */