[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 14ed83cfb0df9e7a77c5673f7005f92a2e0bf25c

Evergreen Git git at git.evergreen-ils.org
Thu Jul 14 16:47:56 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  14ed83cfb0df9e7a77c5673f7005f92a2e0bf25c (commit)
      from  2e50b041803796665fa10270dafeae79c1d0bbe1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 14ed83cfb0df9e7a77c5673f7005f92a2e0bf25c
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Thu Jul 14 16:41:42 2011 -0400

    Corrected the logic of format string building for metarecord holds and...
    
    made hold possiblity checking for metarecord holds respect the format
    string (so you can't place holds on formats for which there will never
    be anything targetable)
    
    Made possible by much concerted effort from Mike Rylander
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index 40e1909..f16c31a 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -2077,6 +2077,7 @@ sub do_possibility_checks {
     my $pickup_lib   = $params{pickup_lib};
     my $hold_type    = $params{hold_type}    || 'T';
     my $selection_ou = $params{selection_ou} || $pickup_lib;
+    my $holdable_formats = $params{holdable_formats};
 
 
 	my $copy;
@@ -2127,9 +2128,9 @@ sub do_possibility_checks {
 		my @status = ();
 		for my $rec (@recs) {
 			@status = _check_title_hold_is_possible(
-				$rec, $depth, $request_lib, $patron, $e->requestor, $pickup_lib, $selection_ou
+				$rec, $depth, $request_lib, $patron, $e->requestor, $pickup_lib, $selection_ou, $holdable_formats
 			);
-			last if $status[1];
+			last if $status[0];
 		}
 		return @status;
 	}
@@ -2162,8 +2163,13 @@ sub create_ranged_org_filter {
 
 
 sub _check_title_hold_is_possible {
-    my( $titleid, $depth, $request_lib, $patron, $requestor, $pickup_lib, $selection_ou ) = @_;
+    my( $titleid, $depth, $request_lib, $patron, $requestor, $pickup_lib, $selection_ou, $holdable_formats ) = @_;
    
+    my ($types, $formats, $lang);
+    if (defined($holdable_formats)) {
+        ($types, $formats, $lang) = split '-', $holdable_formats;
+    }
+
     my $e = new_editor();
     my %org_filter = create_ranged_org_filter($e, $selection_ou, $depth);
 
@@ -2181,6 +2187,16 @@ sub _check_title_hold_is_possible {
                                 field  => 'id',
                                 filter => { id => $titleid },
                                 fkey   => 'record'
+                            },
+                            mrd => {
+                                field  => 'record',
+                                fkey   => 'record',
+                                filter => {
+                                    record => $titleid,
+                                    ( $types   ? (item_type => [split '', $types])   : () ),
+                                    ( $formats ? (item_form => [split '', $formats]) : () ),
+                                    ( $lang    ? (item_lang => $lang)                : () )
+                                }
                             }
                         }
                     },
@@ -2606,7 +2622,8 @@ sub verify_copy_for_hold {
 
     return (
         (not scalar @$permitted), # true if permitted is an empty arrayref
-        (
+        (   # XXX This test is of very dubious value; someone should figure
+            # out what if anything is checking this value
 	        ($copy->circ_lib == $pickup_lib) and 
             ($copy->status == OILS_COPY_STATUS_AVAILABLE)
         ),
diff --git a/Open-ILS/web/opac/skin/default/js/holds.js b/Open-ILS/web/opac/skin/default/js/holds.js
index 9b09f68..4122e8b 100644
--- a/Open-ILS/web/opac/skin/default/js/holds.js
+++ b/Open-ILS/web/opac/skin/default/js/holds.js
@@ -798,14 +798,14 @@ function holdsSetSelectedFormats() {
 
 	var fstring = "";
 
-	if( contains(vals, 'at-d') || contains(vals, 'at-s')) {
+	if( contains(vals, 'at-d') || contains(vals, 'at-s') || contains(vals, 'at')) {
 		if( contains(vals, 'at') ) {
 			fstring = 'at';
 		} else if (contains(vals, 'at-s') && contains(vals, 'at-d')) {
 			fstring = 'at-sd';
 		} else if (!contains(vals, 'at-s')) {
 			fstring = 'at-d';
-	} else {
+		} else {
 			fstring = 'at-s';
 		}
 	}
@@ -836,6 +836,7 @@ function holdsCheckPossibility(pickuplib, hold, recurse) {
 		issuanceid : holdArgs.issuance,
 		copy_id : holdArgs.copy,
 		hold_type : holdArgs.type,
+		holdable_formats : holdArgs.holdable_formats,
 		patronid : holdArgs.recipient.id(),
 		depth : 0, 
 		pickup_lib : pickuplib,
@@ -983,6 +984,8 @@ function holdsBuildHoldFromWindow() {
 	if(fstring) { 
 		hold.hold_type('M'); 
 		hold.holdable_formats(fstring);
+		if (fstring)
+			holdArgs.holdable_formats = fstring;
 		hold.target(holdArgs.metarecord);
 	}
 	return hold;

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |   25 ++++++++++++++++---
 Open-ILS/web/opac/skin/default/js/holds.js         |    7 ++++-
 2 files changed, 26 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list