Bug 2747 for staff interface itemtype display.

Prefer accuracy over graphical icon.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Joe Atzberger 2009-01-07 14:57:28 -06:00 committed by Galen Charlton
parent 458b0ed510
commit cdb4b60d93
2 changed files with 35 additions and 15 deletions

View file

@ -1184,14 +1184,29 @@ If this is set, it is set to C<One Order>.
sub GetItemsInfo {
my ( $biblionumber, $type ) = @_;
my $dbh = C4::Context->dbh;
my $query = "SELECT items.*,biblio.*,biblioitems.volume,biblioitems.number,biblioitems.itemtype,biblioitems.isbn,biblioitems.issn,biblioitems.publicationyear,biblioitems.publishercode,biblioitems.volumedate,biblioitems.volumedesc,biblioitems.lccn,biblioitems.url,items.notforloan as itemnotforloan
FROM items
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber";
$query .= (C4::Context->preference('item-level_itypes')) ?
" LEFT JOIN itemtypes on items.itype = itemtypes.itemtype "
: " LEFT JOIN itemtypes on biblioitems.itemtype = itemtypes.itemtype ";
$query .= "WHERE items.biblionumber = ? ORDER BY items.dateaccessioned desc" ;
# note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
my $query = "
SELECT items.*,
biblio.*,
biblioitems.volume,
biblioitems.number,
biblioitems.itemtype,
biblioitems.isbn,
biblioitems.issn,
biblioitems.publicationyear,
biblioitems.publishercode,
biblioitems.volumedate,
biblioitems.volumedesc,
biblioitems.lccn,
biblioitems.url,
items.notforloan as itemnotforloan,
itemtypes.description
FROM items
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
LEFT JOIN itemtypes ON itemtypes.itemtype = "
. (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
$query .= " WHERE items.biblionumber = ? ORDER BY items.dateaccessioned desc" ;
my $sth = $dbh->prepare($query);
$sth->execute($biblionumber);
my $i = 0;
@ -1309,7 +1324,6 @@ sub GetItemsInfo {
$results[$i] = $data;
$i++;
}
$sth->finish;
if($serial) {
return( sort { ($b->{'publisheddate'} || $b->{'enumchron'}) cmp ($a->{'publisheddate'} || $a->{'enumchron'}) } @results );
} else {

View file

@ -169,7 +169,18 @@ function verify_images() {
</tr>
<!-- TMPL_LOOP NAME="itemloop" -->
<tr>
<!-- TMPL_IF NAME="item-level_itypes" --><td class="itype"><!-- TMPL_IF NAME="noItemTypeImages" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --></td><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="item-level_itypes" -->
<td class="itype">
<!-- TMPL_IF NAME="noItemTypeImages" -->
<!-- TMPL_VAR NAME="description" -->
<!-- TMPL_ELSE -->
<!-- TMPL_IF NAME="imageurl" -->
<img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" />
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="description" -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF --></td>
<!-- /TMPL_IF -->
<td class="location"><!-- TMPL_UNLESS NAME="singlebranchmode" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_UNLESS --> <!-- TMPL_VAR NAME="location" --> </td>
<!-- TMPL_IF NAME="itemdata_ccode" --><td><!-- TMPL_VAR name="ccode" --></td><!-- /TMPL_IF -->
<td class="itemcallnumber"><!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --></td>
@ -312,11 +323,6 @@ function verify_images() {
<!-- TMPL_IF name="size" -->, <!-- /TMPL_IF --><!-- TMPL_VAR name="size" -->
</td>
<!-- TMPL_LOOP NAME=items -->
<!-- <!-- TMPL_IF NAME="itype" --><img src="/opac-tmpl/prog/itemtypeimg/<!-- TMPL_VAR NAME="itype" -->.gif" title="<!-- TMPL_VAR NAME="itype" -->" /><!-- /TMPL_IF --> -->
<!-- barcode:<!-- TMPL_VAR NAME="barcode" --> -->
<!-- /TMPL_LOOP -->
<!-- /TMPL_LOOP -->
</table></div><!-- /TMPL_IF -->
<!-- /TMPL_IF -->