sitka/iNCIPit.git
5 years agoFix patron blocking in LookupUser master
Jeff Godin [Mon, 8 Sep 2014 21:24:39 +0000 (17:24 -0400)]
Fix patron blocking in LookupUser

Not all standing penalties in Evergreen should cause a value to be
returned in the LookupUser BlockOrTrap element.

Uncomment existing code (originally from issa -- thanks, @Dyrcona!)
to iterate over penalties and only block on those whose block list
contains a certain set of block types.

We are now blocking only on standing penalties that contain HOLD or
CIRC in their block list.

Fixes #14.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMake item_cancelled respect no_item_agency_holds
Jeff Godin [Mon, 8 Sep 2014 20:13:24 +0000 (16:13 -0400)]
Make item_cancelled respect no_item_agency_holds

When enabled, the configuration option no_item_agency_holds prevents
holds from being created in Evergreen for requests where the
Evergreen system is acting as the item agency.

Libraries using this setting pull items based on paging slips
printed by the DCB client software, not Evergreen.

This change wraps the hold cancellation logic in item agency holds
within a conditional, similar to what is already done in
item_request. If we are configured to not create holds on item
agency requests, we have no need to attempt to cancel them or
attempt to change copy status.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd/move/change some comments
Jeff Godin [Wed, 3 Sep 2014 17:10:41 +0000 (13:10 -0400)]
Add/move/change some comments

* Add comments in logic of item_cancelled to clarify where we are
the user vs item agency.

* Fix overlooked comment in cancel_hold, originally copied from
update_hold_pickup.

* Re-indent a comment in item_cancelled

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMerge branch 'hektech-changes'
Jeff Godin [Mon, 8 Sep 2014 20:45:52 +0000 (16:45 -0400)]
Merge branch 'hektech-changes'

Changes from Dan Wells at Calvin College, from four pull requests:

fixes #10 - Fix due date field in renew_item()
fixes #11 - Better item cancelled
fixed #12 - No-op check in item
fixes #13 - Better error checking

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoBetter error checking
Dan Wells [Thu, 15 May 2014 20:44:17 +0000 (16:44 -0400)]
Better error checking

In update_copy_shipped(), return an event in both failure cases, then
make sure to fail() if an event comes back.

In place_simple_hold(), fail if we could not create the hold for any
reason.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
5 years agoUse 'noop' checkin for check_in_item()
Dan Wells [Thu, 15 May 2014 20:37:01 +0000 (16:37 -0400)]
Use 'noop' checkin for check_in_item()

Checkins can trigger other events, but since check_in_item() happens
behind the scenes, we can't really react properly to many events.

Making this checkin a 'noop' means fewer side-effects.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
5 years agoCancel holds in item_cancelled()
Dan Wells [Thu, 15 May 2014 20:29:14 +0000 (16:29 -0400)]
Cancel holds in item_cancelled()

Before this fix, item_cancelled() does not work properly, since it never
cancels the hold placed in earlier steps.  For now, let's cancel the
hold and set the status to reshelving.

TODO:
 - more error checking
 - consider a different status, or don't set the status at all, and do
   a limited (e.g. no-op) checkin of some kind
 - consider a different hold cancel reason, including perhaps adding a
   new one

Signed-off-by: Dan Wells <dbw2@calvin.edu>
5 years agoFix due date field in renew_item()
Dan Wells [Thu, 15 May 2014 20:22:48 +0000 (16:22 -0400)]
Fix due date field in renew_item()

The RenewItem message has a 'DesiredDueDate' field, not just 'DueDate'

Signed-off-by: Dan Wells <dbw2@calvin.edu>
5 years agoMerge pull request #9 from tadl/xml_escaping_fixes
Jeff Godin [Thu, 15 May 2014 19:01:45 +0000 (15:01 -0400)]
Merge pull request #9 from tadl/xml_escaping_fixes

xml escaping fixes

In addition to title and author, also attempt to escape call number
values in ItemRequestedResponse messages.

Also, don't use HTML::Entities::encode as that can introduce HTML
entities which are not valid built-in XML entities.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoDon't use HTML entities in XML
Jeff Godin [Thu, 15 May 2014 15:52:06 +0000 (11:52 -0400)]
Don't use HTML entities in XML

Not all HTML entities are valid (built-in) XML entities. Don't try
to use HTML entities in XML.

