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 <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-08-16 11:11:09 +00:00 committed by Tomas Cohen Arazi
parent d8b15c685c
commit 7eced5a054
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
7 changed files with 22 additions and 22 deletions

View File

@ -153,7 +153,7 @@ sub _shared_preferences {
AuthDisplayHierarchy
AutoCreateAuthorities
AutoLinkBiblios
AllowManualAuthorityEditing
RequireChoosingExistingAuthority
AuthorityMergeLimit
AuthorityMergeMode
UseAuthoritiesForTracings

View File

@ -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,

View File

@ -380,7 +380,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',

View File

@ -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";
},

View File

@ -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'),
@ -591,6 +590,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'),

View File

@ -216,7 +216,7 @@
</div>
<div role="tabpanel" class="tab-pane" id="sysinfo">
[% 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) %]
<h2>Warning regarding current user</h2>
<p>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.</p>
@ -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 %]
<h2>Warnings regarding the system configuration</h2>
<table>
<caption>Preferences and parameters</caption>
[% IF (warnPrefAllowManualAuthorityEditing) %]
<tr><th scope="row"><strong>Warning</strong> </th><td>System preference 'AutoCreateAuthorities' set, but needs 'AllowManualAuthorityEditing' set as well. Otherwise catalogers can add headings that will not be linked to authorities.</td></tr>
[% IF (warnPrefRequireChoosingExistingAuthority) %]
<tr><th scope="row"><strong>Warning</strong> </th><td>System preference 'RequireChoosingExistingAuthority' is disabled, but needs 'AutoCreateAuthorites' enabled. Otherwise catalogers can add headings that will not be linked to authorities.</td></tr>
[% END %]
[% IF (warnPrefEasyAnalyticalRecords) %]
<tr><th scope="row"><strong>Warning</strong> </th><td>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.</td></tr>

View File

@ -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 (<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AllowManualAuthorityEditing">AllowManualAuthorityEditing</a> must be set to "allow" for this to have any effect).
- authority records that are missing (<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RequireChoosingExistingAuthority">RequireChoosingExistingAuthority</a> 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 <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AllowManualAuthorityEditing'>AllowManualAuthorityEditing</a> and <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AutoCreateAuthorities'>AutoCreateAuthorities</a>):"
- "Use the following text as default value for the 667$a field of MARC21 authority records (must not require <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RequireChoosingExistingAuthority'>RequireChoosingExistingAuthority</a> and must allow <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AutoCreateAuthorities'>AutoCreateAuthorities</a>):"
- 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 <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AllowManualAuthorityEditing'>AllowManualAuthorityEditing</a> and <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AutoCreateAuthorities'>AutoCreateAuthorities</a>):"
- "Use the following text as default value for the 670$a field of MARC21 authority records (must not require <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RequireChoosingExistingAuthority'>RequireChoosingExistingAuthority</a> and must allow <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AutoCreateAuthorities'>AutoCreateAuthorities</a>):"
- pref: GenerateAuthorityField670
default: "Work cat."
type: textarea