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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-130 / +197 lines)
Lines 72-77 Link Here
72
                            <div class="alert alert-warning">No missing issues found.</div>
72
                            <div class="alert alert-warning">No missing issues found.</div>
73
                        [% ELSE %]
73
                        [% ELSE %]
74
                            <div class="alert alert-info">Please choose a vendor.</div>
74
                            <div class="alert alert-info">Please choose a vendor.</div>
75
                            [% PROCESS select_vendor context => "main" %]
75
                        [% END %]
76
                        [% END %]
76
                    [% END %]
77
                    [% END %]
77
                [% END %]
78
                [% END %]
Lines 86-232 Link Here
86
                    </div>
87
                    </div>
87
                [% END %]
88
                [% END %]
88
89
89
                <form id="claims" name="claims" action="claims.pl" method="get">
90
                    <fieldset>
91
                        <label for="supplierid">Vendor: </label>
92
                        <select id="supplierid" name="supplierid">
93
                            [% FOREACH suploo IN suploop %]
94
                                [% IF ( suploo.selected ) %]
95
                                    <option value="[% suploo.id | html %]" selected="selected" >
96
                                [% ELSE %]
97
                                    <option value="[% suploo.id | html %]">
98
                                [% END %]
99
                                    [% suploo.name | html %]
100
                                    ([% suploo.count | html %])
101
                                </option>
102
                            [% END %]
103
                        </select>
104
                        <input type="submit" class="btn btn-primary" value="OK" />
105
                    </fieldset>
106
                </form> <!-- /#claims -->
107
108
                [% IF ( missingissues ) %]
90
                [% IF ( missingissues ) %]
109
                    <h3>Missing issues</h3>
91
                    <h3>Missing issues</h3>
110
                    <form method="get" action="claims.pl" id="filter_claims_form">
111
                        <fieldset class="rows">
112
                            <legend>Filters:</legend>
113
                            <ol>
114
                                <li>
115
                                    <label for="from">From:</label>
116
                                    <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
117
                                    <label for="to" style="float:none;">To:</label>
118
                                    <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
119
                                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
120
                                    <input id="filterByDate" type="button" value="OK" />
121
                                    <a href="#" id="clearfilter"><i class="fa fa-times"></i> Clear filter</a>
122
                                </li>
123
                            </ol>
124
                        </fieldset>
125
                    </form>
126
92
127
                    <fieldset>
128
                        <form action="claims.pl" method="post" id="claims_form">
93
                        <form action="claims.pl" method="post" id="claims_form">
129
                            [% INCLUDE 'csrf-token.inc' %]
94
                            <div class="page-section">
130
                            <table id="claimst">
95
                                [% INCLUDE 'csrf-token.inc' %]
131
                                <thead>
96
                                <table id="claimst">
132
                                    <tr>
97
                                    <thead>
133
                                        <th><input type="checkbox" id="CheckAll"></th>
98
                                        <tr>
134
                                        <th>Vendor</th>
99
                                            <th class="NoSort"><input type="checkbox" id="CheckAll"></th>
135
                                        <th>Library</th>
100
                                            <th>Vendor</th>
136
                                        <th class="anti-the">Title</th>
101
                                            <th>Library</th>
137
                                        <th>ISSN</th>
102
                                            <th class="anti-the">Title</th>
138
                                        <th>Issue number</th>
103
                                            <th>ISSN</th>
139
                                        <th>Status</th>
104
                                            <th>Issue number</th>
140
                                        <th>Since</th>
105
                                            <th>Status</th>
141
                                        <th>Publication date</th>
106
                                            <th>Since</th>
142
                                        <th>Claims count</th>
107
                                            <th>Publication date</th>
143
                                        <th>Claim date</th>
108
                                            <th>Claims count</th>
144
                                        [% FOR field IN additional_fields_for_subscription %]
109
                                            <th>Claim date</th>
145
                                        <th>[% field.name | html %]</th>
110
                                            [% FOR field IN additional_fields_for_subscription %]
146
                                        [% END %]
111
                                            <th>[% field.name | html %]</th>
147
                                    </tr>
112
                                            [% END %]
148
                                </thead>
113
                                        </tr>
149
                                <tbody>
114
                                    </thead>
150
                                    [% FOREACH missingissue IN missingissues %]
