[Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/reports... [rel_2_2]

Henri-Damien LAURENT laurenthdl at alinto.com
Fri Dec 16 16:58:25 CET 2005


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	Henri-Damien LAURENT <hdl at savannah.gnu.org>	05/12/16 15:58:25

Modified files:
	koha-tmpl/intranet-tmpl/default/en/reports: bor_issues_top.tmpl 
	reports        : acquisitions_stats.pl bor_issues_top.pl 

Log message:
	Bug Fixing on acquisition stats.
	Adding selection to bor_issues_top report.
	Doing soon the same for any other top or out reports....

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/reports/bor_issues_top.tmpl.diff?only_with_tag=rel_2_2&tr1=1.3.2.1&tr2=1.3.2.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/reports/acquisitions_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.4.2.3&tr2=1.4.2.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/reports/bor_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.3.2.2&tr2=1.3.2.3&r1=text&r2=text

Patches:
Index: koha/koha-tmpl/intranet-tmpl/default/en/reports/bor_issues_top.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/default/en/reports/bor_issues_top.tmpl:1.3.2.1 koha/koha-tmpl/intranet-tmpl/default/en/reports/bor_issues_top.tmpl:1.3.2.2
--- koha/koha-tmpl/intranet-tmpl/default/en/reports/bor_issues_top.tmpl:1.3.2.1	Thu Apr  7 10:17:45 2005
+++ koha/koha-tmpl/intranet-tmpl/default/en/reports/bor_issues_top.tmpl	Fri Dec 16 15:58:25 2005
@@ -220,31 +220,82 @@
 				<td>&nbsp;</td>
 				<td>&nbsp;</td>
 				<td>Branch</td>
-				<td><input type="text" name="Filter" value=""></td>
+				<td>
+					<select name="Filter">
+						<option value="">All branches</option>
+						<!-- TMPL_LOOP name="branchloop" -->
+							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name
+	="branchname" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				</td>
 			</tr>
 			<tr>
 				<td>&nbsp;</td>
 				<td>&nbsp;</td>
 				<td>Document Type</td>
-				<td><input type="text" name="Filter" value=""></td>
+				<td>
+					<select name="Filter">
+						<option value="">All Item Types</option>
+						<!-- TMPL_LOOP name="itemtypeloop" -->
+							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name
+	="description" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				</td>
 			</tr>
 			<tr class="hilighted">
 				<td>&nbsp;</td>
 				<td>&nbsp;</td>
 				<td>Borrower Category</td>
-				<td><input type="text" name="Filter" value=""></td>
+				<td>
+					<select name="Filter">
+						<option value="">All Borrower Categories</option>
+						<!-- TMPL_LOOP name="borcatloop" -->
+							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name
+	="description" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				</td>
 			</tr>
 			<tr>
 				<td>&nbsp;</td>
 				<td>&nbsp;</td>
 				<td>Day</td>
-				<td><input type="text" name="Filter" value=""></td>
+				<td>
+					<select name="Filter">
+						<option value="">Any Day</option>
+						<option value="Monday">Monday</option>
+						<option value="Tuesday">Tuesday</option>
+						<option value="Wednesday">Wednesday</option>
+						<option value="Thursday">Thursday</option>
+						<option value="Friday">Friday</option>
+						<option value="Saturday">Saturday</option>
+						<option value="Sunday">Sunday</option>
+					</select>
+				</td>
 			</tr>
 			<tr class="hilighted">
 				<td>&nbsp;</td>
 				<td>&nbsp;</td>
 				<td>Month</td>
-				<td><input type="text" name="Filter" value=""></td>
+				<td>
+					<select name="Filter">
+						<option value="">Any Month</option>
+						<option value="January">January</option>
+						<option value="February">February</option>
+						<option value="March">March</option>
+						<option value="April">April</option>
+						<option value="May">May</option>
+						<option value="June">June</option>
+						<option value="July">July</option>
+						<option value="August">August</option>
+						<option value="September">September</option>
+						<option value="October">October</option>
+						<option value="November">November</option>
+						<option value="December">December</option>
+					</select>
+				</td>
 			</tr>
 			<tr>
 				<td>&nbsp;</td>
Index: koha/reports/acquisitions_stats.pl
diff -u koha/reports/acquisitions_stats.pl:1.4.2.3 koha/reports/acquisitions_stats.pl:1.4.2.4
--- koha/reports/acquisitions_stats.pl:1.4.2.3	Tue Jun 28 10:15:11 2005
+++ koha/reports/acquisitions_stats.pl	Fri Dec 16 15:58:25 2005
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: acquisitions_stats.pl,v 1.4.2.3 2005/06/28 10:15:11 hdl Exp $
+# $Id: acquisitions_stats.pl,v 1.4.2.4 2005/12/16 15:58:25 hdl Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -321,7 +321,7 @@
  	}
 	$strsth .=" group by $linefield";
 	$strsth .=" order by $lineorder";
-	warn "". $strsth;
+	warn "rows: ". $strsth;
 	
 	my $sth = $dbh->prepare( $strsth );
 	if (( @linefilter ) and ($linefilter[1])){
@@ -339,7 +339,7 @@
 #		} else {
 #			$cell{rowtitle} = "";
 		}
