Lines 1501-1515
sub GetAuthorisedValueDesc {
Link Here
|
1501 |
|
1501 |
|
1502 |
return q{} unless defined($value); |
1502 |
return q{} unless defined($value); |
1503 |
|
1503 |
|
1504 |
my $cache = Koha::Caches->get_instance(); |
|
|
1505 |
my $cache_key; |
1506 |
if ( !$category ) { |
1504 |
if ( !$category ) { |
1507 |
|
1505 |
|
1508 |
return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; |
1506 |
return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; |
1509 |
|
1507 |
|
1510 |
#---- branch |
1508 |
#---- branch |
1511 |
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { |
1509 |
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { |
1512 |
$cache_key = "libraries:name"; |
1510 |
my $cache = Koha::Caches->get_instance(); |
|
|
1511 |
my $cache_key = "libraries:name"; |
1513 |
my $libraries = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1512 |
my $libraries = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1514 |
if ( !$libraries ) { |
1513 |
if ( !$libraries ) { |
1515 |
$libraries = { |
1514 |
$libraries = { |
Lines 1525-1534
sub GetAuthorisedValueDesc {
Link Here
|
1525 |
|
1524 |
|
1526 |
#---- itemtypes |
1525 |
#---- itemtypes |
1527 |
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) { |
1526 |
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) { |
1528 |
my $lang = C4::Languages::getlanguage; |
1527 |
my $cache = Koha::Caches->get_instance(); |
|
|
1528 |
my $lang = C4::Languages::getlanguage; |
1529 |
$lang //= 'en'; |
1529 |
$lang //= 'en'; |
1530 |
$cache_key = 'itemtype:description:' . $lang; |
1530 |
my $cache_key = 'itemtype:description:' . $lang; |
1531 |
my $itypes = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1531 |
my $itypes = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1532 |
if ( !$itypes ) { |
1532 |
if ( !$itypes ) { |
1533 |
$itypes = { map { $_->itemtype => $_->translated_description } Koha::ItemTypes->search()->as_list }; |
1533 |
$itypes = { map { $_->itemtype => $_->translated_description } Koha::ItemTypes->search()->as_list }; |
1534 |
$cache->set_in_cache( $cache_key, $itypes ); |
1534 |
$cache->set_in_cache( $cache_key, $itypes ); |
Lines 1537-1543
sub GetAuthorisedValueDesc {
Link Here
|
1537 |
} |
1537 |
} |
1538 |
|
1538 |
|
1539 |
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "cn_source" ) { |
1539 |
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "cn_source" ) { |
1540 |
$cache_key = "cn_sources:description"; |
1540 |
my $cache = Koha::Caches->get_instance(); |
|
|
1541 |
my $cache_key = "cn_sources:description"; |
1541 |
my $cn_sources = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1542 |
my $cn_sources = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1542 |
if ( !$cn_sources ) { |
1543 |
if ( !$cn_sources ) { |
1543 |
$cn_sources = { |
1544 |
$cn_sources = { |
Lines 1557-1563
sub GetAuthorisedValueDesc {
Link Here
|
1557 |
|
1558 |
|
1558 |
my $dbh = C4::Context->dbh; |
1559 |
my $dbh = C4::Context->dbh; |
1559 |
if ( $category ne "" ) { |
1560 |
if ( $category ne "" ) { |
1560 |
$cache_key = "AV_descriptions:" . $category; |
1561 |
my $cache = Koha::Caches->get_instance('authorised-values'); |
|
|
1562 |
my $cache_key = "AV_descriptions:" . $category; |
1561 |
my $av_descriptions = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1563 |
my $av_descriptions = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); |
1562 |
if ( !$av_descriptions ) { |
1564 |
if ( !$av_descriptions ) { |
1563 |
$av_descriptions = { |
1565 |
$av_descriptions = { |