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

Return to bug 37094