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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt (-18 / +85 lines)
Lines 1-5 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE ItemTypes %]
4
[% USE AuthorisedValues %]
5
[% USE KohaDates %]
3
[% PROCESS 'i18n.inc' %]
6
[% PROCESS 'i18n.inc' %]
4
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
Lines 46-65 Link Here
46
                <h1>Catalog statistics</h1>
49
                <h1>Catalog statistics</h1>
47
                [% IF ( do_it ) %]
50
                [% IF ( do_it ) %]
48
                    [% FOREACH mainloo IN mainloop %]
51
                    [% FOREACH mainloo IN mainloop %]
49
                        [% IF ( mainloo.loopfilter ) %]
52
                        [% IF ( mainloo.loopfilter.size > 0 ) %]
50
                            <p>Filtered on:</p>
53
                            <p>Filtered on:</p>
51
                            [% FOREACH loopfilte IN mainloo.loopfilter %]
54
                            <ul>
52
                                <p>[% loopfilte.crit | html %] =[% loopfilte.filter | html %]</p>
55
                                [% FOREACH f IN mainloo.loopfilter %]
53
                            [% END %]
56
                                    [% SWITCH f.crit %]
57
                                        [% CASE 'callnum_from' %]<li>Item call number (from): [% f.filter | html %]</li>
58
                                        [% CASE 'callnum_to' %]<li>Item call number (to): [% f.filter | html %]</li>
59
                                        [% CASE 'itype' %]<li>Item type: [% ItemTypes.GetDescription( f.filter ) | html %]</li>
60
                                        [% CASE 'publisher' %]<li>Publisher: [% f.filter | html %]</li>
61
                                        [% CASE 'pubyear_from' %]<li>Publication year (from): [% f.filter | html %]</li>
62
                                        [% CASE 'pubyear_to' %]<li>Publication year (to): [% f.filter | html %]</li>
63
                                        [% CASE 'library' %]<li>Home library: [% Branches.GetName( f.filter ) | html %]</li>
64
                                        [% CASE 'location' %]<li>Shelving location: [% AuthorisedValues.GetByCode('LOC', f.filter) | html %]</li>
65
                                        [% CASE 'collection' %]<li>Collection: [% AuthorisedValues.GetByCode('CCODE', f.filter) | html %]</li>
66
                                        [% CASE 'nfl_status' %]<li>Not for loan: [% AuthorisedValues.GetByCode('NOT_LOAN', f.filter) | html %]</li>
67
                                        [% CASE 'materials' %]<li>Materials specified: [% f.filter | html %]</li>
68
                                        [% CASE 'barcode_unlike' %]<li>Barcode not like: [% f.filter | html %]</li>
69
                                        [% CASE 'barcode_like' %]<li>Barcode like: [% f.filter | html %]</li>
70
                                        [% CASE 'acquired_from' %]<li>Date acquired (from): [% f.filter | $KohaDates %]</li>
71
                                        [% CASE 'acquired_to' %]<li>Date acquired (to): [% f.filter | $KohaDates %]</li>
72
                                        [% CASE 'deleted_from' %]<li>Date deleted (from): [% f.filter | $KohaDates %]</li>
73
                                        [% CASE 'deleted_to' %]<li>Date deleted (to): [% f.filter | $KohaDates %]</li>
74
                                    [% END %]
75
                                [% END %]
76
                            </ul>
54
                        [% END %]
77
                        [% END %]
55
78
56
                        <div class="page-section">
79
                        <div class="page-section">
57
                            <table id="catalogue_stats">
80
                            <table id="catalogue_stats">
58
                                <thead>
81
                                <thead>
59
                                    <tr>
82
                                    <tr>
60
                                        <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
83
                                        [%- BLOCK row_column -%]
84
                                            [%- SWITCH code -%]
85
                                                [%- CASE ['items.itemcallnumber', 'deleteditems.itemcallnumber'] -%]<span>Item call number</span>
86
                                                [%- CASE ['items.itype', 'deleteditems.itype', 'itemtype'] -%]<span>Item type</span>
87
                                                [%- CASE 'publishercode' -%]<span>Publisher</span>
88
                                                [%- CASE ['copyrightdate', 'publicationyear'] -%]<span>Publication year</span>
89
                                                [%- CASE ['items.homebranch', 'deleteditems.homebranch'] -%]<span>Home library</span>
