background: #FFF;
}
-#ot_nav_widget_box {
+.ot_nav_widget_box {
height: 400px;
width: 400px;
padding-left: 2px;
var cell = trow.insertCell(trow.cells.length);
add_css_class(cell,"record_result_thead_header");
cell.innerHTML =
- findOrgType(findOrgUnit(copy_counts[i].org_unit).ou_type()).name();
+ findOrgType(findOrgUnit(
+ copy_counts[i].org_unit).ou_type()).opac_label();
}
this.theadDrawn = true;
}
this.treeContainerBoxId = container_id;
this.treeBoxId = box_id;
this.setObjects();
+ this.treeBuilder = buildOrgTreeWidget;
}
this.treeContainerBox = getById("ot_nav_widget");
if(this.treeBoxId)
- this.treeBox = getById(treeBoxId);
+ this.treeBox = getById(this.treeBoxId);
else
this.treeBox = getById("ot_nav_widget_box");
debug("Somebody called buildOrgTreeWidget on me...");
this.setObjects();
- this.widget = buildOrgTreeWidget(globalOrgTree, true);
+ //this.widget = buildOrgTreeWidget(globalOrgTree, true);
+ this.widget = this.treeBuilder(globalOrgTree, true);
}
LocationTree.prototype.hide = function() {
this.setObjects();
- this.widget = buildOrgTreeWidget(globalOrgTree, true);
+ this.widget = this.treeBuilder(globalOrgTree, true);
if(this.treeContainerBox &&
- this.treeContainerBox.className.indexOf("nav_bar_visible") != -1 ) {
- swapClass( this.treeContainerBox, "nav_bar_hidden", "nav_bar_visible" );
+ this.treeContainerBox.className.indexOf("show_me") != -1 ) {
+ swapClass( this.treeContainerBox, "hide_me", "show_me" );
}
}
debug("Tree container " + this.treeContainerBox );
debug("Tree box " + this.treeBox );
- swapClass( this.treeContainerBox, "nav_bar_hidden", "nav_bar_visible" );
+ swapClass( this.treeContainerBox, "hide_me", "show_me" );
var obj = this;
- if(this.treeBox && this.treeBox.firstChild.nodeType == 3) {
+ if( (this.treeBox && this.treeBox.firstChild &&
+ this.treeBox.firstChild.nodeType == 3) ||
+ (!this.treeBox.firstChild)) {
+
+ debug("location tree has not been rendered... rendering..");
setTimeout(function() { renderTree(obj); }, 5 );
}
+ //alert(this.treeBox.firstChild.nodeType);
if( button_div && offsetx == null && offsety == null ) {
var x = findPosX(button_div);
function renderTree(tree) {
tree.setObjects();
if(!tree.widget) tree.buildOrgTreeWidget();
+ /*
+ debug("Spitting tree out to the treeBox:\n" +
+ tree.widget.toString() ); */
tree.treeBox.innerHTML = tree.widget.toString();
}
+
+/* generates a new chunk within with the tree is inserted */
+LocationTree.prototype.newSpot = function(box_id, container_id) {
+
+ var cont = elem("div", { id : this.treeContainerBoxId } );
+ var box = elem("div", { id : this.treeBoxId } );
+ var expando_line = elem("div");
+ var expando = elem("div");
+ var expand_all = elem("a", null, null, "Expand All");
+ var collapse_all = elem("a", null, null, "Collapse All");
+
+ add_css_class(cont, "nav_widget");
+ add_css_class(cont, "hide_me");
+ add_css_class(box, "ot_nav_widget_box");
+ add_css_class(expando_line, "expando_links");
+ add_css_class(expando, "expando_links");
+
+
+ cont.appendChild(expando_line);
+ cont.appendChild(expando);
+ cont.appendChild(elem("br"));
+ cont.appendChild(box);
+
+ expando_line.appendChild(elem("br"));
+ var obj = this;
+ expand_all.onclick = function() { obj.widget.expandAll(); };
+ collapse_all.onclick = function() {
+ obj.widget.collapseAll();
+ obj.widget.expand(); };
+
+ expando.appendChild(expand_all);
+ expando.appendChild(createAppTextNode(" "));
+ expando.appendChild(collapse_all);
+ expando.appendChild(createAppTextNode(" "));
+
+ return cont;
+
+}
if( otype.depth() > findOrgType(orgunit.ou_type()).depth() )
continue;
- var select = new Option(otype.name(), otype.depth());
+ var select = new Option(otype.opac_label(), otype.depth());
this.searchRange.options[this.searchRange.options.length] = select;
RecordDetailPage.prototype.constructor = RecordDetailPage;
RecordDetailPage.baseClass = Page.constructor;
+var globalDetailRecord;
+
function RecordDetailPage() {
if( globalRecordDetailPage != null )
return globalRecordDetailPage;
RecordDetailPage.prototype.draw = function() {
this.mainBox = getById("record_detail_copy_info");
+ var linksDiv = elem("div");
+ var leftLink = elem("div", { style: "width: 50%;text-align: left" });
+ var rightLink = elem("div", { style: "width: 50%;text-align: right"});
+ linksDiv.appendChild(leftLink);
+ linksDiv.appendChild(rightLink);
+ this.mainBox.appendChild(linksDiv);
+
this.mainBox.appendChild(elem("br"));
this.parentLink = elem("a",
{ href : "javascript:void(0)",
id : "parent_link",
style : "text-decoration:underline" } );
- this.mainBox.appendChild(this.parentLink);
- this.locationTree = elem("div");
- this.mainBox.appendChild(this.locationTree);
+ var a = elem("a",
+ { href : "javascript:void(0)",
+ style : "text-decoration:underline" }, null,
+ "Select a location whose Volumes/Copies you wish to see");
+
+ var obj = this;
+ a.onclick = function(evt) {
+ obj.copyLocationTree.toggle(null, 100, 100);
+ };
+
+ leftLink.appendChild(a);
+ rightLink.appendChild(this.parentLink);
+
+ /* --------------------------------------------- */
+
+
+ this.copyLocationTree = new LocationTree(
+ globalOrgTree, "record_detail_tree", "record_detail_tree_container" );
+ td = this.copyLocationTree.newSpot();
+ this.copyLocationTree.treeBuilder = buildCustomOrgTree;
+ this.mainBox.appendChild(td);
+
+ this.copyLocationTree.setObjects();
+
+
this.treeDiv = elem("div");
this.mainBox.appendChild(this.treeDiv);
}
+
+function buildCustomOrgTree(org_node, root) {
+
+ debug("performing custom org tree build");
+ var item;
+
+ if(root) {
+ item = new WebFXTree(org_node.name());
+ item.setBehavior('classic');
+ } else {
+ item = new WebFXTreeItem(org_node.name());
+ }
+
+ item.action =
+ "javascript:globalPage.drawCopyTrees(" +
+ org_node.id() + ", logicNode.globalDetailRecord );" +
+ "globalPage.copyLocationTree.hide();";
+
+
+ for( var index in org_node.children()) {
+ var childorg = org_node.children()[index];
+ if( childorg != null ) {
+ debug("Adding " + childorg.name() + " to org tree");
+ var tree_node = buildCustomOrgTree(childorg);
+ if(tree_node != null)
+ item.add(tree_node);
+ }
+ }
+
+ return item;
+}
+
+
RecordDetailPage.prototype.setViewMarc = function(record) {
var marcb = elem( "a",
{
req.setCompleteCallback(
function() {
obj.record = req.getResultObject();
+ globalDetailRecord = obj.record;
+ obj.copyLocationTree.widget =
+ buildCustomOrgTree(globalOrgTree, obj.record, true);
obj.drawRecord(obj.record);
obj.setViewMarc(obj.record);
}
/* entry point for displaying the copy details pane */
RecordDetailPage.prototype.drawCopyTrees = function(orgUnit, record) {
+ debug("Got ORG unit " + orgUnit);
+ orgUnit = findOrgUnit(orgUnit);
+
debug("OrgUnit depth is: " + findOrgType(orgUnit.ou_type()).depth());
- this.displayLocationTree(record);
+ //this.displayLocationTree(record);
/* display a 'hold on' message */
this.treeDiv.appendChild(elem("br"));
}
-/* displays a link to choose another location and embeds a
- copy of the location tree for choosing said location */
+/*
RecordDetailPage.prototype.displayLocationTree = function(record) {
-
- var locTree = new LocationTree(globalOrgTree);
- locTree.buildOrgTreeWidget();
+}
+*/
-}
/* displays a link to view info for the parent org
if showMe == true, we don't search for the parent,
/* locates a specific org unit */
function findOrgUnit(org_id, branch) {
if(org_id == null) return null;
+ if(typeof org_id == 'object') return org_id;
if(globalOrgTree == null)
throw new EXArg("Need globalOrgTree");
}
}
if (text) {
- e.appendChild(document.createTextNode(text));
+ e.appendChild(createAppTextNode(text));
}
return e;
}
function setDeepLink() {
var node = document.getElementById("deep_link_div");
if(node) {
+ var org = logicNode.globalSelectedLocation;
+ if(org == null)
+ org = logicNode.globalLocation;
+ org = org.id();
+
+ var depth = logicNode.globalSearchDepth;
+
var a = document.createElement("a");
- a.setAttribute("href", location.href + "&sub_frame=1");
+ a.setAttribute("href", location.href +
+ "&sub_frame=1&location=" + org + "&depth=" + depth);
+
a.setAttribute("target", "_blank");
a.appendChild(document.createTextNode("Link to this page"));
node.appendChild(a);
WRAPPER html/div id='ot_wrapper_box' class='nav_wrapper_box';
- WRAPPER html/div id='ot_nav_widget' class='nav_widget nav_bar_hidden' ;
+ WRAPPER html/div id='ot_nav_widget' class='nav_widget hide_me' ;
WRAPPER html/div class='expando_links';
lines(1);
lines(1);
- WRAPPER html/div id='ot_nav_widget_box';
+ WRAPPER html/div class='ot_nav_widget_box' id='ot_nav_widget_box';
"Loading Tree...";
END;
WRAPPER html/table class='record_result_box', id='record_result_box';
WRAPPER html/thead class='record_result_thead';
WRAPPER html/row id='record_result_thead_row';
- cell(nowrap='nowrap', colspan='2',
- content="Title / Author", class='record_box_descriptor' );
+ cell(nowrap='nowrap', colspan='2',
+ #content="Title / Author", class='record_box_descriptor' );
+ content=" ", class='record_box_descriptor' );
END;
END;
END;