[Koha-patches] [PATCH] Update Catalog Stats report: / Remove lccn/loc filter, which seems to conflate marc21 010 and 050. / Update labels to reflect 3.0 terminology.

Ryan Higgins rch at liblime.com
Sun May 25 22:54:21 CEST 2008


---
 .../prog/en/modules/reports/catalogue_stats.tmpl   |   51 +++--------
 reports/catalogue_stats.pl                         |   91 ++++++++++---------
 2 files changed, 62 insertions(+), 80 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tmpl
index e92e719..eb81d0f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tmpl
@@ -74,38 +74,15 @@
 			</tr>
 		</thead>
 		<tbody>
-			<!-- TMPL_IF Name="hasdewey" -->
-				<tr class="hilighted">
-					<td>Dewey Classification</td>
-					<td><input type="radio" name="Line" value="dewey" /></td>
-					<td><input type="radio" name="Column" value="dewey" /></td>
-					<td> <label for="deweyFrom">From</label> <input type="text" id="deweyFrom" name="Filter" /> <label for="deweyTo">To</label> <input type="text" id="deweyTo" name="Filter" /></td>
-				</tr>
-				<tr class="hilighted">
-					<td>&nbsp;</td>
-					<td colspan="2"><select name="deweydigits" id="deweydigits">
-						<option value=""> </option>
-						<option value ="1">1</option>
-						<option value ="2">2</option>
-						<option value ="3">3</option>
-						<option value ="4">4</option>
-						<option value ="5">5</option>
-						</select>
-						<label for="deweydigits">digits</label> 
-					</td>
-					<td>&nbsp;</td>
-				</tr>
-				<!-- TMPL_ELSE -->
-				<tr><td colspan="4"><input type="hidden" name="Filter" /> <input type="hidden" name="Filter" /></td></tr>
-			<!-- /TMPL_IF -->
+				<input type="hidden" name="Filter" /> <input type="hidden" name="Filter" />
 			<!-- TMPL_IF Name="haslccn" -->
-				<!--TMPL_IF Name="hlghtlccn"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+					<tr>
 					<td>LoC Classification</td>
 					<td><input type="radio" name="Line" value="lccn" /></td>
 					<td><input type="radio" name="Column" value="lccn" /></td>
 					<td> <label for="locFrom">From</label> <input type="text" name="Filter" id="locFrom" /> <label for="locTo">To</label> <input type="text" name="Filter" id="locTo" /></td>
 				</tr>
-				<!--TMPL_IF Name="hlghtlccn"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+					<tr>
 					<td>&nbsp;</td>
 					<td colspan="2"><select name="lccndigits" id="lccndigits">
 						<option value=""> </option>
@@ -120,16 +97,16 @@
 					<td>&nbsp;</td>
 				</tr>
 				<!-- TMPL_ELSE -->
-				<tr><td colspan="4"><input type="hidden" name="Filter" /> <input type="hidden" name="Filter" /></td></tr>
+				<input type="hidden" name="Filter" /> <input type="hidden" name="Filter" />
 			<!-- /TMPL_IF  -->
 			<!-- TMPL_IF Name="hascote" -->
-				<!--TMPL_IF Name="hlghtcote"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
-					<td>Callnumber</td>
+			  <tr>
+					<td>Koha Full Call Number</td>
 					<td><input type="radio" name="Line" value="items.itemcallnumber" /></td>
 					<td><input type="radio" name="Column" value="items.itemcallnumber" /></td>
 					<td><label for="callnoFrom">From</label> <input type="text" name="Filter" id="callnoFrom" /> <label for="callnoTo">To</label> <input type="text" name="Filter" id="callnoTo" /></td>
 				</tr>
-				<!--TMPL_IF Name="hlghtcote"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+			 <tr>
 					<td>&nbsp;</td>
 					<td colspan="2"><select name="cotedigits" id="cotedigits">
 						<option value=""> </option>
@@ -146,7 +123,7 @@
 				<!-- TMPL_ELSE -->
 				<tr><td colspan="4"><input type="hidden" name="Filter" /> <input type="hidden" name="Filter" /></td></tr>
 			<!-- /TMPL_IF -->
