Bugzilla – Attachment 30916 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]
Bug 7673: Update permission names in script
Bug-7673-Update-permission-names-in-script.patch (text/plain), 7.87 KB, created by
Jonathan Druart
on 2014-08-18 09:10:37 UTC
(
hide
)
Description:
Bug 7673: Update permission names in script
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-08-18 09:10:37 UTC
Size:
7.87 KB
patch
obsolete
>From 1b5123732b6be22406e80b502ebfff35f8d0508b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 25 Apr 2014 16:51:35 +0200 >Subject: [PATCH] Bug 7673: Update permission names in script > >Two permission names have been changed since the first patch. > >Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com> >--- > cataloguing/additem.pl | 28 ++++++++++++++-------------- > tools/batchMod.pl | 12 ++++++------ > 2 files changed, 20 insertions(+), 20 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 941cff0..f2df4a0 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -104,7 +104,7 @@ sub _increment_barcode { > > > sub generate_subfield_form { >- my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i, $limitededition) = @_; >+ my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i, $restrictededition) = @_; > > my $frameworkcode = &GetFrameworkCode($biblionumber); > >@@ -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 limited edition is enabled >+ # Getting list of subfields to keep when restricted edition is enabled > my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition'); > my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition); > >- # If we're on limited edition, and our field is not in the list of subfields to allow, >+ # 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 ( >- $limitededition >+ $restrictededition > and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow > ); > >@@ -242,11 +242,11 @@ sub generate_subfield_form { > -class => "input_marceditor", > ); > >- # If we're on limited edition, and our field is not in the list of subfields to allow, >+ # If we're on restricted edition, and our field is not in the list of subfields to allow, > # then it is read-only > push @scrparam, (-readonly => "readonly"), (-disabled => "disabled") > if ( >- $limitededition >+ $restrictededition > and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow > ); > $subfield_data{marc_value} =CGI::scrolling_list(@scrparam); >@@ -368,13 +368,13 @@ my ($template, $loggedinuser, $cookie) > }); > > >-# Does the user have a limited item edition permission? >+# Does the user have a restricted item edition permission? > my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; >-my $limitededition = $uid ? haspermission($uid, {'editcatalogue' => 'limited_item_edition'}) : undef; >-# In case user is a superlibrarian, edition is not limited >-$limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1); >-# In case user has fast cataloging permission (and we're in fast cataloging), edition is not limited >-$limitededition = 0 if ($limitededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'})); >+my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; >+# In case user is a superlibrarian, edition is not restricted >+$restrictededition = 0 if ($restrictededition != 0 && $restrictededition->{'superlibrarian'} eq 1); >+# In case user has fast cataloging permission (and we're in fast cataloging), edition is not restricted >+$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'})); > > my $today_iso = C4::Dates->today('iso'); > my $tagslib = &GetMarcStructure(1,$frameworkcode); >@@ -808,7 +808,7 @@ if($itemrecord){ > next if subfield_is_koha_internal_p($subfieldtag); > next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); > >- my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $limitededition); >+ my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $restrictededition); > push @fields, "$tag$subfieldtag"; > push (@loop_data, $subfield_data); > $i++; >@@ -832,7 +832,7 @@ foreach my $tag ( keys %{$tagslib}){ > my @values = (undef); > @values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); > for my $value (@values){ >- my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $limitededition); >+ my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $restrictededition); > push (@loop_data, $subfield_data); > $i++; > } >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index f3c50dc..d308309 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -70,11 +70,11 @@ my ($template, $loggedinuser, $cookie) > flagsrequired => $template_flag, > }); > >-# Does the user have a limited item edition permission? >+# Does the user have a restricted item edition permission? > my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; >-my $limitededition = $uid ? haspermission($uid, {'tools' => 'items_limited_batchmod'}) : undef; >-# In case user is a superlibrarian, edition is not limited >-$limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1); >+my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; >+# In case user is a superlibrarian, edition is not restricted >+$restrictededition = 0 if ($restrictededition != 0 && $restrictededition->{'superlibrarian'} eq 1); > > my $today_iso = C4::Dates->today('iso'); > $template->param(today_iso => $today_iso); >@@ -299,7 +299,7 @@ unshift (@$branches, $nochange_branch); > > my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); > >-# Getting list of subfields to keep when limited batchmod edit is enabled >+# Getting list of subfields to keep when restricted batchmod edit is enabled > my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod'); > my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod); > >@@ -307,7 +307,7 @@ 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 ($limitededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow ); >+ next if ($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'; >-- >2.0.0.rc2
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