90
                                                [%- CASE ['items.location', 'deleteditems.location'] -%]<span>Shelving location</span>
91
                                                [%- CASE ['items.ccode', 'deleteditems.ccode'] -%]<span>Collection</span>
92
                                                [%- CASE ['items.notforloan', 'deleteditems.notforloan'] -%]<span>Not for loan</span>
93
                                                [%- CASE ['items.materials', 'deleteditems.materials'] -%]<span>Materials specified</span>
94
                                                [%- CASE ['items.dateaccessioned', 'deleteditems.dateaccessioned'] -%]<span>Date acquired</span>
95
                                                [%- CASE 'deleteditems.timestamp' -%]<span>Date deleted</span>
96
                                                [%- CASE -%]<span>[% code | html %]<span>
97
                                            [%- END -%]
98
                                        [%- END -%]
99
                                        [%- BLOCK display_text -%]
100
                                            [%- SWITCH type -%]
101
                                                [%- CASE ['items.itype', 'deleteditems.itype', 'itemtype'] -%][% ItemTypes.GetDescription( code ) | html %]
102
                                                [%- CASE ['items.homebranch', 'deleteditems.homebranch'] -%][% Branches.GetName( code ) | html %]
103
                                                [%- CASE ['items.location', 'deleteditems.location'] -%]
104
                                                    [% IF code == "NULL" %]
105
                                                        <span>No location</span>
106
                                                    [% ELSE %]
107
                                                        [% AuthorisedValues.GetByCode('LOC', code) | html %]
108
                                                    [% END %]
109
                                                [%- CASE ['items.ccode', 'deleteditems.ccode'] -%]
110
                                                    [% IF code == "NULL" %]
111
                                                        <span>No collection</span>
112
                                                    [% ELSE %]
113
                                                        [% AuthorisedValues.GetByCode('CCODE', code) | html %]
114
                                                    [% END %]
115
                                                [%- CASE ['items.notforloan', 'deleteditems.notforloan'] -%][% IF code != 0 %][% AuthorisedValues.GetByCode('NOT_LOAN', code) | html %][% END %]
116
                                                [%- CASE ['items.dateaccessioned', 'deleteditems.dateaccessioned', 'deleteditems.timestamp'] -%][% code | $KohaDates %]
117
                                                [%- CASE -%][% IF code == "NULL" %]Empty[% ELSE %][% code | html %][% END %]
118
                                            [%- END -%]
119
                                        [%- END -%]
120
                                        <th>[%- PROCESS row_column code=mainloo.line -%] / [%- PROCESS row_column code=mainloo.column -%]</th>
61
                                        [% FOREACH loopco IN mainloo.loopcol %]
121
                                        [% FOREACH loopco IN mainloo.loopcol %]
62
                                            <th>[% loopco.coltitle | html %]</th>
122
                                            <th>
123
                                                [%- PROCESS display_text code=loopco.coltitle type=mainloo.column -%]
124
                                            </th>
63
                                        [% END %]
125
                                        [% END %]
64
                                        <th>TOTAL</th>
126
                                        <th>TOTAL</th>
65
                                    </tr>
127
                                    </tr>
Lines 67-84 Link Here
67
                                <tbody>
129
                                <tbody>
68
                                    [% FOREACH loopro IN mainloo.looprow %]
130
                                    [% FOREACH loopro IN mainloo.looprow %]
69
                                        <tr>
131
                                        <tr>
70
                                            [% IF ( loopro.hilighted ) %]<td class="hilighted">[% ELSE %]<td>[% END %]
132
                                            [% IF mainloo.line.search(".dateaccessioned") || mainloo.line == "deleteditems.timestamp" %]
71
                                                [% loopro.rowtitle | html %]</td>
133
                                                <td data-order="[% loopro.rowtitle | html %]">
72
                                                [% FOREACH loopcel IN loopro.loopcell %]
134
                                            [% ELSE %]
73
                                                    [% IF ( loopcel.hilighted ) %]<td>[% ELSE %]<td>[% END %]
135
                                                <td>
74
                                                        [% IF ( loopcel.value ) %]
136
                                            [% END %]
75
                                                            [% loopcel.value | html %]
137
                                                [%- PROCESS display_text code=loopro.rowtitle type=mainloo.line -%]
76
                                                        [% ELSE %]
138
                                            </td>
77
                                                            &nbsp;
