bug 2772: bad image location
authorNahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Mon, 10 Nov 2008 16:16:16 +0000 (17:16 +0100)
committerGalen Charlton <galen.charlton@liblime.com>
Fri, 6 Mar 2009 15:07:46 +0000 (09:07 -0600)
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>
C4/VirtualShelves/Page.pm
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl

index 27db71e..b624073 100644 (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;
index 9732fdc..5f36998 100644 (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>