#rdetail_copy_info_table { font-size: 92%; }
.rdetail_copy_nav_link { font-weight: normal; font-size: 95%; }
+#rdetail_view_marc { font-size: 90%; }
var UPDATE_USER_PREFS = "open-ils.actor:open-ils.actor.patron.settings.update";
var FETCH_COPY_STATUSES = "open-ils.search:open-ils.search.config.copy_status.retrieve.all";
var FETCH_COPY_COUNTS_SUMMARY = "open-ils.search:open-ils.search.biblio.copy_counts.summary.retrieve";
+var FETCH_MARC_HTML = "open-ils.search:open-ils.search.biblio.record.html";
/* ---------------------------------------------------------------------------- */
Request.prototype.result = function(){return this.request.getResultObject();}
/* ----------------------------------------------------------------------- */
-function showCanvas() { setTimeout(_showCanvas, 200); }
-function _showCanvas() {
+function showCanvas() {
for( var x in G.ui.altcanvas ) {
hideMe(G.ui.altcanvas[x]);
}
/* ----------------------------------------------------------------------- */
/* build the org tree */
/* ----------------------------------------------------------------------- */
-
-
function drawOrgTree() {
G.ui.common.org_tree.innerHTML = buildOrgSelector().toString();
}
}
+/* ----------------------------------------------------------------------- */
+/* resource icon code */
+/* ----------------------------------------------------------------------- */
+
+var resourceFormats = [
+ "text",
+ "moving image",
+ "sound recording", "software, multimedia",
+ "still images",
+ "cartographic",
+ "mixed material",
+ "notated music",
+ "three dimensional object" ];
+
+
+function modsFormatToMARC(format) {
+ switch(format) {
+ case "text":
+ return "at";
+ case "moving image":
+ return "g";
+ case "sound recording":
+ return "ij";
+ case "sound recording-nonmusical":
+ return "i";
+ case "sound recording-musical":
+ return "j";
+ case "software, multimedia":
+ return "m";
+ case "still images":
+ return "k";
+ case "cartographic":
+ return "ef";
+ case "mixed material":
+ return "op";
+ case "notated music":
+ return "cd";
+ case "three dimensional object":
+ return "r";
+ }
+ return "at";
+}
+function MARCFormatToMods(format) {
+ switch(format) {
+ case "a":
+ case "t":
+ return "text";
+ case "g":
+ return "moving image";
+ case "i":
+ return "sound recording-nonmusical";
+ case "j":
+ return "sound recording-musical";
+ case "m":
+ return "software, multimedia";
+ case "k":
+ return "still images";
+ case "e":
+ case "f":
+ return "cartographic";
+ case "o":
+ case "p":
+ return "mixed material";
+ case "c":
+ case "d":
+ return "notated music";
+ case "r":
+ return "three dimensional object";
+ }
+ return "text";
+}
+
+
+function setResourcePic( img, resource ) {
+ img.setAttribute( "src", "../../../images/tor/" + resource + ".jpg");
+ img.title = resource;
+}
+
<!ENTITY navigate.home.title "Go to the Home page">
<!ENTITY navigate.advanced "Advanced Search">
<!ENTITY navigate.advanced.title "Go to the Advanced Search Page">
-<!ENTITY navigate.myopac "My OPAC">
+<!ENTITY navigate.myopac "My Account">
<!ENTITY navigate.myopac.title "Go to My OPAC">
-<!ENTITY navigate.login "Log in for personalized features">
-<!ENTITY navigate.login.title "Log in">
+<!ENTITY navigate.login "Log in">
+<!ENTITY navigate.login.title "Log in for personalized features">
<!ENTITY navigate.logout "Log out">
<!ENTITY navigate.logout.title "Log out">
<!ENTITY rdetail.copyInfo.all "View copy information for all libraries">
<!ENTITY rdetail.loading "Loading copy infomation...">
<!ENTITY rdetail.noneAvailable " * There are no copies in this library">
+<!ENTITY rdetail.detailMain.viewMarc "View MARC">
+<!ENTITY rdetail.detailMain.hideMarc "Return to title summary view">
#rdetail_detail_main { width: 100%; }
#rdetail_details_table { padding-top: 10px; width: 100%; padding: 30px; border-collapse: collapse;}
-.rdetail_header { padding: 3px; padding-left: 10px; font-weight: 600; }
+.rdetail_header { padding: 3px; padding-left: 10px;}
.rdetail_desc { padding: 2px; padding-left: 4px; padding-right: 4px;}
.rdetail_item { width: 75%; padding-left: 10px; }
#rdetail_image { padding-right: 10px; }
#rdetail_copy_info_table { padding: 4px; width: 100%; border-collapse: collapse; }
-.rdetail_copy_info_header_cell { padding: 6px; }
+.rdetail_copy_info_header_cell { padding: 2px; }
.rdetail_copy_count_cell { text-align: center; }
+.tor_pic { width: 20px; height: 20px; border: none;}
G.ui.rdetail.cp_info_local.onclick = rdetailShowLocalCopies;
G.ui.rdetail.cp_info_all.onclick = rdetailShowAllCopies;
+ G.ui.rdetail.view_marc.onclick = rdetailViewMarc;
+ G.ui.rdetail.hide_marc.onclick = showCanvas;
var req = new Request(FETCH_RMODS, getRid());
req.callback(_rdetailDraw);
req.send();
}
+function rdetailViewMarc() {
+ if(!record) return;
+
+ if( G.ui.rdetail.view_marc_box.innerHTML.indexOf("style") == -1 ) {
+ var req = new Request( FETCH_MARC_HTML, record.doc_id() );
+ req.send(true);
+ var html = req.result();
+ G.ui.rdetail.view_marc_box.innerHTML = html;
+ }
+ swapCanvas(G.ui.rdetail.view_marc_div);
+}
+
+
function rdetailShowLocalCopies() {
var found = false;
G.ui.rdetail.edition.appendChild(text(record.edition()));
G.ui.rdetail.pubdate.appendChild(text(record.pubdate()));
G.ui.rdetail.publisher.appendChild(text(record.publisher()));
- G.ui.rdetail.tor.appendChild(text(record.types_of_resource()));
+ G.ui.rdetail.tor.appendChild(text(record.types_of_resource()[0]));
+ setResourcePic( G.ui.rdetail.tor_pic, record.types_of_resource()[0]);
G.ui.rdetail.abstr.appendChild(text(record.synopsis()));
G.ui.rdetail.image.setAttribute("src", buildISBNSrc(cleanISBN(record.isbn())));
var row = copyRow.cloneNode(true);
row.id = "cp_info_" + node.id();
+
var libtd = findNodeByName( row, config.names.rdetail.lib_cell );
var cntd = findNodeByName( row, config.names.rdetail.cn_cell );
var cpctd = findNodeByName( row, config.names.rdetail.cp_count_cell );
libtd.setAttribute("style", "padding-left: " + ((findOrgDepth(node) - 1) * 9) + "px;");
if(!findOrgType(node.ou_type()).can_have_vols()) {
- libtd.setAttribute("colspan", numStatuses + 2 );
- libtd.colSpan = numStatuses + 2;
+
row.removeChild(cntd);
row.removeChild(cpctd);
+
+ libtd.setAttribute("colspan", numStatuses + 2 );
+ libtd.colSpan = numStatuses + 2;
addCSSClass(row, config.css.color_3);
}
findNodeByName(r, "result_table_title_cell").width =
100 - (orgNodeTrail(findOrgUnit(getLocation())).length * 8) + "%";
+ resultBuildFormatIcons( r, rec );
+
unHideMe(r);
runEvt("result", "recordDrawn", rec.doc_id(), title_link);
runEvt('result', 'allRecordsReceived', recordsCache);
}
+function resultBuildFormatIcons( row, rec ) {
+
+ var td = findNodeByName( row, config.names.result.format_cell );
+ var linkt = td.removeChild(findNodeByName( row, config.names.result.format_link ));
+ var resources = rec.types_of_resource();
+
+ for( var i in resources ) {
+ var link = linkt.cloneNode(true);
+
+ var args = {};
+ args.page = RRESULT;
+ args[PARAM_OFFSET] = 0;
+ args[PARAM_MRID] = rec.doc_id();
+ args[PARAM_FORM] = modsFormatToMARC(resources[i]);
+ link.setAttribute("href", buildOPACLink(args));
+
+ var img = findNodeByName(link, config.names.result.format_pic);
+ setResourcePic( img, resources[i] );
+ td.appendChild(link);
+ }
+}
+
+
function resultPageIsDone(pos) {
return (recordsHandled == getDisplayCount()
|| recordsHandled + getOffset() == getHitCount());
<!-- The org tree -->
<xi:include href="orgtree.xml"/>
+
<!-- ============================================================================= -->
<!-- Register the alternate canvases -->
<script language='javascript'>
<?xml version='1.0'?>
+<!--
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
+-->
+
<div xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="logo.xml"/>
<xi:include href="fonts.xml"/>
<?xml version='1.0'?>
<!DOCTYPE x [ <!ENTITY % ent SYSTEM "../../../locale/en-US/lang.dtd"> %ent; ] >
+<!--
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ -->
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
<head>
<script language='javascript' src='../js/rdetail.js'> </script>
</head>
+ <script language='javascript'>
+ config.ids.rdetail = {};
+ config.ids.rdetail.view_marc = "rdetail_view_marc";
+ </script>
+
<body onload="init();">
<xi:include href="header.xml"/>
+
+
<div id='canvas' class='canvas'>
+
<xi:include href="altcanvas.xml"/>
+ <xi:include href="rdetail_altcanvas.xml"/>
+
<div id='canvas_main'>
<div>
<div class='rdetail_header color_1'>
- <span>&rdetail.detailMain.headerLabel;</span>
+ <table width='100%'>
+ <tbody>
+ <tr>
+ <td>
+ <span>&rdetail.detailMain.headerLabel;</span>
+ </td>
+ <td align='right'>
+ <a href="javascript:void(0);" id='rdetail_view_marc'>&rdetail.detailMain.viewMarc;</a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
</div>
<xi:include href="rdetail_summary.xml"/>
</div>
</tr>
<tr>
- <td class='result_table_format_cell'>
- <a class='search_link'>
+ <td name='result_table_format_cell' class='result_table_format_cell'>
+ <a name='resource_link' class='search_link'>
+ <img name='format_pic' class='tor_pic'> </img>
<!-- Item formats go here -->
</a>
</td>
</tbody>
</table>
</td>
-
</tr>
</tbody>
</table>
+
+ <script language='javascript'>
+ config.names.result.format_cell = 'result_table_format_cell';
+ config.names.result.format_link = 'resource_link'
+ config.names.result.format_pic = 'format_pic'
+ </script>
+
</div>
<td align='left' class='searchbar_main_td'>
<span class="searchbar_item">
<select id='search_type_selector'>
- <option value='title' selected='selected'>Title</option>
+ <option value='keyword' selected='selected'>Keyword</option>
+ <option value='title'>Title</option>
<option value='author'>Author</option>
<option value='subject'>Subject</option>
<option value='series'>Series</option>
- <option value='keyword'>Keyword</option>
</select>
</span>