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