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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt (-7 / +19 lines)
Lines 17-22 Link Here
17
</style>
17
</style>
18
</head>
18
</head>
19
19
20
[% BLOCK reservestatus %]
21
    [% IF field == 'reservestatus' %]
22
         [% SWITCH value %]
23
             [% CASE 'C'%]Cancelled
24
             [% CASE 'F'%]Filled
25
             [% CASE 'P'%]Placed
26
             [% CASE 'W'%]Waiting
27
         [% END %]
28
    [% ELSE %]
29
        [% value | html %]
30
    [% END %]
31
[% END %]
32
20
<body id="rep_reserve_stats" class="rep">
33
<body id="rep_reserve_stats" class="rep">
21
[% WRAPPER 'header.inc' %]
34
[% WRAPPER 'header.inc' %]
22
    [% INCLUDE 'cat-search.inc' %]
35
    [% INCLUDE 'cat-search.inc' %]
Lines 71-83 Link Here
71
            <tr>
84
            <tr>
72
                <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
85
                <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
73
                [% FOREACH loopco IN mainloo.loopcol %]
86
                [% FOREACH loopco IN mainloo.loopcol %]
74
                    <th>[% loopco.coltitle_display | html %]</th>
87
                    <th>[% PROCESS reservestatus field=mainloo.column value=loopco.coltitle_display %]</th>
75
                [% END %]
88
                [% END %]
76
                <th>TOTAL</th>
89
                <th>TOTAL</th>
77
                </tr>
90
                </tr>
78
                [% FOREACH loopro IN mainloo.looprow %]
91
                [% FOREACH loopro IN mainloo.looprow %]
79
                    <tr>
92
                    <tr>
80
                        <td>[% loopro.rowtitle_display or "UNKNOWN VALUE" | html %]</td>
93
                        <td>[% PROCESS reservestatus field=mainloo.line value=loopro.rowtitle_display %]</td>
81
                    [% FOREACH loopcel IN loopro.loopcell %]
94
                    [% FOREACH loopcel IN loopro.loopcell %]
82
						<td align="center">
95
						<td align="center">
83
                        [% IF ( loopcel.url_complement ) %]<a href="reserves_stats.pl?output=[% loopcel.output | uri %]&amp;[% loopcel.url_complement | uri %]">[% loopcel.value | html %]</a>[% ELSE %][% loopcel.value | html %][% END %]
96
                        [% IF ( loopcel.url_complement ) %]<a href="reserves_stats.pl?output=[% loopcel.output | uri %]&amp;[% loopcel.url_complement | uri %]">[% loopcel.value | html %]</a>[% ELSE %][% loopcel.value | html %][% END %]
Lines 115-125 Link Here
115
                <td><input type="radio" name="Line" value="reservestatus" /></td>
128
                <td><input type="radio" name="Line" value="reservestatus" /></td>
116
                <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
129
                <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
117
                <td>
130
                <td>
118
				<input type="checkbox" name="filter_reservestatus_or_1" value="1" /> Asked
131
                <input type="checkbox" name="filter_reservestatus_or_C" value="C" /> Cancelled
119
				<input type="checkbox" name="filter_reservestatus_or_2" value="2" /> Processing
132
                <input type="checkbox" name="filter_reservestatus_or_F" value="F" /> Filled
120
				<input type="checkbox" name="filter_reservestatus_or_3" value="3" /> Waiting
133
                <input type="checkbox" name="filter_reservestatus_or_P" value="P" /> Placed
121
				<input type="checkbox" name="filter_reservestatus_or_4" value="4" /> Satisfied
134
                <input type="checkbox" name="filter_reservestatus_or_W" value="W" /> Waiting
122
				<input type="checkbox" name="filter_reservestatus_or_5" value="5" /> Cancelled
123
				</td>
135
				</td>
124
             </tr>
136
             </tr>
125
             <tr>
137
             <tr>
(-)a/reports/reserves_stats.pl (-32 / +4 lines)
Lines 300-306 sub display_value { Link Here
300
      : ( $crit =~ /location/ )      ? $locations->{$value}
300
      : ( $crit =~ /location/ )      ? $locations->{$value}
301
      : ( $crit =~ /itemtype/ )      ? Koha::ItemTypes->find( $value )->translated_description
301
      : ( $crit =~ /itemtype/ )      ? Koha::ItemTypes->find( $value )->translated_description
302
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
302
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
303
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
304
      :                                $value;    # default fallback
303
      :                                $value;    # default fallback
305
    if ($crit =~ /sort1/) {
304
    if ($crit =~ /sort1/) {
306
        foreach (@$Bsort1) {
305
        foreach (@$Bsort1) {
Lines 324-358 sub display_value { Link Here
324
    return $display_value;
323
    return $display_value;
325
}
324
}
326
325
327
sub reservestatushuman{
328
	my ($val)=@_;
329
	my %hashhuman=(
330
	1=>"1- placed",
331
	2=>"2- processed",
332
	3=>"3- pending",
333
	4=>"4- satisfied",
334
	5=>"5- cancelled",
335
	6=>"6- not a status"
336
	);
337
	$hashhuman{$val};
338
}
339
340
sub changeifreservestatus{
326
sub changeifreservestatus{
341
	my ($val)=@_;
327
    my ( $field ) = @_;
342
	($val=~/reservestatus/
328
    return $field unless $field =~ /reservestatus/;
343
		?$val=qq{ case 
329
    # For reservestatus we return C- Cancelled, W- Waiting, F- Filled, P- Placed (or other like processing, transit etc.)
344
					when priority>0 then 1 
330
    return q|CASE WHEN cancellationdate IS NOT NULL THEN 'C' WHEN found='W' THEN 'W' WHEN found='F' THEN 'F' ELSE 'P' END|;
345
					when priority=0 then
346
						(case 
347
						   when found='f' then 4
348
						   when found='w' then 
349
						   (case 
350
						    when cancellationdate is null then 3
351
							else 5
352
							end )
353
						   else 2 
354
						 end )
355
				    else 6 
356
					end }
357
		:$val);
358
}
331
}
359
- 

Return to bug 23059