Jason Stephenson [Thu, 14 Jan 2016 16:40:59 +0000 (11:40 -0500)]
Handle shelf-expired holds in NCIP::ILS::Evergreen->checkinitem.
We modify the check_circ_details method to look for shelf-expired
holds in addition to circulations and transits. It is also modified
to better handle being used from the renewitem handler.
We add the clear_expired flag when actually doing the checkin.
Finally, a new helper _date_past is added to check if a date is in the
past, and the _expired helper is modified to use the _date_past
subroutine.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Comment out the code to strip everything up to and including the
first - from the location field when trying to parse the input.
Apparently, they've stopped adding extra crud on the front of
our codes. The presence of this code is now causing problems
for those locations that do have dashes in their shortnames in
Evergreen.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Use dummy call number in NCIP::ILS::Evergreen->acceptitem.
We have received an AcceptItem message with a missing call number
for the incoming copy. This prevents Evergreen from accepting
the item because Evergreen needs a call number to link the new
copy to the new bibliographic record. This commit will use
either the FromAgencyId and RequestId concatenated or the copy
barcode as the call number when no call number is provided.
This may not be an issue with the use precats option. However,
there are still issues with precats in Evergreen, so use of that
option is strongly discouraged.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Tue, 24 Nov 2015 16:54:48 +0000 (11:54 -0500)]
Check for eligible copies in NCIP::ILS::Evergreen->requestitem.
Add a method to count the number of copies available at the selection
ou to fill the hold. Call this method from requestitem, and if it
returns 0, send a problem response that the requested item will not
be available by need by date.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Tue, 10 Nov 2015 18:27:44 +0000 (13:27 -0500)]
Use default notifications for holds in NCIP::ILS::Evergreen.
When placing holds for our own patrons, we look up the user's settings
for hold notifications and add those the hold parameters. If the
patron has not set any defaults, we fall back to using email and day
phone if these are available for the user.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Tue, 27 Oct 2015 17:13:42 +0000 (13:13 -0400)]
Cancel requests via RequestId in NCIP::ILS::Evergreen.
Add a routine to search for holds via the RequestIdentifierValue of
the CancelRequestItem message's RequestId. This searches action::
hold_request_note by title and body for uncancelled, unfilled holds
where request_lib is equal to our working org. unit. If found, the
corresponding hold is returned to be canceled.
The original logic of searching by ItemId remains as a fallback
when the above fails and for those cases where holds were placed
before this logic was added.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Tue, 27 Oct 2015 16:32:46 +0000 (12:32 -0400)]
Add creation of hold notes in NCIP::ILS::Evergreen.
We'll use the hold notes to store the RequestIdentifierValue that
we're given in the RequestItem and AcceptItem messages. We'll use
that note to find the appropriate hold for cancellation with the
CancelRequestItem message, later.
NOTE: This commit requires that the UPDATE_HOLD permission be granted
to the NCIPServer staff user at the consortium level, i.e. depth 0.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Fri, 23 Oct 2015 19:02:58 +0000 (15:02 -0400)]
Simplify RequestItem handling in NCIP::ILS::Evergreen.
Replace several subroutines and OpenILS calls to check for existing
copies, holds, etc., and to check if the hold is possible before
creating the hold with a single call to open-ils.circ.holds.
test_and_create.batch. This call does everything in one step and
leads to cleaner code for us.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Thu, 22 Oct 2015 13:13:39 +0000 (09:13 -0400)]
Fix bug with title hold in NCIP::ILS::Evergreen->place_hold.
Add the selection_ou and selection depth to the parameters when
checking if the title hold is possible. This will prevent the
placement of holds that are basically unfillable.
TODO: There is quite a bit of code here that could be simplified
by using test and create instead of separate is possible and
create calls.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
We modify NCIP::ILS::Evergreen->find_location_failover to return an
undefined value in the event of failure to lookup an agency.
We then modify the requestitem and cancelrequestitem handlers to
return a Problem message if the lookup fails for their selection
org. units. These appear to be the only two places possilby
affected by a failure to find a location.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Tue, 18 Aug 2015 14:32:34 +0000 (10:32 -0400)]
"Fix" templates/includes/problem.inc.
During testing I noticed that the Problem messages had an extra
newline in the ProblemType field. This apparently causes problems
for Auto-Graphics' parser, so this commit removes it.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Tue, 18 Aug 2015 13:27:54 +0000 (09:27 -0400)]
Add error handling to NCIP::ILS::Evergreen->cancelrequestitem.
We did not check the return value of open-ils.circ.hold.cancel, because
why would it fail? Turns out there are a couple of reasons it could
fail, including not setting up permissions for the staff user correctly.
The cancel_hold helper function now returns the return value of the
open-ils.circ.hold.cancel method. This method returns 1 on succes or
a reference ot an event hash on failure.
The cancelrequestitem method now returns a Problem response message
of Temporary Processing Failure if cancel_hold returns a ref.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Jason Stephenson [Thu, 30 Jul 2015 13:38:55 +0000 (09:38 -0400)]
Some defensive coding in NCIP::ILS.pm.
XML::LibXML::Simple will return {} for an empty field. We need to
check this on barcode input, at least, and undef the variable. This
is done in the base class find_user_barcode and find_item_barcode
methods.
Jason Stephenson [Mon, 13 Apr 2015 11:42:48 +0000 (07:42 -0400)]
A little more defensive programming in NCIP::ILS::Evergreen.
If for some reason actor.usr.card does not have the id of a valid
barcode and we get nothing from it, we use the barcode that we
were given in the LookupUser request.
Jason Stephenson [Mon, 19 Jan 2015 20:21:28 +0000 (15:21 -0500)]
Reimplement requestitem handler in NCIP::ILS::Evergreen.
Testing with Auto-Graphics suggests that our original logic was too
complicated, so we simplify it to only handle what Auto-Graphics
sends us. We may want to implement a more generic handler in the
future when NCIPServer is used with more vendors. However, it seems
fairly typical for responders to also be vendor specific.
While simplifying the logic, this commit gets rid of some unneeded
funtions.
We also fix a typo in the RequestItemResponse.inc template.
Jason Stephenson [Sat, 20 Dec 2014 20:59:38 +0000 (15:59 -0500)]
Changes to NCIP::ILS::Evergreen as a result of testing.
These modifications are based on testing with Auto-Graphics and
reflect how they say they will be sending data in production. They
will return the ItemId that we are now returning in the response
to RequestItem so we can use that to find the appropriate hold to
cancel.
The above necessitated some internal changes to the code that
amounted to a simplification of placing holds (in some cases) as
well as a simplification in canceling holds. There is still some
cruft hanging around that should probably go away, but I think
we're safe for now.
We've also update some templates to fix issues while testing the
above mentioned changes, specifically RequestItemResponse.inc and
CancelRequestItemResponse.inc.
Jason Stephenson [Thu, 18 Dec 2014 19:58:16 +0000 (14:58 -0500)]
Modify NCIP::ILS::Evergreen->requestitem.
We now return AgencyId in the ItemId response field when returning a
database id and not barcode. If we can't figure out the AgencyId to
return, we set the ItemId/ItemIdentifierType to SYSNUMBER.
There's room for improvement here, but no time right now.
Jason Stephenson [Sat, 13 Dec 2014 21:57:31 +0000 (16:57 -0500)]
Receive or abort transit in NCIP::ILS::Evergreen->checkoutitem.
If the copy is in transit to or from the working organizational
unit of the NCIP staff user, then we have to either receive or
abort the transit before the check out can proceed.
Modify NCIP::ILS::Evergreen based on communication and testing.
Auto-Graphics is sending our target branch code in the ToAgencyId
field of the InitiationHeader. They are not sending some of the
optional fields that we are looking for. Most of the changes in
this commit revolve around using the ToAgencyId as a fallback
when the other fields are not available. The focus of these
changes are the AcceptItem and RequestItem messages since the
local location is most important there.
Jason Stephenson [Sun, 26 Oct 2014 19:27:14 +0000 (15:27 -0400)]
Templates changes for Auto-graphics.
They requested that we remove "carriage returns" from the output. I'm not
100% certain if he meant all carriage returns or if he just wanted the
weird spacing that some elements had where the open tag is on one line
followed by the value and the close tag on the next line. I don't really
know exactly why that was happening, but it seemed to have something to
do with trying to make the value come out on a line by its own between
the open and close tags. This change puts those elements on one line.
Jason Stephenson [Fri, 24 Oct 2014 12:29:00 +0000 (08:29 -0400)]
Add NCIP::PhysicalAddress object.
I started to add this to the code last night to make addresses even
more abstract and extensible. Instead, I took a short cut. In the
light of the new day, I decided to go back and add this class as the
right thing to do.
We modify NCIP::ILS::Evergreen, NCIP::User::AddressInformation, and
the include for UserOptionalFields to make use of the new object.
Jason Stephenson [Sat, 11 Oct 2014 20:20:07 +0000 (16:20 -0400)]
Fix checkoutitem in NCIP::ILS::Evergreen.
Even though, the function documentation for checkout(.full) says
a copy object works, it apparently doesn't, so I switched to using
the copy_id parameter with $copy->id().
Jason Stephenson [Sat, 11 Oct 2014 16:46:41 +0000 (12:46 -0400)]
Fix some warnings in NCIP::ILS::Evergreen.
Try to fix thes:
Use of uninitialized value in string eq at
/home/opensrf/NCIPServer/lib/NCIP/ILS/Evergreen.pm line 2553.
Use of uninitialized value in string eq at
/home/opensrf/NCIPServer/lib/NCIP/ILS/Evergreen.pm line 2589.
Jason Stephenson [Sun, 28 Sep 2014 14:29:39 +0000 (10:29 -0400)]
Alter NCIP::ILS::Evergreen->_hold_search() to do just one thing.
Remove the code that had it return a problem if no holds were
found and make it the caller's responsibility to check if a hold
was returned or nothing.