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);
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
);
-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);
});
-# 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);
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++;
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++;
}
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);
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);
# 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';