Lines 257-276
if( @scanned_items ) {
Link Here
|
257 |
# status, or are still checked out. |
257 |
# status, or are still checked out. |
258 |
foreach my $item ( @scanned_items ) { |
258 |
foreach my $item ( @scanned_items ) { |
259 |
$item->{notforloancode} = $item->{notforloan}; # save for later use |
259 |
$item->{notforloancode} = $item->{notforloan}; # save for later use |
260 |
|
260 |
my $fc = $item->{'frameworkcode'} || ''; |
261 |
# Populating with authorised values |
261 |
|
262 |
foreach my $field ( keys %$item ) { |
262 |
# Populating with authorised values description |
263 |
# If the koha field is mapped to a marc field |
263 |
foreach my $field (qw/ location notforloan itemlost damaged withdrawn /) { |
264 |
my $fc = $item->{'frameworkcode'} || ''; |
264 |
my $av = Koha::AuthorisedValues->get_description_by_koha_field( |
265 |
my ($f, $sf) = GetMarcFromKohaField("items.$field", $fc); |
265 |
{ frameworkcode => $fc, kohafield => "items.$field", authorised_value => $item->{$field} } ); |
266 |
if ($f and $sf) { |
266 |
if ( $av and defined $item->{$field} and defined $av->{lib} ) { |
267 |
# We replace the code with it's description |
267 |
$item->{$field} = $av->{lib}; |
268 |
my $av = Koha::AuthorisedValues->search_by_marc_field({ frameworkcode => $fc, tagfield => $f, tagsubfield => $sf, }); |
|
|
269 |
$av = $av->count ? $av->unblessed : []; |
270 |
my $authvals = { map { ( $_->{authorised_value} => $_->{lib} ) } @$av }; |
271 |
if ($authvals and defined $item->{$field} and defined $authvals->{$item->{$field}}) { |
272 |
$item->{$field} = $authvals->{$item->{$field}}; |
273 |
} |
274 |
} |
268 |
} |
275 |
} |
269 |
} |
276 |
|
270 |
|
Lines 358-364
if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){
Link Here
|
358 |
$csv->combine(@translated_keys); |
352 |
$csv->combine(@translated_keys); |
359 |
print $csv->string, "\n"; |
353 |
print $csv->string, "\n"; |
360 |
|
354 |
|
361 |
my @keys = qw / title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged withdrawn stocknumber /; |
355 |
my @keys = qw/ title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged withdrawn stocknumber /; |
362 |
for my $item ( @$loop ) { |
356 |
for my $item ( @$loop ) { |
363 |
my @line; |
357 |
my @line; |
364 |
for my $key (@keys) { |
358 |
for my $key (@keys) { |
365 |
- |
|
|