From edb6b63bc565f8028a582f6f6eb265e30f682fbf Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 21 Aug 2006 16:00:25 +0000 Subject: [PATCH] added latest circ to flesh copy call and displaying due_date in copy-details for isXUL git-svn-id: svn://svn.open-ils.org/ILS/trunk@5627 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 1 + .../perlmods/OpenILS/Application/Search/Biblio.pm | 25 ++++++++++++---------- Open-ILS/web/opac/skin/default/js/copy_details.js | 11 +++++++++- .../default/xml/rdetail/rdetail_cn_details.xml | 5 +++++ 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 81a64021d0..823f22477a 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -1642,6 +1642,7 @@ + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 09cc0b099e..842ffa1281 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -280,18 +280,21 @@ sub fleshed_copy_retrieve2 { # For backwards compatibility $copy->stat_cat_entries($copy->stat_cat_entry_copy_maps); - return $copy; - -# return $copy unless $copy->stat_cat_entries; -# -# for my $map (@{$copy->stat_cat_entries}) { -# $map->stat_cat( -# $e->retrieve_asset_stat_cat($map->stat_cat)); -# $map->stat_cat_entry( -# $e->retrieve_asset_stat_cat_entry($map->stat_cat_entry)); -# } -# return $copy; + if( $copy->status->id == OILS_COPY_STATUS_CHECKED_OUT ) { + $copy->circulations( + $e->search_action_circulation( + [ + { target_copy => $copy->id }, + { + order_by => 'xact_start', + limit => 1 + } + ] + ) + ); + } + return $copy; } diff --git a/Open-ILS/web/opac/skin/default/js/copy_details.js b/Open-ILS/web/opac/skin/default/js/copy_details.js index 617addfb7d..aa3792eb37 100644 --- a/Open-ILS/web/opac/skin/default/js/copy_details.js +++ b/Open-ILS/web/opac/skin/default/js/copy_details.js @@ -25,6 +25,7 @@ var i = cpdCheckExisting(contextRow); unHideMe($n(templateRow, 'age_protect_label')); unHideMe($n(templateRow, 'create_date_label')); unHideMe($n(templateRow, 'holdable_label')); + unHideMe($n(templateRow, 'due_date_label')); } unHideMe(templateRow); @@ -175,6 +176,7 @@ function cpdDrawCopies(r) { unHideMe($n(copyrow, 'age_protect_value')); unHideMe($n(copyrow, 'create_date_value')); unHideMe($n(copyrow, 'copy_holdable_td')); + unHideMe($n(copyrow, 'copy_due_date_td')); } for( var i = 0; i < copies.length; i++ ) { @@ -198,7 +200,6 @@ function cpdDrawCopy(r) { $n(row, 'status').appendChild(text(copy.status().name())); if(isXUL()) { - /* show the hold link */ var l = $n(row, 'copy_hold_link'); unHideMe(l); @@ -230,6 +231,14 @@ function cpdDrawCopy(r) { $n(row, 'copy_is_holdable').appendChild(text(no)); } + var circ; + if( copy.circulations() ) { + circ = copy.circulations()[0]; + if( circ ) { + $n(row, 'copy_due_date').appendChild(text(circ.due_date().replace(/[T ].*/,''))); + } + } + } r.args.copy = copy; diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml index 619f5ca2f6..1a10718379 100644 --- a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml +++ b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml @@ -16,6 +16,7 @@ Age Hold Protection Create Date Holdable + Due Date @@ -39,6 +40,10 @@ + + + + -- 2.11.0