[Koha-patches] [PATCH] Add authorised values descriptions to selector for "location".

Joe Atzberger joe.atzberger at liblime.com
Fri Apr 11 18:44:24 CEST 2008


---
 .../prog/en/modules/reports/catalogue_stats.tmpl   |    6 ++--
 reports/catalogue_stats.pl                         |   21 ++++++++++++-------
 2 files changed, 16 insertions(+), 11 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 79573d1..e92e719 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
@@ -147,7 +147,7 @@
 				<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-->
-				<td>Document Type</td>
+				<td>Item Type</td>
 				<td><input type="radio" name="Line" value="itemtype" /></td>
 				<td><input type="radio" name="Column" value="itemtype" /></td>
 				<td><select name="Filter" id="itemtype">
@@ -189,13 +189,13 @@
 				<td><select name="Filter" id="location">
 					<option value=""> </option>
 					<!-- TMPL_LOOP NAME="locationloop" -->
-					<option value="<!-- TMPL_VAR NAME='location' -->" <!-- TMPL_IF NAME='selected' -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="location" --></option>
+					<option value="<!-- TMPL_VAR NAME='code' -->" <!-- TMPL_IF NAME='selected' -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="description" --></option>
 					<!-- /TMPL_LOOP -->
 					</select>
 				</td>
 			</tr>
 			<tr class="hilighted">
-				<td>Catalogue Code</td>
+				<td>Collection</td>
 				<td><input type="radio" name="Line"   value="items.ccode" /></td>
 				<td><input type="radio" name="Column" value="items.ccode" /></td>
 				<td><select name="Filter" id="ccode">
diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl
index 47ef65a..b1f8a44 100755
--- a/reports/catalogue_stats.pl
+++ b/reports/catalogue_stats.pl
@@ -206,6 +206,11 @@ if ($do_it) {
 	$req = $dbh->prepare("select distinctrow location from items order by location");
 	$req->execute;
 	my $locationloop = $req->fetchall_arrayref({});
+	my $locations = GetKohaAuthorisedValues("items.location");
+	my @locations;
+	foreach (sort keys %$locations) {
+		push @locations, { code => $_, description => "$_ - " . $locations->{$_} };
+	}
 	
 	my @mime  = ( map { +{type =>$_} } (split /[;:]/,C4::Context->preference("MIME")) );
 	my @delim = ( map { +{delim=>$_} } (split //,C4::Context->preference("delimiter")) );
@@ -213,16 +218,16 @@ if ($do_it) {
 	$template->param(hasdewey=>$hasdewey,
 #					CGIFromDeweyClass => $CGIdewey,
 #					CGIToDeweyClass => $CGIdewey,
-					haslccn=> $haslccn,
+					haslccn   => $haslccn,
 					hlghtlccn => $hlghtlccn,
 #					CGIFromLoCClass => $CGIlccn,
 #					CGIToLoCClass => $CGIlccn,
-					hascote=> $hascote,
+					hascote   => $hascote,
 					hlghtcote => $hlghtcote,
-					hglghtDT => $hglghtDT,
+					hglghtDT  => $hglghtDT,
 					hglghtPub => $hglghtPub,
-					hglghtPY => $hglghtPY,
-					hglghtHB => $hglghtHB,
+					hglghtPY  => $hglghtPY,
+					hglghtHB  => $hglghtHB,
 					hglghtLOC => $hglghtLOC,
 #					CGIFromCoteClass => $CGIcote,
 #					CGIToCoteClass => $CGIcote,
@@ -230,9 +235,9 @@ if ($do_it) {
 # 					CGIFromPublicationYear => $CGIpublicationyear,
 # 					CGIToPublicationYear => $CGIpublicationyear,
 #					CGIPublisher => $CGIpublisher,
-					CGIBranch => \@branchloop,
-					locationloop => $locationloop,
-					authvals  => \@authvals,
+					CGIBranch    => \@branchloop,
+					locationloop => \@locations,
+					authvals     => \@authvals,
 					CGIextChoice => \@mime,
 					CGIsepChoice => \@delim,
 					);
-- 
1.5.2.1




More information about the Koha-patches mailing list