Skip to content

Commit d0efd50

Browse files
author
kohaputti
authored
Disable ILL messaging preferences if ILL Module is not used (#3)
This mimicks the behaviour of Koha's OPAC and Staff interfaces where the modification of ILL module related messaging preferences is disabled when ILLModule syspref is not set.
1 parent 800a6d3 commit d0efd50

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Koha/Plugin/Fi/KohaSuomi/DI/Koha/Patron/Message/Preferences.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ sub get_options {
9090
# KD-3952 Quick fix until we get the letter template checking in place, for now just follow suomifi system preference
9191
next if $transport->get_column('message_transport_type') eq 'suomifi' && ! C4::Context->preference('SuomiFiMessaging');
9292
my $name = $transport->get_column('message_name');
93+
next if $name =~ m/^Ill_/ && ! C4::Context->preference('ILLModule');
9394
$choices->{$name}->{'message_attribute_id'} = $transport->message_attribute_id;
9495
$choices->{$name}->{'message_name'} = $name;
9596
$choices->{$name}->{'takes_days'} = $transport->get_column('takes_days');
@@ -138,6 +139,7 @@ sub TO_JSON {
138139
my $preferences = {};
139140
my $options = $self->get_options;
140141
foreach my $preference ($self->as_list) {
142+
next if $preference->message_name =~ m/^Ill_/ && ! C4::Context->preference('ILLModule');
141143
$preferences->{$preference->message_name} = $preference->TO_JSON({
142144
options => $options
143145
});

0 commit comments

Comments
 (0)