-			<!--TMPL_IF Name="hglghtDT"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+			 <tr>
 				<td>Item Type</td>
 				<td><input type="radio" name="Line" value="itemtype" /></td>
 				<td><input type="radio" name="Column" value="itemtype" /></td>
@@ -158,19 +135,19 @@
 					</select>
 				</td>
 			</tr>
-			<!--TMPL_IF Name="hglghtPub"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+			 <tr>
 				<td>Publisher</td>
 				<td><input type="radio" name="Line" value="publishercode" /></td>
 				<td><input type="radio" name="Column" value="publishercode" /></td>
 				<td><input type="text" name="Filter" /></td>
 			</tr>
-			<!--TMPL_IF Name="hglghtPY"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+			<tr>
 				<td>Publication Year</td>
 				<td><input type="radio" name="Line" value="publicationyear" /></td>
 				<td><input type="radio" name="Column" value="publicationyear" /></td>
 				<td><label for="pubyearFrom">From</label> <input type="text" name="Filter" id="pubyearFrom" /> <label for="pubyearTo">To</label> <input type="text" name="Filter" id="pubyearTo" /></td>
 			</tr>
-			<!--TMPL_IF Name="hglghtHB"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
+			<tr>
 				<td>Home Branch</td>
 				<td><input type="radio" name="Line" value="items.homebranch" /></td>
 				<td><input type="radio" name="Column" value="items.homebranch" /></td>
@@ -182,8 +159,8 @@
 					</select>
 				</td>
 			</tr>
-			<!--TMPL_IF Name="hglghtLOC"--><tr class="hilighted"> <!--TMPL_ELSE --><tr><!--/TMPL_IF-->
-				<td>Location</td>
+			<tr>
+				<td>Shelving Location</td>
 				<td><input type="radio" name="Line" value="items.location" /></td>
 				<td><input type="radio" name="Column" value="items.location" /></td>
 				<td><select name="Filter" id="location">
@@ -194,7 +171,7 @@
 					</select>
 				</td>
 			</tr>
-			<tr class="hilighted">
+			<tr>
 				<td>Collection</td>
 				<td><input type="radio" name="Line"   value="items.ccode" /></td>
 				<td><input type="radio" name="Column" value="items.ccode" /></td>
diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl
index b1f8a44..485dca4 100755
--- a/reports/catalogue_stats.pl
+++ b/reports/catalogue_stats.pl
@@ -121,47 +121,52 @@ if ($do_it) {
 # 				-values   => \@select,
 # 				-size     => 1,
 # 				-multiple => 0 );
-	
-	$req = $dbh->prepare( "select count(lccn) from biblioitems ");
-	$req->execute;
-# 	undef @select;
-# 	push @select,"";
-	my $haslccn;
-	my $hlghtlccn;
-	while (my ($value) =$req->fetchrow) {
-		$hlghtlccn = !($hasdewey);
-		$haslccn =1 if (($value>2) and (! $haslccn));
-		$count++ if (($value) and (! $haslccn));
+
+# (rch) biblioitems.lccn is mapped to lccn MARC21 010$a in default framework.
+# This is not the LC Classification.  It's the Control Number.
+# So I'm just going to remove this bit.  Call Number is handled in itemcallnumber.
+#
+	my $haslccn = 0;
+#	$req = $dbh->prepare( "select count(lccn) from biblioitems ");
+#	$req->execute;
+#	my $hlghtlccn;
+#	while (my ($value) =$req->fetchrow) {
+#		$hlghtlccn = !($hasdewey);
+#		$haslccn =1 if (($value>2) and (! $haslccn));
+#		$count++ if (($value) and (! $haslccn));
 #		push @select, $value;
-	}
+#	}
 # 	my $CGIlccn=CGI::scrolling_list( -name     => 'Filter',
 # 				-id => 'Filter',
 # 				-values   => \@select,
 # 				-size     => 1,
 # 				-multiple => 0 );
-	
-	$req = $dbh->prepare("select count(itemcallnumber) from items");
-	$req->execute;
-#	undef @select;
-#	push @select,"";
-	my $hascote;
-	my $hlghtcote;
-	while (my ($value) =$req->fetchrow) {
-		$hascote =1 if (($value>2) and (! $hascote));
-		$count++ if (($value) and (! $hascote));
-		$hlghtcote = (($hasdewey) and ($haslccn)) or (!($hasdewey) and !($haslccn));
-#		push @select, $value;
-	}
+
+# No need to test for data here.  If you don't have itemcallnumbers, you probably know it.
+# FIXME: Hardcoding to 5 chars on itemcallnum. 
+#
+	 my $hascote = 1;
+	 my $highcote = 5;
+
+#	$req = $dbh->prepare("select count(itemcallnumber) from items");
+#	$req->execute;
+#	my $hlghtcote;
+#	while (my ($value) =$req->fetchrow) {
+#		$hascote =1 if (($value>2) and (! $hascote));
+#		$count++ if (($value) and (! $hascote));
+#		$hlghtcote = (($hasdewey) and ($haslccn)) or (!($hasdewey) and !($haslccn));
+##		push @select, $value;
+#	}
 # 	my $CGIcote=CGI::scrolling_list( -name     => 'Filter',
 # 				-id => 'Filter',
 # 				-values   => \@select,
 # 				-size     => 1,
 # 				-multiple => 0 );
-	my $hglghtDT  = ++$count % 2;
-	my $hglghtPub = ++$count % 2;
-	my $hglghtPY  = ++$count % 2;
-	my $hglghtHB  = ++$count % 2;
-	my $hglghtLOC = ++$count % 2;
+#	my $hglghtDT  = ++$count % 2;
+#	my $hglghtPub = ++$count % 2;
+#	my $hglghtPY  = ++$count % 2;
+#	my $hglghtHB  = ++$count % 2;
+#	my $hglghtLOC = ++$count % 2;
 #	warn "highlightDT "  .$hglghtDT;
 #	warn "highlightPub " .$hglghtPub;
 #	warn "highlightPY "  .$hglghtPY;
@@ -219,16 +224,16 @@ if ($do_it) {
 #					CGIFromDeweyClass => $CGIdewey,
 #					CGIToDeweyClass => $CGIdewey,
 					haslccn   => $haslccn,
-					hlghtlccn => $hlghtlccn,
+#					hlghtlccn => $hlghtlccn,
 #					CGIFromLoCClass => $CGIlccn,
 #					CGIToLoCClass => $CGIlccn,
 					hascote   => $hascote,
-					hlghtcote => $hlghtcote,
-					hglghtDT  => $hglghtDT,
-					hglghtPub => $hglghtPub,
-					hglghtPY  => $hglghtPY,
-					hglghtHB  => $hglghtHB,
-					hglghtLOC => $hglghtLOC,
+#					hlghtcote => $hlghtcote,
+#					hglghtDT  => $hglghtDT,
+#					hglghtPub => $hglghtPub,
+#					hglghtPY  => $hglghtPY,
+#					hglghtHB  => $hglghtHB,
+#					hglghtLOC => $hglghtLOC,
 #					CGIFromCoteClass => $CGIcote,
 #					CGIToCoteClass => $CGIcote,
 					CGIItemType => $CGIitemtype,
@@ -276,15 +281,15 @@ sub calculate {
 				($i== 1) ? "Dewey Classification To"   :
 				($i== 2) ? "Lccn Classification From"  :
 				($i== 3) ? "Lccn Classification To"    :
-				($i== 4) ? "Cote Classification From"  :
-				($i== 5) ? "Cote Classification To"    :
-				($i== 6) ? "Document type"             :
+				($i== 4) ? "Item CallNumber From"  :
+				($i== 5) ? "Item CallNumber To"    :
+				($i== 6) ? "Item type"             :
 				($i== 7) ? "Publisher"                 :
 				($i== 8) ? "Publication year From"     :
 				($i== 9) ? "Publication year To"       :
-				($i==10) ? "Branch :"                  :
-				($i==11) ? "Location :"                :
-				($i==12) ? "Catalog Code :"            : '';
+				($i==10) ? "Library :"                  :
+				($i==11) ? "Shelving Location :"                :
+				($i==12) ? "Collection Code :"            : '';
 			push @loopfilter, \%cell;
 		}
 	}
-- 
1.5.5.GIT




More information about the Koha-patches mailing list