View | Details | Raw Unified | Return to bug 7673
Collapse All | Expand All

(-)a/cataloguing/additem.pl (-10 / +10 lines)
Lines 158-172 sub generate_subfield_form { Link Here
158
        my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" );
158
        my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" );
159
        my $attributes_no_value_textarea = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" rows="5" cols="64" );
159
        my $attributes_no_value_textarea = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" rows="5" cols="64" );
160
160
161
        # Getting list of subfields to keep when restricted edition is enabled
161
        # Getting list of subfields to keep when restricted editing is enabled
162
        my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition');
162
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
163
        my $allowAllSubfields = (
163
        my $allowAllSubfields = (
164
            not defined $subfieldsToAllowForRestrictedEdition
164
            not defined $subfieldsToAllowForRestrictedEditing
165
              or $subfieldsToAllowForRestrictedEdition == q||
165
              or $subfieldsToAllowForRestrictedEditing == q||
166
        ) ? 1 : 0;
166
        ) ? 1 : 0;
167
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition);
167
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing);
168
168
169
        # If we're on restricted edition, and our field is not in the list of subfields to allow,
169
        # If we're on restricted editing, and our field is not in the list of subfields to allow,
170
        # then it is read-only
170
        # then it is read-only
171
        $attributes_no_value .= 'readonly="readonly" '
171
        $attributes_no_value .= 'readonly="readonly" '
172
            if (
172
            if (
Lines 247-253 sub generate_subfield_form { Link Here
247
                    -class    => "input_marceditor",
247
                    -class    => "input_marceditor",
248
                );
248
                );
249
249
250
                # If we're on restricted edition, and our field is not in the list of subfields to allow,
250
                # If we're on restricted editing, and our field is not in the list of subfields to allow,
251
                # then it is read-only
251
                # then it is read-only
252
                push @scrparam, (-readonly => "readonly"), (-disabled => "disabled")
252
                push @scrparam, (-readonly => "readonly"), (-disabled => "disabled")
253
                    if (
253
                    if (
Lines 374-385 my ($template, $loggedinuser, $cookie) Link Here
374
                 });
374
                 });
375
375
376
376
377
# Does the user have a restricted item edition permission?
377
# Does the user have a restricted item editing permission?
378
my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef;
378
my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef;
379
my $restrictededition = $uid ? haspermission($uid,  {'editcatalogue' => 'edit_items_restricted'}) : undef;
379
my $restrictededition = $uid ? haspermission($uid,  {'editcatalogue' => 'edit_items_restricted'}) : undef;
380
# In case user is a superlibrarian, edition is not restricted
380
# In case user is a superlibrarian, editing is not restricted
381
$restrictededition = 0 if ($restrictededition != 0 &&  C4::Context->IsSuperLibrarian());
381
$restrictededition = 0 if ($restrictededition != 0 &&  C4::Context->IsSuperLibrarian());
382
# In case user has fast cataloging permission (and we're in fast cataloging), edition is not restricted
382
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted
383
$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'}));
383
$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'}));
384
384
385
my $today_iso = C4::Dates->today('iso');
385
my $today_iso = C4::Dates->today('iso');
(-)a/installer/data/mysql/de-DE/mandatory/userpermissions.sql (-1 / +1 lines)
Lines 11-17 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
11
   ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
12
   ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'),
12
   ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'),
13
   ( 9, 'edit_items', 'Exemplare bearbeiten'),
