bug 2004: changes to guided reports on items
authorGalen Charlton <galen.charlton@liblime.com>
Tue, 8 Apr 2008 21:08:12 +0000 (16:08 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 8 Apr 2008 22:00:12 +0000 (17:00 -0500)
* Added items.location and items.ccode to list of
  columns available for limiting
* choice of item type column (i.e., biblioitems.itemtype
  or items.itype) to limit by now respects
  item-level_itypes syspref

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Reports.pm
koha-tmpl/intranet-tmpl/prog/en/columns.def

index 02cfc9c..376196a 100644 (file)
@@ -70,16 +70,23 @@ $keys{'5'} = ['borrowers.borrowernumber=accountlines.borrowernumber'];
 our %criteria;
 $criteria{'1'} = [
     'statistics.type',   'borrowers.categorycode',
-    'statistics.branch', 'biblioitems.itemtype',
+    'statistics.branch',
     'biblioitems.publicationyear|date',
     'items.dateaccessioned|date'
 ];
 $criteria{'2'} =
-  [ 'biblioitems.itemtype', 'items.holdingbranch', 'items.homebranch' ,'items.itemlost'];
+  [ 'items.holdingbranch', 'items.homebranch' ,'items.itemlost', 'items.location', 'items.ccode'];
 $criteria{'3'} = ['borrowers.branchcode'];
 $criteria{'4'} = ['aqorders.datereceived|date'];
 $criteria{'5'} = ['borrowers.branchcode'];
 
+if (C4::Context->preference('item-level_itypes')) {
+    unshift @{ $criteria{'1'} }, 'items.itype';
+    unshift @{ $criteria{'2'} }, 'items.itype';
+} else {
+    unshift @{ $criteria{'1'} }, 'biblioitems.itemtype';
+    unshift @{ $criteria{'2'} }, 'biblioitems.itemtype';
+}
 
 =head1 NAME
    
index 2a2f1b5..d53685a 100644 (file)
@@ -78,6 +78,8 @@ items.holdingbranch   Current Branch
 items.paidfor  Has Item been lost and then paid for
 items.timestamp        Timestamp
 items.location Location
+items.ccode    Koha Collection
+items.itype    Item-level Item Type
 items.spystatus
 items.spydescr
 items.itemlog
@@ -97,7 +99,7 @@ biblioitems.biblionumber      Biblio Number
 biblioitems.volume     Volume Number
 biblioitems.number     Number
 biblioitems.classification     Classification
-biblioitems.itemtype   Itemtype
+biblioitems.itemtype   Biblio-level Item Type
 biblioitems.isbn       ISBN
 biblioitems.issn       ISSN
 biblioitems.dewey      Dewey/Classification