bug 2772: bad image location

This patch make Page.pm to use the getitemtypeinfo function to generate the imageurl, and check (in the template) if an
image is set.
Before this patch, always the "Alt" information was shown, because the url wasn't right.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Nahuel Angelinetti 2008-11-10 17:16:16 +01:00 committed by Galen Charlton
parent 04f8382d5b
commit e080066db4
2 changed files with 5 additions and 1 deletions

View file

@ -177,6 +177,7 @@ SWITCH: {
#$this_item->{imageurl} = $imgdir."/".$itemtypes->{ $this_item->{itemtype} }->{'imageurl'};
#$this_item->{'description'} = $itemtypes->{ $this_item->{itemtype} }->{'description'};
$this_item->{'dateadded'} = format_date($this_item->{'dateadded'});
$this_item->{'imageurl'} = getitemtypeinfo($this_item->{'itemtype'})->{'imageurl'};
}
push @paramsloop, {display => 'privateshelves'} if $category == 1;
$showadd = 1;

View file

@ -122,7 +122,10 @@ $.tablesorter.addParser({
</td>
<!-- /TMPL_IF -->
<!-- TMPL_UNLESS NAME="item-level_itypes" --><td>
<img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" /><!-- TMPL_VAR NAME="description" -->
<!-- TMPL_IF NAME="imageurl" -->
<img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" />
</TMPL_IF>
<!-- TMPL_VAR NAME="description" -->
</td> <!-- /TMPL_UNLESS -->
<td><!-- TMPL_IF NAME="BiblioDefaultViewmarc" --><a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" --></a>