Bug 9252

Summary: Add option to send patron's home branch in AF field
Product: Koha Reporter: Kyle M Hall <kyle>
Component: SIP2Assignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: cbrannon, chris, colin.campbell, gmcharlt, melia, paul.poulain
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 9252 - Add option to send patron's home branch in AF field
Bug 9252 - Add option to send patron's home branch in AF field
Bug 9243: Bad delete order in sub index-records
Bug 9243: Bad delete order in sub index-records
[Signed off] Bug 9252 - Add option to send patron's home branch in AF field
Bug 9252 - Add option to send patron's home branch in AF field
Bug 9252 - Add option to send patron's home branch in AF field
Bug 9252 - Add option to send patron's home branch in AF field - QA Followup
Bug 9252 - Add option to send patron's home branch in AF field
Bug 9252 - Add option to send patron's home branch in AF field - QA Followup

Description Kyle M Hall 2012-12-10 13:58:26 UTC
There are two pieces of information that SIP needs to pass along to Overdrive when authenticating:  Patron type and Home library.  We are getting Patron type just fine.  However, it appears that there is no mechanism in SIP at this time to pass along Home library.  It is critical that we get this information though as
we need to be able to break down actual patron usage among individual patron home libraries.

Since Overdrive logs in through SIP using a single SIP login, it becomes obvious AO does not work for this.

According to Overdrive, putting the patron home branch in an AF field will work just fine for them.
Comment 1 Kyle M Hall 2012-12-10 14:03:39 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-12-10 14:05:18 UTC Comment hidden (obsolete)
Comment 3 Colin Campbell 2012-12-18 10:38:23 UTC
Do we need to repeat AF in this case? I would think replacing the Greetings AF by one containing branch would make for simpler processing on the client side
Comment 4 Kyle M Hall 2012-12-18 12:24:24 UTC
(In reply to comment #3)
> Do we need to repeat AF in this case? I would think replacing the Greetings
> AF by one containing branch would make for simpler processing on the client
> side

Is the AF field traditionally displayed by SIP self checkout machines? I had assumed they did, which would make having them display the branchcode on the screen odd if not confusing for patrons. That is why I made add this AF field configurable on a per SIP account basis.
Comment 5 Colin Campbell 2012-12-18 14:36:44 UTC
Yes AF is for screen display. If there are multiple AFs they should result in a multiple line display. (one AF per line). (How much we can rely on units doing that is up for discussion)
Comment 6 Kyle M Hall 2012-12-18 19:02:08 UTC
(In reply to comment #5)
> Yes AF is for screen display. If there are multiple AFs they should result
> in a multiple line display. (one AF per line). (How much we can rely on
> units doing that is up for discussion)

I think it's probably best we assume they do, even if many don't. The idea behind the account-level configuration for this, is so we can send this extra AF to Overdrive ( or any other SIP using service ) and not to SCO units ( in case one library is using both ).
Comment 7 Paul Poulain 2013-05-17 16:12:17 UTC
Patch tested with a sandbox, by Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Paul Poulain 2013-05-17 16:12:37 UTC Comment hidden (obsolete)
Comment 9 Paul Poulain 2013-05-17 16:13:17 UTC
Patch tested with a sandbox, by George Williams <georgew@latahlibrary.org>
Comment 10 Paul Poulain 2013-05-17 16:13:35 UTC Comment hidden (obsolete)
Comment 11 Christopher Brannon 2013-05-17 16:15:32 UTC
My name is Christopher Brannon with the Coeur d'Alene Public Library, and we have tested the patch and can verify that the patch works as intended.
Comment 12 Christopher Brannon 2013-05-17 16:16:08 UTC
My name is Christopher Brannon with the Coeur d'Alene Public Library, and we have tested the patch and can verify that the patch works as intended.
Comment 13 Melia Meggs 2013-05-17 16:19:59 UTC Comment hidden (obsolete)
Comment 14 Melia Meggs 2013-05-17 16:20:56 UTC
This patch was tested by George and Christopher.  They have verified it works, so I am signing it off on their behalf.  (We had some weirdness trying to use the sandbox.)

Thanks,

Melia
Comment 15 Kyle M Hall 2013-06-17 17:20:13 UTC Comment hidden (obsolete)
Comment 16 Kyle M Hall 2013-06-17 17:21:43 UTC Comment hidden (obsolete)
Comment 17 Chris Cormack 2013-07-07 04:59:46 UTC
Comment on attachment 19084 [details] [review]
Bug 9252 - Add option to send patron's home branch in AF field

Review of attachment 19084 [details] [review]:
-----------------------------------------------------------------

::: C4/SIP/Sip/MsgType.pm
@@ +453,5 @@
>  	}
>  
> +    $resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg );
> +    $resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode} )
> +      if ( $server->{account}->{send_patron_home_library_in_af} );

I see at line 492
$resp = build_patron_status($patron, $lang, $fields, $server ); 

but
line 742 has 
 $resp = build_patron_status($patron, $patron->language, $fields);

In the handle_block_patron subroutine.

This means that $server will be undefined and throw a warn.
Comment 18 Kyle M Hall 2013-07-08 12:03:30 UTC Comment hidden (obsolete)
Comment 19 Chris Cormack 2013-08-11 02:17:51 UTC
Created attachment 20264 [details] [review]
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>
Comment 20 Chris Cormack 2013-08-11 02:18:19 UTC
Created attachment 20265 [details] [review]
Bug 9252 - Add option to send patron's home branch in AF field - QA Followup

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 21 Galen Charlton 2013-09-08 06:11:39 UTC
Pushed to master.  Thanks, Kyle!