@@ -, +, @@
---
Koha/UI/Form/Builder/Item.pm | 5 +++--
catalogue/detail.pl | 4 +++-
catalogue/search.pl | 8 +++++++-
.../prog/en/modules/catalogue/detail.tt | 2 +-
.../bootstrap/en/modules/opac-reserve.tt | 4 ++--
opac/opac-reserve.pl | 12 +++++++-----
opac/opac-search.pl | 16 ++++++++++++++--
7 files changed, 37 insertions(+), 14 deletions(-)
--- a/Koha/UI/Form/Builder/Item.pm
+++ a/Koha/UI/Form/Builder/Item.pm
@@ -209,8 +209,9 @@ sub generate_subfield_form {
push @authorised_values, "";
my $itemtypes;
if ($branch_limit) {
- $itemtypes = Koha::ItemTypes->search(
- { branchcode => $branch_limit } );
+ $itemtypes =
+ Koha::ItemTypes->search_with_library_limits( undef, undef,
+ $branch_limit );
}
else {
$itemtypes = Koha::ItemTypes->search;
--- a/catalogue/detail.pl
+++ a/catalogue/detail.pl
@@ -50,6 +50,7 @@ use Koha::Biblio::ItemGroup::Items;
use Koha::Biblio::ItemGroups;
use Koha::CoverImages;
use Koha::DateUtils;
+use Koha::I18N;
use Koha::Illrequests;
use Koha::Items;
use Koha::ItemTypes;
@@ -189,7 +190,8 @@ $template->param(
content_identifier_exists => $content_identifier_exists,
);
-my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_localization->as_list } };
+my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search->as_list } };
+
my $all_items = $biblio->items->search_ordered;
my @items;
my $patron = Koha::Patrons->find( $borrowernumber );
--- a/catalogue/search.pl
+++ a/catalogue/search.pl
@@ -579,7 +579,13 @@ for (my $i=0;$i<@servers;$i++) {
\@sort_by, $scan, $lang, { weighted_fields => $weight_search, whole_record => $whole_record });
my $quoted_results_hashref;
eval {
- my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
+ my $itemtypes = {
+ map {
+ $_->{itemtype} =>
+ { %$_, description => db_t( 'itemtype', $_->{itemtype} ), }
+ } @{ Koha::ItemTypes->search->unblessed }
+ };
+
( $error, $quoted_results_hashref, $facets ) = $searcher->search_compat(
$query, $simple_query, \@sort_by, ['biblioserver'],
$results_per_page, $offset, undef, $itemtypes,
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
@@ -405,7 +405,7 @@
[% IF !noItemTypeImages && itemtype.image_location('intranet') %]
[% END %]
- [% ItemTypes.t(item.translation_key) | html %]
+ [% ItemTypes.t(itemtype.translation_key) | html %]
[% END %]
[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.holdingbranch ) | html %] [% END %] |
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
@@ -232,7 +232,7 @@
Item type:
[% IF ( bibitemloo.imageurl ) %][% END %]
- [% ItemTypes.t(bibitemloo.translation_key) | html %]
+ [% bibitemloo.description | html %]
[% END %]
@@ -421,7 +421,7 @@
[% END %]
[% END %]
- [% ItemTypes.t(itemLoo.translation_key) | html %]
+ [% itemLoo.description | html %]
[% END %]
--- a/opac/opac-reserve.pl
+++ a/opac/opac-reserve.pl
@@ -35,6 +35,7 @@ use C4::Overdues;
use Koha::AuthorisedValues;
use Koha::Biblios;
use Koha::CirculationRules;
+use Koha::I18N;
use Koha::Items;
use Koha::ItemTypes;
use Koha::Checkouts;
@@ -72,7 +73,7 @@ unless ( $can_place_hold_if_available_at_pickup ) {
}
}
-my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
+my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search->as_list } };
# There are two ways of calling this script, with a single biblio num
# or multiple biblio nums.
@@ -413,8 +414,9 @@ foreach my $biblioNum (@biblionumbers) {
$biblioLoopIter{object} = $biblio;
if (!$itemLevelTypes && $biblioData->{itemtype}) {
- $biblioLoopIter{description} = $itemtypes->{$biblioData->{itemtype}}{description};
- $biblioLoopIter{imageurl} = getitemtypeimagesrc() . "/". $itemtypes->{$biblioData->{itemtype}}{imageurl};
+ $biblioLoopIter{description} =
+ db_t('itemtype', $itemtypes->{$biblioData->{itemtype}}->translation_key);
+ $biblioLoopIter{imageurl} = getitemtypeimagesrc() . "/". $itemtypes->{$biblioData->{itemtype}}->imageurl;
}
@@ -435,9 +437,9 @@ foreach my $biblioNum (@biblionumbers) {
if ($itemLevelTypes) {
my $itemtype = $item->itemtype;
$item_info->{'imageurl'} = getitemtypeimagelocation( 'opac',
- $itemtypes->{ $itemtype->itemtype }->{'imageurl'} );
+ $itemtypes->{ $itemtype->itemtype }->imageurl );
$item_info->{'description'} =
- db_t('itemtype', $itemtypes->{ $itemtype->itemtype }->{description});
+ db_t('itemtype', $itemtypes->{ $itemtype->itemtype }->translation_key);
}
# checking for holds
--- a/opac/opac-search.pl
+++ a/opac/opac-search.pl
@@ -577,7 +577,13 @@ if ($tag) {
$pasarParams .= '&count=' . uri_escape_utf8($results_per_page);
$pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query);
$pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type);
- my $itemtypes_nocategory = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
+ my $itemtypes_nocategory = {
+ map {
+ $_->{itemtype} =>
+ { %$_, description => db_t( 'itemtype', $_->{itemtype} ), }
+ } @{ Koha::ItemTypes->search->unblessed }
+ };
+
eval {
($error, $results_hashref, $facets) = $searcher->search_compat($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,undef,$itemtypes_nocategory,$query_type,$scan,1);
};
@@ -638,7 +644,13 @@ for (my $i=0;$i<@servers;$i++) {
}
);
my $quoted_results_hashref;
- my $itemtypes_nocategory = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
+ my $itemtypes_nocategory = {
+ map {
+ $_->{itemtype} =>
+ { %$_, description => db_t( 'itemtype', $_->{itemtype} ), }
+ } @{ Koha::ItemTypes->search->unblessed }
+ };
+
eval {
($error, $quoted_results_hashref, $facets) = $searcher->search_compat($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,undef,$itemtypes_nocategory,$query_type,$scan,1);
};
--