Instead (until the TODO of "Move away from heredocs for generating
XML" is completed), use a naive sub to replace only ampersand,
greater than, and less than.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAlso escape call number in responses
Jeff Godin [Fri, 21 Mar 2014 17:09:23 +0000 (13:09 -0400)]
Also escape call number in responses

Also escape call number value in XML responses.

Still a strong desire to move away from heredocs for generating xml.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMerge pull request #6 from atz/master
Jeff Godin [Thu, 15 May 2014 18:42:50 +0000 (14:42 -0400)]
Merge pull request #6 from atz/master

Die if open() fails.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoDie if open() fails.
Joe Atzberger [Tue, 3 Dec 2013 18:06:48 +0000 (13:06 -0500)]
Die if open() fails.

5 years agoMerge pull request #7 from tadl/handle_invalid_xml
Jeff Godin [Thu, 15 May 2014 18:29:54 +0000 (14:29 -0400)]
Merge pull request #7 from tadl/handle_invalid_xml

Handle invalid xml

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd 'use XML::LibXML::ErrNo'
Jeff Godin [Fri, 21 Mar 2014 17:19:07 +0000 (13:19 -0400)]
Add 'use XML::LibXML::ErrNo'

We are referencing a constant defined in XML::LibXML::ErrNo, so
let's ensure that we use that module.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMake invalid XML handling more robust, verbose
Jeff Godin [Thu, 5 Dec 2013 21:24:00 +0000 (16:24 -0500)]
Make invalid XML handling more robust, verbose

Differentiate between LibXML and non-LibXML errors when parsing
incoming NCIP messages.

Log the actual error encountered, and log what steps we take (if
any) to mitigate.

Also, remove an invalid use of == introduced in the previous commit.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd handling / mitigation for invalid XML
Jeff Godin [Wed, 4 Dec 2013 18:03:00 +0000 (13:03 -0500)]
Add handling / mitigation for invalid XML

Wrap XML parsing attempts in an eval block to avoid having the CGI
generate an Internal Server Error.

Add support for removing raw Control-D characters, which we have
experienced in the wild when working with INN-REACH.

Generate warnings and attempt to gracefully fail with a log entry
and the "do not hang INN-REACH" message approach used in fail().

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMerge pull request #5 from tadl/patron_identifier_config_changes
Jeff [Thu, 15 May 2014 18:19:09 +0000 (14:19 -0400)]
Merge pull request #5 from tadl/patron_identifier_config_changes

Expand patron identifier config options

5 years agoExpand patron identifier config options
Jeff Godin [Tue, 3 Dec 2013 16:16:36 +0000 (11:16 -0500)]
Expand patron identifier config options

Remove the patron_id_as_identifier yes/no configuration option and
replace it with "patron_identifier" which accepts the following:

* barcode - patron barcode (the default)
* id - patron database id

In the near future, we expect to have an additional option:

* ident - patron's ident value

This future third option will require additional work for retrieving
patrons via their ident value, etc.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMerge pull request #8 from mark-cooper/load_config_hostname_match
Jeff [Thu, 15 May 2014 18:09:42 +0000 (14:09 -0400)]
Merge pull request #8 from mark-cooper/load_config_hostname_match

Load config automatically based on matching request hostname

5 years agoAdd markdown extension to README
Mark Cooper [Wed, 12 Mar 2014 21:54:46 +0000 (14:54 -0700)]
Add markdown extension to README

5 years agoAdd configuration file instructions
Mark Cooper [Wed, 12 Mar 2014 17:19:43 +0000 (10:19 -0700)]
Add configuration file instructions

5 years agoLoad config automatically based on matching request hostname
Mark Cooper [Wed, 12 Mar 2014 17:19:15 +0000 (10:19 -0700)]
Load config automatically based on matching request hostname

5 years agoadded contact info and copyleft
Jon Scott [Thu, 6 Feb 2014 06:47:21 +0000 (22:47 -0800)]
added contact info and copyleft

5 years agoAdded extra header info to use for processing xml and added support for different...
Jon Scott [Thu, 6 Feb 2014 05:53:53 +0000 (21:53 -0800)]
Added extra header info to use for processing xml and added support for different ini/configuration files based on hostname

5 years agoMerge pull request #4 from tadl/master
Hekman Library Technology Team [Tue, 3 Dec 2013 15:57:20 +0000 (07:57 -0800)]
Merge pull request #4 from tadl/master

Omnibus pull request of TADL changes

Per request of Dan Wells, this omnibus pull request incorporates all of the changes which TADL has made to iNCIPit over the course of our go-live and first few months with MeLCat.

I have not summarized the changes here. Please see the individual commit messages for more details.

Thanks for reviewing and testing, Dan!

EDIT:
Please note that the config file added in this merge is not guaranteed to be stable, and is very likely to have minor changes in the near future. -Dan W.

5 years agoAdd copyright statements, acknowledge issa
Jeff Godin [Thu, 21 Nov 2013 20:26:21 +0000 (15:26 -0500)]
Add copyright statements, acknowledge issa

Add copyright statements and acknowledge that iNCIPit incorporates a
significant amount of code from the issa project.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd further hold-not-found checks
Jeff Godin [Fri, 11 Oct 2013 14:25:05 +0000 (10:25 -0400)]
Add further hold-not-found checks

Add checks for hold-not-found in update_hold_pickup subroutine to
prevent failure from trying to call pickup_lib on an undef value.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd check for hold in AcceptItem
Jeff Godin [Fri, 11 Oct 2013 13:46:11 +0000 (09:46 -0400)]
Add check for hold in AcceptItem

Add a check in AcceptItem message handling to ensure that a hold was
found before trying to check the item in to capture for that hold.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMake holds go Available at AcceptItem time
Jeff Godin [Wed, 9 Oct 2013 16:21:08 +0000 (12:21 -0400)]
Make holds go Available at AcceptItem time

So that we may benefit from things like patron notification, make
the hold for an item go Available at AcceptItem time by checking the
copy in at the pickup location.

Since the AcceptItem message does not contain location information,
fetch the pickup information from the hold.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMove "find hold on copy" logic into own sub
Jeff Godin [Wed, 9 Oct 2013 16:19:39 +0000 (12:19 -0400)]
Move "find hold on copy" logic into own sub

Move the "find hold on copy" logic in update_hold_pickup into its
own new subroutine, find_hold_on_copy.

This is to prepare for where we will need to find the hold again in
accept_item.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoRobustify update_pickup_lib sub
Jeff Godin [Thu, 3 Oct 2013 16:52:00 +0000 (12:52 -0400)]
Robustify update_pickup_lib sub

Robustify update_pickup_lib sub to handle cases where the bib or
hold is not found.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMove invalid copy detection up
Jeff Godin [Thu, 3 Oct 2013 16:51:35 +0000 (12:51 -0400)]
Move invalid copy detection up

Move invalid copy detection up

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoHandle shipped copies that are not found
Jeff Godin [Thu, 3 Oct 2013 16:44:45 +0000 (12:44 -0400)]
Handle shipped copies that are not found

Handle shipped copies that are not found by barcode.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd .gitignore file
Jeff Godin [Wed, 2 Oct 2013 20:24:51 +0000 (16:24 -0400)]
Add .gitignore file

Add .gitignore file to ignore non-sample config files

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoUpdate pickup lib at ItemShipped time
Jeff Godin [Wed, 2 Oct 2013 20:11:57 +0000 (16:11 -0400)]
Update pickup lib at ItemShipped time

The ItemRequested NCIP message does not include information on where
the user wishes to pick up their hold.

Because of this, all holds are created with an initial hold pickup
location from the ini file.

Pickup library information is included in the ItemShipped message.

When we receive the ItemShipped message, we retrieve the hold and
update its pickup library based on a mapping file which maps the
address data in the NCIP message to a local org unit id.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoRemove commented stat cat code in create_copy
Jeff Godin [Wed, 2 Oct 2013 17:33:53 +0000 (13:33 -0400)]
Remove commented stat cat code in create_copy

Remove commented-out, unused stat cat code in create_copy sub.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAvoid generating invalid ItemRequestedResponse xml
Jeff Godin [Wed, 2 Oct 2013 17:13:31 +0000 (13:13 -0400)]
Avoid generating invalid ItemRequestedResponse xml

Avoid generating invalid XML in the ItemRequestedResponse message by
encoding title/author values.

This is a stopgap measure. Longer term, we should move away from
using heredocs for XML generation.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoMove from CGI::XMLPost to CGI
Jeff Godin [Wed, 2 Oct 2013 16:19:21 +0000 (12:19 -0400)]
Move from CGI::XMLPost to CGI

It would be convenient to use some of the features available in the
CGI module, but CGI::XMLPost and CGI cannot (easily) co-exist.

As an added bonus, this means that we have one less external
non-core Perl module dependency, and might make future persistency
under mod_perl or Plack easier.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoRemove unused XML::XPath dependency
Jeff Godin [Wed, 2 Oct 2013 16:17:26 +0000 (12:17 -0400)]
Remove unused XML::XPath dependency

Remove dependency on (currently) unused XML::XPath

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAvoid uninit value warning when testing for HTTPS
Jeff Godin [Wed, 2 Oct 2013 16:09:42 +0000 (12:09 -0400)]
Avoid uninit value warning when testing for HTTPS

Avoid an uninitialized value warning for testing for HTTPS.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd config value for institutional patron
Jeff Godin [Wed, 2 Oct 2013 16:07:10 +0000 (12:07 -0400)]
Add config value for institutional patron

Add new config value for institutional patron -- the account which
items are checked out to when we are the item agency sending our
items to other libraries to fill their patron's requests.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoAdd option to use patron id instead of barcode
Jeff Godin [Wed, 2 Oct 2013 15:36:16 +0000 (11:36 -0400)]
Add option to use patron id instead of barcode

Add a new config option to use patron database id instead of patron barcode.

Set this in the ini file's [behavior] section to enable:

patron_id_as_identifier = yes

Signed-off-by: Jeff Godin <jgodin@tadl.org>
5 years agoRemove unused SIGALRM handler
Jeff Godin [Tue, 24 Sep 2013 17:26:00 +0000 (13:26 -0400)]
Remove unused SIGALRM handler

Remove the unused SIGALRM handler and a call to alarm().

These were copied from issa.pl, and are really not that useful in a
CGI context.

Also, without at least one call to alarm() with a non-zero argument,
they're effectively a no-op.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoAdd comments about CheckOutItem barcodes
Jeff Godin [Wed, 11 Sep 2013 17:52:38 +0000 (13:52 -0400)]
Add comments about CheckOutItem barcodes

Add comments about item barcode assumptions when responding in a
User Agency vs Item Agency CheckOutItem scenario.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoRemove unused functions originally from issa.pl
Jeff Godin [Thu, 22 Aug 2013 18:52:32 +0000 (14:52 -0400)]
Remove unused functions originally from issa.pl

Remove unused functions originally copied from issa.pl (GPL v2 or
later).

- place_hold
- set_title_hold_expiration
- org_unit_from_shortname

If they are needed in the future, we know where to find them.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoFix call to lookup_userpriv to pass map also
Jeff Godin [Thu, 22 Aug 2013 15:34:48 +0000 (11:34 -0400)]
Fix call to lookup_userpriv to pass map also

In order to perform a successful userpriv lookup, we need to pass
lookup_userpriv the hashref to the populated map.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoAdd configurable mapping of patron profile names
Jeff Godin [Wed, 21 Aug 2013 21:42:21 +0000 (17:42 -0400)]
Add configurable mapping of patron profile names

Support mapping patron profile names to new values using a
"userpriv" file.

This is a re-implementation of a feature from MCLS / Jon Scott code
received via e-mail.

See userpriv-example for an example mapping file.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoStop re-declaring $userpriv, remove unused $userou
Jeff Godin [Wed, 21 Aug 2013 21:33:35 +0000 (17:33 -0400)]
Stop re-declaring $userpriv, remove unused $userou

Avoid a warning by not declaring $userpriv twice.

Remove $userou as we are not currently using it.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoRename example configuration file
Jeff Godin [Wed, 21 Aug 2013 20:38:19 +0000 (16:38 -0400)]
Rename example configuration file

Rename the example configuration file, mostly for the benefit of it
having an .ini filename extension for things like syntax hilighting
editors.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoUse profile name for AgencyUserPrivilegeType value
Jeff Godin [Wed, 21 Aug 2013 20:26:25 +0000 (16:26 -0400)]
Use profile name for AgencyUserPrivilegeType value

In the AgencyUserPrivilegeType value, we were returning a
stringified Perl object reference instead of something resembling a
string or integer.

Remove $userprivid (which did not contain the profile id anyway) and
instead return the profile name as the AgencyUserPrivilegeType
value.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoAdd option to omit patron email from LookupUser
Jeff Godin [Wed, 14 Aug 2013 20:23:17 +0000 (16:23 -0400)]
Add option to omit patron email from LookupUser

Add option to omit the patron email address in a LookupUserResponse
message.

To omit patron email addresses, specify the following in the config
file:

[behavior]
omit_patron_email = yes

The default is to include patron email addresses in the
LookupUserResponse message.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoAdd option to skip item agency ItemRequested holds
Jeff Godin [Wed, 14 Aug 2013 20:14:42 +0000 (16:14 -0400)]
Add option to skip item agency ItemRequested holds

Add configuration option under "behavior" ini section to disable
holds and copy status changes when we are the item agency receiving
an ItemRequested message.

Useful if you are not relying on Evergreen hold pull lists and just
want to use the paging slips from the DCB client to pull items to
ship to other agencies.

The default behavior remains the same, unless you set
"no_item_agency_holds = yes" under [behavior].

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoHandle "copy not found" scenario
Jeff Godin [Fri, 9 Aug 2013 15:20:53 +0000 (11:20 -0400)]
Handle "copy not found" scenario

Prevent internal server error condition when we receive an
AcceptItem message and the copy in question is not found.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoMove more things into config file, add comments
Jeff Godin [Fri, 9 Aug 2013 15:16:36 +0000 (11:16 -0400)]
Move more things into config file, add comments

Move more previously-hardcoded values to the config file, remove
CUSTOMIZATION NEEDED markers where appropriate, add a few NOTE and
TODO comments.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoFix syntax error
Jeff Godin [Fri, 9 Aug 2013 15:14:35 +0000 (11:14 -0400)]
Fix syntax error

Fix syntax error: ~= != =~

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoWhitespace cleanup.
Jeff Godin [Thu, 8 Aug 2013 17:54:01 +0000 (13:54 -0400)]
Whitespace cleanup.

Whitespace cleanup -- replace stray tabs.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoAdd support for source IP auth behind a proxy
Jeff Godin [Wed, 7 Aug 2013 21:19:32 +0000 (17:19 -0400)]
Add support for source IP auth behind a proxy

When using a proxy in front of your web server(s), the web server
sees the IP address of the proxy, and not the actual IP address of
the client making the requests.

This prevents you from using standard Apache directives to limit
access to a set of specific source IP addresses. While there are
Apache modules available that can help in this situation, we also
have the option of performing the access control within iNCIPit
itself.

This commit adds support for relying on the X-Forwarded-For HTTP
header to determine the actual IP of the client.

SECURITY NOTE: Your proxy MUST set/modify the X-Forwarded-For HTTP
header for this feature to work. If your proxy passes the header
unmodified, not only will your authorized clients likely be unable
to access the script, but unauthorized clients can easily spoof the
header to gain access.

To use, in the [access] section of iNCIPit.ini:

- set load_balancer_ip to the IP of your proxy
- set allowed_client_ips to a comma-delimited list of authorized IP
  addresses

If your proxy speaks to your backend servers via HTTP, you will also
need to set permit_plaintext to "yes" (case insensitive).  You must
then rely on your proxy to enforce the use of HTTPS, or trust your
authorized clients to always use HTTPS.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoBegin to break config out into ini file
Jeff Godin [Wed, 31 Jul 2013 17:54:06 +0000 (13:54 -0400)]
Begin to break config out into ini file

Begin to migrate from hardcoded variables to a configuration file.

Copy the example iNCIPit.ini-example file to iNCIPit.ini and make
your changes there.

At this point, only the username and password are moved to a config
file.

This commit introduces a new dependency on Config::Tiny

SECURITY NOTE:
You will want to take steps to protect your configuration file, and
ensure that it is NOT accessible via the web server.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agouse strict;
Jeff Godin [Tue, 30 Jul 2013 18:02:18 +0000 (14:02 -0400)]
use strict;

Having eliminated a number of issues with nonexistent variables being
referenced, we can now enable the "use strict" pragma.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoFix nonexistent variables in ItemReceivedResponse
Jeff Godin [Tue, 30 Jul 2013 17:46:31 +0000 (13:46 -0400)]
Fix nonexistent variables in ItemReceivedResponse

When creating an NCIP ItemReceivedResponse message, nonexistent
variables were being referenced, resulting in warnings and empty
values for the following elements in ResponseHeader:

FromAgencyId/UniqueAgencyId/Scheme
ToAgencyId/UniqueAgencyId/Scheme
ToAgencyId/UniqueAgencyId/Value

This commit populates the variables $faidScheme, $taidScheme, and
$taidValie in a manner similar to other locations in the code,
silencing the warnings and causing the elements in question to
contain data.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoFix ref. to nonexistent $visid, clarify terms
Jeff Godin [Tue, 30 Jul 2013 17:37:44 +0000 (13:37 -0400)]
Fix ref. to nonexistent $visid, clarify terms

The XML for NCIP message RenewItemResponse was being constructed
with a nonexistent variable $visid, resulting in warnings and no
content in the ItemIdentifierValue element.

When processing a RenewItem message in renew_item(), we are
referencing the item by its UniqueItemId, so in addition to fixing
the nonexistent variable issue, this commit adjusts the variable
names for clarity.

Log output is also changed.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoAvoid referencing nonexistent AgencyId vars
Jeff Godin [Tue, 30 Jul 2013 17:00:08 +0000 (13:00 -0400)]
Avoid referencing nonexistent AgencyId vars

In fail() and do_user_lookup_error_stanza(), we were attempting to
call staff_log() with values for FromAgencyId and ToAgencyId using
variables which did not exist.

Also, in fail() we were attempting to use those same variables in
the creation of an XML NCIP response.

The above issues would result in "Use of uninitialized value"
warnings, as well preventing use of "use strict".

This commit removes the references to the nonexistent variables,
resulting in the same log and xml output.

A future commit may provide a means for these functions to log the
FromAgencyId and ToAgencyId.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoRemove duplicate request detection
Jeff Godin [Tue, 30 Jul 2013 15:04:53 +0000 (11:04 -0400)]
Remove duplicate request detection

Per MeLCat staff 2013-07-26, duplicate request detection is no
longer needed, and can cause its own problems. It should be removed.

This commit removes the duplicate NCIP message detection.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
6 years agoMerge pull request #3 from Dyrcona/last_post
Hekman Library Technology Team [Mon, 25 Mar 2013 14:26:25 +0000 (07:26 -0700)]
Merge pull request #3 from Dyrcona/last_post

A little defensive coding around last_post.txt.

6 years agoA little defensive coding around last_post.txt.
Jason Stephenson [Thu, 21 Mar 2013 13:24:30 +0000 (09:24 -0400)]
A little defensive coding around last_post.txt.

If the file doesn't exist, rather than die, try to create it.  Only
die if we fail to create it.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
6 years agoMore customization markers, and general cleanup
Dan Wells [Tue, 12 Mar 2013 15:17:12 +0000 (11:17 -0400)]
More customization markers, and general cleanup

First, add more CUSTOMIZATION markers wherever a value likely needs
per-system configuration.

Second, clean up and clarify the code in a few places.  This includes
standardizing some variable names.  In particular, $visid and
$barcode were both used interchangeably, and this commit standardizes
on $visid for anything which isn't an actual local item barcode (i.e.
it is a fake or external system "barcode" value).

