bug_7140: Added item description to complement icon to search result and biblio detail pages

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This seems like a very big improvement, especially for people using screen
readers. I agree that the change to C4::Search is required.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Srdjan Jankovic 2012-01-27 16:59:27 +13:00 committed by Jared Camins-Esakov
parent 46a55fb4bb
commit e739d9ea1c
3 changed files with 54 additions and 34 deletions

View File

@ -1619,6 +1619,7 @@ sub searchResults {
foreach my $code ( keys %subfieldstosearch ) {
$item->{$code} = $field->subfield( $subfieldstosearch{$code} );
}
$item->{description} = $itemtypes{ $item->{itype} }{description};
# Hidden items
if ($is_opac) {
@ -1649,6 +1650,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} };

View File

@ -255,16 +255,12 @@ function verify_images() {
[% FOREACH itemloo IN itemloop %]
<tr>
[% IF ( item_level_itypes ) %]
<td class="itype">
[% IF ( noItemTypeImages ) %]
[% itemloo.description %]
[% ELSE %]
[% IF ( itemloo.imageurl ) %]
<td class="itype">
[% IF !noItemTypeImages && itemloo.imageurl %]
<img src="[% itemloo.imageurl %]" alt="[% itemloo.description %]" title="[% itemloo.description %]" />
[% ELSE %]
[% itemloo.description %]
[% END %]
[% END %]</td>
[% END %]
[% itemloo.description %]
</td>
[% END %]
<td class="location">[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %]</td>
<td class="homebranch">[% itemloo.homebranch %]<span class="shelvingloc">[% itemloo.location %]</span> </td>

View File

@ -470,17 +470,18 @@ YAHOO.util.Event.onContentReady("searchheader", function () {
[% END %]
<p>
[% UNLESS ( item_level_itypes ) %]
[% UNLESS ( noItemTypeImages ) %][% IF ( SEARCH_RESULT.imageurl ) %]
<img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" style="float: left; margin: .1em;" alt="" />
[% END %][% END %]
[% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
<img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" style="float: left; margin: .1em;" alt="[% SEARCH_RESULT.description %]" />
[% END %]
[% SEARCH_RESULT.description %]
[% END %]
[% SEARCH_RESULT.summary %]</p>
[% ELSE %]
<p>
[% UNLESS ( item_level_itypes ) %]
[% UNLESS ( noItemTypeImages ) %][% IF ( SEARCH_RESULT.imageurl ) %]
[% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
<img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" style="float: left; margin: .1em;" alt="" />
[% END %][% END %]
[% END %]
[% END %]
[% IF ( SEARCH_RESULT.author ) %]
@ -531,41 +532,56 @@ YAHOO.util.Event.onContentReady("searchheader", function () {
<ul>
[% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
[% IF ( noItemTypeImages ) %]<li>[% ELSE %][% IF ( item_level_itypes ) %][% IF ( available_items_loo.imageurl ) %]<li style="list-style: none; list-style-type: none;"><img src="[% available_items_loo.imageurl %]" title="[% available_items_loo.description %]" alt="[% available_items_loo.description %]" />[% ELSE %]<li>[% END %][% ELSE %]<li>[% END %][% END %]
[% IF item_level_itypes && !noItemTypeImages && available_items_loo.imageurl %]
<li style="list-style: none; list-style-type: none;">
<img src="[% available_items_loo.imageurl %]" title="[% available_items_loo.description %]" alt="[% available_items_loo.description %]" />
[% ELSE %]
<li>
[% END %]
[% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname %][% END %]
[% IF ( available_items_loo.location ) %][% available_items_loo.location %][% END %]
[% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
([% available_items_loo.count %])</li>
[% END %]</ul>
([% available_items_loo.count %])
[% IF item_level_itypes && available_items_loo.description %]
<br/>[% available_items_loo.description %]
[% END %]
</li>
[% END %]
</ul>
[% END %]
[% IF ( SEARCH_RESULT.onloancount ) %]
<span class="status">[% SEARCH_RESULT.onloancount %] on loan:</span>
<ul>
[% FOREACH onloan_items_loo IN SEARCH_RESULT.onloan_items_loop %]
[% IF ( noItemTypeImages ) %]<li>[% ELSE %][% IF ( item_level_itypes ) %]
[% IF ( onloan_items_loo.imageurl ) %]
<li style="list-style: none; list-style-type: none;"><img src="[% onloan_items_loo.imageurl %]" title="[% onloan_items_loo.description %]" alt="[% onloan_items_loo.description %]" />
[% ELSE %]<li>[% END %]
[% ELSE %]<li>[% END %][% END %]
[% IF item_level_itypes && !noItemTypeImages && onloan_items_loo.imageurl %]
<li style="list-style: none; list-style-type: none;">
<img src="[% onloan_items_loo.imageurl %]" title="[% onloan_items_loo.description %]" alt="[% onloan_items_loo.description %]" />
[% ELSE %]
<li>
[% END %]
[% IF ( onloan_items_loo.branchname ) %][% onloan_items_loo.branchname %][% END %]
[% IF ( onloan_items_loo.location ) %][% onloan_items_loo.location %][% END %]
[% IF ( onloan_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=[% onloan_items_loo.itemcallnumber |url %]">[% onloan_items_loo.itemcallnumber %]</a>][% END %]
([% onloan_items_loo.count %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue %] long overdue[% END %]) date due: [% onloan_items_loo.due_date %]</li>
[% END %]</ul>
([% 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 %]
<br/>[% onloan_items_loo.description %]
[% END %]
</li>
[% END %]
</ul>
[% END %]
[% IF ( SEARCH_RESULT.othercount ) %]
<span class="unavailable">[% SEARCH_RESULT.othercount %] unavailable:</span>
<ul>
[% FOREACH other_items_loo IN SEARCH_RESULT.other_items_loop %]
[% IF ( noItemTypeImages ) %]<li>[% ELSE %][% IF ( item_level_itypes ) %]
[% IF ( other_items_loo.imageurl ) %]
<li style="list-style: none; list-style-type: none;"><img src="[% other_items_loo.imageurl %]" title="[% other_items_loo.description %]" alt="[% other_items_loo.description %]" />
[% ELSE %]<li>[% END %]
[% ELSE %]<li>[% END %][% END %]
[% IF item_level_itypes && !noItemTypeImages && other_items_loo.imageurl %]
<li style="list-style: none; list-style-type: none;">
<img src="[% other_items_loo.imageurl %]" title="[% other_items_loo.description %]" alt="[% other_items_loo.description %]" />
[% ELSE %]
<li>
[% END %]
[% IF ( other_items_loo.branchname ) %][% other_items_loo.branchname %][% END %]
[% IF ( other_items_loo.location ) %][% other_items_loo.location %][% END %]
[% IF ( other_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=[% other_items_loo.itemcallnumber |url %]">[% other_items_loo.itemcallnumber %]</a>][% END %]
@ -575,8 +591,13 @@ YAHOO.util.Event.onContentReady("searchheader", function () {
[% IF ( other_items_loo.intransit ) %](In transit)[% END %]
[% IF ( other_items_loo.onhold ) %](On hold)[% END %]
[% IF ( other_items_loo.notforloan ) %][% other_items_loo.notforloan %][% END %]
([% other_items_loo.count %])</li>
[% END %]</ul>
([% other_items_loo.count %])
[% IF item_level_itypes && other_items_loo.description %]
<br/>[% other_items_loo.description %]
[% END %]
</li>
[% END %]
</ul>
[% END %]
[% ELSE %]
[% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.count ) %]