View | Details | Raw Unified | Return to bug 36585
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt (-7 / +8 lines)
Lines 86-98 Link Here
86
		<table>
86
		<table>
87
			<tr>
87
			<tr>
88
				<th rowspan="2">Rank</th>
88
				<th rowspan="2">Rank</th>
89
				<th rowspan="2">Patron</th>
90
				<th rowspan="2">Total</th>
89
				[% FOREACH loopco IN mainloo.loopcol %]
91
				[% FOREACH loopco IN mainloo.loopcol %]
90
					<th colspan="2">[% loopco.coltitle | html %]</th>
92
					<th>[% loopco.coltitle | html %]</th>
91
				[% END %]
93
				[% END %]
92
			</tr>
94
			</tr>
93
			<tr>
95
			<tr>
94
				[% FOREACH loopco IN mainloo.loopcol %]
96
				[% FOREACH loopco IN mainloo.loopcol %]
95
					<th>Patron</th>
96
					<th>Checkout count</th>
97
					<th>Checkout count</th>
97
				[% END %]
98
				[% END %]
98
			</tr>
99
			</tr>
Lines 100-112 Link Here
100
				<tr>
101
				<tr>
101
					[% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
102
					[% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
102
					[% loopro.rowtitle | html %]</td>
103
					[% loopro.rowtitle | html %]</td>
104
					[% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
105
						[% IF ( loopro.reference ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.reference | uri %]">[% END %]
106
						[% IF ( loopro.patron ) %][% loopro.patron | html %][% END %]
107
						[% IF ( loopro.reference ) %]</a>[% END %]
108
					</td>
103
					[% FOREACH loopcel IN loopro.loopcell %]
109
					[% FOREACH loopcel IN loopro.loopcell %]
104
						[% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
110
						[% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
105
                            [% IF ( loopcel.reference ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopcel.reference | uri %]">[% END %]
106
							[% IF ( loopcel.value ) %][% loopcel.value | html %][% END %]
107
							[% IF ( loopcel.reference ) %]</a>[% END %]
108
						</td>
109
						[% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
110
						[% IF ( loopcel.count ) %][% loopcel.count | html %][% END %]
111
						[% IF ( loopcel.count ) %][% loopcel.count | html %][% END %]
111
						</td>
112
						</td>
112
					[% END %]
113
					[% END %]
(-)a/reports/bor_issues_top.pl (-23 / +28 lines)
Lines 68-90 if ($do_it) { Link Here
68
                            -filename=>"$basename.csv" );
68
                            -filename=>"$basename.csv" );
69
        my $cols  = @$results[0]->{loopcol};
69
        my $cols  = @$results[0]->{loopcol};
70
        my $lines = @$results[0]->{looprow};
70
        my $lines = @$results[0]->{looprow};
71
# header top-right
71
# header top-left
72
        print @$results[0]->{line} ."/". @$results[0]->{column} .$sep;
72
        print @$results[0]->{line} ."/". @$results[0]->{column} .$sep;
73
        print "Patron".$sep;
74
        print "Total".$sep;
73
# Other header
75
# Other header
74
		print join($sep, map {$_->{coltitle}} @$cols);
76
		print join($sep, map {$_->{coltitle}} @$cols);
75
        print $sep . "Total\n";
77
        print "\n";
76
# Table
78
# Table
77
        foreach my $line ( @$lines ) {
79
        foreach my $line ( @$lines ) {
78
            my $x = $line->{loopcell};
80
            my $x = $line->{loopcell};
79
            print $line->{rowtitle}.$sep;
81
            print $line->{rowtitle}.$sep;
80
			print join($sep, map {$_->{value}} @$x);
82
            print '"'.$line->{patron}.'"'.$sep;
81
            print $sep,$line->{totalrow};
83
			print join($sep, map {$_->{count}} @$x);
82
            print "\n";
84
            print "\n";
83
        }
85
        }
84
# footer
86
# footer
85
        print "TOTAL";
87
        print "TOTAL";
86
        $cols = @$results[0]->{loopfooter};
88
        $cols = @$results[0]->{loopfooter};
87
		print join($sep, map {$_->{totalcol}} @$cols);
89
		print join($sep, map {$_->{total}} @$cols);
88
        print $sep.@$results[0]->{total};
90
        print $sep.@$results[0]->{total};
89
    }
91
    }
90
    exit;
92
    exit;
Lines 148-154 sub calculate { Link Here
148
    my $colorder;
150
    my $colorder;
149
    if ($column){
151
    if ($column){
150
        $column = "old_issues." .$column if (($column=~/branchcode/) or ($column=~/timestamp/));
152
        $column = "old_issues." .$column if (($column=~/branchcode/) or ($column=~/timestamp/));
151
        $column = "biblioitems.".$column if $column=~/itemtype/;
153
        $column = "items.itype"          if $column=~/itemtype/;
152
        $column = "borrowers."  .$column if $column=~/categorycode/;
154
        $column = "borrowers."  .$column if $column=~/categorycode/;
153
        my @colfilter ;
155
        my @colfilter ;
154
		if ($column =~ /timestamp/) {
156
		if ($column =~ /timestamp/) {
Lines 245-251 sub calculate { Link Here
245
		'old_issues.returndate >',
247
		'old_issues.returndate >',
246
		'old_issues.returndate <',
248
		'old_issues.returndate <',
247
		'old_issues.branchcode  like',
249
		'old_issues.branchcode  like',
248
		'biblioitems.itemtype   like',
250
		'items.itype            like',
249
		'borrowers.categorycode like',
251
		'borrowers.categorycode like',
250
	);
252
	);
251
    foreach ((@$filters)[0..9]) {
253
    foreach ((@$filters)[0..9]) {
Lines 309-332 sub calculate { Link Here
309
    foreach my $id (@ranked_ids) {
311
    foreach my $id (@ranked_ids) {
310
        my @loopcell;
312
        my @loopcell;
311
313
312
        foreach my $key (@cols_in_order) {
314
        if($column){
313
			if($column){
315
            #  Total
314
		      push @loopcell, {
316
            push @loopcell, {
315
				value => $patrons{$id}->{name},
317
                count => $patrons{$id}->{total},
316
				reference => $id,
318
            };
317
				count => $patrons{$id}->{allcols}->{$key},
319
            foreach my $key (@cols_in_order) {
318
			  };
320
                push @loopcell, {
319
			}else{
321
                    count => $patrons{$id}->{allcols}->{$key},
320
			  push @loopcell, {
322
                };
321
				value => $patrons{$id}->{name},
323
                $grantotal += $patrons{$id}->{allcols}->{$key};
322
				reference => $id,
324
            }
323
				count => $patrons{$id}->{total},
325
        }else{
324
			  };  
326
            push @loopcell, {
325
			}
327
                count => $patrons{$id}->{total},
328
            };
329
            $grantotal += $patrons{$id}->{total};
326
        }
330
        }
327
        push @looprow,{ 'rowtitle' => $i++ ,
331
        push @looprow,{ 'rowtitle' => $i++ ,
328
                        'loopcell' => \@loopcell,
332
                        'loopcell' => \@loopcell,
329
                        'hilighted' => ($i%2),
333
                        'hilighted' => ($i%2),
334
                        'patron' => $patrons{$id}->{name},
335
                        'reference' => $id,
330
                    };
336
                    };
331
        # use a limit, if a limit is defined
337
        # use a limit, if a limit is defined
332
        last if $i > $limit and $limit
338
        last if $i > $limit and $limit
Lines 336-342 sub calculate { Link Here
336
    $globalline{loopfilter}=\@loopfilter;
342
    $globalline{loopfilter}=\@loopfilter;
337
    # the core of the table
343
    # the core of the table
338
    $globalline{looprow} = \@looprow;
344
    $globalline{looprow} = \@looprow;
339
    $globalline{loopcol} = [ map {{coltitle=>$_}} @cols_in_order ];
345
    $globalline{loopcol} = [ map {{coltitle=>$_}} @cols_in_order ] if ($column);
340
 	# the foot (totals by borrower type)
346
 	# the foot (totals by borrower type)
341
    $globalline{loopfooter} = [];
347
    $globalline{loopfooter} = [];
342
    $globalline{total}= $grantotal;		# FIXME: useless
348
    $globalline{total}= $grantotal;		# FIXME: useless
343
- 

Return to bug 36585