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 34504170bb..313296cef3 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 d8711f6e42..7f601a2393 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 @@ -610,13 +610,6 @@ OPAC: yes: Show 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 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 )%]