Signed-off-by: Dan Wells <dbw2@calvin.edu>
6 years agoRemove force-to-available code from check_in_item
Dan Wells [Tue, 12 Mar 2013 15:12:14 +0000 (11:12 -0400)]
Remove force-to-available code from check_in_item

check_in_item() currently tries to force the checked-in copy to the
"Available" status.  This seems unnecessary, and possibly damaging.

Instead, let the EG check in process set the status as it sees fit
(most often to "Reshelving").

Signed-off-by: Dan Wells <dbw2@calvin.edu>
6 years agoClarify item_request(), add missing $U
Dan Wells [Tue, 12 Mar 2013 15:07:48 +0000 (11:07 -0400)]
Clarify item_request(), add missing $U

First, we clarify the item_request() sub by:
 - adding customization notes
 - making sure we retain our custom status after hold placement
 - identifying Item vs User Agency code branches

Second, we add the common $U AppUtils variable which was missing from
the last commit.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
6 years agoUpdate and fix place_simple_hold()
Dan Wells [Tue, 12 Mar 2013 14:52:55 +0000 (10:52 -0400)]
Update and fix place_simple_hold()

This commit makes the following changes to the place_simple_hold()
subroutine:
 - clarify that the patron parameter is an ID
 - use a more typical default location for the oils_header.pl file
 - use a Fieldmapper object rather than raw JSON to construct the