115
                                    <tbody>
116
                                        [% FOREACH missingissue IN missingissues %]
117
                                            <tr>
118
                                                <td>
119
                                                [% UNLESS missingissue.cannot_claim %]
120
                                                    <input type="checkbox" class="select_serial" name="serialid" value="[% missingissue.serialid | html %]" />
121
                                                [% END %]
122
                                                </td>
123
                                                <td>[% missingissue.name | html %]</td>
124
                                                <td>
125
                                                    <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
126
                                                </td>
127
                                                <td>
128
                                                    <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
129
                                                </td>
130
                                                <td>[% missingissue.issn | html %]</td>
131
                                                <td>[% missingissue.serialseq | html %]</td>
132
                                                <td>
133
                                                    [% INCLUDE 'serial-status.inc' serial = missingissue %]
134
                                                </td>
135
                                                <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
136
                                                    [% missingissue.planneddate | $KohaDates %]
137
                                                </td>
138
                                                <td class="publisheddate" data-order="[% missingissue.publisheddate | html %]">
139
                                                    [% missingissue.publisheddate | $KohaDates %]
140
                                                </td>
141
                                                <td>[% missingissue.claims_count | html %]</td>
142
                                                <td data-order="[% missingissue.claimdate | html %]">
143
                                                    [% missingissue.claimdate | $KohaDates %]
144
                                                </td>
145
                                                [% INCLUDE 'additional-fields-display.inc' available=additional_fields_for_subscription values=missingissue.additional_field_values value_only=1 is_table_cell=1 %]
146
                                            </tr>
