Bugzilla – Attachment 34187 Details for
Bug 13411
Koha's SIP server returns not ok for checking in items that are not checked out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13411 - Koha's SIP server returns not ok for checking in items that are not checked out
Bug-13411---Kohas-SIP-server-returns-not-ok-for-ch.patch (text/plain), 4.85 KB, created by
Kyle M Hall (khall)
on 2014-12-08 18:53:46 UTC
(
hide
)
Description:
Bug 13411 - Koha's SIP server returns not ok for checking in items that are not checked out
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-12-08 18:53:46 UTC
Size:
4.85 KB
patch
obsolete
>From 84838bdf9696789f0a373daab81d0c2258057a69 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 8 Dec 2014 12:36:11 -0500 >Subject: [PATCH] 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 4rd character is 1, and you do not recieve the item not checked out message. >--- > C4/SIP/ILS.pm | 42 +++++++++++++++++++++++------------------- > C4/SIP/Sip/MsgType.pm | 2 +- > etc/SIPconfig.xml | 2 +- > 3 files changed, 25 insertions(+), 21 deletions(-) > >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index 8086bc6..da2ea5f 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -172,34 +172,38 @@ sub checkout { > } > > sub checkin { >- my ($self, $item_id, $trans_date, $return_date, >- $current_loc, $item_props, $cancel) = @_; >- my ($patron, $item, $circ); >+ my ( $self, $item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel, $checked_in_ok ) = @_; >+ my ( $patron, $item, $circ ); > > $circ = new ILS::Transaction::Checkin; >+ > # BEGIN TRANSACTION >- $circ->item($item = new ILS::Item $item_id); >+ $circ->item( $item = new ILS::Item $item_id); > > if ($item) { >- $circ->do_checkin($current_loc, $return_date); >- } else { >+ $circ->do_checkin( $current_loc, $return_date ); >+ } >+ else { > $circ->alert(1); > $circ->alert_type(99); > $circ->screen_msg('Invalid Item'); > } >- # It's ok to check it in if it exists, and if it was checked out >- $circ->ok($item && $item->{patron}); >- >- if (!defined($item->{patron})) { >- $circ->screen_msg("Item not checked out"); >- } else { >- if ($circ->ok) { >- $circ->patron($patron = new ILS::Patron $item->{patron}); >- delete $item->{patron}; >- delete $item->{due_date}; >- $patron->{items} = [ grep {$_ ne $item_id} @{$patron->{items}} ]; >- } >- } >+ >+ # It's ok to check it in if it exists, and if it was checked out >+ $circ->ok( $item && $item->{patron} ); >+ >+ if ( !defined( $item->{patron} ) && !$checked_in_ok ) { >+ $circ->screen_msg("Item not checked out"); >+ } >+ else { >+ if ( $circ->ok ) { >+ $circ->patron( $patron = new ILS::Patron $item->{patron} ); >+ delete $item->{patron}; >+ delete $item->{due_date}; >+ $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ]; >+ } >+ } >+ > # END TRANSACTION > > return $circ; >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 2aca72f..04e0484 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -639,7 +639,7 @@ sub handle_checkin { > syslog("LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id}); > $status = $ils->checkin_no_block($item_id, $trans_date, $return_date, $item_props, $cancel); > } else { >- $status = $ils->checkin($item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel); >+ $status = $ils->checkin($item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel, $account->{checked_in_ok}); > } > > $patron = $status->patron; >diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml >index 8d2d77b..141bc4f 100644 >--- a/etc/SIPconfig.xml >+++ b/etc/SIPconfig.xml >@@ -36,7 +36,7 @@ > </listeners> > > <accounts> >- <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" /> >+ <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" /> > <login id="koha" password="koha" delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" /> > <login id="koha2" password="koha" institution="kohalibrary2" terminator="CR" /> > <login id="lpl-sc" password="1234" institution="LPL" /> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13411
:
34187
|
35665
|
35667
|
35669
|
36271
|
36310
|
36428
|
40952
|
40953
|
42035
|
42036
|
42081
|
42082
|
43590
|
43591
|
45027
|
45028