hold request
 - add freeze/thaw to hold process to prevent custom status issues
 - add comments where customization is likely needed

We should probably revisit the freeze/thaw process in the future,
but this at least gets us to a working state.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
6 years agoComment out incomplete, unused subs
Dan Wells [Tue, 12 Mar 2013 14:30:11 +0000 (10:30 -0400)]
Comment out incomplete, unused subs

Signed-off-by: Dan Wells <dbw2@calvin.edu>
6 years agoWhitespace revision, take II
Dan Wells [Mon, 11 Mar 2013 22:11:42 +0000 (18:11 -0400)]
Whitespace revision, take II

perltidy can result in code formatting which is a little extreme
when left at the 80-characters-wide default, so rejoin the split
$doc->findvalue() calls which were negatively affecting
readability.

Also, Evergreen code standards is for using four spaces, not tabs,
so correct for that small mixup as well.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
6 years agocleaning up service detection block by way of including code from atz fork
Jon Scott [Mon, 11 Mar 2013 20:22:37 +0000 (13:22 -0700)]
cleaning up service detection block by way of including code from atz fork

6 years agoattempt to clean up whitespace and get standardized with eg code formatting asap :
Jon Scott [Mon, 11 Mar 2013 19:57:04 +0000 (12:57 -0700)]
attempt to clean up whitespace and get standardized with eg code formatting asap :
perltidy cuddled else and 's/ {4}/\t/g' version

