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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+16 lines)
Lines 385-390 aside { Link Here
385
                a {
385
                a {
386
                    display: block;
386
                    display: block;
387
                    flex-grow: 1;
387
                    flex-grow: 1;
388
389
                    + input[type="reset"] {
390
                        flex-grow: 0;
391
                        margin-left: .5rem;
392
                    }
388
                }
393
                }
389
            }
394
            }
390
        }
395
        }
Lines 1055-1060 fieldset { Link Here
1055
        }
1060
        }
1056
    }
1061
    }
1057
1062
1063
    &[disabled] {
1064
        legend,
1065
        label,
1066
        select,
1067
        input {
1068
            cursor: not-allowed;
1069
            filter: alpha( opacity=65 );
1070
            opacity: .65;
1071
        }
1072
    }
1073
1058
    &.lastchecked {
1074
    &.lastchecked {
1059
        margin-bottom: 0;
1075
        margin-bottom: 0;
1060
        margin-right: 0;
1076
        margin-right: 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-103 / +207 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-153 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>
133
                                        <th>Vendor</th>
134
                                        <th>Library</th>
135
                                        <th class="anti-the">Title</th>
136
                                        <th>ISSN</th>
137
                                        <th>Issue number</th>
138
                                        <th>Status</th>
139
                                        <th>Since</th>
140
                                        <th>Publication date</th>
141
                                        <th>Claims count</th>
142
                                        <th>Claim date</th>
143
                                        [% FOR field IN additional_fields_for_subscription %]
144
                                        <th>[% field.name | html %]</th>
145
                                        [% END %]
146
                                    </tr>
147
                                </thead>
148
                                <tbody>
149
                                    [% FOREACH missingissue IN missingissues %]
150
                                        <tr>
97
                                        <tr>
98
<<<<<<< HEAD
151
                                            <td>
99
                                            <td>
152
                                            [% UNLESS missingissue.cannot_claim %]
100
                                            [% UNLESS missingissue.cannot_claim %]
153
                                                <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
101
                                                <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
Lines 176-231 Link Here
176
                                                [% missingissue.claimdate | $KohaDates %]
124
                                                [% missingissue.claimdate | $KohaDates %]
177
                                            </td>
125
                                            </td>
178
                                            [% INCLUDE 'additional-fields-display.inc' available=additional_fields_for_subscription values=missingissue.additional_field_values value_only=1 is_table_cell=1 %]
126
                                            [% INCLUDE 'additional-fields-display.inc' available=additional_fields_for_subscription values=missingissue.additional_field_values value_only=1 is_table_cell=1 %]
127
=======
128
                                            <th class="NoSort"><input type="checkbox" id="CheckAll"></th>
129
                                            <th>Vendor</th>
130
                                            <th>Library</th>
131
                                            <th class="anti-the">Title</th>
132
                                            <th>ISSN</th>
133
                                            <th>Issue number</th>
134
                                            <th>Status</th>
135
                                            <th>Since</th>
136
                                            <th>Publication date</th>
137
                                            <th>Claims count</th>
138
                                            <th>Claim date</th>
139
                                            [% FOR field IN additional_fields_for_subscription %]
140
                                            <th>[% field.name | html %]</th>
141
                                            [% END %]
179
                                        </tr>
142
                                        </tr>
180
                                    [% END # /FOREACH missingissue %]
143
                                    </thead>
181
                                </tbody>
144
                                    <tbody>
182
                                <tfoot>
145
                                        [% FOREACH missingissue IN missingissues %]
183
                                    <tr>
146
                                            <tr>
184
                                        <td></td>
147
                                                <td>
185
                                        <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
148
                                                [% UNLESS missingissue.cannot_claim %]
186
                                        <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
149
                                                    <input type="checkbox" class="select_serial" name="serialid" value="[% missingissue.serialid | html %]" />
187
                                        <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
150
                                                [% END %]
188
                                        <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
151
                                                </td>
189
                                        <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
152
                                                <td>[% missingissue.name | html %]</td>
190
                                        <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
153
                                                <td>
191
                                        <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
154
                                                    <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
192
                                        <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
155
                                                </td>
193
                                        <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
156
                                                <td>
194
                                        <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
157
                                                    <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
195
                                        [% FOR field IN additional_fields_for_subscription %]
158
                                                </td>
196
                                            <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
159
                                                <td>[% missingissue.issn | html %]</td>
197
                                        [% END %]
160
                                                <td>[% missingissue.serialseq | html %]</td>
198
                                    </tr>
161
                                                <td>
199
                                </tfoot>
162
                                                    [% INCLUDE 'serial-status.inc' serial = missingissue %]
200
                            </table> <!-- /#claimst -->
163
                                                </td>
164
                                                <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
165
                                                    [% missingissue.planneddate | $KohaDates %]
166
                                                </td>
167
                                                <td class="publisheddate" data-order="[% missingissue.publisheddate | html %]">
168
                                                    [% missingissue.publisheddate | $KohaDates %]
169
                                                </td>
170
                                                <td>[% missingissue.claims_count | html %]</td>
171
                                                <td data-order="[% missingissue.claimdate | html %]">
172
                                                    [% missingissue.claimdate | $KohaDates %]
173
                                                </td>
174
                                                [% FOR field IN additional_fields_for_subscription %]
175
                                                    [% IF field.authorised_value_category %]
176
                                                        <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
177
                                                    [% ELSE %]
178
                                                        <td>[% missingissue.additional_fields.${field.name} | html %]</td>
179
                                                    [% END %]
180
                                                [% END %]
181
                                            </tr>
182
                                        [% END # /FOREACH missingissue %]
183
                                    </tbody>
184
                                    <tfoot>
185
                                        <tr>
186
                                            <td></td>
187
                                            <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
188
                                            <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
189
                                            <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
190
                                            <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
191
                                            <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
192
                                            <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
193
                                            <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
194
                                            <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
195
                                            <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
196
                                            <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
197
                                            [% FOR field IN additional_fields_for_subscription %]
198
                                                <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
199
                                            [% END %]
200
>>>>>>> Bug 37094: Improve layout of serial claims page
201
                                        </tr>
202
                                    </tfoot>
203
                                </table> <!-- /#claimst -->
204
                            </div> <!-- /.page-section -->
205
206
                            <hr />
207
208
                            [% IF ( csv_profiles.count && letters ) %]
209
                                <div class="row">
210
                                    <div class="col-sm-6">
211
                            [% ELSIF ( csv_profiles.count || letters ) %]
212
                                <div class="row">
213
                                    <div class="col-sm-12">
214
                            [% END %]
201
215
202
                            [% IF csv_profiles.count %]
216
                            [% IF csv_profiles.count %]
203
                                <fieldset class="action">
217
                                <fieldset class="serial_batch_op" disabled="disabled">
204
                                    <label for="csv_code">Select CSV profile:</label>
218
                                    <fieldset class="brief">
205
                                    <select id="csv_profile_for_export">
219
                                        <legend>Download selected claims</legend>
206
                                        [% FOR csv IN csv_profiles %]
220
                                        <label for="csv_profile_for_export">Select CSV profile:</label>
207
                                            <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
221
                                        <select id="csv_profile_for_export">
208
                                        [% END %]
222
                                            [% FOR csv IN csv_profiles %]
209
                                    </select>
223
                                                <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>
224
                                            [% END %]
225
                                        </select>
226
                                        <fieldset class="action">
227
                                            <button class="btn btn-primary" id="ExportSelected" type="button">Download selected claims</button>
228
                                        </fieldset>
229
                                    </fieldset>
211
                                </fieldset>
230
                                </fieldset>
212
                            [% END %]
231
                            [% END %]
213
232
233
                            [% IF ( csv_profiles.count && letters ) %]
234
                                </div>
235
                                <div class="col-sm-6">
236
                            [% END %]
237
214
                            [% IF letters %]
238
                            [% IF letters %]
215
                                <fieldset class="action">
239
                                <fieldset class="serial_batch_op" disabled="disabled">
216
                                    <label for="letter_code">Select notice:</label>
240
                                    <fieldset class="brief">
217
                                    <select name="letter_code" id="letter_code">
241
                                        <legend>Send claim notification</legend>
218
                                        [% FOREACH letter IN letters %]
242
                                        <label for="letter_code">Select notice:</label>
219
                                            <option value="[% letter.code | html %]">[% letter.name | html %]</option>
243
                                        <select name="letter_code" id="letter_code">
220
                                        [% END %]
244
                                            [% FOREACH letter IN letters %]
221
                                    </select>
245
                                                <option value="[% letter.code | html %]">[% letter.name | html %]</option>
222
                                    <input type="hidden" name="op" value="cud-send_alert" />
246
                                            [% END %]
223
                                    <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
247
                                        </select>
224
                                    <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
248
                                        <fieldset class="action">
249
                                            <input type="hidden" name="op" value="cud-send_alert" />
250
                                            <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
251
                                            <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
252
                                        </fieldset>
253
                                    </fieldset>
225
                                </fieldset>
254
                                </fieldset>
226
                            [% END %]
255
                            [% END %]
256
257
                            [% IF ( csv_profiles.count && letters ) %]
258
                                    </div> <!-- /.col-sm- -->
259
                                </div> <!-- /.row -->
260
                            [% END %]
227
                        </form> <!-- /#claims_form -->
261
                        </form> <!-- /#claims_form -->
228
                    </fieldset>
262
229
                [% END # /missingissues %]
263
                [% END # /missingissues %]
230
264
231
            </main>
265
            </main>
Lines 233-267 Link Here
233
267
234
        <div class="col-md-2 order-sm-2 order-md-1">
268
        <div class="col-md-2 order-sm-2 order-md-1">
235
            <aside>
269
            <aside>
270
                [% IF letters %]
271
                    [% IF ( missingissues && supplierid ) %]
272
                        [% PROCESS select_vendor context => "sidebar" %]
273
                    [% END %]
274
                [% END %]
275
276
                [% IF ( missingissues ) %]
277
                    <form action="claims.pl" id="filter_claims_form">
278
                        <fieldset class="brief">
279
                            <legend class="sr-only">Filter missing issues</legend>
280
                            <h4>Filter missing issues</h4>
281
                            <ol>
282
                                <li>
283
                                    <label for="from">From:</label>
284
                                    <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
285
                                </li>
286
                                <li>
287
                                    <label for="to">To:</label>
288
                                    <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
289
                                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
290
                                </li>
291
                            </ol>
292
                        </fieldset>
293
                        <fieldset class="action">
294
                            <input id="filterByDate" class="btn btn-primary" type="button" value="OK" />
295
                            <input type="reset" class="btn btn-default" value="Clear" id="clearfilter" />
296
                        </fieldset>
297
                    </form>
298
                [% END %]
299
236
                [% INCLUDE 'serials-menu.inc' %]
300
                [% INCLUDE 'serials-menu.inc' %]
237
            </aside>
301
            </aside>
238
        </div> <!-- /.col-md-2.order-md-1 -->
302
        </div> <!-- /.col-md-2.order-md-1 -->
239
     </div> <!-- /.row -->
303
     </div> <!-- /.row -->
240
304
305
[% BLOCK select_vendor %]
306
    <form class="select_vendor" name="claims" action="claims.pl" method="get">
307
        [% IF ( context == "main") %]
308
            <fieldset class="rows">
309
        [% ELSE %]
310
            <fieldset class="brief">
311
        [% END %]
312
            <h4>Choose vendor</h4>
313
            <label class="sr-only" for="supplierid">Choose vendor: </label>
314
            <select id="supplierid" name="supplierid">
315
                [% FOREACH suploo IN suploop %]
316
                    [% IF ( suploo.selected ) %]
317
                        <option value="[% suploo.id | html %]" selected="selected" >
318
                    [% ELSE %]
319
                        <option value="[% suploo.id | html %]">
320
                    [% END %]
321
                        [% suploo.name | html %]
322
                        ([% suploo.count | html %])
323
                    </option>
324
                [% END %]
325
            </select>
326
        </fieldset>
327
        <fieldset class="action">
328
            <input type="submit" class="btn btn-primary" value="OK" />
329
        </fieldset>
330
    </form> <!-- /#claims -->
331
[% END %]
332
241
[% MACRO jsinclude BLOCK %]
333
[% MACRO jsinclude BLOCK %]
242
    [% INCLUDE 'calendar.inc' %]
334
    [% INCLUDE 'calendar.inc' %]
243
    [% INCLUDE 'datatables.inc' %]
335
    [% INCLUDE 'datatables.inc' %]
244
    <script>
336
    <script>
245
        var sTable;
337
        var sTable;
246
        $(document).ready(function() {
338
        $(document).ready(function() {
339
            enableSelectedActions();
247
            sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
340
            sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
248
                "dom": 't',
341
                "dom": 't',
342
                "order": [[ 7, "asc" ]],
249
                "columnDefs": [
343
                "columnDefs": [
250
                    { "targets": [ 0 ], "orderable": false, "searchable":  false },
344
                    { 'sortable': false, 'targets': [ 'NoSort' ] },
251
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
345
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
252
                ],
346
                ],
253
                "paginate": false
347
                "paginate": false
254
            }));
348
            }));
255
            sTable.fnAddFilters("filter", "200");
349
            sTable.fnAddFilters("filter", "200");
256
            $('#supplierid').change(function() {
257
                $('#claims').submit();
258
            });
259
350
260
            // Checkboxes : Select All / None
351
            // Checkboxes : Select All / None
261
            $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
352
            $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
262
353
263
            $("#CheckAll").click(function() {
354
            $("#CheckAll").click(function() {
264
                $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
355
                $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
356
                enableSelectedActions();
265
            });
357
            });
266
358
267
            // Generates a dynamic link for exporting the selections data as CSV
359
            // Generates a dynamic link for exporting the selections data as CSV
Lines 300-307 Link Here
300
            $("#filter_claims_form").on("submit",function(){
392
            $("#filter_claims_form").on("submit",function(){
301
                return false;
393
                return false;
302
            });
394
            });
395
396
            $(".select_serial").on("change", function(){
397
                enableSelectedActions();
398
            });
303
        });
399
        });
304
400
401
        function enableSelectedActions() {
402
            var checkedBoxes = $(".select_serial:checked");
403
            if ( checkedBoxes.length ) {
404
                $(".serial_batch_op").prop( "disabled", false );
405
            } else {
406
                $(".serial_batch_op").prop( "disabled", true );
407
            }
408
        }
409
305
        // Checks if the form can be sent (at least one checkbox must be checked)
410
        // Checks if the form can be sent (at least one checkbox must be checked)
306
        function checkForm() {
411
        function checkForm() {
307
            if ($("input:checked").length == 0) {
412
            if ($("input:checked").length == 0) {
308
- 

Return to bug 37094