diff --git a/C4/Context.pm b/C4/Context.pm index bcc1fc8269..d1388208f2 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -364,9 +364,11 @@ sub multivalue_preference { my ( $self, $preference ) = @_; my $syspref = $self->preference($preference) // q{}; - my $values = [ split qr{\|}, $syspref ]; - return $values; + return [ split qr{\|}, $syspref ] + if $syspref =~ qr{\|}; + + return [ split qr{,}, $syspref ] } =head2 enable_syspref_cache diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm index cacd5347df..1f45dacb57 100644 --- a/Koha/ArticleRequest.pm +++ b/Koha/ArticleRequest.pm @@ -266,10 +266,9 @@ sub store { if ( !$self->in_storage ) { $self->created_on( dt_from_string() ); } - my $format = $self->format; - if ( C4::Context->preference('ArticleRequestsSupportedFormats') !~ /\b$format\b/ ) { - Koha::Exceptions::ArticleRequest::WrongFormat->throw; - } + + Koha::Exceptions::ArticleRequest::WrongFormat->throw + unless grep { $_ eq $self->format } @{ C4::Context->multivalue_preference('ArticleRequestsSupportedFormats') }; return $self->SUPER::store; } diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index 55671d2199..ffc78351ea 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -71,6 +71,11 @@ sub Preference { return C4::Context->preference( $pref ); } +sub MultivaluePreference { + my ( $self, $pref ) = @_; + return C4::Context->multivalue_preference( $pref ); +} + =head3 CSVDelimiter The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index a689118bfd..259f106053 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -1308,7 +1308,10 @@ Circulation: - - "The following article request formats are supported:" - pref: ArticleRequestsSupportedFormats - - "(Valid choices are currently: PHOTOCOPY and SCAN. Separate the supported formats by a vertical bar. The first listed format is selected by default when you request via the OPAC.)" + multiple_sortable: + PHOTOCOPY: Photocopy + SCAN: Scan + - "The first listed format is selected by default when you request via the OPAC." Item bundles: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt index fd05b5cd54..b64273a4f9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt @@ -154,13 +154,21 @@ + [% SET ArticleRequestsSupportedFormats = Koha.MultivaluePreference('ArticleRequestsSupportedFormats') %] + [% IF ArticleRequestsSupportedFormats.size %]