139
                                            [% FOREACH loopcel IN loopro.loopcell %]
78
                                                        [% END %]
140
                                                <td>
79
                                                    </td>
141
                                                    [% IF ( loopcel.value ) %]
80
                                                [% END %]
142
                                                        [% loopcel.value | html %]
81
                                                [% IF ( loopro.hilighted ) %]<td>[% ELSE %]<td>[% END %]
143
                                                    [% ELSE %]
144
                                                        &nbsp;
145
                                                    [% END %]
146
                                                </td>
147
                                            [% END %]
148
                                            <td>
82
                                                [% loopro.totalrow | html %]
149
                                                [% loopro.totalrow | html %]
83
                                            </td>
150
                                            </td>
84
                                        </tr>
151
                                        </tr>
(-)a/reports/catalogue_stats.pl (-20 / +19 lines)
Lines 184-190 sub calculate { Link Here
184
    # Checking filters
184
    # Checking filters
185
    #
185
    #
186
    my @loopfilter;
186
    my @loopfilter;
187
    for ( my $i = 0 ; $i <= @$filters ; $i++ ) {
187
    foreach my $i ( 0 .. scalar @$filters ) {
188
        my %cell;
188
        my %cell;
189
        if ( defined @$filters[$i] and @$filters[$i] ne '' and $i != 11 ) {
189
        if ( defined @$filters[$i] and @$filters[$i] ne '' and $i != 11 ) {
190
            if ( ( ( $i == 1 ) or ( $i == 5 ) ) and ( @$filters[ $i - 1 ] ) ) {
190
            if ( ( ( $i == 1 ) or ( $i == 5 ) ) and ( @$filters[ $i - 1 ] ) ) {
Lines 192-215 sub calculate { Link Here
192
            }
192
            }
193
            $cell{filter} .= @$filters[$i];
193
            $cell{filter} .= @$filters[$i];
194
            $cell{crit} .=
194
            $cell{crit} .=
195
                ( $i == 0 )  ? "Item CallNumber From"
195
                  ( $i == 0 )                          ? "callnum_from"
196
              : ( $i == 1 )  ? "Item CallNumber To"
196
                : ( $i == 1 )                          ? "callnum_to"
197
              : ( $i == 2 )  ? "Item type"
197
                : ( $i == 2 )                          ? "itype"
198
              : ( $i == 3 )  ? "Publisher"
198
                : ( $i == 3 )                          ? "publisher"
199
              : ( $i == 4 )  ? "Publication year From"
199
                : ( $i == 4 )                          ? "pubyear_from"
200
              : ( $i == 5 )  ? "Publication year To"
200
                : ( $i == 5 )                          ? "pubyear_to"
201
              : ( $i == 6 ) ? "Library"
201
                : ( $i == 6 )                          ? "library"
202
              : ( $i == 7 ) ? "Shelving Location"
202
                : ( $i == 7 )                          ? "location"
203
              : ( $i == 8 ) ? "Collection Code"
203
                : ( $i == 8 )                          ? "collection"
204
              : ( $i == 9 ) ? "Status"
204
                : ( $i == 9 )                          ? "nfl_status"
205
              : ( $i == 10 ) ? "Materials"
205
                : ( $i == 10 )                         ? "materials"
206
              : ( $i == 12 and $filters->[11] == 0 ) ? "Barcode (not like)"
206
                : ( $i == 12 and $filters->[11] == 0 ) ? "barcode_unlike"
207
              : ( $i == 12 and $filters->[11] == 1 ) ? "Barcode (like)"
207
                : ( $i == 12 and $filters->[11] == 1 ) ? "barcode_like"
208
              : ( $i == 13 ) ? "Date acquired (item) from"
208
                : ( $i == 13 )                         ? "acquired_from"
209
              : ( $i == 14 ) ? "Date acquired (item) to"
209
                : ( $i == 14 )                         ? "acquired_to"
210
              : ( $i == 15 ) ? "Date deleted (item) from"
210
                : ( $i == 15 )                         ? "deleted_from"
211
              : ( $i == 16 ) ? "Date deleted (item) to"
211
                : ( $i == 16 )                         ? "deleted_to"
212
              :                '';
212
                :                                        '';
213
213
214
            push @loopfilter, \%cell;
214
            push @loopfilter, \%cell;
215
        }
215
        }
216
- 

Return to bug 35807