Lines 34-39
use YAML qw/Load/;
Link Here
|
34 |
use DateTime::Format::MySQL; |
34 |
use DateTime::Format::MySQL; |
35 |
use Data::Dumper; # used as part of logging item record changes, not just for |
35 |
use Data::Dumper; # used as part of logging item record changes, not just for |
36 |
# debugging; so please don't remove this |
36 |
# debugging; so please don't remove this |
|
|
37 |
|
38 |
use Koha::AuthorisedValues; |
37 |
use Koha::DateUtils qw/dt_from_string/; |
39 |
use Koha::DateUtils qw/dt_from_string/; |
38 |
use Koha::Database; |
40 |
use Koha::Database; |
39 |
|
41 |
|
Lines 1380-1398
sub GetItemsInfo {
Link Here
|
1380 |
|
1382 |
|
1381 |
# get notforloan complete status if applicable |
1383 |
# get notforloan complete status if applicable |
1382 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) { |
1384 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) { |
1383 |
$data->{notforloanvalue} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{itemnotforloan} ); |
1385 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $data->{itemnotforloan} }); |
1384 |
$data->{notforloanvalueopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{itemnotforloan}, 1 ); |
1386 |
$av = $av->count ? $av->next : undef; |
|
|
1387 |
$data->{notforloanvalue} = $av ? $av->lib : ''; |
1388 |
$data->{notforloanvalueopac} = $av ? $av->opac_description : ''; |
1385 |
} |
1389 |
} |
1386 |
|
1390 |
|
1387 |
# get restricted status and description if applicable |
1391 |
# get restricted status and description if applicable |
1388 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) { |
1392 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) { |
1389 |
$data->{restrictedopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted}, 1 ); |
1393 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $data->{restricted} }); |
1390 |
$data->{restricted} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted} ); |
1394 |
$av = $av->count ? $av->next : undef; |
|
|
1395 |
$data->{restricted} = $av ? $av->lib : ''; |
1396 |
$data->{restrictedopac} = $av ? $av->opac_description : ''; |
1391 |
} |
1397 |
} |
1392 |
|
1398 |
|
1393 |
# my stack procedures |
1399 |
# my stack procedures |
1394 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { |
1400 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { |
1395 |
$data->{stack} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{stack} ); |
1401 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $data->{stack} }); |
|
|
1402 |
$data->{stack} = $av->count ? $av->next->lib : ''; |
1396 |
} |
1403 |
} |
1397 |
|
1404 |
|
1398 |
# Find the last 3 people who borrowed this item. |
1405 |
# Find the last 3 people who borrowed this item. |
Lines 1477-1484
sub GetItemsLocationInfo {
Link Here
|
1477 |
$sth->execute($biblionumber); |
1484 |
$sth->execute($biblionumber); |
1478 |
|
1485 |
|
1479 |
while ( my $data = $sth->fetchrow_hashref ) { |
1486 |
while ( my $data = $sth->fetchrow_hashref ) { |
1480 |
$data->{location_intranet} = GetKohaAuthorisedValueLib('LOC', $data->{location}); |
1487 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $data->{location} }); |
1481 |
$data->{location_opac}= GetKohaAuthorisedValueLib('LOC', $data->{location}, 1); |
1488 |
$av = $av->count ? $av->next : undef; |
|
|
1489 |
$data->{location_intranet} = $av ? $av->lib : ''; |
1490 |
$data->{location_opac} = $av ? $av->opac_description : ''; |
1482 |
push @results, $data; |
1491 |
push @results, $data; |
1483 |
} |
1492 |
} |
1484 |
return @results; |
1493 |
return @results; |