[open-ils-commits] r17559 - in branches/rel_2_0/Open-ILS: src/perlmods/OpenILS/Application web/opac/common/js web/opac/locale/en-US web/opac/skin/default/js web/opac/skin/default/xml/common (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Sep 9 18:02:13 EDT 2010
Author: erickson
Date: 2010-09-09 18:02:07 -0400 (Thu, 09 Sep 2010)
New Revision: 17559
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm
branches/rel_2_0/Open-ILS/web/opac/common/js/config.js
branches/rel_2_0/Open-ILS/web/opac/locale/en-US/opac.dtd
branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js
branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/common/holds.xml
Log:
back-porting: 17553 17554 => support for viewing and editing existing issuance-level holds to the default opac skin; alternate issuance flesh call that only fleshes the subscription; used for public/opac display
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm 2010-09-09 21:46:22 UTC (rev 17558)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm 2010-09-09 22:02:07 UTC (rev 17559)
@@ -320,7 +320,36 @@
});
}
+__PACKAGE__->register_method(
+ method => "pub_fleshed_serial_issuance_retrieve_batch",
+ api_name => "open-ils.serial.issuance.pub_fleshed.batch.retrieve",
+ signature => {
+ desc => q/
+ Public (i.e. OPAC) call for getting at the sub and
+ ultimately the record entry from an issuance
+ /,
+ params => [{name => 'ids', desc => 'Array of IDs', type => 'array'}],
+ return => {
+ desc => q/
+ issuance objects, fleshed with subscriptions
+ /,
+ class => 'siss'
+ }
+ }
+);
+sub pub_fleshed_serial_issuance_retrieve_batch {
+ my( $self, $client, $ids ) = @_;
+ return [] unless $ids and @$ids;
+ return new_editor()->search_serial_issuance([
+ { id => $ids },
+ {
+ flesh => 1,
+ flesh_fields => {siss => [ qw/subscription/ ]}
+ }
+ ]);
+}
+
##########################################################################
# unit methods
#
Modified: branches/rel_2_0/Open-ILS/web/opac/common/js/config.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/common/js/config.js 2010-09-09 21:46:22 UTC (rev 17558)
+++ branches/rel_2_0/Open-ILS/web/opac/common/js/config.js 2010-09-09 22:02:07 UTC (rev 17559)
@@ -356,6 +356,7 @@
var FETCH_COPIES_FROM_VOLUME = 'open-ils.search:open-ils.search.asset.copy.retrieve_by_cn_label:1';
var FETCH_VOLUME_BY_INFO = 'open-ils.search:open-ils.search.call_number.retrieve_by_info'; /* XXX staff method? */
var FETCH_VOLUME = 'open-ils.search:open-ils.search.asset.call_number.retrieve';
+var FETCH_ISSUANCE = 'open-ils.serial:open-ils.serial.issuance.pub_fleshed.batch.retrieve';
var FETCH_COPY_LOCATIONS = 'open-ils.circ:open-ils.circ.copy_location.retrieve.all';
var FETCH_COPY_NOTES = 'open-ils.circ:open-ils.circ.copy_note.retrieve.all';
var FETCH_COPY_STAT_CATS = 'open-ils.circ:open-ils.circ.asset.stat_cat_entries.fleshed.retrieve_by_copy';
Modified: branches/rel_2_0/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/locale/en-US/opac.dtd 2010-09-09 21:46:22 UTC (rev 17558)
+++ branches/rel_2_0/Open-ILS/web/opac/locale/en-US/opac.dtd 2010-09-09 22:02:07 UTC (rev 17559)
@@ -592,6 +592,7 @@
<!ENTITY common.isbn.label "ISBN:">
<!ENTITY common.issn.label "ISSN:">
<!ENTITY common.copy.barcode.label "Copy Barcode:">
+<!ENTITY common.issuance_label.label "Issuance Label:">
<!ENTITY common.hold.place "Place hold for my account">
<!ENTITY common.hold.check "Checking for possibility of hold fulfillment...">
<!ENTITY common.hold.create "Create / Edit a Hold">
@@ -599,6 +600,7 @@
<!ENTITY common.hold.type.label "Hold Type:">
<!ENTITY common.hold.volume "Volume Hold">
<!ENTITY common.hold.copy "Copy Hold">
+<!ENTITY common.hold.issuance "Issuance Hold">
<!ENTITY common.hold.advanced "Advanced Hold Options">
<!ENTITY common.hold.delivery "Please select a physical location where your hold can be delivered.">
<!ENTITY common.hold.checked_out "This item is already checked out.">
Modified: branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js 2010-09-09 21:46:22 UTC (rev 17558)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/js/holds.js 2010-09-09 22:02:07 UTC (rev 17559)
@@ -11,6 +11,16 @@
var noEmailMessage;
var noEmailMessageXUL;
+var holdTargetTypeMap = {
+ M : 'metarecord',
+ T : 'record',
+ V : 'volume',
+ I : 'issuance',
+ C : 'copy'
+};
+
+
+
function holdsHandleStaff() {
// if we know the recipient's barcode, use it
@@ -180,21 +190,7 @@
var args = (oargs) ? oargs : {};
args.type = hold.hold_type();
var target = hold.target();
-
- switch(args.type) {
- case 'M':
- args.metarecord = target;
- break;
- case 'T':
- args.record = target;
- break;
- case 'V':
- args.volume = target;
- break;
- case 'C':
- args.copy = target;
- break;
- }
+ args[holdTargetTypeMap[args.type]] = target;
return args;
}
@@ -229,6 +225,9 @@
if( type == 'V' ) {
_h_set_vol(args, doneCallback);
+ } else if( type == 'I' ) {
+ _h_set_issuance(args, doneCallback);
+
} else {
if( type == 'T' ) {
_h_set_rec(args, doneCallback);
@@ -263,6 +262,28 @@
}
}
+function _h_set_issuance(args, doneCallback) {
+
+ if( args.issuanceObject ) {
+ args.issuance = args.issuanceObject.id();
+ args.record = args.issuanceObject.subscription().record_entry();
+ _h_set_rec(args, doneCallback);
+
+ } else {
+
+ var vreq = new Request(FETCH_ISSUANCE, [args.issuance]);
+ vreq.callback(
+ function(r) {
+ var issuance = r.getResultObject()[0];
+ args.issuanceObject = issuance;
+ args.record = issuance.subscription().record_entry();
+ _h_set_rec(args, doneCallback);
+ }
+ );
+ vreq.send();
+ }
+}
+
function _h_set_rec(args, doneCallback) {
if(args.recordObject)
@@ -395,8 +416,14 @@
appendClear($('holds_title'), text(rec.title()));
appendClear($('holds_author'), text(rec.author()));
- if( holdArgs.type == 'V' || holdArgs.type == 'C' ) {
+ if( holdArgs.type == 'I' ) {
+ unHideMe($('holds_type_row'));
+ unHideMe($('holds_is_issuance'));
+ unHideMe($('holds_issuance_row'));
+ appendClear($('holds_issuance_label'), text(holdArgs.issuanceObject.label()));
+ } else if( holdArgs.type == 'V' || holdArgs.type == 'C' ) {
+
unHideMe($('holds_type_row'));
unHideMe($('holds_cn_row'));
appendClear($('holds_cn'), text(holdArgs.volumeObject.label()));
@@ -416,6 +443,7 @@
hideMe($('holds_type_row'));
hideMe($('holds_copy_row'));
hideMe($('holds_cn_row'));
+ hideMe($('holds_issuance_row'));
}
removeChildren($('holds_format'));
@@ -783,21 +811,8 @@
else
hold.email_notify(0);
- var target;
+ var target = holdArgs[holdTargetTypeMap[holdArgs.type]];
- switch(holdArgs.type) {
- case 'M':
- target = holdArgs.metarecord; break;
- case 'T':
- target = holdArgs.record; break;
- case 'V':
- target = holdArgs.volume; break;
- case 'C':
- target = holdArgs.copy; break;
- }
-
-
-
hold.pickup_lib(org);
//hold.request_lib(org);
hold.requestor(holdArgs.requestor.id());
Modified: branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/common/holds.xml
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/common/holds.xml 2010-09-09 21:46:22 UTC (rev 17558)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/common/holds.xml 2010-09-09 22:02:07 UTC (rev 17559)
@@ -62,10 +62,16 @@
<td class='holds_cell'><b id='holds_copy'/> </td>
</tr>
+ <tr class='hide_me' id='holds_issuance_row'>
+ <td class='holds_cell'>&common.issuance_label.label;</td>
+ <td class='holds_cell'><b id='holds_issuance_label'/> </td>
+ </tr>
+
<tr class='hide_me' id='holds_type_row'>
<td class='holds_cell'>&common.hold.type.label;</td>
<td class='holds_cell hide_me' id='holds_is_cn'><b>&common.hold.volume;</b></td>
<td class='holds_cell hide_me' id='holds_is_copy'><b>&common.hold.copy;</b></td>
+ <td class='holds_cell hide_me' id='holds_is_issuance'><b>&common.hold.issuance;</b></td>
</tr>
<tr>
More information about the open-ils-commits
mailing list