- 		$cell{totalrow} = 0;
+		$cell{totalrow} = 0;
 		push @loopline, \%cell;
  	}
 
@@ -394,7 +394,7 @@
  	}
 	$strsth2 .=" group by $colfield";
 	$strsth2 .=" order by $colorder";
- 	warn "". $strsth2;
+ 	warn "columns : ". $strsth2;
 	
 	my $sth2 = $dbh->prepare( $strsth2 );
 	if (( @colfilter ) and ($colfilter[1])){
@@ -449,7 +449,7 @@
 	@$filters[4]=~ s/\*/%/g if (@$filters[4]);
 	$strcalc .= " AND aqbooksellers.name like '" . @$filters[4] ."'" if ( @$filters[4] );
 	@$filters[5]=~ s/\*/%/g if (@$filters[5]);
-	$strcalc .= " AND aqbookfund.bookfundid like '" . @$filters[5] ."'" if ( @$filters[5] );
+	$strcalc .= " AND aqorderbreakdown.bookfundid like '" . @$filters[5] ."'" if ( @$filters[5] );
 	@$filters[6]=~ s/\*/%/g if (@$filters[6]);
 	$strcalc .= " AND aqorders.sort1 like '" . @$filters[6] ."'" if ( @$filters[6] );
 	@$filters[7]=~ s/\*/%/g if (@$filters[7]);
@@ -472,20 +472,20 @@
 		$grantotal += $value;
 	}
 
- 	push @loopcol,{coltitle => "NULL"} if ($emptycol);
+	push @loopcol,{coltitle => "NULL"} if ($emptycol);
 	
-	foreach my $row ( sort keys %table ) {
+	foreach my $row (@loopline) {
 		my @loopcell;
 		#@loopcol ensures the order for columns is common with column titles
 		# and the number matches the number of columns
 		foreach my $col ( @loopcol ) {
-			my $value =$table{$row}->{($col->{coltitle} eq "NULL")?"zzEMPTY":$col->{coltitle}};
+			my $value =$table{($row->{'rowtitle'} eq "NULL")?"zzEMPTY":$row->{'rowtitle'}}->{($col->{coltitle} eq "NULL")?"zzEMPTY":$col->{coltitle}};
 			push @loopcell, {value => $value  } ;
 		}
-		push @looprow,{ 'rowtitle' => ($row eq "zzEMPTY")?"NULL":$row,
+		push @looprow,{ 'rowtitle' => $row->{'rowtitle'},
 						'loopcell' => \@loopcell,
 						'hilighted' => ($hilighted >0),
-						'totalrow' => $table{$row}->{totalrow}
+						'totalrow' => $table{($row->{'rowtitle'} eq "NULL")?"zzEMPTY":$row->{'rowtitle'}}->{totalrow}
 					};
 		$hilighted = -$hilighted;
 	}
Index: koha/reports/bor_issues_top.pl
diff -u koha/reports/bor_issues_top.pl:1.3.2.2 koha/reports/bor_issues_top.pl:1.3.2.3
--- koha/reports/bor_issues_top.pl:1.3.2.2	Mon Nov 28 10:40:32 2005
+++ koha/reports/bor_issues_top.pl	Fri Dec 16 15:58:25 2005
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: bor_issues_top.pl,v 1.3.2.2 2005/11/28 10:40:32 hdl Exp $
+# $Id: bor_issues_top.pl,v 1.3.2.3 2005/12/16 15:58:25 hdl Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -132,10 +132,50 @@
 				-values   => \@dels,
 				-size     => 1,
 				-multiple => 0 );
+	#branch
+	my $branches = getallbranches;
+	my @branchloop;
+	foreach my $thisbranch (keys %$branches) {
+# 			my $selected = 1 if $thisbranch eq $branch;
+			my %row =(value => $thisbranch,
+# 									selected => $selected,
+									branchname => $branches->{$thisbranch}->{'branchname'},
+							);
+			push @branchloop, \%row;
+	}
+
+	#doctype
+	my $itemtypes = getitemtypes;
+	my @itemtypeloop;
+	foreach my $thisitemtype (keys %$itemtypes) {
+# 			my $selected = 1 if $thisbranch eq $branch;
+			my %row =(value => $thisitemtype,
+# 									selected => $selected,
+									description => $itemtypes->{$thisitemtype}->{'description'},
+							);
+			push @itemtypeloop, \%row;
+	}
+	
+	#borcat
+ 	my ($codes,$labels) = borrowercategories;
+ 	my @borcatloop;
+ 	foreach my $thisborcat (sort keys %$labels) {
+ # 			my $selected = 1 if $thisbranch eq $branch;
+ 			my %row =(value => $thisborcat,
+ # 									selected => $selected,
+ 									description => $labels->{$thisborcat},
+ 							);
+ 			push @borcatloop, \%row;
+ 	}
 	
+	#Day
+	#Month
 	$template->param(
 					CGIextChoice => $CGIextChoice,
-					CGIsepChoice => $CGIsepChoice
+					CGIsepChoice => $CGIsepChoice,
+					branchloop =>\@branchloop,
+					itemtypeloop =>\@itemtypeloop,
+					borcatloop =>\@borcatloop,
 					);
 output_html_with_http_headers $input, $cookie, $template->output;
 }





More information about the Koha-cvs mailing list