From 9fcc38d44140e74661b354e72f35130c507dbb60 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Mon, 17 Mar 2008 21:11:53 -0400 Subject: [PATCH 1/1] fixing display of itemtypes and itemtype icons in virtual shelves Signed-off-by: Joshua Ferraro --- C4/VirtualShelves/Page.pm | 9 ++++++++- .../prog/en/modules/virtualshelves/shelves.tmpl | 12 ++++-------- koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl | 9 +++++---- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index fbfb4bf1c4..a85508639e 100755 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -26,6 +26,7 @@ use CGI; use C4::VirtualShelves qw/:DEFAULT GetShelvesSummary/; use C4::Biblio; use C4::Items; +use C4::Koha; use C4::Auth qw/get_session/; use C4::Members; use C4::Output; @@ -59,7 +60,9 @@ sub shelfpage ($$$$$) { # getting the Shelves list my $shelflist = GetShelves( $loggedinuser, 2 ); my $op = $query->param('op'); - + my $imgdir = getitemtypeimagesrc(); + my $itemtypes = GetItemTypes(); + # the format of this is unindented for ease of diff comparison to the old script # Note: do not mistake the assignment statements below for comparisons! @@ -138,6 +141,10 @@ SWITCH: { #check that the user can view the shelf if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) { my $items = GetShelfContents($shelfnumber); + for my $this_item (@$items) { + $this_item->{imageurl} = $imgdir."/".$itemtypes->{ $this_item->{itemtype} }->{'imageurl'}; + $this_item->{'description'} = $itemtypes->{ $this_item->{itemtype} }->{'description'}; + } $showadd = 1; my $i = 0; foreach (grep {$i++ % 2} @$items) { # every other item diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl index 7259088083..6610ba29fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl @@ -118,7 +118,7 @@ $(document).ready(function(){ - + @@ -138,13 +138,9 @@ $(document).ready(function(){ " /> - +
 Item TypeItem Type Title Author Date Added - - /../img/itemtypeimg/" alt="" title="" /> - - /../img/itemtypeimg/.gif" alt="" title="" /> - - + " alt="" title="" /> + "> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 7923d0d279..75a0dfbd5c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -87,7 +87,7 @@ $.tablesorter.addParser({ - + @@ -103,9 +103,10 @@ $.tablesorter.addParser({ " /> - + + -- 2.11.0
  Item Type Title Author Copyright - /../itemtypeimg/.gif" alt="" title="" /> - + " alt="" title="" /> + "> "> ">