From: Jeff Godin Date: Sun, 15 Apr 2012 03:07:12 +0000 (-0400) Subject: Remove copy info matrix from rdetail page X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cda9e654348b38f213f5b3bcbbf4677bb2aae939;p=evergreen%2Ftadl.git Remove copy info matrix from rdetail page Removing copy info matrix. Next up: bibtemplate-style copy information to replace copy info matrix. Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js b/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js index beb53218ed..db7e25a418 100644 --- a/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js +++ b/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js @@ -3,7 +3,6 @@ detachAllEvt('common', 'run'); attachEvt("common", "run", rdetailDraw); -attachEvt("rdetail", "recordDrawn", rdetailBuildStatusColumns); attachEvt("rdetail", "recordDrawn", rdetailBuildInfoRows); attachEvt("rdetail", "recordDrawn", rdetailGetPageIds); @@ -44,7 +43,6 @@ var rdetailStart = null; var rdetailEnd = null; var mfhdDetails = []; -var orgHiding = false; if(location.href.match(/&place_hold=1/)) { // prevent load flicker between canvases @@ -139,17 +137,6 @@ function rdetailDraw() { attachEvt('common','holdUpdated', rdetailReload); attachEvt('common','holdUpdateCanceled', rdetailReload); - copyRowParent = G.ui.rdetail.cp_info_row.parentNode; - copyRow = copyRowParent.removeChild(G.ui.rdetail.cp_info_row); - statusRow = G.ui.rdetail.cp_status.parentNode; - statusRow.id = '__rdsrow'; - - G.ui.rdetail.cp_info_local.onclick = rdetailShowLocalCopies; - G.ui.rdetail.cp_info_all.onclick = rdetailShowAllCopies; - - if(getLocation() == globalOrgTree.id()) - hideMe(G.ui.rdetail.cp_info_all); - if(getRid()) { var req = new Request(FETCH_RMODS, getRid()); @@ -297,25 +284,6 @@ function rdetailForeignItems(r,id) { } } - - -function rdetailShowLocalCopies() { - rdetailShowLocal = true; - rdetailBuildInfoRows(); - hideMe(G.ui.rdetail.cp_info_local); - unHideMe(G.ui.rdetail.cp_info_all); - hideMe(G.ui.rdetail.cp_info_none); -} - -function rdetailShowAllCopies() { - - rdetailShowLocal = false; - rdetailBuildInfoRows(); - hideMe(G.ui.rdetail.cp_info_all); - unHideMe(G.ui.rdetail.cp_info_local); - hideMe(G.ui.rdetail.cp_info_none); -} - function OpenMarcEditWindow(pcrud, rec) { /* To run in Firefox directly, must set signed.applets.codebase_principal_support @@ -514,7 +482,6 @@ function _rdetailDraw(r) { hideMe($('rdetail_place_hold')); hideMe($('rdetail_copy_info_link')); hideMe($('rdetail_viewcn_link')); - hideMe($('rdetail_copy_info_div')); } } for( var i = 0; links && links.length > 0 && i < links.length; i = i + 3 ) { @@ -755,7 +722,6 @@ var rdetailMarcFetched = false; var rdetailForeignItemsFetched = false; function rdetailShowExtra(type, args) { - hideMe($('rdetail_copy_info_div')); hideMe($('rdetail_summary_div')); hideMe($('rdetail_reviews_div')); hideMe($('rdetail_toc_div')); @@ -785,7 +751,6 @@ function rdetailShowExtra(type, args) { switch(type) { case "copyinfo": - unHideMe($('rdetail_copy_info_div')); addCSSClass($('rdetail_copy_info_link'), 'rdetail_extras_selected'); break; @@ -904,7 +869,6 @@ function rdetailShowCNBrowse( cn, loc, depth, fromOnclick ) { unHideMe($('rdetail_cn_browse_select_div')); rdetailBuildCNList(); setSelector( $('cn_browse_selector'), js2JSON(cn) ); - hideMe($('rdetail_copy_info_div')); hideMe($('rdetail_reviews_div')); hideMe($('rdetail_summary_div')); hideMe($('rdetail_toc_div')); @@ -985,100 +949,10 @@ function rdetailBuildInfoRows() { req.send(); } -function _rdetailRows(node) { - - if( rdetailShowLocal && getLocation() != globalOrgTree.id() ) { - var loc = findOrgUnit(getLocation()); - if( node ) { - if( !orgIsMine(node, loc) && !orgIsMine(loc,node) ) return; - } else { - var kids = globalOrgTree.children(); - if (kids) { - for( var i = 0; i < kids.length; i++ ) { - var org = findOrgUnit(kids[i]); - if( orgIsMine(org, loc) ) { - node = org; - break; - } - } - } - } - } - - if(!node && findOrgType(globalOrgTree.ou_type()).can_have_vols()) - node = globalOrgTree; - - - /* don't show hidden orgs */ - - if(node) { - - if(!isXUL() && !isTrue(node.opac_visible())) return; - - if (orgHiding) { - if (isTrue( findOrgType(node.ou_type()).can_have_vols() )) { - if ( ! orgIsMine( orgHiding.org, node, orgHiding.depth ) ) { - return; - } - } - } - - 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 ); - var actions = $n(row, 'rdetail_actions_cell'); - - var p = libtd.getElementsByTagName('a')[0]; - libtd.insertBefore(text(node.name()), p); - libtd.setAttribute("style", "padding-left: " + ((findOrgDepth(node) - 1) * 9) + "px;"); - - if(!findOrgType(node.ou_type()).can_have_vols()) { - - row.removeChild(cntd); - row.removeChild(cpctd); - row.removeChild(actions); - row.setAttribute('novols', '1'); - - libtd.setAttribute("colspan", numStatuses + 3 ); - libtd.colSpan = numStatuses + 3; - addCSSClass(row, 'copy_info_region_row'); - } - - copyRowParent.appendChild(row); - - } else { node = globalOrgTree; } - - var kids = node.children(); - if (kids) { - for( var c = 0; c < kids.length; c++ ) - _rdetailRows(kids[c]); - } -} - -function rdetailCNPrint(orgid, cn) { - var div = cpdBuildPrintWindow( record, orgid); - var template = div.removeChild($n(div, 'cnrow')); - var rowNode = $("cp_info_" + orgid); - cpdStylePopupWindow(div); - openWindow(div.innerHTML); -} - var localCNFound = false; var ctr = 0; function _rdetailBuildInfoRows(r) { - if (rdetailShowCopyLocation) - unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header' ) ); - - removeChildren(copyRowParent); - - orgHiding = checkOrgHiding(); - - _rdetailRows(); - var summary = r.getResultObject(); if(!summary) return; @@ -1088,47 +962,6 @@ function _rdetailBuildInfoRows(r) { var arr = summary[i]; globalCNCache[js2JSON([arr[1],arr[2],arr[3]])] = 1; // prefix, label, suffix. FIXME - Am I used anywhere? var thisOrg = findOrgUnit(arr[0]); - var rowNode = $("cp_info_" + thisOrg.id()); - if(!rowNode) continue; - - if(rowNode.getAttribute("used")) { - - if( rowNode.nextSibling ) { - sib = rowNode.nextSibling; - o ='cp_info_'+thisOrg.id()+'_'; - /* push the new row on as the last row for this org unit */ - while( sib && sib.id.match(o) ) { - sib = sib.nextSibling; - } - if(sib) - rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib); - else - rowNode = copyRowParent.appendChild(copyRow.cloneNode(true)); - } else { - rowNode = copyRowParent.appendChild(copyRow.cloneNode(true)); - } - - var n = findNodeByName( rowNode, config.names.rdetail.lib_cell ); - n.appendChild(text(thisOrg.name())); - n.setAttribute("style", "padding-left: " + ((findOrgDepth(thisOrg) - 1) * 9) + "px;"); - rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr); - - } else { - rowNode.setAttribute("used", "1"); - } - - var cpc_temp = rowNode.removeChild( - findNodeByName(rowNode, config.names.rdetail.cp_count_cell)); - - var statuses = arr[4]; - var cl = ''; - if (rdetailShowCopyLocation) { - cl = arr[4]; - statuses = arr[5]; - } - - - rdetailApplyStatuses(rowNode, cpc_temp, statuses); var isLocal = false; if( orgIsMine( findOrgUnit(getLocation()), thisOrg ) ) { @@ -1140,19 +973,14 @@ function _rdetailBuildInfoRows(r) { } } - //if(isLocal) unHideMe(rowNode); - unHideMe(rowNode); - - rdetailSetPath( thisOrg, isLocal ); - rdetailBuildBrowseInfo( rowNode, [arr[1],arr[2],arr[3]], isLocal, thisOrg, cl ); + rdetailBuildBrowseInfo( [arr[1],arr[2],arr[3]], isLocal, thisOrg, cl ); if( i == summary.length - 1 && !defaultCN) defaultCN = [arr[1],arr[2],arr[3]]; // prefix, label, suffix } - if(!found) unHideMe(G.ui.rdetail.cp_info_none); } -function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) { +function rdetailBuildBrowseInfo(cn, local, orgNode, cl) { var whole_cn_json = js2JSON(cn); var whole_cn_text = (cn[0] ? cn[0] + ' ' : '') + cn[1] + (cn[2] ? ' ' + cn[2] : ''); @@ -1163,103 +991,6 @@ function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) { else callnumberCache[whole_cn_json] = { count : 1 }; } - var depth = getDepth(); - if( !local ) depth = findOrgDepth(globalOrgTree); - - $n(row, 'rdetail_callnumber_cell').appendChild(text(whole_cn_text)); - - if (rdetailShowCopyLocation) { - var cl_cell = $n(row, 'rdetail_copylocation_cell'); - cl_cell.appendChild(text(cl)); - unHideMe(cl_cell); - } - - _debug('setting action clicks for cn ' + whole_cn_text); - - var dHref = 'javascript:rdetailVolumeDetails('+ - '{copy_location : "'+cl.replace(/\"/g, '\\"')+'", rowid : "'+row.id+'", cn_prefix :"'+cn[0].replace(/\"/g, '\\"')+'",cn :"'+cn[1].replace(/\"/g, '\\"')+'",cn_suffix :"'+cn[2].replace(/\"/g, '\\"')+'", depth:"'+depth+'", org:"'+orgNode.id()+'", local: '+local+'});'; - - var bHref = 'javascript:rdetailShowCNBrowse("'+cn[1].replace(/\"/g, '\\"') + '", '+orgNode.id()+', "'+depth+'");'; - - unHideMe( $n(row, 'details') ) - $n(row, 'details').setAttribute('href', dHref); - unHideMe( $n(row, 'browse') ) - $n(row, 'browse').setAttribute('href', bHref); - - if(isXUL()) { - unHideMe($n(row, 'hold_div')); - $n(row, 'hold').onclick = function() { - var req = new Request(FETCH_VOLUME_BY_INFO, cn, record.doc_id(), orgNode.id()); - req.callback( - function(r) { - var vol = r.getResultObject(); - holdsDrawEditor({type: 'V', volumeObject : vol}); - } - ); - req.send(); - }; - } -} - -// sets the path to org as 'active' and displays the path if it's local -function rdetailSetPath(org, local) { - if( findOrgDepth(org) == 0 ) return; - var row = $("cp_info_" + org.id()); - row.setAttribute("hasinfo", "1"); - unHideMe(row); - rdetailSetPath(findOrgUnit(org.parent_ou()), local); -} - -//Append all the statuses for a given summary to the -//copy summary table -function rdetailApplyStatuses( row, template, statuses ) { - for( var j in _statusPositions ) { - var stat = _statusPositions[j]; - var val = statuses[stat.id()]; - var nn = template.cloneNode(true); - if(val) nn.appendChild(text(val)); - else nn.appendChild(text(0)); - row.appendChild(nn); - } -} - -//Add one td (creating a new column) to the copy summary -//table for each opac_visible copy status -function rdetailBuildStatusColumns() { - - rdetailGrabCopyStatuses(); - var parent = statusRow; - var template = parent.removeChild(G.ui.rdetail.cp_status); - - var i = 0; - for( i = 0; i < cp_statuses.length; i++ ) { - - var c = cp_statuses[i]; - if( c && isTrue(c.opac_visible()) ) { - var name = c.name(); - _statusPositions[i] = c; - var node = template.cloneNode(true); - var data = findNodeByName( node, config.names.rdetail.cp_status); - - data.appendChild(text(name)); - parent.appendChild(node); - } - } - - numStatuses = 0; - for(x in _statusPositions) numStatuses++; -} - -function rdetailGrabCopyStatuses() { - if(cp_statuses) return cp_statuses; - var req = new Request(FETCH_COPY_STATUSES); - req.send(true); - cp_statuses = req.result(); - cp_statuses = cp_statuses.sort(_rdetailSortStatuses); -} - -function _rdetailSortStatuses(a, b) { - return parseInt(a.id()) - parseInt(b.id()); } /** diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml deleted file mode 100644 index 01e463bf7d..0000000000 --- a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml +++ /dev/null @@ -1,89 +0,0 @@ - - -
- -
- - &rdetail.copyInfo.local; - - - &rdetail.copyInfo.all; - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
&rdetail.copyInfo.library;&rdetail.copyInfo.callnumber;&rdetail.copyInfo.copylocation;&rdetail.copyInfo.actions; -
-
- - &rdetail.copyInfo.print; - - - - - -
&rdetail.loading;
- - - -

- -
&rdetail.noneAvailable;
- - - -
- - diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml index 47382b624f..c9f563ecdc 100644 --- a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml @@ -4,12 +4,6 @@ - -