Bugzilla – Attachment 122728 Details for
Bug 20310
Article requests: Use details from the host record when submitting an article request on an analytic record without attached items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20310: Adding a pref to control behavior
Bug-20310-Adding-a-pref-to-control-behavior.patch (text/plain), 4.77 KB, created by
Nick Clemens (kidclamp)
on 2021-07-09 12:03:58 UTC
(
hide
)
Description:
Bug 20310: Adding a pref to control behavior
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-07-09 12:03:58 UTC
Size:
4.77 KB
patch
obsolete
>From 48f9591371008832e4dc464b7ed5616261a7101a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 8 Sep 2020 13:29:45 +0000 >Subject: [PATCH] Bug 20310: Adding a pref to control behavior > >If people want to control the redirection, we could add a pref >like ArticleRequestsHostRedirection. If it is not enabled, >the party is over. > >Test plan: >Test if redirection stops on a child and host when you disable. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Biblio.pm | 1 + > installer/data/mysql/atomicupdate/bug_20130.perl | 8 ++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ > t/db_dependent/Koha/Biblio/host_record.t | 1 + > 5 files changed, 17 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_20130.perl > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 3b38a82ce0..12b22d90ef 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -910,6 +910,7 @@ sub host_record { > my ($self, $params) = @_; > my $no_items = $params->{no_items}; > return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO >+ return if !C4::Context->preference('ArticleRequestsHostRedirection'); > return if $params->{no_items} && $self->items->count > 0; > > my $record; >diff --git a/installer/data/mysql/atomicupdate/bug_20130.perl b/installer/data/mysql/atomicupdate/bug_20130.perl >new file mode 100644 >index 0000000000..c8e7143321 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_20130.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('ArticleRequestsHostRedirection', '0', NULL, 'Enables redirection from child to host', 'YesNo') >+ }); >+ NewVersion( $DBversion, 20310, "Add pref ArticleRequestsHostRedirection"); >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 4ba309ce0b..e240a1880e 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -56,6 +56,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'), > ('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''), > ('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'), >+('ArticleRequestsHostRedirection', '0', NULL, 'Enables redirection from child to host', 'YesNo'), > ('ArticleRequestsLinkControl', 'calc', 'always|calc', 'Control display of article request link on search results', 'Choice'), > ('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'), > ('ArticleRequestsMandatoryFieldsItemOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'), >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 b64b06efcd..ebad36bfb4 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 >@@ -1192,6 +1192,12 @@ Circulation: > 1: Enable > 0: "Don't enable" > - patrons to place article requests. >+ - >+ - pref: ArticleRequestsHostRedirection >+ choices: >+ yes: Enable >+ no: Disable >+ - " redirection from child to host based on MARC21 773$w when the child has no items." > - > - pref: ArticleRequestsLinkControl > choices: >diff --git a/t/db_dependent/Koha/Biblio/host_record.t b/t/db_dependent/Koha/Biblio/host_record.t >index 59b9f139e6..bf728f1d38 100644 >--- a/t/db_dependent/Koha/Biblio/host_record.t >+++ b/t/db_dependent/Koha/Biblio/host_record.t >@@ -40,6 +40,7 @@ subtest 'host_record' => sub { > > t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); > t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' ); >+ t::lib::Mocks::mock_preference( 'ArticleRequestsHostRedirection', 1 ); > > my $bib1 = $builder->build_object({ class => 'Koha::Biblios' }); > my $bib2 = $builder->build_object({ class => 'Koha::Biblios' }); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20310
:
73142
|
73143
|
73805
|
73998
|
74000
|
74992
|
74993
|
74994
|
88887
|
88888
|
88889
|
109750
|
109751
|
109752
|
109753
|
111467
|
111468
|
111469
|
111470
|
118976
|
118977
|
118978
|
118979
|
119346
|
122469
|
122470
|
122471
|
122472
|
122473
|
122474
|
122475
|
122725
|
122726
|
122727
| 122728 |
122729
|
122730
|
122731
|
122732