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'); |