Commit graph

15 commits

Author SHA1 Message Date
dbc24783ee Bug 17826: Allow extended patron attributes to be sent in arbitrary SIP2 fields
Some libraries need to be able to send additional patron data from the
extended patron attributes in made up SIP2 fields for the patron
information and patron status responses.

Test Plan:
1) Apply this patch
2) Create 3 new patron attributes with the codes CODE1, CODE2, CODE3.
   Make a least one repeatable.
3) Create a patron, add those attibutes for the patron, make sure there
   are at least two instances of the repeatable code
4) Edit your SIP2 config file, add the following within the login stanza:
   <patron_attribute field="XX" code="CODE1" />
   <patron_attribute field="XY" code="CODE2" />
   <patron_attribute field="XZ" code="CODE3" />
5) Using the sip cli emulator, run patron_information and
   patron_status_request messages for the patron
6) Note the values you set for the patron attributes are sent in the
   corrosponding fields!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Daniel Mauchley <dmauchley@duchesne.utah.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: added parentheses on line 488 when assigning hashref to array.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-23 11:45:38 -03:00
22249e4ced Bug 16899: Add ability to disallow overpayments
Some SIP services ( such as Comprise ) require that an attempt at
over-paying a patron's account via SIP2 should fail, rather than create
a credit on the account. We should make this a configurable option on a
per-login basis in the SIP2 config file.

Test Plan:
1) Apply this patch
2) Enable the new parameter
   disallow_overpayment="1"
   for the login to be used in this test.
3) Restart your SIP server
4) Create or find a patron with fines
5) Attempt to send a payment via SIP for more than what the
   patron's balance is
6) Note the response indicates a payment failure
7) Attempt to send a payment via SIP for the account balance or
   less
8) Note the response indicates the payment has succeeded
9) Verify in Koha that the payment was processed

Signed-off-by: Rhonda Kuiper <kuiper@roundrocktexas.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 14:10:29 -03:00
df4a87d4a6 Bug 18104 - allow SIP2 field AE (personal name ) to be customized
Koha's SIP2 server sends the patron's name in the format "Firstname
Surname" which is not very good for machine reading. We need to allow
the format of the patron name to be customized in a manner similar to
what is done with the DA field on bug 16755.

Test Plan:
1) Apply this patch, start or restart your SIP server
2) Find a patron with a first and last name
3) Send a patron information request via the sip2 cli tool
4) Note the AE field has the format "<firstname> <surname>" ( i.e. the current behavior )
5) Add this parameter to the login stanza you are using:
   ae_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
6) Restart your SIP server
7) Repeat step 3
8) Note the AE field now has the format "<surname>, <firstname>"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Benjamin Daeuber <BDaeuber@cityoffargo.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-06 14:52:54 -03:00
a78bb5ba1c Bug 16755 - allow SIP2 field DA ( hold patron name ) to be customized
The SIP2 DA field that Koha transmits is an odd and arbitrary format
that some SIP2 clients cannot handle. It would be best if this
format were customizable on a per-login basis in the same manner as
the AV field.

Test Plan:
1) Find an item that is checked out with holds
2) Return the item via SIP2 ( using the SIP2 cli emulator )
3) Note the value of the DA field
4) Apply this patch, restart your SIP2 server
5) Repeat step 2
6) Note the DA field value has not changed
7) Add this parameter to the login stanza you are using:
   da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
8) Restart the SIP2 server again
9) Repeat step 2
10) Note the DA field returned is now in the format "$surname, $firstname"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Benjamin Daeuber <BDaeuber@cityoffargo.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-06 14:52:54 -03:00
7e62964107 Bug 16895 - Allow writeoffs via SIP2
Many SIP2 services such as those by Comprise Technologies are able to or
require that an ILS be able to accept writeoffs via SIP2. The SIP2
protocol specifies that payment type be a two digit number, but does not
specify a code for writeoffs. To this end we should allow the write-off
code to be specified in the SIP2 config on a per-account basis so that
if different vendors use different fixed codes for write-offs we can
handle that gracefully.

