From d54bd36a0c126113b12d412fb837e9823a49e8f2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 29 Oct 2014 11:58:39 -0400 Subject: [PATCH] Bug 7673 [Terminology follow-up] New patron permissions to manage items Content-Type: text/plain; charset="utf-8" This bug adds a new preference, "SubfieldsToAllowForRestrictedEdition," but the use of the term "Edition" in this context is incorrect. I think it would be more clear to change the preference name to "SubfieldsToAllowForRestrictedEditing." This patch makes this change. I realize this isn't a big issue since the preference has a good description, but I thought that if we were going to make this as clear as possible now would be the time to do it. To test, start with a database which hasn't previously been used to test Bug 7673. Apply all patches and run the database update. Follow the test plan as described in the bug. --- cataloguing/additem.pl | 20 ++++++++++---------- .../data/mysql/de-DE/mandatory/userpermissions.sql | 2 +- .../data/mysql/en/mandatory/userpermissions.sql | 2 +- .../data/mysql/es-ES/mandatory/userpermissions.sql | 2 +- .../mysql/fr-FR/1-Obligatoire/userpermissions.sql | 2 +- .../data/mysql/it-IT/necessari/userpermissions.sql | 2 +- .../mysql/nb-NO/1-Obligatorisk/userpermissions.sql | 2 +- .../data/mysql/pl-PL/mandatory/userpermissions.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 6 +++--- .../en/modules/admin/preferences/cataloguing.pref | 6 +++--- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index e6151d3..047b733 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -158,15 +158,15 @@ sub generate_subfield_form { my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" ); my $attributes_no_value_textarea = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" rows="5" cols="64" ); - # Getting list of subfields to keep when restricted edition is enabled - my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition'); + # Getting list of subfields to keep when restricted editing is enabled + my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing'); my $allowAllSubfields = ( - not defined $subfieldsToAllowForRestrictedEdition - or $subfieldsToAllowForRestrictedEdition == q|| + not defined $subfieldsToAllowForRestrictedEditing + or $subfieldsToAllowForRestrictedEditing == q|| ) ? 1 : 0; - my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition); + my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing); - # If we're on restricted edition, and our field is not in the list of subfields to allow, + # If we're on restricted editing, and our field is not in the list of subfields to allow, # then it is read-only $attributes_no_value .= 'readonly="readonly" ' if ( @@ -247,7 +247,7 @@ sub generate_subfield_form { -class => "input_marceditor", ); - # If we're on restricted edition, and our field is not in the list of subfields to allow, + # If we're on restricted editing, and our field is not in the list of subfields to allow, # then it is read-only push @scrparam, (-readonly => "readonly"), (-disabled => "disabled") if ( @@ -374,12 +374,12 @@ my ($template, $loggedinuser, $cookie) }); -# Does the user have a restricted item edition permission? +# Does the user have a restricted item editing permission? my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; -# In case user is a superlibrarian, edition is not restricted +# In case user is a superlibrarian, editing is not restricted $restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); -# In case user has fast cataloging permission (and we're in fast cataloging), edition is not restricted +# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted $restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'})); my $today_iso = C4::Dates->today('iso'); diff --git a/installer/data/mysql/de-DE/mandatory/userpermissions.sql b/installer/data/mysql/de-DE/mandatory/userpermissions.sql index 535cdf7..99d7671 100644 --- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql +++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql @@ -11,7 +11,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'), ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'), ( 9, 'edit_items', 'Exemplare bearbeiten'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Gebühren erlassen'), (10, 'remaining_permissions', 'Verbleibende Berechtigungen für die Verwaltung von Gebühren'), diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index c6c4384..67951c4 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -11,7 +11,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), ( 9, 'fast_cataloging', 'Fast cataloging'), ( 9, 'edit_items', 'Edit items'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), diff --git a/installer/data/mysql/es-ES/mandatory/userpermissions.sql b/installer/data/mysql/es-ES/mandatory/userpermissions.sql index 8a6dae0..41a14fe 100644 --- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql +++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql @@ -11,7 +11,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), ( 9, 'fast_cataloging', 'Fast cataloging'), ( 9, 'edit_items', 'Edit Items'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index b3e878d..e121def 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -11,7 +11,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'), ( 9, 'fast_cataloging', 'Catalogage rapide'), ( 9, 'edit_items', 'Modifier des exemplaires'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), diff --git a/installer/data/mysql/it-IT/necessari/userpermissions.sql b/installer/data/mysql/it-IT/necessari/userpermissions.sql index a6046d6..77fe3d8 100644 --- a/installer/data/mysql/it-IT/necessari/userpermissions.sql +++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql @@ -11,7 +11,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'), ( 9, 'fast_cataloging', 'Catalogazione veloce'), ( 9, 'edit_items', 'Crea/modifica copie'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Cancellare multe e tariffe'), (10, 'remaining_permissions', 'Permessi rimanenti per gestione multe e costi'), diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql index 436baee..fd50d6b 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql @@ -31,7 +31,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'), ( 9, 'fast_cataloging', 'Hurtigkatalogisering'), ( 9, 'edit_items', 'Endre eksmeplarer'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql index d35ad09..9ed9f78 100644 --- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql +++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql @@ -11,7 +11,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_catalogue', 'Edit catalogue'), ( 9, 'fast_cataloging', 'Szybkie katalogowanie'), ( 9, 'edit_items', 'Edit Items'), - ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'), + ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index eb5dc3d..8f4a531 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -381,7 +381,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'), ('StatisticsFields','location|itype|ccode', NULL, 'Define Fields (from the items table) used for statistics members','Free'), ('SubfieldsToAllowForRestrictedBatchmod','','Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j',NULL,'Free'); -('SubfieldsToAllowForRestrictedEdition','','Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j',NULL,'Free'), +('SubfieldsToAllowForRestrictedEditing','','Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j',NULL,'Free'), ('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'), ('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free'), ('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 86c9ab7..ec91da0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8894,7 +8894,7 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.17.00.XXX"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $dbh->do(q{ - INSERT INTO permissions (module_bit, code, description) VALUES ('9', 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'); + INSERT INTO permissions (module_bit, code, description) VALUES ('9', 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'); }); $dbh->do(q{ @@ -8912,14 +8912,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { # Add 2 new prefs $dbh->do(q{ - INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToAllowForRestrictedEdition','','Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j','','Free'); + INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToAllowForRestrictedEditing','','Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j','','Free'); }); $dbh->do(q{ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToAllowForRestrictedBatchmod','','Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j','','Free'); }); - print "Upgrade to $DBversion done (Bug 7673: Adds 2 new prefs (SubfieldsToAllowForRestrictedEdition and SubfieldsToAllowForRestrictedBatchmod) and 3 new permissions (edit_items_restricted and delete_all_items and items_batchmod_restricted))\n"; + print "Upgrade to $DBversion done (Bug 7673: Adds 2 new prefs (SubfieldsToAllowForRestrictedEditing and SubfieldsToAllowForRestrictedBatchmod) and 3 new permissions (edit_items_restricted and delete_all_items and items_batchmod_restricted))\n"; SetVersion($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index a132731..157bfc8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -110,15 +110,15 @@ Cataloging: class: short - as default language in the UNIMARC field 100 when creating a new record or in the field plugin. - - - Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces. - - pref: SubfieldsToAllowForRestrictedEdition + - Define a list of subfields for which editing is authorized when edit_items_restricted permission is enabled, separated by spaces. + - pref: SubfieldsToAllowForRestrictedEditing - 'Examples:' - 'UNIMARC: "995$f 995$h 995$j"' - 'MARC21: "952$a 952$b 952$c"' - Note that the FA framework is excluded from the permission. - If the pref is empty, no fields are restricted. - - - Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces. + - Define a list of subfields for which editing is authorized when items_batchmod_restricted permission is enabled, separated by spaces. - pref: SubfieldsToAllowForRestrictedBatchmod - 'Examples:' - 'UNIMARC: "995$f 995$h 995$j"' -- 1.7.9.5