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 1381-1399
sub GetItemsInfo {
Link Here
|
1381 |
|
1383 |
|
1382 |
# get notforloan complete status if applicable |
1384 |
# get notforloan complete status if applicable |
1383 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) { |
1385 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) { |
1384 |
$data->{notforloanvalue} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{itemnotforloan} ); |
1386 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $data->{itemnotforloan} }); |
1385 |
$data->{notforloanvalueopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{itemnotforloan}, 1 ); |
1387 |
$av = $av->count ? $av->next : undef; |
|
|
1388 |
$data->{notforloanvalue} = $av ? $av->lib : ''; |
1389 |
$data->{notforloanvalueopac} = $av ? $av->opac_description : ''; |
1386 |
} |
1390 |
} |
1387 |
|
1391 |
|
1388 |
# get restricted status and description if applicable |
1392 |
# get restricted status and description if applicable |
1389 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) { |
1393 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) { |
1390 |
$data->{restrictedopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted}, 1 ); |
1394 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $data->{restricted} }); |
1391 |
$data->{restricted} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted} ); |
1395 |
$av = $av->count ? $av->next : undef; |
|
|
1396 |
$data->{restricted} = $av ? $av->lib : ''; |
1397 |
$data->{restrictedopac} = $av ? $av->opac_description : ''; |
1392 |
} |
1398 |
} |
1393 |
|
1399 |
|
1394 |
# my stack procedures |
1400 |
# my stack procedures |
1395 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { |
1401 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { |
1396 |
$data->{stack} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{stack} ); |
1402 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $data->{stack} }); |
|
|
1403 |
$data->{stack} = $av->count ? $av->next->lib : ''; |
1397 |
} |
1404 |
} |
1398 |
|
1405 |
|
1399 |
# Find the last 3 people who borrowed this item. |
1406 |
# Find the last 3 people who borrowed this item. |
Lines 1478-1485
sub GetItemsLocationInfo {
Link Here
|
1478 |
$sth->execute($biblionumber); |
1485 |
$sth->execute($biblionumber); |
1479 |
|
1486 |
|
1480 |
while ( my $data = $sth->fetchrow_hashref ) { |
1487 |
while ( my $data = $sth->fetchrow_hashref ) { |
1481 |
$data->{location_intranet} = GetKohaAuthorisedValueLib('LOC', $data->{location}); |
1488 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $data->{location} }); |
1482 |
$data->{location_opac}= GetKohaAuthorisedValueLib('LOC', $data->{location}, 1); |
1489 |
$av = $av->count ? $av->next : undef; |
|
|
1490 |
$data->{location_intranet} = $av ? $av->lib : ''; |
1491 |
$data->{location_opac} = $av ? $av->opac_description : ''; |
1483 |
push @results, $data; |
1492 |
push @results, $data; |
1484 |
} |
1493 |
} |
1485 |
return @results; |
1494 |
return @results; |