147
                                        [% END # /FOREACH missingissue %]
148
                                    </tbody>
149
                                    <tfoot>
151
                                        <tr>
150
                                        <tr>
152
                                            <td>
151
                                            <td></td>
153
                                            [% UNLESS missingissue.cannot_claim %]
152
                                            <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
154
                                                <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
153
                                            <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
154
                                            <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
155
                                            <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
156
                                            <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
157
                                            <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
158
                                            <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
159
                                            <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
160
                                            <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
161
                                            <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
162
                                            [% FOR field IN additional_fields_for_subscription %]
163
                                                <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
155
                                            [% END %]
164
                                            [% END %]
156
                                            </td>
157
                                            <td>[% missingissue.name | html %]</td>
158
                                            <td>
159
                                                <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
160
                                            </td>
161
                                            <td>
162
                                                <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
163
                                            </td>
164
                                            <td>[% missingissue.issn | html %]</td>
165
                                            <td>[% missingissue.serialseq | html %]</td>
166
                                            <td>
167
                                                [% INCLUDE 'serial-status.inc' serial = missingissue %]
168
                                            </td>
169
                                            <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
170
                                                [% missingissue.planneddate | $KohaDates %]
171
                                            </td>
172
                                            <td class="publisheddate" data-order="[% missingissue.publisheddate | html %]">
173
                                                [% missingissue.publisheddate | $KohaDates %]
174
                                            </td>
175
                                            <td>[% missingissue.claims_count | html %]</td>
176
                                            <td data-order="[% missingissue.claimdate | html %]">
177
                                                [% missingissue.claimdate | $KohaDates %]
178
                                            </td>
179
                                            [% INCLUDE 'additional-fields-display.inc' available=additional_fields_for_subscription values=missingissue.additional_field_values value_only=1 is_table_cell=1 %]
180
                                        </tr>
165
                                        </tr>
181
                                    [% END # /FOREACH missingissue %]
166
                                    </tfoot>
182
                                </tbody>
167
                                </table> <!-- /#claimst -->
183
                                <tfoot>
168
                            </div> <!-- /.page-section -->
184
                                    <tr>
169
185
                                        <td></td>
170
                            <hr />
186
                                        <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
171
187
                                        <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
172
                            [% IF ( csv_profiles.count && letters ) %]
188
                                        <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
173
                                <div class="row">
189
                                        <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
174
                                    <div class="col-sm-6">
190
                                        <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
175
                            [% ELSIF ( csv_profiles.count || letters ) %]
191
                                        <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
176
                                <div class="row">
192
                                        <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
177
                                    <div class="col-sm-12">
193
                                        <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
178
                            [% END %]
194
                                        <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
195
                                        <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
196
                                        [% FOR field IN additional_fields_for_subscription %]
197
                                            <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
198
                                        [% END %]
199
                                    </tr>
200
                                </tfoot>
201
                            </table> <!-- /#claimst -->
202
179
203
                            [% IF csv_profiles.count %]
180
                            [% IF csv_profiles.count %]
204
                                <fieldset class="action">
181
                                <fieldset class="serial_batch_op" disabled="disabled">
205
                                    <label for="csv_code">Select CSV profile:</label>
182
                                    <fieldset class="brief">
206
                                    <select id="csv_profile_for_export">
183
                                        <legend>Download selected claims</legend>
207
                                        [% FOR csv IN csv_profiles %]
184
                                        <label for="csv_profile_for_export">Select CSV profile:</label>
208
                                            <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
185
                                        <select id="csv_profile_for_export">
209
                                        [% END %]
186
                                            [% FOR csv IN csv_profiles %]
210
                                    </select>
187
                                                <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
211
                                    <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
188
                                            [% END %]
189
                                        </select>
190
                                        <fieldset class="action">
191
                                            <button class="btn btn-primary" id="ExportSelected" type="button">Download selected claims</button>
192
                                        </fieldset>
193
                                    </fieldset>
212
                                </fieldset>
194
                                </fieldset>
213
                            [% END %]
195
                            [% END %]
214
196
197
                            [% IF ( csv_profiles.count && letters ) %]
198
                                </div>
199
                                <div class="col-sm-6">
200
                            [% END %]
201
215
                            [% IF letters %]
202
                            [% IF letters %]
216
                                <fieldset class="action">
203
                                <fieldset class="serial_batch_op" disabled="disabled">
217
                                    <label for="letter_code">Select notice:</label>
204
                                    <fieldset class="brief">
218
                                    <select name="letter_code" id="letter_code">
205
                                        <legend>Send claim notification</legend>
219
                                        [% FOREACH letter IN letters %]
206
                                        <label for="letter_code">Select notice:</label>
220
                                            <option value="[% letter.code | html %]">[% letter.name | html %]</option>
207
                                        <select name="letter_code" id="letter_code">
221
                                        [% END %]
208
                                            [% FOREACH letter IN letters %]
222
                                    </select>
209
                                                <option value="[% letter.code | html %]">[% letter.name | html %]</option>
223
                                    <input type="hidden" name="op" value="cud-send_alert" />
210
                                            [% END %]
224
                                    <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
211
                                        </select>
225
                                    <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
212
                                        <fieldset class="action">
213
                                            <input type="hidden" name="op" value="cud-send_alert" />
214
                                            <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
215
                                            <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
216
                                        </fieldset>
217
                                    </fieldset>
226
                                </fieldset>
218
                                </fieldset>
227
                            [% END %]
219
                            [% END %]
220
221
                            [% IF ( csv_profiles.count && letters ) %]
222
                                </div>
223
                                <div class="col-sm-6">
224
                            [% END %]
228
                        </form> <!-- /#claims_form -->
225
                        </form> <!-- /#claims_form -->
229
                    </fieldset>
226
230
                [% END # /missingissues %]
227
                [% END # /missingissues %]
231
228
232
            </main>
229
            </main>
Lines 234-267 Link Here
234
231
235
        <div class="col-md-2 order-sm-2 order-md-1">
232
        <div class="col-md-2 order-sm-2 order-md-1">
236
            <aside>
233
            <aside>
234
                [% IF letters %]
235
                    [% IF ( missingissues && supplierid ) %]
236
                        [% PROCESS select_vendor context => "sidebar" %]
237
                    [% END %]
238
                [% END %]
239
240
                [% IF ( missingissues ) %]
241
                    <form action="claims.pl" id="filter_claims_form">
242
                        <fieldset class="brief">
243
                            <h4>Filter missing issues</h4>
244
                            <legend class="sr-only">Filter missing issues</legend>
245
                            <ol>
246
                                <li>
247
                                    <label for="from">From:</label>
248
                                    <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
249
                                </li>
250
                                <li>
251
                                    <label for="to">To:</label>
252
                                    <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
253
                                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
254
                                </li>
255
                            </ol>
256
                        </fieldset>
257
                        <fieldset class="action">
258
                            <input id="filterByDate" class="btn btn-primary" type="button" value="OK" />
259
                            <input type="reset" class="btn btn-default" value="Clear" id="clearfilter" />
260
                        </fieldset>
261
                    </form>
262
                [% END %]
263
237
                [% INCLUDE 'serials-menu.inc' %]
264
                [% INCLUDE 'serials-menu.inc' %]
238
            </aside>
265
            </aside>
239
        </div> <!-- /.col-md-2.order-md-1 -->
266
        </div> <!-- /.col-md-2.order-md-1 -->
240
     </div> <!-- /.row -->
267
     </div> <!-- /.row -->
241
268
269
[% BLOCK select_vendor %]
270
    <form class="select_vendor" name="claims" action="claims.pl" method="get">
271
        [% IF ( context == "main") %]
272
            <fieldset class="rows">
273
        [% ELSE %]
274
            <fieldset class="brief">
275
        [% END %]
276
            <h4>Choose vendor</h4>
277
            <label class="sr-only" for="supplierid">Choose vendor: </label>
278
            <select id="supplierid" name="supplierid">
279
                [% FOREACH suploo IN suploop %]
280
                    [% IF ( suploo.selected ) %]
281
                        <option value="[% suploo.id | html %]" selected="selected" >
282
                    [% ELSE %]
283
                        <option value="[% suploo.id | html %]">
284
                    [% END %]
285
                        [% suploo.name | html %]
286
                        ([% suploo.count | html %])
287
                    </option>
288
                [% END %]
289
            </select>
290
        </fieldset>
291
        <fieldset class="action">
292
            <input type="submit" class="btn btn-primary" value="OK" />
293
        </fieldset>
294
    </form> <!-- /#claims -->
295
[% END %]
296
242
[% MACRO jsinclude BLOCK %]
297
[% MACRO jsinclude BLOCK %]
243
    [% INCLUDE 'calendar.inc' %]
298
    [% INCLUDE 'calendar.inc' %]
244
    [% INCLUDE 'datatables.inc' %]
299
    [% INCLUDE 'datatables.inc' %]
245
    <script>
300
    <script>
246
        var sTable;
301
        var sTable;
247
        $(document).ready(function() {
302
        $(document).ready(function() {
303
            enableSelectedActions();
248
            sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
304
            sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
249
                "dom": 't',
305
                "dom": 't',
306
                "order": [[ 7, "asc" ]],
250
                "columnDefs": [
307
                "columnDefs": [
251
                    { "targets": [ 0 ], "orderable": false, "searchable":  false },
308
                    { 'sortable': false, 'targets': [ 'NoSort' ] },
252
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
309
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
253
                ],
310
                ],
254
                "paginate": false
311
                "paginate": false
255
            }));
312
            }));
256
            $('#supplierid').change(function() {
257
                $('#claims').submit();
258
            });
259
313
260
            // Checkboxes : Select All / None
314
            // Checkboxes : Select All / None
261
            $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
315
            $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
262
316
263
            $("#CheckAll").click(function() {
317
            $("#CheckAll").click(function() {
264
                $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
318
                $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
319
                enableSelectedActions();
265
            });
320
            });
266
321
267
            // Generates a dynamic link for exporting the selections data as CSV
322
            // Generates a dynamic link for exporting the selections data as CSV
Lines 300-307 Link Here
300
            $("#filter_claims_form").on("submit",function(){
355
            $("#filter_claims_form").on("submit",function(){
301
                return false;
356
                return false;
302
            });
357
            });
358
359
            $(".select_serial").on("change", function(){
360
                enableSelectedActions();
361
            });
303
        });
362
        });
304
363
364
        function enableSelectedActions() {
365
            var checkedBoxes = $(".select_serial:checked");
366
            if ( checkedBoxes.length ) {
367
                $(".serial_batch_op").prop( "disabled", false );
368
            } else {
369
                $(".serial_batch_op").prop( "disabled", true );
370
            }
371
        }
372
305
        // Checks if the form can be sent (at least one checkbox must be checked)
373
        // Checks if the form can be sent (at least one checkbox must be checked)
306
        function checkForm() {
374
        function checkForm() {
307
            if ($("input:checked").length == 0) {
375
            if ($("input:checked").length == 0) {
308
- 

Return to bug 37094