6 years agoadded comments for removing local customizations / reading ini file going forward
Jon Scott [Mon, 11 Mar 2013 19:10:47 +0000 (12:10 -0700)]
added comments for removing local customizations / reading ini file going forward

7 years agoAdded NCIPmsgs : ItemCheckedIn, RenewItem, ItemShipped, ItemRequested, ItemRequestCan...
Jon Scott [Wed, 12 Sep 2012 00:25:02 +0000 (17:25 -0700)]
Added NCIPmsgs : ItemCheckedIn, RenewItem, ItemShipped, ItemRequested, ItemRequestCancelled, ItemRenewed, ItemReceived, ItemCheckedOut, CheckOutItem, CheckInItem and AcceptItem

7 years agolatest version
Jon Scott [Tue, 11 Sep 2012 21:06:29 +0000 (14:06 -0700)]
latest version

7 years agoUpdate README
Jon Scott [Fri, 11 May 2012 21:10:17 +0000 (14:10 -0700)]
Update README

7 years agowanted the ncip ItemRenewed to be able to override std.limits on renewals so ...
Jon Scott [Fri, 11 May 2012 21:05:05 +0000 (14:05 -0700)]
wanted the ncip ItemRenewed to be able to override std.limits on renewals so ...

7 years agoUpdate README
Jon Scott [Fri, 11 May 2012 14:14:26 +0000 (07:14 -0700)]
Update README

