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.
Created attachment 29677 [details] [review] 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!
Created attachment 29678 [details] [review] 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!
Created attachment 29679 [details] [review] 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!
Patch tested with a sandbox, by Jason Burds <jburds@dubuque.lib.ia.us>
Created attachment 30293 [details] [review] 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>
I assisted Jason Burds with the testing of this patch. We used the sandbox for sign-off so he wouldn't need to create an account.
QA comment * passes koha-qa.pl * I could not test this patch, because I've no SIP2 equipment * the code looks OK, even if I feel that when you have a lot of strings, it may be CPU consuming (regexp on each string, on each SIP2 request) But that's a valuable enhancement, that non english speaking libraries will like very much, so passing QA
Created attachment 32206 [details] [review] 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>
Would it not be better to load the strings from a separate file. So that if multiple configs are used they could share them. Also to force the variable to be an array ref instead of the rather ugly testing that for each message
Patch pushed to master. Thanks Kyle!