13
   ( 9, 'edit_items', 'Exemplare bearbeiten'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   (10, 'writeoff', 'Gebühren erlassen'),
16
   (10, 'writeoff', 'Gebühren erlassen'),
17
   (10, 'remaining_permissions', 'Verbleibende Berechtigungen für die Verwaltung von Gebühren'),
17
   (10, 'remaining_permissions', 'Verbleibende Berechtigungen für die Verwaltung von Gebühren'),
(-)a/installer/data/mysql/en/mandatory/userpermissions.sql (-1 / +1 lines)
Lines 11-17 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
11
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
12
   ( 9, 'fast_cataloging', 'Fast cataloging'),
12
   ( 9, 'fast_cataloging', 'Fast cataloging'),
13
   ( 9, 'edit_items', 'Edit items'),
13
   ( 9, 'edit_items', 'Edit items'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   (10, 'writeoff', 'Write off fines and fees'),
16
   (10, 'writeoff', 'Write off fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
(-)a/installer/data/mysql/es-ES/mandatory/userpermissions.sql (-1 / +1 lines)
Lines 11-17 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
11
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
12
   ( 9, 'fast_cataloging', 'Fast cataloging'),
12
   ( 9, 'fast_cataloging', 'Fast cataloging'),
13
   ( 9, 'edit_items', 'Edit Items'),
13
   ( 9, 'edit_items', 'Edit Items'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   (10, 'writeoff', 'Write off fines and fees'),
16
   (10, 'writeoff', 'Write off fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql (-1 / +1 lines)
Lines 11-17 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
11
   ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
12
   ( 9, 'fast_cataloging', 'Catalogage rapide'),
12
   ( 9, 'fast_cataloging', 'Catalogage rapide'),
13
   ( 9, 'edit_items', 'Modifier des exemplaires'),
13
   ( 9, 'edit_items', 'Modifier des exemplaires'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   (10, 'writeoff', 'Write off fines and fees'),
16
   (10, 'writeoff', 'Write off fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
(-)a/installer/data/mysql/it-IT/necessari/userpermissions.sql (-1 / +1 lines)
Lines 11-17 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
11
   ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
12
   ( 9, 'fast_cataloging', 'Catalogazione veloce'),
12
   ( 9, 'fast_cataloging', 'Catalogazione veloce'),
13
   ( 9, 'edit_items', 'Crea/modifica copie'),
13
   ( 9, 'edit_items', 'Crea/modifica copie'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   (10, 'writeoff', 'Cancellare multe e tariffe'),
16
   (10, 'writeoff', 'Cancellare multe e tariffe'),
17
   (10, 'remaining_permissions', 'Permessi rimanenti per gestione multe e costi'),
17
   (10, 'remaining_permissions', 'Permessi rimanenti per gestione multe e costi'),
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql (-1 / +1 lines)
Lines 31-37 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
31
   ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
31
   ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
32
   ( 9, 'fast_cataloging', 'Hurtigkatalogisering'),
32
   ( 9, 'fast_cataloging', 'Hurtigkatalogisering'),
33
   ( 9, 'edit_items', 'Endre eksmeplarer'),
33
   ( 9, 'edit_items', 'Endre eksmeplarer'),
34
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
34
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
35
   ( 9, 'delete_all_items', 'Delete all items at once'),
35
   ( 9, 'delete_all_items', 'Delete all items at once'),
36
   (10, 'writeoff', 'Write off fines and fees'),
36
   (10, 'writeoff', 'Write off fines and fees'),
37
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
37
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
(-)a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql (-1 / +1 lines)
Lines 11-17 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Edit catalogue'),
11
   ( 9, 'edit_catalogue', 'Edit catalogue'),
12
   ( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
12
   ( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
13
   ( 9, 'edit_items', 'Edit Items'),
13
   ( 9, 'edit_items', 'Edit Items'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEdition preference (please note that edit_item is still required)'),
14
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
15
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   (10, 'writeoff', 'Write off fines and fees'),
16
   (10, 'writeoff', 'Write off fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
17
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 381-387 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
381
('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'),
381
('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'),
382
('StatisticsFields','location|itype|ccode', NULL, 'Define Fields (from the items table) used for statistics members','Free'),
382
('StatisticsFields','location|itype|ccode', NULL, 'Define Fields (from the items table) used for statistics members','Free'),
383
('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');
383
('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');
384
('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'),
384
('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'),
385
('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'),
385
('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'),
386
('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free'),
386
('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free'),
387
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
387
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (-3 / +3 lines)
Lines 8894-8900 if ( CheckVersion($DBversion) ) { Link Here
8894
$DBversion = "3.17.00.XXX";
8894
$DBversion = "3.17.00.XXX";
8895
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
8895
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
8896
    $dbh->do(q{
8896
    $dbh->do(q{
8897
        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)');
8897
        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)');
8898
    });
8898
    });
8899
8899
8900
    $dbh->do(q{
8900
    $dbh->do(q{
Lines 8912-8925 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
8912
8912
8913
    # Add 2 new prefs
8913
    # Add 2 new prefs
8914
    $dbh->do(q{
8914
    $dbh->do(q{
8915
        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');
8915
        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');
8916
    });
8916
    });
8917
8917
8918
    $dbh->do(q{
8918
    $dbh->do(q{
8919
        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');
8919
        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');
8920
    });
8920
    });
8921
8921
8922
    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";
8922
    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";
8923
    SetVersion($DBversion);
8923
    SetVersion($DBversion);
8924
}
8924
}
8925
8925
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-4 / +3 lines)
Lines 110-124 Cataloging: Link Here
110
              class: short
110
              class: short
111
            - as default language in the UNIMARC field 100 when creating a new record or in the field plugin.
111
            - as default language in the UNIMARC field 100 when creating a new record or in the field plugin.
112
        -
112
        -
113
            - Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces.
113
            - Define a list of subfields for which editing is authorized when edit_items_restricted permission is enabled, separated by spaces.
114
            - pref: SubfieldsToAllowForRestrictedEdition
114
            - pref: SubfieldsToAllowForRestrictedEditing
115
            - 'Examples:'
115
            - 'Examples:'
116
            - 'UNIMARC: "995$f 995$h 995$j"'
116
            - 'UNIMARC: "995$f 995$h 995$j"'
117
            - 'MARC21: "952$a 952$b 952$c"'
117
            - 'MARC21: "952$a 952$b 952$c"'
118
            - Note that the FA framework is excluded from the permission.
118
            - Note that the FA framework is excluded from the permission.
119
            - If the pref is empty, no fields are restricted.
119
            - If the pref is empty, no fields are restricted.
120
        -
120
        -
121
            - Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces.
121
            - Define a list of subfields for which editing is authorized when items_batchmod_restricted permission is enabled, separated by spaces.
122
            - pref: SubfieldsToAllowForRestrictedBatchmod
122
            - pref: SubfieldsToAllowForRestrictedBatchmod
123
            - 'Examples:'
123
            - 'Examples:'
124
            - 'UNIMARC: "995$f 995$h 995$j"'
124
            - 'UNIMARC: "995$f 995$h 995$j"'
125
- 

Return to bug 7673