From 9cdac855c95d334b5119cf6f13c37354a1306722 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 17 Dec 2018 12:34:14 -0500 Subject: [PATCH] Bug 22014: Add ability to send "00" in SIP CV field on checkin success Some SIP devices ( in this particular case, bin sorting machines from RFID Library Solutions ) require a checkin success to return a CV field of the value "00" rather than no CV field at all. Koha should be able to support this behavior. Test Plan: 1) Apply this patch 2) Enable the new option cv_send_00_on_success for a SIP2 account 3) Restart SIP 4) Check in an item successfully via SIP 5) Note the response contains a CV field with the value '00' Sponsored-by: Pueblo City-County Library District Signed-off-by: Kyle M Hall Signed-off-by: Jill Kleven Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- C4/SIP/Sip/MsgType.pm | 6 +++++- etc/SIPconfig.xml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index 43b02d29ab..d28f1bd024 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -684,7 +684,11 @@ sub handle_checkin { } } - $resp .= maybe_add( FID_ALERT_TYPE, $status->alert_type ) if $status->alert; + if ( $status->alert && $status->alert_type ) { + $resp .= maybe_add( FID_ALERT_TYPE, $status->alert_type ); + } elsif ( $server->{account}->{cv_send_00_on_success} ) { + $resp .= add_field( FID_ALERT_TYPE, '00' ); + } $resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); $resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml index 5d9ee98bc2..49ff852698 100644 --- a/etc/SIPconfig.xml +++ b/etc/SIPconfig.xml @@ -51,6 +51,7 @@ -- 2.39.5