Test Plan:
1) Apply this patch
2) Modify your SIP2 config to include
      payment_type_writeoff="06"
  in the login portion of the account you will be using for the test.
3) Restart your SIP2 server
4) Create a fee for a patron
5) Send a SIP2 fee paid message specifying the payment type code we
   defined earlier, with a payment amount that is *not* equal to the
   amount outstanding for the fee.
6) Note the fee paid response indicates the payment failed
7) Repeat step 5, but this time send the amount outstanding as the
   payment amount
8) Note that the fee paid response indicates a successful payment
9) Note in Koha that the fee has been written off!

Signed-off-by: Rhonda Kuiper <kuiper@roundrocktexas.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2017-04-21 10:59:53 -04:00
Magnus Enger
cb72420b46 Bug 17228 - Fix whitespace in etc/SIPconfig.xml
Remove trailing whitespace and replace tabs with 4 spaces.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 15:48:14 +00:00
Colin Campbell
b27da7e0ce Bug 15006: Introduce client_timeout in SIPconfig.xml
Most selfchecks have persistent connections and send a
periodic status request at intervals (approx every 5mins appears
the norm) The timeout was dropping connections by default every 30secs
which for the client appears as a very flakey network.

This patch adds a separate parameter client_timeout that can be
used if you do want to force a disconnect if the client sends
no requests for a period. The sample config sets it to 600, but you
can also define a 0 value meaning no timeout. If the parameter is not
defined, it will fallback to service timeout.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Restored this patch from Colin in order to separate it from the
get_timeout patch. Adjusted the commit message slightly.
The original value of 600 from Colin's earlier patch may give less
discussion than setting to 0 (no timeout) in a later proposal.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-15 14:11:05 +00:00
59266cbd61 Bug 14512 - Add support for AV field to Koha's SIP2 Server
Koha's SIP2 server should have support for the AV field ( field items ).
The biggest problem with this field is that its' contents are not really
defined in SIP2 protocol specification. All it says is "this field
should be sent for each fine item". Due to this, I think the contents of
the field need to be configurable at the login level, so that the
contents can be defined based on the SIP2 devices requirements for the
AV field.

Test Plan:
1) Apply this patch
2) Find a patron with outstanding fines
3) Run a patron information request using misc/sip_cli_emulator.pl using the new -s option with the value "   Y      "
4) Note there is an AV field for each fee containing the description and amount
5) Edit your sip config, add an av_field_template parameter to the login you are using such as
    av_field_template="TEST [% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]"
6) Restart your SIP server
7) Repeat the patron information request
8) Note your custom AV field is being used!

Signed-off-by: Chris Davis <cgdavis@uintah.utah.gov>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-31 20:29:18 +00:00
181d3aa56d Bug 13411: Koha's SIP server returns not ok for checking in items that are not checked out
If an item is not checked out when a checkin via SIP2 is attempted,
Koha's SIP server sends back an "ok" of 0, and the AF message "Item
not checked out". I am not entirely sure this is good and correct
behavior by the SIP2 protocol.

In particular, this will cause SIP2 book sorting devices to fail on
all items that are not checked out, causing them all to be put into
the "special handling" been that should be reserved for things like
items checked in at the wrong library and items on hold.

Test Plan:
1) Apply the patch for bug 13159 so you can use the new enhanced
   SIP2 command line emulator
2) Use a command similar to the following to check in an item:
   sip_cli_emulator.pl -a localhost -su <sip user> -sp <sip password> -l <instituation id> --item <barcode> -m checkin
