From 438bdc5b9627094bd22ec776898dca4e60fe6458 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Wed, 2 Nov 2011 19:30:03 +1300 Subject: [PATCH] [SIGNED-OFF] bug_7140: Added item description to complement icon to search result and biblio detail pages Content-Type: text/plain; charset="utf-8" Signed-off-by: Owen Leonard --- C4/Search.pm | 5 +- .../prog/en/modules/catalogue/detail.tt | 14 ++--- .../prog/en/modules/catalogue/results.tt | 70 +++++++++++++------- 3 files changed, 55 insertions(+), 34 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 98db887..2aba42e 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1622,6 +1622,7 @@ sub searchResults { foreach my $code ( keys %subfieldstosearch ) { $item->{$code} = $field->subfield( $subfieldstosearch{$code} ); } + $item->{description} = $itemtypes{ $item->{itype} }{description}; # Hidden items my @items = ($item); @@ -1650,6 +1651,7 @@ sub searchResults { $onloan_items->{$key}->{branchname} = $item->{branchname}; $onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; $onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; + $onloan_items->{$key}->{description} = $item->{description}; $onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); # if something's checked out and lost, mark it as 'long overdue' if ( $item->{itemlost} ) { @@ -1733,6 +1735,7 @@ sub searchResults { $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value; $other_items->{$key}->{count}++ if $item->{$hbranch}; $other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; + $other_items->{$key}->{description} = $item->{description}; $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); } # item is available @@ -1740,7 +1743,7 @@ sub searchResults { $can_place_holds = 1; $available_count++; $available_items->{$prefix}->{count}++ if $item->{$hbranch}; - foreach (qw(branchname itemcallnumber hideatopac)) { + foreach (qw(branchname itemcallnumber hideatopac description)) { $available_items->{$prefix}->{$_} = $item->{$_}; } $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index b1e225f..53aa03d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -255,16 +255,12 @@ function verify_images() { [% FOREACH itemloo IN itemloop %] [% IF ( item_level_itypes ) %] - - [% IF ( noItemTypeImages ) %] - [% itemloo.description %] - [% ELSE %] - [% IF ( itemloo.imageurl ) %] + + [% IF !noItemTypeImages && itemloo.imageurl %] [% itemloo.description %] - [% ELSE %] - [% itemloo.description %] - [% END %] - [% END %] + [% END %] + [% itemloo.description %] + [% END %] [% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %] [% itemloo.homebranch %][% itemloo.location %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 2bed51c..cf283dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -470,17 +470,19 @@ YAHOO.util.Event.onContentReady("searchheader", function () { [% END %]

[% UNLESS ( item_level_itypes ) %] - [% UNLESS ( noItemTypeImages ) %][% IF ( SEARCH_RESULT.imageurl ) %] - - [% END %][% END %] + [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] + [% SEARCH_RESULT.description %] + [% END %] + [% SEARCH_RESULT.description %] [% END %] [% SEARCH_RESULT.summary %]

[% ELSE %]

[% UNLESS ( item_level_itypes ) %] - [% UNLESS ( noItemTypeImages ) %][% IF ( SEARCH_RESULT.imageurl ) %] + [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] - [% END %][% END %] + [% END %] + [% SEARCH_RESULT.description %] [% END %] [% IF ( SEARCH_RESULT.author ) %] @@ -532,41 +534,56 @@ YAHOO.util.Event.onContentReady("searchheader", function () {

+ ([% available_items_loo.count %]) + [% IF item_level_itypes && available_items_loo.description %] +
[% available_items_loo.description %] + [% END %] + + [% END %] + [% END %] [% IF ( SEARCH_RESULT.onloancount ) %] [% SEARCH_RESULT.onloancount %] on loan: + ([% onloan_items_loo.count %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue %] long overdue[% END %]) date due: [% onloan_items_loo.due_date %] + [% IF item_level_itypes && onloan_items_loo.description %] +
[% onloan_items_loo.description %] + [% END %] + + [% END %] + [% END %] [% IF ( SEARCH_RESULT.othercount ) %] [% SEARCH_RESULT.othercount %] unavailable: + ([% other_items_loo.count %]) + [% IF item_level_itypes && other_items_loo.description %] +
[% other_items_loo.description %] + [% END %] + + [% END %] + [% END %] [% ELSE %] [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.count ) %] -- 1.7.3