add a user's expiration date to the SIP2 message in its own field, at least Patron Information Response (64), and probably the Patron Status Response (24)
Created attachment 90813 [details] [review] Bug 20816: Add ability to define custom templated fields in SIP patron responses To test: 1 - You will need to enable SIP on your testing instance cp etc/SIPconfig.xml /etc/koha/sites/kohadev/ sudo koha-start-sip add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works) 2 - If you copied the above file you should be set to get custom field DE with dateexpiry 3 - send a status test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su lpl-sc-beacock -sp xyzzy -l LPL --patron nick -m patron_status_request 4 - send an information test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su lpl-sc-beacock -sp xyzzy -l LPL --patron nick -m patron_information 5 - confirm you receive the DE field with a dateexpiry 6 - Add your own custom fields and confirm it works with several 7 - prove -v t/db_dependent/SIP/Patron.t 8 - prove -v t/db_dependent/SIP/
Patch does not apply. Merge conflicts. Using index info to reconstruct a base tree... M C4/SIP/ILS/Patron.pm M C4/SIP/Sip.pm M C4/SIP/Sip/MsgType.pm M etc/SIPconfig.xml Falling back to patching base and 3-way merge... Auto-merging etc/SIPconfig.xml CONFLICT (content): Merge conflict in etc/SIPconfig.xml Auto-merging C4/SIP/Sip/MsgType.pm CONFLICT (content): Merge conflict in C4/SIP/Sip/MsgType.pm Auto-merging C4/SIP/Sip.pm Auto-merging C4/SIP/ILS/Patron.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 20816: Add ability to define custom templated fields in SIP patron responses The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-20816-Add-ability-to-define-custom-templated-f-a8rxuw.patch
Created attachment 93493 [details] [review] Bug 20816: Add ability to define custom templated fields in SIP patron responses To test: 1 - You will need to enable SIP on your testing instance cp etc/SIPconfig.xml /etc/koha/sites/kohadev/ sudo koha-start-sip add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works) 2 - If you copied the above file you should be set to get custom field DE with dateexpiry 3 - send a status test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su lpl-sc-beacock -sp xyzzy -l LPL --patron nick -m patron_status_request 4 - send an information test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su lpl-sc-beacock -sp xyzzy -l LPL --patron nick -m patron_information 5 - confirm you receive the DE field with a dateexpiry 6 - Add your own custom fields and confirm it works with several 7 - prove -v t/db_dependent/SIP/Patron.t 8 - prove -v t/db_dependent/SIP/
Created attachment 93494 [details] [review] Bug 20816: Make SIP tests pass under ES
Created attachment 96811 [details] [review] Bug 20816: Add ability to define custom templated fields in SIP patron responses To test: 1 - You will need to enable SIP on your testing instance cp etc/SIPconfig.xml /etc/koha/sites/kohadev/ sudo koha-start-sip add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works) on koha-testing-docker you should be able to start sip with user koha/koha without any adjustments 2 - If you copied the above file you should be set to get custom field DE with dateexpiry Otherwise edit the sip login for the user to have a custom section like: <login id="koha" password="koha" delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" > <custom_patron_field field="DE" template="[% patron.dateexpiry %]" /> </login> 3 - send a status test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_status_request 4 - send an information test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_information 5 - confirm you receive the DE field with a dateexpiry 6 - Add your own custom fields and confirm it works with several <custom_patron_field field="EW" template="Phone: [% patron.phone %] Email: [% patron.email %]" /> 7 - prove -v t/db_dependent/SIP/Patron.t 8 - prove -v t/db_dependent/SIP/
Created attachment 96812 [details] [review] Bug 20816: Make SIP tests pass under ES
The ES patch no longer applies.
Created attachment 102447 [details] [review] Bug 20816: Make SIP tests pass under ES
Created attachment 102469 [details] [review] Bug 20816: Add ability to define custom templated fields in SIP patron responses To test: 1 - You will need to enable SIP on your testing instance cp etc/SIPconfig.xml /etc/koha/sites/kohadev/ sudo koha-start-sip add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works) on koha-testing-docker you should be able to start sip with user koha/koha without any adjustments 2 - If you copied the above file you should be set to get custom field DE with dateexpiry Otherwise edit the sip login for the user to have a custom section like: <login id="koha" password="koha" delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" > <custom_patron_field field="DE" template="[% patron.dateexpiry %]" /> </login> 3 - send a status test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_status_request 4 - send an information test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_information 5 - confirm you receive the DE field with a dateexpiry 6 - Add your own custom fields and confirm it works with several <custom_patron_field field="EW" template="Phone: [% patron.phone %] Email: [% patron.email %]" /> 7 - prove -v t/db_dependent/SIP/Patron.t 8 - prove -v t/db_dependent/SIP/ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 102470 [details] [review] Bug 20816: Make SIP tests pass under ES Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 103385 [details] [review] Bug 20816: Add ability to define custom templated fields in SIP patron responses To test: 1 - You will need to enable SIP on your testing instance cp etc/SIPconfig.xml /etc/koha/sites/kohadev/ sudo koha-start-sip add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works) on koha-testing-docker you should be able to start sip with user koha/koha without any adjustments 2 - If you copied the above file you should be set to get custom field DE with dateexpiry Otherwise edit the sip login for the user to have a custom section like: <login id="koha" password="koha" delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" > <custom_patron_field field="DE" template="[% patron.dateexpiry %]" /> </login> 3 - send a status test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_status_request 4 - send an information test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_information 5 - confirm you receive the DE field with a dateexpiry 6 - Add your own custom fields and confirm it works with several <custom_patron_field field="EW" template="Phone: [% patron.phone %] Email: [% patron.email %]" /> 7 - prove -v t/db_dependent/SIP/Patron.t 8 - prove -v t/db_dependent/SIP/ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 103386 [details] [review] Bug 20816: Make SIP tests pass under ES Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works well and code makes sense. Tests pass, though the QA script spits out a random POD error.. manually checking the POD it looks OK to me. Passing QA. I like that we're generalised the TT parsing into a ->format method, though it may be nice to have abstracted that a level higher somehow as it's almost exactly repeated in SIP/ILS/Item at least... one for another day however.
Nice work everyone! Pushed to master for 20.05
tests don't apply to 19.11.x please rebase if needed in 19.11
Created attachment 104622 [details] [review] Bug 20816: [19.11.x] Add ability to define custom templated fields in SIP patron responses To test: 1 - You will need to enable SIP on your testing instance cp etc/SIPconfig.xml /etc/koha/sites/kohadev/ sudo koha-start-sip add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works) on koha-testing-docker you should be able to start sip with user koha/koha without any adjustments 2 - If you copied the above file you should be set to get custom field DE with dateexpiry Otherwise edit the sip login for the user to have a custom section like: <login id="koha" password="koha" delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" > <custom_patron_field field="DE" template="[% patron.dateexpiry %]" /> </login> 3 - send a status test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_status_request 4 - send an information test using the sip cli tester: perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_information 5 - confirm you receive the DE field with a dateexpiry 6 - Add your own custom fields and confirm it works with several <custom_patron_field field="EW" template="Phone: [% patron.phone %] Email: [% patron.email %]" /> 7 - prove -v t/db_dependent/SIP/Patron.t 8 - prove -v t/db_dependent/SIP/ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Bug 20816: Make SIP tests pass under ES Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thanks for the rebase! Backported to 19.11.x for 19.11.06
enhancement will not be backported to 19.05.x