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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-191 / +206 lines)
Lines 4-10 Link Here
4
[% USE Branches %]
4
[% USE Branches %]
5
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
    <title>[% IF ( supplierid ) -%] Claims for [% suppliername | html %] [% END %] &rsaquo; Claims &rsaquo; Serials &rsaquo; Koha</title>
7
    <title>[% IF ( supplierid ) -%] Claims for [% suppliername | html %] &rsaquo; [% END %] Claims &rsaquo; Serials &rsaquo; Koha</title>
8
    [% INCLUDE 'doc-head-close.inc' %]
8
    [% INCLUDE 'doc-head-close.inc' %]
9
</head>
9
</head>
10
10
Lines 44-217 Link Here
44
        <div class="col-sm-10 col-sm-push-2">
44
        <div class="col-sm-10 col-sm-push-2">
45
            <main>
45
            <main>
46
46
47
    <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
47
                <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
48
48
49
    [% IF error_claim %]
49
                [% IF error_claim %]
50
        [% IF error_claim == 'no_vendor_email' %]
50
                    [% IF error_claim == 'no_vendor_email' %]
51
            <div class="dialog alert">This vendor has no email defined for late issues.</div>
51
                        <div class="dialog alert">This vendor has no email defined for late issues.</div>
52
        [% ELSIF error_claim == 'bad_or_missing_sender' %]
52
                    [% ELSIF error_claim == 'bad_or_missing_sender' %]
53
            <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
53
                        <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
54
        [% ELSE %]
54
                    [% ELSE %]
55
            <div class="dialog alert">[% error_claim | html %]</div>
55
                        <div class="dialog alert">[% error_claim | html %]</div>
56
        [% END %]
56
                    [% END %]
57
    [% END %]
57
                [% END %]
58
    [% IF info_claim %]
58
                [% IF info_claim %]
59
        <div class="dialog message">Email has been sent.</div>
59
                    <div class="dialog message">Email has been sent.</div>
60
    [% END %]
60
                [% END %]
61
62
[% IF letters %][% UNLESS ( missingissues ) %][% IF ( supplierid ) %] <div class="dialog alert">No missing issues found.</div>[% ELSE %]<div class="dialog message">Please choose a vendor.</div>[% END %][% END %][% END %]
63
	
64
	     [% IF ( SHOWCONFIRMATION ) %]
65
     <div class="dialog alert">Your notification has been sent.</div>
66
     [% END %]
