Browse Source

Bug 20954: Add ability to set syspref overrides in SIP as we can in apache

We should be able to set system preference overrides for SIP in a
similar manner that we do in Apache. It would be great if we could
specify those overrides on both a config level, and login level basis.

Test Plan:
 1) Apply this patch
 2) Start your SIP server
 3) Enable the syspref AllFinesNeedOverride
 4) Find or create a patron with a small fine ( less than noissuescharge )
 5) Attempt to check out an item to the patron, it should fail
 6) Add the global syspref override from the bottom of the example SIP config file
 7) Restart your SIP server
 8) Attempt to check out an item to the patron again, this time it should work
 9) Now, add the login level syspref override section as it appears in
    the eaxmple SIP config file. Make sure to add it to the login you are using
10) Attempt to check out another item to the patron, this time is should
    again fail

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Kyle Hall 4 years ago
committed by Martin Renvoize
parent
commit
9cbaec2a94
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 13
      C4/SIP/Sip/MsgType.pm
  2. 12
      etc/SIPconfig.xml

13
C4/SIP/Sip/MsgType.pm

@ -331,6 +331,19 @@ sub handle {
my $config = $server->{config};
my $self;
# Set system preference overrides, first global, then account level
# Clear overrides from previous message handling first
foreach my $key ( %ENV ) {
delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0;
}
foreach my $key ( keys %{ $config->{'syspref-overrides'} } ) {
$ENV{"OVERRIDE_SYSPREF_$key"} = $config->{'syspref-overrides'}->{$key};
}
foreach my $key ( keys %{ $server->{account}->{'syspref-overrides'} } ) {
$ENV{"OVERRIDE_SYSPREF_$key"} =
$server->{account}->{'syspref-overrides'}->{$key};
}
#
# What's the field delimiter for variable length fields?
# This can't be based on the account, since we need to know

12
etc/SIPconfig.xml

@ -61,6 +61,9 @@
<screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
<screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
<patron_attribute field="XY" code="CODE" />
<syspref-overrides>
<AllFinesNeedOverride>0</AllFinesNeedOverride>
</syspref-overrides>
</login>
</accounts>
@ -101,4 +104,13 @@ in our case "ILS".
retries="5" />
</institution>
</institutions>
<!-- This section allows system preferences to be overridden on a global basis.
If the same system preference is overridden at the login level, the login
version will take precedence.
-->
<syspref-overrides>
<AllFinesNeedOverride>0</AllFinesNeedOverride>
</syspref-overrides>
</acsconfig>

Loading…
Cancel
Save