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 9-14 Link Here
9
</style>
9
</style>
10
</head>
10
</head>
11
11
12
[% BLOCK reservestatus %]
13
    [% IF field == 'reservestatus' %]
14
         [% SWITCH value %]
15
             [% CASE 'C'%]Cancelled
16
             [% CASE 'F'%]Filled
17
             [% CASE 'P'%]Placed
18
             [% CASE 'W'%]Waiting
19
         [% END %]
20
    [% ELSE %]
21
        [% value | html %]
22
    [% END %]
23
[% END %]
24
12
<body id="rep_reserve_stats" class="rep">
25
<body id="rep_reserve_stats" class="rep">
13
[% WRAPPER 'header.inc' %]
26
[% WRAPPER 'header.inc' %]
14
    [% INCLUDE 'cat-search.inc' %]
27
    [% INCLUDE 'cat-search.inc' %]
Lines 63-75 Link Here
63
            <tr>
76
            <tr>
64
                <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
77
                <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
65
                [% FOREACH loopco IN mainloo.loopcol %]
78
                [% FOREACH loopco IN mainloo.loopcol %]
66
                    <th>[% loopco.coltitle_display | html %]</th>
79
                    <th>[% PROCESS reservestatus field=mainloo.column value=loopco.coltitle_display %]</th>
67
                [% END %]
80
                [% END %]
68
                <th>TOTAL</th>
81
                <th>TOTAL</th>
69
                </tr>
82
                </tr>
70
                [% FOREACH loopro IN mainloo.looprow %]
83
                [% FOREACH loopro IN mainloo.looprow %]
71
                    <tr>
84
                    <tr>
72
                        <td>[% loopro.rowtitle_display or "UNKNOWN VALUE" | html %]</td>
85
                        <td>[% PROCESS reservestatus field=mainloo.line value=loopro.rowtitle_display %]</td>
73
                    [% FOREACH loopcel IN loopro.loopcell %]
86
                    [% FOREACH loopcel IN loopro.loopcell %]
74
						<td align="center">
87
						<td align="center">
75
                        [% 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 %]
88
                        [% 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 107-117 Link Here
107
                <td><input type="radio" name="Line" value="reservestatus" /></td>
120
                <td><input type="radio" name="Line" value="reservestatus" /></td>
108
                <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
121
                <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
109
                <td>
122
                <td>
110
				<input type="checkbox" name="filter_reservestatus_or_1" value="1" /> Asked
123
                <input type="checkbox" name="filter_reservestatus_or_C" value="C" /> Cancelled
111
				<input type="checkbox" name="filter_reservestatus_or_2" value="2" /> Processing
124
                <input type="checkbox" name="filter_reservestatus_or_F" value="F" /> Filled
112
				<input type="checkbox" name="filter_reservestatus_or_3" value="3" /> Waiting
125
                <input type="checkbox" name="filter_reservestatus_or_P" value="P" /> Placed
113
				<input type="checkbox" name="filter_reservestatus_or_4" value="4" /> Satisfied
126
                <input type="checkbox" name="filter_reservestatus_or_W" value="W" /> Waiting
114
				<input type="checkbox" name="filter_reservestatus_or_5" value="5" /> Cancelled
115
				</td>
127
				</td>
116
             </tr>
128
             </tr>
117
             <tr>
129
             <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