From 7155fb3846334364e64e17b248e929a10e6750d3 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 23 Sep 2020 23:00:07 +0000 Subject: [PATCH] Bug 23420: (QA follow-up) Remove AllowPurchaseSuggestionBranchChoice syspref --- ...0_add_OPACSuggestionUnwantedFields_syspref.perl | 22 +++++++++++++++++++--- installer/data/mysql/sysprefs.sql | 1 - .../prog/en/modules/admin/preferences/opac.pref | 7 ------- .../bootstrap/en/modules/opac-suggestions.tt | 2 -- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_23420_add_OPACSuggestionUnwantedFields_syspref.perl b/installer/data/mysql/atomicupdate/bug_23420_add_OPACSuggestionUnwantedFields_syspref.perl index 26b9157335..d715980774 100644 --- a/installer/data/mysql/atomicupdate/bug_23420_add_OPACSuggestionUnwantedFields_syspref.perl +++ b/installer/data/mysql/atomicupdate/bug_23420_add_OPACSuggestionUnwantedFields_syspref.perl @@ -1,7 +1,23 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do(q{ - INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('OPACSuggestionUnwantedFields','', NULL,'Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'); - }); + #Get value from AllowPurchaseSuggestionBranchChoice system preference + my ( $allowpurchasesuggestionbranchchoice ) = C4::Context->preference('AllowPurchaseSuggestionBranchChoice'); + if ( $allowpurchasesuggestionbranchchoice ) { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences + (`variable`, `value`, `options`, `explanation`, `type`) + VALUES + ('OPACSuggestionUnwantedFields','branch', NULL,'Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'); + }); + } else { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences + (`variable`, `value`, `options`, `explanation`, `type`) + VALUES + ('OPACSuggestionUnwantedFields','', NULL,'Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'); + }); + } + #Remove the AllowPurchaseSuggestionBranchChoice system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='AllowPurchaseSuggestionBranchChoice'"); NewVersion($DBversion, 23420, "Allow configuration of hidden fields on the suggestion form in OPAC"); } diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index d16c262f4a..9ad622afdf 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -39,7 +39,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo'), ('AllowPatronToSetFinesVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set fines to be visible to his or her guarantor', 'YesNo'), ('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'), -('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'), ('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'), ('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'), ('AllowRenewalOnHoldOverride','0',NULL,'If ON, allow items on hold to be renewed with a specified due date','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 3cb298c423..ecde3e34bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -607,13 +607,6 @@ OPAC: no: "Don't show" - purchase suggestions from other patrons on the OPAC. - - - pref: AllowPurchaseSuggestionBranchChoice - default: 0 - choices: - no: "Don't allow" - yes: Allow - - "patrons to select library when making a purchase suggestion." - - - "Fields that should be mandatory for patron purchase suggestions:" - pref: OPACSuggestionMandatoryFields multiple: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index 6a9630fcd4..956a254805 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -174,7 +174,6 @@ [% END %] [% END %] - [% IF branchcode %] [% UNLESS ( branch_hidden )%]
  • [% IF ( branchcode_required ) %] @@ -191,7 +190,6 @@ [% END %]
  • [% END %] - [% END %] [% IF ( patron_reason_loop ) %] [% UNLESS ( patronreason_hidden )%]
  • -- 2.11.0