Bugzilla – Attachment 32227 Details for
Bug 7673
New patron permissions to manage items (edit, batchmod, delete all)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 7673: Assume that all fields can be edited if the pref is empty
PASSED-QA-Bug-7673-Assume-that-all-fields-can-be-e.patch (text/plain), 4.68 KB, created by
Katrin Fischer
on 2014-10-10 21:40:01 UTC
(
hide
)
Description:
[PASSED QA] Bug 7673: Assume that all fields can be edited if the pref is empty
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-10-10 21:40:01 UTC
Size:
4.68 KB
patch
obsolete
>From 1cf881b124f92f10b524a7397e1a0d6c78a8f3bc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 10 Oct 2014 21:50:34 +0200 >Subject: [PATCH] [PASSED QA] Bug 7673: Assume that all fields can be edited if > the pref is empty > >If the sysprefs are empty, we assume that the librarian can edit all >subfields, even if s/he has the restricted permission. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > cataloguing/additem.pl | 10 ++++++++-- > .../prog/en/modules/admin/preferences/cataloguing.pref | 2 ++ > tools/batchMod.pl | 6 +++++- > 3 files changed, 15 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 3908edd..e6151d3 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -160,13 +160,18 @@ sub generate_subfield_form { > > # Getting list of subfields to keep when restricted edition is enabled > my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition'); >+ my $allowAllSubfields = ( >+ not defined $subfieldsToAllowForRestrictedEdition >+ or $subfieldsToAllowForRestrictedEdition == q|| >+ ) ? 1 : 0; > my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition); > > # If we're on restricted edition, and our field is not in the list of subfields to allow, > # then it is read-only > $attributes_no_value .= 'readonly="readonly" ' > if ( >- $restrictededition >+ not $allowAllSubfields >+ and $restrictededition > and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow > ); > >@@ -246,7 +251,8 @@ sub generate_subfield_form { > # then it is read-only > push @scrparam, (-readonly => "readonly"), (-disabled => "disabled") > if ( >- $restrictededition >+ not $allowAllSubfields >+ and $restrictededition > and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow > ); > $subfield_data{marc_value} =CGI::scrolling_list(@scrparam); >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 5f80f4c..a132731 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 >@@ -116,6 +116,7 @@ Cataloging: > - '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. > - pref: SubfieldsToAllowForRestrictedBatchmod >@@ -123,6 +124,7 @@ Cataloging: > - '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. > Display: > - > - 'Separate multiple displayed authors, series or subjects with ' >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index a4fd66a..ea9c856 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -301,13 +301,17 @@ my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); > > # Getting list of subfields to keep when restricted batchmod edit is enabled > my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod'); >+my $allowAllSubfields = ( >+ not defined $subfieldsToAllowForBatchmod >+ or $subfieldsToAllowForBatchmod == q|| >+) ? 1 : 0; > my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod); > > foreach my $tag (sort keys %{$tagslib}) { > # loop through each subfield > foreach my $subfield (sort keys %{$tagslib->{$tag}}) { > next if subfield_is_koha_internal_p($subfield); >- next if ($restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow ); >+ next if (not $allowAllSubfields and $restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow ); > next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10"); > # barcode and stocknumber are not meant to be batch-modified > next if $tagslib->{$tag}->{$subfield}->{'kohafield'} eq 'items.barcode'; >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7673
:
8714
|
9857
|
10360
|
12102
|
13004
|
16225
|
16239
|
16368
|
16371
|
23266
|
23267
|
23270
|
23271
|
26008
|
26009
|
26704
|
26705
|
26722
|
27631
|
27632
|
27633
|
27634
|
27635
|
27636
|
27637
|
27638
|
27640
|
27641
|
28007
|
28008
|
28009
|
28010
|
28011
|
28012
|
28013
|
28014
|
28015
|
29550
|
30910
|
30911
|
30912
|
30913
|
30914
|
30915
|
30916
|
30917
|
30918
|
30919
|
31010
|
31011
|
31012
|
31013
|
31015
|
31016
|
31017
|
31019
|
32200
|
32201
|
32215
|
32217
|
32219
|
32220
|
32222
|
32224
|
32225
|
32226
| 32227 |
32228
|
32928
|
32962
|
32993
|
33487