From 52c6802c7ca81ac71d60bd3951b202cdc0a2eb50 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 16 Aug 2022 11:11:09 +0000 Subject: [PATCH] Bug 30025: Replace AllowManualAuthorityEditing with RequireChoosingExistingAuthority This flips the pref from an allowance to a requirement, hopefully this makes the logic here clearer Test as before, but the values for the renamed pref flipped Signed-off-by: AFHDubCoLib Signed-off-by: Martin Renvoize --- C4/UsageStats.pm | 2 +- about.pl | 8 ++++---- cataloguing/addbiblio.pl | 2 +- installer/data/mysql/atomicupdate/bug_30025.pl | 6 +++--- installer/data/mysql/mandatory/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 8 ++++---- .../modules/admin/preferences/authorities.pref | 16 ++++++++-------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 16b833dd9c..7cf2098f49 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -153,7 +153,7 @@ sub _shared_preferences { AuthDisplayHierarchy AutoCreateAuthorities AutoLinkBiblios - AllowManualAuthorityEditing + RequireChoosingExistingAuthority AuthorityMergeLimit AuthorityMergeMode UseAuthoritiesForTracings diff --git a/about.pl b/about.pl index 9b01124ab9..8adf1c94c0 100755 --- a/about.pl +++ b/about.pl @@ -172,8 +172,8 @@ if ($prefStatisticsFields) { } my $prefAutoCreateAuthorities = C4::Context->preference('AutoCreateAuthorities'); -my $prefAllowManualAuthorityEditing = C4::Context->preference('AllowManualAuthorityEditing'); -my $warnPrefAllowManualAuthorityEditing = ( $prefAutoCreateAuthorities && ( !$prefAllowManualAuthorityEditing) ); +my $prefRequireChoosingExistingAuthority = C4::Context->preference('RequireChoosingExistingAuthority'); +my $warnPrefRequireChoosingExistingAuthority = ( !$prefAutoCreateAuthorities && ( !$prefRequireChoosingExistingAuthority) ); my $prefEasyAnalyticalRecords = C4::Context->preference('EasyAnalyticalRecords'); my $prefUseControlNumber = C4::Context->preference('UseControlNumber'); @@ -632,9 +632,9 @@ $template->param( mysqlVersion => $versions{'mysqlVersion'}, apacheVersion => $versions{'apacheVersion'}, zebraVersion => $zebraVersion, - prefAllowManualAuthorityEditing => $prefAllowManualAuthorityEditing, + prefRequireChoosingExistingAuthority => $prefRequireChoosingExistingAuthority, prefAutoCreateAuthorities => $prefAutoCreateAuthorities, - warnPrefAllowManualAuthorityEditing => $warnPrefAllowManualAuthorityEditing, + warnPrefRequireChoosingExistingAuthority => $warnPrefRequireChoosingExistingAuthority, warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords, warnPrefAnonymousPatronOPACPrivacy => $warnPrefAnonymousPatronOPACPrivacy, warnPrefAnonymousPatronAnonSuggestions => $warnPrefAnonymousPatronAnonSuggestions, diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 494d4d84a7..acb60dbc33 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -376,7 +376,7 @@ sub create_input { } elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) { # when authorities auto-creation is allowed, do not set readonly - my $is_readonly = !C4::Context->preference("AllowManualAuthorityEditing"); + my $is_readonly = C4::Context->preference("RequireChoosingExistingAuthority"); $subfield_data{marc_value} = { type => 'text', diff --git a/installer/data/mysql/atomicupdate/bug_30025.pl b/installer/data/mysql/atomicupdate/bug_30025.pl index d82246f49f..56337b6429 100755 --- a/installer/data/mysql/atomicupdate/bug_30025.pl +++ b/installer/data/mysql/atomicupdate/bug_30025.pl @@ -11,10 +11,10 @@ return { $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES - ('AllowManualAuthorityEditing',?,NULL,'Allow manual entry in controlled fields during cataloging.','YesNo'), + ('RequireChoosingExistingAuthority',?,NULL,'Require selecting existing authority entry in controlled fields during cataloging.','YesNo'), ('AutoLinkBiblios',?,NULL,'If enabled, link biblio to authorities on creation and edit','YesNo') - },undef,($biblio_adds_authorities,$biblio_adds_authorities)); - say $out "Added AllowManualAuthorityEditing and AutoLinkBiblios"; + },undef,($biblio_adds_authorities eq '1' ? '0' : '1', $biblio_adds_authorities)); + say $out "Added RequireChoosingExistingAuthority and AutoLinkBiblios"; $dbh->do(q{DELETE FROM systempreferences WHERE variable="BiblioAddsAuthorities";}); say $out "BiblioAddsAuthorities removed"; }, diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 6c600d9fc2..e186b4d4f0 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -31,7 +31,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'), ('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.','YesNo'), ('AllowItemsOnHoldCheckoutSCO','0','','Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'), -('AllowManualAuthorityEditing','0',NULL,'Allow manual entry in controlled fields during cataloging.','YesNo'), ('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'), ('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'), ('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'), @@ -590,6 +589,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'), ('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'), ('RequireCashRegister','0',NULL,'Require a cash register when collecting a payment','YesNo'), +('RequireChoosingExistingAuthority','0',NULL,'Require existing authority selection in controlled fields during cataloging.','YesNo'), ('RequirePaymentType','0','','Require staff to select a payment type when a payment is made','YesNo'), ('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'), ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index aa434efde8..bfba83993b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -216,7 +216,7 @@
- [% IF warnAllowManualAuthorityEditing || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker || elasticsearch_has_missing %] + [% IF warnRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker || elasticsearch_has_missing %] [% IF (warnIsRootUser) %]

Warning regarding current user

You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.

@@ -300,12 +300,12 @@ Contact your system administrator. [% END %] - [% IF warnPrefAllowManualAuthorityEditing || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || warnXSLT || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %] + [% IF warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || warnXSLT || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %]

Warnings regarding the system configuration

- [% IF (warnPrefAllowManualAuthorityEditing) %] - + [% IF (warnPrefRequireChoosingExistingAuthority) %] + [% END %] [% IF (warnPrefEasyAnalyticalRecords) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref index 01f4ae1ff9..a8a5244368 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref @@ -16,12 +16,12 @@ Authorities: type: textarea - - When editing records, - - pref: AllowManualAuthorityEditing - default: no + - pref: RequireChoosingExistingAuthority + default: yes choices: - 1: allow - 0: "don't allow" - - catalogers to manually create new headings if needed, rather than having to reference existing authorities. + 1: require + 0: "don't require" + - catalogers to reference existing authorities. If set to don't, catalogers can manually enter uncontrolled terms into controlled fields - - When editing records, - pref: AutoCreateAuthorities @@ -29,7 +29,7 @@ Authorities: choices: 1: generate 0: "don't generate" - - authority records that are missing (AllowManualAuthorityEditing must be set to "allow" for this to have any effect). + - authority records that are missing (RequireChoosingExistingAuthority must be set to "don't require" for this to have any effect). - - When modifying an authority record, do not update attached bibliographic records if the number exceeds - pref: AuthorityMergeLimit @@ -64,13 +64,13 @@ Authorities: "strict": strict - mode. In strict mode subfields that are not found in the authority record, are deleted. Loose mode will keep them. Loose mode is the historical behavior and still the default. - - - "Use the following text as default value for the 667$a field of MARC21 authority records (requires AllowManualAuthorityEditing and AutoCreateAuthorities):" + - "Use the following text as default value for the 667$a field of MARC21 authority records (must not require RequireChoosingExistingAuthority and must allow AutoCreateAuthorities):" - pref: GenerateAuthorityField667 default: "Machine generated authority record" type: textarea class: code - - - "Use the following text as default value for the 670$a field of MARC21 authority records (requires AllowManualAuthorityEditing and AutoCreateAuthorities):" + - "Use the following text as default value for the 670$a field of MARC21 authority records (must not require RequireChoosingExistingAuthority and must allow AutoCreateAuthorities):" - pref: GenerateAuthorityField670 default: "Work cat." type: textarea -- 2.20.1
Preferences and parameters
Warning System preference 'AutoCreateAuthorities' set, but needs 'AllowManualAuthorityEditing' set as well. Otherwise catalogers can add headings that will not be linked to authorities.
Warning System preference 'RequireChoosingExistingAuthority' is disabled, but needs 'AutoCreateAuthorites' enabled. Otherwise catalogers can add headings that will not be linked to authorities.
Warning System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff interface and the OPAC will be broken.