7 years agoStanding Penalties Added - Want to return blocking info to NCIP request
Jon Scott [Fri, 11 May 2012 13:55:07 +0000 (06:55 -0700)]
Standing Penalties Added - Want to return blocking info to NCIP request

7 years agoNCIPmsgs/LookupUser.ncip demo added
Jon Scott [Thu, 26 Apr 2012 19:29:04 +0000 (12:29 -0700)]
NCIPmsgs/LookupUser.ncip demo added

7 years agoUpdate iNCIPit.cgi
Jon Scott [Thu, 26 Apr 2012 17:31:28 +0000 (10:31 -0700)]
Update iNCIPit.cgi

7 years agoUpdate README
Jon Scott [Thu, 26 Apr 2012 17:22:20 +0000 (10:22 -0700)]
Update README

7 years agoUpdate README
Jon Scott [Thu, 26 Apr 2012 14:37:29 +0000 (07:37 -0700)]
Update README

7 years agoUpdate README
Jon Scott [Thu, 26 Apr 2012 12:50:52 +0000 (05:50 -0700)]
Update README

7 years agoUpdate README
Wolf Halton [Thu, 26 Apr 2012 12:44:50 +0000 (05:44 -0700)]
Update README

7 years agofirst commit
Jon Scott [Wed, 25 Apr 2012 14:22:45 +0000 (07:22 -0700)]
first commit