[open-ils-commits] r17536 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 9 09:36:37 EDT 2010


Author: erickson
Date: 2010-09-09 09:36:36 -0400 (Thu, 09 Sep 2010)
New Revision: 17536

Modified:
   branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
back-port: 17535 => for consistency, use 'issuanceid' as the issuance ID param for holds possibility testing; removed some crusty, old hold create code

Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2010-09-09 13:35:18 UTC (rev 17535)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2010-09-09 13:36:36 UTC (rev 17536)
@@ -221,58 +221,6 @@
 	return undef;
 }
 
-sub __create_hold {
-	my( $self, $client, $login_session, @holds) = @_;
-
-	if(!@holds){return 0;}
-	my( $user, $evt ) = $apputils->checkses($login_session);
-	return $evt if $evt;
-
-	my $holdsref = (ref($holds[0]) eq 'ARRAY') ? $holds[0] : [ @holds ];
-
-	$logger->debug("Iterating over " . scalar(@$holdsref) . " holds requests...");
-
-	for my $hold (@$holdsref) {
-        $hold or next;
-		my $type = $hold->hold_type;
-
-		$logger->activity("User " . $user->id . 
-			" creating new hold of type $type for user " . $hold->usr);
-
-		my $recipient;
-		if($user->id ne $hold->usr) {
-			( $recipient, $evt ) = $apputils->fetch_user($hold->usr);
-			return $evt if $evt;
-		} else {
-			$recipient = $user;
-		}
-
-		# am I allowed to place holds for this user?
-		if($hold->requestor ne $hold->usr) {
-			my $perm = _check_request_holds_perm($user->id, $user->home_ou);
-            return $perm if $perm;
-		}
-
-		# is this user allowed to have holds of this type?
-		my $perm = _check_holds_perm($type, $hold->requestor, $recipient->home_ou);
-        return $perm if $perm;
-
-		#enforce the fact that the login is the one requesting the hold
-		$hold->requestor($user->id); 
-		$hold->selection_ou($recipient->home_ou) unless $hold->selection_ou;
-
-		my $resp = $apputils->simplereq(
-			'open-ils.storage',
-			'open-ils.storage.direct.action.hold_request.create', $hold );
-
-		if(!$resp) { 
-			return OpenSRF::EX::ERROR ("Error creating hold"); 
-		}
-	}
-
-	return 1;
-}
-
 # makes sure that a user has permission to place the type of requested hold
 # returns the Perm exception if not allowed, returns undef if all is well
 sub _check_holds_perm {
@@ -1836,7 +1784,7 @@
 sub do_possibility_checks {
     my($e, $patron, $request_lib, $depth, %params) = @_;
 
-    my $issuanceid   = $params{issuance}      || "";
+    my $issuanceid   = $params{issuanceid}      || "";
     my $titleid      = $params{titleid}      || "";
     my $volid        = $params{volume_id};
     my $copyid       = $params{copy_id};



More information about the open-ils-commits mailing list