67
[% UNLESS letters %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
68
    <form id="claims" name="claims" action="claims.pl" method="post">
69
    <fieldset>
70
	    <label for="supplierid">Vendor: </label>
71
	    <select id="supplierid" name="supplierid">
72
	        [% FOREACH suploo IN suploop %]
73
	            [% IF ( suploo.selected ) %]
74
	            <option value="[% suploo.id | html %]" selected="selected" >
75
	            [% ELSE %]
76
	            <option value="[% suploo.id | html %]">
77
	            [% END %]
78
	                [% suploo.name | html %]
79
	                ([% suploo.count | html %])
80
	            </option>
81
	        [% END %]
82
	    </select>
83
        <input type="submit" value="OK" />
84
    </fieldset>
85
</form>
86
87
   [% IF ( missingissues ) %]	
88
    <h3>Missing issues</h3>
89
    <form action="claims.pl" id="filter_claims_form">
90
	<fieldset class="rows">
91
	<legend>Filters :</legend>
92
	
93
	<ol>
94
	<li>
95
        <label for="from">From:</label>
96
        <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
97
        <label for="to" style="float:none;">To:</label>
98
        <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
99
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
100
        <input id="filterByDate" type="button" value="OK" />
101
        <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
102
    </li>
103
	</ol>
104
	</fieldset>
105
    </form>
106
61
107
    <fieldset>
62
                [% IF letters %]
108
        <form action="claims.pl" method="post" id="claims_form">
63
                    [% UNLESS ( missingissues ) %]
109
            <table id="claimst">
64
                        [% IF ( supplierid ) %]
110
                <thead>
65
                            <div class="dialog alert">No missing issues found.</div>
111
                    <tr>
66
                        [% ELSE %]
112
                        <th><input type="checkbox" id="CheckAll"></th>
67
                            <div class="dialog message">Please choose a vendor.</div>
113
                        <th>Vendor</th>
114
                        <th>Library</th>
115
                        <th class="anti-the">Title</th>
116
                        <th>ISSN</th>
117
                        <th>Issue number</th>
118
                        <th>Status</th>
119
                        <th>Since</th>
120
                        <th>Claims count</th>
121
                        <th>Claim date</th>
122
                        [% FOR field IN additional_fields_for_subscription %]
123
                          <th>[% field.name | html %]</th>
124
                        [% END %]
68
                        [% END %]
125
                    </tr>
126
                </thead>
127
                <tfoot>
128
                  <tr>
129
                    <td></td>
130
                    <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
131
                    <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
132
                    <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
133
                    <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
134
                    <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
135
                    <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
136
                    <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
137
                    <td><input type="text" class="filter" data-column_num="8" placeholder="Search claim count" /></td>
138
                    <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim date" /></td>
139
                    [% FOR field IN additional_fields_for_subscription %]
140
                      <td><input type="text" class="filter" data-column_num="[% loop.count + 9 | html %]" placeholder="Search [% field.name | html %]" /></td>
141
                    [% END %]
69
                    [% END %]
142
                  </tr>
70
                [% END %]
143
                </tfoot>
144
                <tbody>[% FOREACH missingissue IN missingissues %]
145
                    <tr>
146
                        <td>
147
                          [% UNLESS missingissue.cannot_claim %]
148
                            <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
149
                          [% END %]
150
                        </td>
151
                        <td>[% missingissue.name | html %]</td>
152
                        <td>
153
                            <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
154
                        </td>
155
                        <td>
156
                        <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
157
                        </td>
158
                        <td>[% missingissue.issn | html %]</td>
159
                        <td>[% missingissue.serialseq | html %]</td>
160
                        <td>
161
                            [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
162
                            [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
163
                            [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
164
                            [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
165
                            [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
166
                            [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
167
                            [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
168
                            [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
169
                        </td>
170
                        <td class="planneddate" data-order="[% missingissue.planneddateISO | html %]">
171
                            [% missingissue.planneddate | html %]
172
                        </td>
173
                        <td>[% missingissue.claims_count | html %]</td>
174
                        <td data-order="[% missingissue.claimdateISO | html %]">
175
                            [% missingissue.claimdate | html %]
176
                        </td>
177
                        [% FOR field IN additional_fields_for_subscription %]
178
                          [% IF field.authorised_value_category %]
179
                            <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
180
                          [% ELSE %]
181
                            <td>[% missingissue.additional_fields.${field.name} | html %]</td>
182
                          [% END %]
183
                        [% END %]
184
                    </tr>
185
                [% END %]</tbody>
186
            </table>
187
71
188
            [% IF csv_profiles.count %]
72
                [% IF ( SHOWCONFIRMATION ) %]
189
              <fieldset class="action">
73
                    <div class="dialog alert">Your notification has been sent.</div>
190
                <label for="csv_code">Select CSV profile:</label>
74
                [% END %]
191
                <select id="csv_profile_for_export">
192
                  [% FOR csv IN csv_profiles %]
193
                    <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
194
                   [% END %]
195
                </select>
196
                <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
197
            [% END %]
198
75
199
            [% IF letters %]
76
                [% UNLESS letters %]
200
                <fieldset class="action">
77
                    <div class="dialog alert">
201
                    <label for="letter_code">Select notice:</label>
78
                        No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.
202
                    <select name="letter_code" id="letter_code">
79
                    </div>
203
                        [% FOREACH letter IN letters %]
80
                [% END %]
204
                            <option value="[% letter.code | html %]">[% letter.name | html %]</option>
81
205
                        [% END %]
82
                <form id="claims" name="claims" action="claims.pl" method="post">
206
                    </select>
83
                    <fieldset>
207
                    <input type="hidden" name="op" value="send_alert" />
84
                        <label for="supplierid">Vendor: </label>
208
                    <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
85
                        <select id="supplierid" name="supplierid">
209
                    <input type="submit" name="submit" class="button" value="Send notification" />
86
                            [% FOREACH suploo IN suploop %]
210
                </fieldset>
87
                                [% IF ( suploo.selected ) %]
211
            [% END %]
88
                                    <option value="[% suploo.id | html %]" selected="selected" >
212
        </form>
89
                                [% ELSE %]
213
    </fieldset>
90
                                    <option value="[% suploo.id | html %]">
214
[% END %]
91
                                [% END %]
92
                                    [% suploo.name | html %]
93
                                    ([% suploo.count | html %])
94
                                </option>
95
                            [% END %]
96
                        </select>
97
                        <input type="submit" value="OK" />
98
                    </fieldset>
99
                </form>
100
101
                [% IF ( missingissues ) %]
102
                    <h3>Missing issues</h3>
103
                    <form action="claims.pl" id="filter_claims_form">
104
                        <fieldset class="rows">
105
                            <legend>Filters :</legend>
106
                            <ol>
107
                                <li>
108
                                    <label for="from">From:</label>
109
                                    <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
110
                                    <label for="to" style="float:none;">To:</label>
111
                                    <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
112
                                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
113
                                    <input id="filterByDate" type="button" value="OK" />
114
                                    <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
115
                                </li>
116
                            </ol>
117
                        </fieldset>
118
                    </form>
119
120
                    <fieldset>
121
                        <form action="claims.pl" method="post" id="claims_form">
122
                            <table id="claimst">
123
                                <thead>
124
                                    <tr>
125
                                        <th><input type="checkbox" id="CheckAll"></th>
126
                                        <th>Vendor</th>
127
                                        <th>Library</th>
128
                                        <th class="anti-the">Title</th>
129
                                        <th>ISSN</th>
130
                                        <th>Issue number</th>
131
                                        <th>Status</th>
132
                                        <th>Since</th>
133
                                        <th>Claims count</th>
134
                                        <th>Claim date</th>
135
                                        [% FOR field IN additional_fields_for_subscription %]
136
                                        <th>[% field.name | html %]</th>
137
                                        [% END %]
138
                                    </tr>
139
                                </thead>
140
                                <tbody>
141
                                    [% FOREACH missingissue IN missingissues %]
142
                                        <tr>
143
                                            <td>
144
                                            [% UNLESS missingissue.cannot_claim %]
145
                                                <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
146
                                            [% END %]
147
                                            </td>
148
                                            <td>[% missingissue.name | html %]</td>
149
                                            <td>
150
                                                <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
151
                                            </td>
152
                                            <td>
153
                                                <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
154
                                            </td>
155
                                            <td>[% missingissue.issn | html %]</td>
156
                                            <td>[% missingissue.serialseq | html %]</td>
157
                                            <td>
158
                                                [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
159
                                                [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
160
                                                [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
161
                                                [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
162
                                                [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
163
                                                [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
164
                                                [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
165
                                                [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
166
                                            </td>
167
                                            <td class="planneddate" data-order="[% missingissue.planneddateISO | html %]">
168
                                                [% missingissue.planneddate | html %]
169
                                            </td>
170
                                            <td>[% missingissue.claims_count | html %]</td>
171
                                            <td data-order="[% missingissue.claimdateISO | html %]">
172
                                                [% missingissue.claimdate | html %]
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 %]
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 claim count" /></td>
195
                                        <td><input type="text" class="filter" data-column_num="9" 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 + 9 | html %]" placeholder="Search [% field.name | html %]" /></td>
198
                                        [% END %]
199
                                    </tr>
200
                                </tfoot>
201
                            </table>
202
203
                            [% IF csv_profiles.count %]
204
                                <fieldset class="action">
205
                                    <label for="csv_code">Select CSV profile:</label>
206
                                    <select id="csv_profile_for_export">
207
                                        [% FOR csv IN csv_profiles %]
208
                                            <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
209
                                        [% END %]
210
                                    </select>
211
                                    <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
212
                                </fieldset>
213
                            [% END %]
214
215
                            [% IF letters %]
216
                                <fieldset class="action">
217
                                    <label for="letter_code">Select notice:</label>
218
                                    <select name="letter_code" id="letter_code">
219
                                        [% FOREACH letter IN letters %]
220
                                            <option value="[% letter.code | html %]">[% letter.name | html %]</option>
221
                                        [% END %]
222
                                    </select>
223
                                    <input type="hidden" name="op" value="send_alert" />
224
                                    <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
225
                                    <input type="submit" name="submit" class="button" value="Send notification" />
226
                                </fieldset>
227
                            [% END %]
228
                        </form>
229
                    </fieldset>
230
                [% END %]
215
231
216
            </main>
232
            </main>
217
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
233
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
Lines 231-240 Link Here
231
        $(document).ready(function() {
247
        $(document).ready(function() {
232
            sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
248
            sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
233
                "sDom": 't',
249
                "sDom": 't',
234
                    "aoColumnDefs": [
250
                "aoColumnDefs": [
235
                        { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
251
                    { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
236
                        { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
252
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
237
                    ],
253
                ],
238
                "bPaginate": false
254
                "bPaginate": false
239
            }));
255
            }));
240
            sTable.fnAddFilters("filter", "200");
256
            sTable.fnAddFilters("filter", "200");
Lines 254-273 Link Here
254
                // We need to use "input[name=serialid]:checked" instead of "input:checked". Otherwise, the "check all" box will pass the value of "on" as a serialid, which produces a SQL error.
270
                // We need to use "input[name=serialid]:checked" instead of "input:checked". Otherwise, the "check all" box will pass the value of "on" as a serialid, which produces a SQL error.
255
                var selected = $("input[name=serialid]:checked");
271
                var selected = $("input[name=serialid]:checked");
256
272
257
            if (selected.length == 0) {
273
                if (selected.length == 0) {
258
                alert(_("Please select at least one item to export."));
274
                    alert(_("Please select at least one item to export."));
259
                return false;
275
                    return false;
260
            }
276
                }
261
277
262
            // Building the url from currently checked boxes
278
                // Building the url from currently checked boxes
263
            var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&amp;op=claims';
279
                var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&amp;op=claims';
264
            for (var i = 0; i < selected.length; i++) {
280
                for (var i = 0; i < selected.length; i++) {
265
                url += '&amp;serialid=' + selected[i].value;
281
                    url += '&amp;serialid=' + selected[i].value;
266
            }
282
                }
267
            url += '&amp;csv_profile=' + $("#csv_profile_for_export option:selected").val();
283
                url += '&amp;csv_profile=' + $("#csv_profile_for_export option:selected").val();
268
            // And redirecting to the CSV page
284
                // And redirecting to the CSV page
269
            location.href = url;
285
                location.href = url;
270
            return false;
286
                return false;
271
            });
287
            });
272
            $("#filterByDate").on("click",function(e){
288
            $("#filterByDate").on("click",function(e){
273
                e.preventDefault();
289
                e.preventDefault();
Lines 284-296 Link Here
284
            $("#filter_claims_form").on("submit",function(){
300
            $("#filter_claims_form").on("submit",function(){
285
                return false;
301
                return false;
286
            });
302
            });
287
         });
303
        });
288
304
289
        // Checks if the form can be sent (at least one checkbox must be checked)
305
        // Checks if the form can be sent (at least one checkbox must be checked)
290
        function checkForm() {
306
        function checkForm() {
291
            if ($("input:checked").length == 0) {
307
            if ($("input:checked").length == 0) {
292
            alert(_("Please select at least one issue."));
308
                alert(_("Please select at least one issue."));
293
            return false;
309
                return false;
294
            }
310
            }
295
        }
311
        }
296
312
Lines 325-338 Link Here
325
            // For each date in the table
341
            // For each date in the table
326
            $(".planneddate").each(function() {
342
            $(".planneddate").each(function() {
327
343
328
            // We make a JS Date Object, according to the locale
344
                // We make a JS Date Object, according to the locale
329
            var pdate = Date_from_syspref($(this).text()).getTime();
345
                var pdate = Date_from_syspref($(this).text()).getTime();
330
346
331
            // And checks if the date is between the beginning and ending dates
347
                // And checks if the date is between the beginning and ending dates
332
            if (pdate > beginDate &&
348
                if (pdate > beginDate &&
333
                pdate < endDate) {
349
                    pdate < endDate) {
334
                // If so, we can show the row
350
                    // If so, we can show the row
335
                $(this).parent().show();
351
                    $(this).parent().show();
336
                }
352
                }
337
            });
353
            });
338
        }
354
        }
339
- 

Return to bug 30609