[open-ils-commits] r15585 - in trunk/Open-ILS: src/perlmods/OpenILS/WWW web/opac/locale/en-US web/opac/skin/default/js web/opac/skin/default/xml/result (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Feb 18 15:28:42 EST 2010


Author: miker
Date: 2010-02-18 15:28:37 -0500 (Thu, 18 Feb 2010)
New Revision: 15585

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
   trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
   trunk/Open-ILS/web/opac/skin/default/js/result_common.js
   trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
Log:
adding "show call numbers at can-have-vols search locations; supporing unapi format

Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-02-18 17:05:11 UTC (rev 15584)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-02-18 20:28:37 UTC (rev 15585)
@@ -347,6 +347,8 @@
 	<format name='opac' type='text/html'/>
 	<format name='html' type='text/html'/>
 	<format name='htmlholdings' type='text/html'/>
+	<format name='holdings_xml' type='application/xml'/>
+	<format name='holdings_xml-full' type='application/xml'/>
 	<format name='html-full' type='text/html'/>
 	<format name='htmlholdings-full' type='text/html'/>
 	<format name='marctxt' type='text/plain'/>
@@ -390,6 +392,8 @@
 	<format name='opac' type='text/html'/>
 	<format name='html' type='text/html'/>
 	<format name='htmlholdings' type='text/html'/>
+	<format name='holdings_xml' type='application/xml'/>
+	<format name='holdings_xml-full' type='application/xml'/>
 	<format name='html-full' type='text/html'/>
 	<format name='htmlholdings-full' type='text/html'/>
 	<format name='marctxt' type='text/plain'/>
@@ -469,11 +473,11 @@
 	}
 
 	if ( !grep
-	       { (keys(%$_))[0] eq $base_format }
-	       @{ $supercat->request("open-ils.supercat.$type.formats")->gather(1) }
-	     and !grep
-	       { $_ eq $base_format }
-	       qw/opac html htmlholdings marctxt ris/
+		   { (keys(%$_))[0] eq $base_format }
+		   @{ $supercat->request("open-ils.supercat.$type.formats")->gather(1) }
+		 and !grep
+		   { $_ eq $base_format }
+		   qw/opac html htmlholdings marctxt ris holdings_xml/
 	) {
 		print "Content-type: text/html; charset=utf-8\n\n";
 		$apache->custom_response( 406, <<"		HTML");
@@ -532,9 +536,22 @@
 		return Apache2::Const::OK;
 	}
 
-	my $req = $supercat->request("open-ils.supercat.$type.$format.$command",$id);
+	my $method = "open-ils.supercat.$type.$base_format.$command";
+	my @params = ($id);
+
+	if ($base_format eq 'holdings_xml') {
+		$method .= '.atomic';
+		push @params, $lib;
+		if ($format !~ /-full$/o) {
+			push @params, 1;
+		}
+	}
+
+	my $req = $supercat->request($method, at params);
 	my $data = $req->gather(1);
 
+	$data = join('', @$data) if ($base_format eq 'holdings_xml');
+
 	if ($req->failed || !$data) {
 		print "Content-type: text/html; charset=utf-8\n\n";
 		$apache->custom_response( 404, <<"		HTML");

Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd	2010-02-18 17:05:11 UTC (rev 15584)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd	2010-02-18 20:28:37 UTC (rev 15585)
@@ -576,6 +576,7 @@
 <!ENTITY result.table.keyword "View titles for this record">
 <!ENTITY result.table.author "Perform an Author Search">
 <!ENTITY result.googleBooks.browse "Browse in Google Books Search">
+<!ENTITY result.localCallNumbers "Local Call Numbers:">
 
 <!ENTITY common.call.number.label "Call Number:">
 <!ENTITY common.isbn.label "ISBN:">

Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js	2010-02-18 17:05:11 UTC (rev 15584)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js	2010-02-18 20:28:37 UTC (rev 15585)
@@ -483,6 +483,23 @@
 			title_link.setAttribute("href", buildOPACLink(args));
 			title_link.appendChild(text(normalize(truncate(rec.title(), 65))));
 			
+			var here = findOrgUnit(getLocation());
+			if (findOrgType(here.ou_type()).can_have_vols()) { // show the callnumber list
+				dojo.require('openils.BibTemplate');
+				var l_cn_list = $n(r,'local_callnumber_list');
+
+				setTimeout(
+					function () {
+						unHideMe(l_cn_list);
+						new openils.BibTemplate({
+							root : l_cn_list,
+							record : onlyrec,
+							org_unit : here.shortname()
+						}).render();
+					}, 0
+				);
+			}
+
 		} else {
 			buildunAPISpan($n(r,'unapi'), 'metabib-metarecord', rec.doc_id());
 
@@ -507,6 +524,24 @@
 		unHideMe($n(r,'place_hold_span'));
 		$n(r,'place_hold_link').setAttribute(
 			'href','javascript:holdsDrawEditor({record:"'+rec.doc_id()+'",type:"T"});');
+
+		var here = findOrgUnit(getLocation());
+		if (findOrgType(here.ou_type()).can_have_vols()) { // show the callnumber list
+			dojo.require('openils.BibTemplate');
+			var l_cn_list = $n(r,'local_callnumber_list');
+			var onlyrec = rec.doc_id();
+
+			setTimeout(
+				function () {
+					unHideMe(l_cn_list);
+					new openils.BibTemplate({
+						root : l_cn_list,
+						record : onlyrec,
+						org_unit : here.shortname()
+					}).render();
+				}, 0
+			);
+		}
 	}
 
 	buildSearchLink(STYPE_AUTHOR, rec.author(), author_link);

Modified: trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml	2010-02-18 17:05:11 UTC (rev 15584)
+++ trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml	2010-02-18 20:28:37 UTC (rev 15585)
@@ -33,7 +33,7 @@
 
 							<tr style='height: 1em' name='counts_row'>
 
-								<td  rowspan='3' class='result_table_pic_header'>
+								<td  rowspan='4' class='result_table_pic_header'>
 									<a><img name='item_jacket' class='result_table_pic'/></a>
 								</td>
 
@@ -45,7 +45,7 @@
 								</td>
 
 								<!-- Copy this td for each copy count appended -->
-								<td  rowspan='3' nowrap='nowrap' name="copy_count_cell" class='copy_count_cell'> 
+								<td  rowspan='4' nowrap='nowrap' name="copy_count_cell" class='copy_count_cell'> 
 								</td>
 
 							</tr>
@@ -137,6 +137,13 @@
 
 								</td>
 							</tr>
+							<tr name="local_callnumber_list" class="result_table_title_cell hide_me">
+								<td>&result.localCallNumbers;
+									<span type='opac/slot-data+holdings_xml' query='volumes volume' join=", ">
+										<script type='opac/slot-format'><![CDATA[return '<b>'+item.getAttribute('label')+'</b>';]]></script>
+									</span>
+								</td>
+							</tr>
 
 						</tbody>
 					</table>



More information about the open-ils-commits mailing list