3) Note the 3rd character is 0, and there is an AF field saying the item is not checked out
4) Apply this patch
5) Restart the SIP server
6) Repeat steps 2-3, note that nothing has changed
7) In the SIP config file, Add the parameter checked_in_ok="1" to the SIP account you are using.
8) Restart the SIP server
9) Repeat steps 2-3, note that this time the 3rd character is 1, and you do not recieve the item not checked out message.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 20:20:44 -03:00
c95a4b0f84 Bug 12571 - Add ability to customize SIP2 screen messages
We should add the ability to apply a regular expression to screen
messages for the SIP2 server. This would allow libraries to not only
customize the screen messages the patron sees, but can also allow screen
messages to be translated.

Test Plan:
1) Apply this patch
2) Inspect etc/SIPconfig.xml, note the new screen_msg_regex tags
   that can be nested inside a given login tag.
3) Add one or more screen_msg_regex tags to your own SIP config
   Recommendation: s/Greetings from Koha./Welcome to your library!/g
4) Restart your SIP2 server
5) Test with a SIP2 machine, or use /misc/sip_cli_emulator.pl
6) Note your new AF fields!

Signed-off-by: Jason Burds <jburds@dubuque.lib.ia.us>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 09:26:47 -03:00
7b295e9dd7 Bug 9865 (follow-up) give better usage examples in example SIPconfig.xml
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-30 16:34:18 +00:00
Adrien Saurat
4a72f6b237 Bug 9865: make SIP msg encoding configurable via SIPconfig.xml
The accounts->login tag in SIPconfig.xml can now accept a new
parameter, "encoding". It will be mostly used to encode to utf8.

For this, simply add the parameter: encoding="utf8"

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Works as advertised, does nothing if encoding is not set.
Blows up all the machines that can't handled utf8 if it is set :) But
that's not Koha's fault. :)

Patch rebased by Christophe Croullebois  <christophe.croullebois@biblibre.com>

Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>

But now I did it the right way! And I can confirm that this patch solves
all issues with mangled characters in SIP messages. Confirmed that it
looks good with Norwegian characters in patron name and in book titles.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-30 16:33:52 +00:00
e1de36fbb9 Bug 9252 - Add option to send patron's home branch in AF field
This patch gives you the option of sending a patrons home branch code
in an AF field for patron status requests. It is controlled at the account
login level, so it can be enable on a per-sip-login basis.

Test Plan:
1) Apply patch
2) Edit SIPconfig.xml, add the parameter 'send_patron_home_library_in_af="1"'
   to the login you will be using to test.
3) Start your SIP2 server.
4) Connect to it via telnet ( something like: '9300CNterm1|COterm1|CPCPL|' )
5) Send a patron status request ( like: '2300120121110    82925AOCPL|AA23529000035676|ACterm1|ADletmein' )
6) Examine reponse you should see something like this:
      "24              00120121210    085332AEHenry Acevedo|AA23529000035676|BLY|CQN|AFGreetings from Koha. |AFMPL|AO|"
   Note the second AF field with the value MPL.

Signed-off-by: George Williams <georgew@latahlibrary.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-08 06:07:38 +00:00
90e2aafeb5 Bug 9531: Make SIP2 message terminator configurable via SIPconfig.xml
Add a terminator option to SIPConfig.xml, choices for 'terminator' are
'CR' or 'CRLF'.  The default continues to be 'CRLF' if 'terminator' is
undefined.

Test Plan:
1) Apply patch
2) Start SIP server
3) Run C4/SIP/t/04patron_status.t
4) Stop SIP server
5) Add terminator="CR" for account login 'term1'
6) Run 04patron_status.t again, you should see no change

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Adrien Saurat <adrien.saurat@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-08 05:44:09 +00:00
Chris Cormack
43b3fb9701 Bug 7238 : Shifting SIPconfig.xml to the etc dir and the scripts to misc/bin
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
The scripts run with the caveat that you must specify the path to SIPconfig.xml. The followup previously attached should take care of that issue.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 15:15:22 +01:00
Renamed from C4/SIP/SIPconfig.xml (Browse further)