new feature : image for itemtypes.
authortipaul <tipaul>
Fri, 2 Sep 2005 14:28:38 +0000 (14:28 +0000)
committertipaul <tipaul>
Fri, 2 Sep 2005 14:28:38 +0000 (14:28 +0000)
* run updater/updatedatabase to create imageurl field in itemtypes.
* go to Koha >> parameters >> itemtypes >> modify (or add) an itemtype. You will see around 20 nice images to choose between (thanks to owen). If you prefer your own image, you also can type a complete url (http://www.myserver.lib/path/to/my/image.gif)
* go to OPAC, and search something. In the result list, you now have the picture instead of the text itemtype.

C4/SearchMarc.pm

index 9b093dc..f06140c 100644 (file)
@@ -190,6 +190,7 @@ sub catalogsearch {
        }
        # prepare the query to find date_due where applicable
        my $sth_issue = $dbh->prepare("select date_due,returndate from issues where itemnumber=?");
+       my $sth_itemtype = $dbh->prepare("select itemtypes.description,itemtypes.notforloan,itemtypes.imageurl from itemtypes where itemtype=?");
        
        # prepare the query to find subtitles
        my $sth_subtitle = $dbh->prepare("SELECT subtitle FROM bibliosubtitle WHERE biblionumber=?"); # Added BY JF for Subtitles
@@ -278,7 +279,12 @@ sub catalogsearch {
 #                warn "and here's the subtitle: ".$subtitle_here;
 
         # /ADDED BY JF
-
+               # search itemtype information
+               $sth_itemtype->execute($line->{itemtype});
+               my ($itemtype_description,$itemtype_notforloan,$itemtype_imageurl) = $sth_itemtype->fetchrow;
+               $line->{description} = $itemtype_description;
+               $line->{imageurl} = $itemtype_imageurl;
+               $line->{notforloan} = $itemtype_notforloan;
                $sth_itemCN->execute($biblionumber);
                my @CNresults = ();
                my $notforloan=1; # to see if there is at least 1 item that can be issued