|
Lines 33-38
use C4::ClassSource;
Link Here
|
| 33 |
use C4::Dates; |
33 |
use C4::Dates; |
| 34 |
use List::MoreUtils qw/any/; |
34 |
use List::MoreUtils qw/any/; |
| 35 |
use C4::Search; |
35 |
use C4::Search; |
|
|
36 |
use C4::Members; |
| 36 |
|
37 |
|
| 37 |
use MARC::File::XML; |
38 |
use MARC::File::XML; |
| 38 |
use URI::Escape; |
39 |
use URI::Escape; |
|
Lines 100-106
sub _increment_barcode {
Link Here
|
| 100 |
|
101 |
|
| 101 |
|
102 |
|
| 102 |
sub generate_subfield_form { |
103 |
sub generate_subfield_form { |
| 103 |
my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i) = @_; |
104 |
my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i, $limitededition) = @_; |
| 104 |
|
105 |
|
| 105 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
106 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
| 106 |
my %subfield_data; |
107 |
my %subfield_data; |
|
Lines 152-157
sub generate_subfield_form {
Link Here
|
| 152 |
$value = $input->param('barcode'); |
153 |
$value = $input->param('barcode'); |
| 153 |
} |
154 |
} |
| 154 |
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="$subfield_data{maxlength}" ); |
155 |
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="$subfield_data{maxlength}" ); |
|
|
156 |
$attributes_no_value .= 'readonly="readonly" ' |
| 157 |
if ( |
| 158 |
$limitededition |
| 159 |
and C4::Context->preference("marcflavour") eq "UNIMARC" |
| 160 |
and $subfieldtag ne 'f' |
| 161 |
and $subfieldtag ne 'u' |
| 162 |
); |
| 163 |
|
| 155 |
my $attributes = qq($attributes_no_value value="$value" ); |
164 |
my $attributes = qq($attributes_no_value value="$value" ); |
| 156 |
|
165 |
|
| 157 |
if ( $subfieldlib->{authorised_value} ) { |
166 |
if ( $subfieldlib->{authorised_value} ) { |
|
Lines 212-218
sub generate_subfield_form {
Link Here
|
| 212 |
$subfield_data{marc_value} = qq(<input type="hidden" $attributes /> $authorised_lib{$value}); |
221 |
$subfield_data{marc_value} = qq(<input type="hidden" $attributes /> $authorised_lib{$value}); |
| 213 |
} |
222 |
} |
| 214 |
else { |
223 |
else { |
| 215 |
$subfield_data{marc_value} =CGI::scrolling_list( # FIXME: factor out scrolling_list |
224 |
my @scrparam = ( |
| 216 |
-name => "field_value", |
225 |
-name => "field_value", |
| 217 |
-values => \@authorised_values, |
226 |
-values => \@authorised_values, |
| 218 |
-default => $value, |
227 |
-default => $value, |
|
Lines 224-229
sub generate_subfield_form {
Link Here
|
| 224 |
-id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, |
233 |
-id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, |
| 225 |
-class => "input_marceditor", |
234 |
-class => "input_marceditor", |
| 226 |
); |
235 |
); |
|
|
236 |
push @scrparam, (-readonly => "readonly") |
| 237 |
if ( |
| 238 |
$limitededition |
| 239 |
and C4::Context->preference("marcflavour") eq "UNIMARC" |
| 240 |
and $subfieldtag ne 'o' |
| 241 |
); |
| 242 |
$subfield_data{marc_value} =CGI::scrolling_list(@scrparam); |
| 227 |
} |
243 |
} |
| 228 |
|
244 |
|
| 229 |
} |
245 |
} |
|
Lines 308-313
my ($template, $loggedinuser, $cookie)
Link Here
|
| 308 |
}); |
324 |
}); |
| 309 |
|
325 |
|
| 310 |
|
326 |
|
|
|
327 |
# Does the user have a limited item edition permission? |
| 328 |
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser) ; |
| 329 |
my $limitededition = haspermission($uid, {'editcatalogue' => 'limited_item_edition'}) if ($uid); |
| 330 |
# In case user is a superlibrarian, edition is not limited |
| 331 |
$limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1); |
| 332 |
|
| 311 |
my $today_iso = C4::Dates->today('iso'); |
333 |
my $today_iso = C4::Dates->today('iso'); |
| 312 |
my $tagslib = &GetMarcStructure(1,$frameworkcode); |
334 |
my $tagslib = &GetMarcStructure(1,$frameworkcode); |
| 313 |
my $record = GetMarcBiblio($biblionumber); |
335 |
my $record = GetMarcBiblio($biblionumber); |
|
Lines 682-689
if($itemrecord){
Link Here
|
| 682 |
next if subfield_is_koha_internal_p($subfieldtag); |
704 |
next if subfield_is_koha_internal_p($subfieldtag); |
| 683 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
705 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
| 684 |
|
706 |
|
| 685 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); |
707 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $limitededition); |
| 686 |
|
|
|
| 687 |
push @fields, "$tag$subfieldtag"; |
708 |
push @fields, "$tag$subfieldtag"; |
| 688 |
push (@loop_data, $subfield_data); |
709 |
push (@loop_data, $subfield_data); |
| 689 |
$i++; |
710 |
$i++; |