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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +4 lines)
Lines 2-8 Link Here
2
[% INCLUDE 'blocking_errors.inc' %]
2
[% INCLUDE 'blocking_errors.inc' %]
3
<div id="toolbar" class="btn-toolbar">
3
<div id="toolbar" class="btn-toolbar">
4
4
5
[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_serials_create_subscription ) %]
5
[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_serials_create_subscription || Koha.Preference('CatalogConcerns') ) %]
6
    <div class="btn-group">
6
    <div class="btn-group">
7
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button>
7
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button>
8
        <ul class="dropdown-menu">
8
        <ul class="dropdown-menu">
Lines 23-28 Link Here
23
            [% IF CAN_user_editcatalogue_edit_catalogue && ! EasyAnalyticalRecords %]
23
            [% IF CAN_user_editcatalogue_edit_catalogue && ! EasyAnalyticalRecords %]
24
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber | uri %]">New child record</a></li>
24
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber | uri %]">New child record</a></li>
25
            [% END %]
25
            [% END %]
26
            [% IF Koha.Preference('CatalogConcerns') %]
27
                <li><a id="newconcern" role="button" href="#" data-toggle="modal" data-target="#addConcernModal">New catalog concern</a></li>
28
            [% END %]
26
    </ul>
29
    </ul>
27
    </div>
30
    </div>
28
[% END %]
31
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc (+36 lines)
Line 0 Link Here
1
<!-- Add concern modal -->
2
<div class="modal" id="addConcernModal" tabindex="-1" role="dialog" aria-labelledby="addConcernLabel">
3
    <div class="modal-dialog" role="document">
4
        <div class="modal-content">
5
            <div class="modal-header">
6
                <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
7
                <h4 class="modal-title" id="addConcernLabel">Add concern</h4>
8
            </div>
9
            <div class="modal-body">
10
                <fieldset class="rows">
11
                    <ol>
12
                        [% IF biblionumber %]
13
                        <input type="hidden" id="biblio_add" name="biblio_id" value="[% biblionumber %]">
14
                        [% ELSE %]
15
                        <li>
16
                            <label class="required" for="biblio_id">Biblio: </label>
17
                            <input type="text" name="biblio_id" id="biblio_add">
18
                            <span class="required">Required</span>
19
                        </li>
20
                        [% END %]
21
                        <li>
22
                            <label class="required" for="message">Please describe your concern: </label>
23
                            <textarea id="message_add" name="message" required="required"></textarea>
24
                            <span class="required">Required</span>
25
                            <p id="helpBlock" class="help-block">A short summary of what the library policy is for dealing with such concerns and what constitutes a valid concern</p>
26
                        </li>
27
                    </ol>
28
                </fieldset>
29
            </div> <!-- /.modal-body -->
30
            <div class="modal-footer">
31
                <button type="submit" class="btn btn-default" id="addConfirm">Confirm</button>
32
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
33
            </div> <!-- /.modal-footer -->
34
        </div> <!-- /.modal-content -->
35
    </div> <!-- /.modal-dialog -->
36
</div> <!-- /#addConcernModal -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt (+11 lines)
Lines 82-91 Link Here
82
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
82
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
83
     </div> <!-- /.row -->
83
     </div> <!-- /.row -->
84
84
85
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
86
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
87
    [% END %]
88
85
[% MACRO jsinclude BLOCK %]
89
[% MACRO jsinclude BLOCK %]
86
    [% INCLUDE 'catalog-strings.inc' %]
90
    [% INCLUDE 'catalog-strings.inc' %]
87
    [% Asset.js("js/catalog.js") | $raw %]
91
    [% Asset.js("js/catalog.js") | $raw %]
88
    [% Asset.js("js/browser.js") | $raw %]
92
    [% Asset.js("js/browser.js") | $raw %]
93
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
94
        <script>
95
            /* Set a variable needed by add_catalog_concern.js */
96
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
97
        </script>
98
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
99
    [% END %]
89
    <script>
100
    <script>
90
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
101
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
91
        browser.show();
102
        browser.show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (+10 lines)
Lines 206-216 Link Here
206
206
207
[% END %]
207
[% END %]
208
208
209
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
210
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
211
    [% END %]
209
212
210
[% MACRO jsinclude BLOCK %]
213
[% MACRO jsinclude BLOCK %]
211
    [% INCLUDE 'catalog-strings.inc' %]
214
    [% INCLUDE 'catalog-strings.inc' %]
212
    [% Asset.js("js/catalog.js") | $raw %]
215
    [% Asset.js("js/catalog.js") | $raw %]
213
    [% Asset.js("js/browser.js") | $raw %]
216
    [% Asset.js("js/browser.js") | $raw %]
217
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
218
        <script>
219
            /* Set a variable needed by add_catalog_concern.js */
220
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
221
        </script>
222
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
223
    [% END %]
214
    <script>
224
    <script>
215
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
225
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
216
        browser.show();
226
        browser.show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+11 lines)
Lines 1290-1301 Note that permanent location is a code, and location may be an authval. Link Here
1290
    </div>
1290
    </div>
1291
    [% END %]
1291
    [% END %]
1292
1292
1293
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
1294
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
1295
    [% END %]
1296
1293
[% MACRO jsinclude BLOCK %]
1297
[% MACRO jsinclude BLOCK %]
1294
    [% INCLUDE 'catalog-strings.inc' %]
1298
    [% INCLUDE 'catalog-strings.inc' %]
1295
    [% Asset.js("js/catalog.js") | $raw %]
1299
    [% Asset.js("js/catalog.js") | $raw %]
1296
    [% Asset.js("js/recalls.js") | $raw %]
1300
    [% Asset.js("js/recalls.js") | $raw %]
1297
    [% Asset.js("js/coce.js") | $raw %]
1301
    [% Asset.js("js/coce.js") | $raw %]
1298
    [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1302
    [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1303
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
1304
        <script>
1305
            /* Set a variable needed by add_catalog_concern.js */
1306
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1307
        </script>
1308
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1309
    [% END %]
1299
    <script>
1310
    <script>
1300
        var interface = "[% interface | html %]";
1311
        var interface = "[% interface | html %]";
1301
        var theme = "[% theme | html %]";
1312
        var theme = "[% theme | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (+11 lines)
Lines 130-138 Link Here
130
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
130
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
131
     </div> <!-- /.row -->
131
     </div> <!-- /.row -->
132
132
133
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
134
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
135
    [% END %]
136
133
[% MACRO jsinclude BLOCK %]
137
[% MACRO jsinclude BLOCK %]
134
    [% INCLUDE 'catalog-strings.inc' %]
138
    [% INCLUDE 'catalog-strings.inc' %]
135
    [% Asset.js("js/catalog.js") | $raw %]
139
    [% Asset.js("js/catalog.js") | $raw %]
140
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
141
        <script>
142
            /* Set a variable needed by add_catalog_concern.js */
143
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
144
        </script>
145
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
146
    [% END %]
136
    <script>
147
    <script>
137
        var interface = "[% interface | html %]";
148
        var interface = "[% interface | html %]";
138
        var theme = "[% theme | html %]";
149
        var theme = "[% theme | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (+11 lines)
Lines 92-101 Link Here
92
     </div> <!-- /.row -->
92
     </div> <!-- /.row -->
93
[% END %]
93
[% END %]
94
94
95
[% IF ( Koha.Preference('CatalogConcerns') ) %]
96
[% INCLUDE 'modals/add_catalog_concern.inc' %]
97
[% END %]
98
95
[% MACRO jsinclude BLOCK %]
99
[% MACRO jsinclude BLOCK %]
96
    [% INCLUDE 'catalog-strings.inc' %]
100
    [% INCLUDE 'catalog-strings.inc' %]
97
    [% Asset.js("js/catalog.js") | $raw %]
101
    [% Asset.js("js/catalog.js") | $raw %]
98
    [% Asset.js("js/browser.js") | $raw %]
102
    [% Asset.js("js/browser.js") | $raw %]
103
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
104
        <script>
105
            /* Set a variable needed by add_catalog_concern.js */
106
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
107
        </script>
108
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
109
    [% END %]
99
    <script>
110
    <script>
100
    //<![CDATA[
111
    //<![CDATA[
101
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
112
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+11 lines)
Lines 373-378 Link Here
373
            </aside>
373
            </aside>
374
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
374
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
375
     </div> <!-- /.row -->
375
     </div> <!-- /.row -->
376
     
377
[% IF ( Koha.Preference('CatalogConcerns') ) %]
378
[% INCLUDE 'modals/add_catalog_concern.inc' %]
379
[% END %]
376
380
377
[% MACRO jsinclude BLOCK %]
381
[% MACRO jsinclude BLOCK %]
378
    [% INCLUDE 'catalog-strings.inc' %]
382
    [% INCLUDE 'catalog-strings.inc' %]
Lines 383-388 Link Here
383
    [% Asset.js("js/catalog.js") | $raw %]
387
    [% Asset.js("js/catalog.js") | $raw %]
384
    [% Asset.js("js/browser.js") | $raw %]
388
    [% Asset.js("js/browser.js") | $raw %]
385
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
389
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
390
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
391
        <script>
392
            /* Set a variable needed by add_catalog_concern.js */
393
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
394
        </script>
395
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
396
    [% END %]
386
    <script>
397
    <script>
387
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
398
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
388
        browser.show();
399
        browser.show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt (-57 / +2 lines)
Lines 65-102 Link Here
65
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
65
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
66
        </div> <!-- /.row -->
66
        </div> <!-- /.row -->
67
67
68
        <!-- Add concern modal -->
68
        [% INCLUDE 'modals/add_catalog_concern.inc' %]
69
        <div class="modal" id="addConcernModal" tabindex="-1" role="dialog" aria-labelledby="addConcernLabel">
70
            <div class="modal-dialog" role="document">
71
                <div class="modal-content">
72
                    <div class="modal-header">
73
                        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
74
                        <h4 class="modal-title" id="addConcernLabel">Add concern</h4>
75
                    </div>
76
                    <div class="modal-body">
77
                        <fieldset class="rows">
78
                            <ol>
79
                                <li>
80
                                    <label class="required" for="biblio_id">Biblio: </label>
81
                                    <input type="text" name="biblio_id" id="biblio_add">
82
                                    <span class="required">Required</span>
83
                                </li>
84
                                <li>
85
                                    <label class="required" for="message">Please describe your concern: </label>
86
                                    <textarea id="message_add" name="message" required="required"></textarea>
87
                                    <span class="required">Required</span>
88
                                    <p id="helpBlock" class="help-block">A short summary of what the library policy is for dealing with such concerns and what constitutes a valid concern</p>
89
                                </li>
90
                            </ol>
91
                        </fieldset>
92
                    </div> <!-- /.modal-body -->
93
                    <div class="modal-footer">
94
                        <button type="submit" class="btn btn-default" id="addConfirm">Confirm</button>
95
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
96
                    </div> <!-- /.modal-footer -->
97
                </div> <!-- /.modal-content -->
98
            </div> <!-- /.modal-dialog -->
99
        </div> <!-- /#addConcernModal -->
100
69
101
        <!-- Resolve concern modal -->
70
        <!-- Resolve concern modal -->
102
        <div class="modal" id="resolveConcernModal" tabindex="-1" role="dialog" aria-labelledby="resolveConcernLabel">
71
        <div class="modal" id="resolveConcernModal" tabindex="-1" role="dialog" aria-labelledby="resolveConcernLabel">
Lines 137-142 Link Here
137
    [% INCLUDE 'js-date-format.inc' %]
106
    [% INCLUDE 'js-date-format.inc' %]
138
    [% INCLUDE 'js-patron-format.inc' %]
107
    [% INCLUDE 'js-patron-format.inc' %]
139
    [% INCLUDE 'js-biblio-format.inc' %]
108
    [% INCLUDE 'js-biblio-format.inc' %]
109
    [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
140
    <script>
110
    <script>
141
        $(document).ready(function() {
111
        $(document).ready(function() {
142
112
Lines 262-292 Link Here
262
                    $("#concern_resolve_error").html(_("Error resolving concern #%s. Check the logs.").format(concern_id)).show();
232
                    $("#concern_resolve_error").html(_("Error resolving concern #%s. Check the logs.").format(concern_id)).show();
263
                });
233
                });
264
            });
234
            });
265
266
            $('#addConcernModal').on('click', '#addConfirm', function(e) {
267
                let biblio_id = $('#biblio_add').val();
268
                let message = $('#message_add').val();
269
270
                params = {
271
                    message: message,
272
                    biblio_id: biblio_id,
273
                    reporter_id: logged_in_user_borrowernumber,
274
                };
275
276
                $.ajax({
277
                    url: '/api/v1/catalog/concerns',
278
                    type: 'POST',
279
                    data: JSON.stringify(params),
280
                    success: function(data) {
281
                        $('#AddConcernModal').modal('hide');
282
283
                        if ( $.fn.dataTable.isDataTable("#table_concerns") ) {
284
                            $("#table_concerns").DataTable().ajax.reload();
285
                        }
286
                    },
287
                    contentType: "json"
288
                });
289
            });
290
        });
235
        });
291
    </script>
236
    </script>
292
[% END %]
237
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +11 lines)
Lines 1347-1352 Link Here
1347
    </div> <!-- /#bundleMissingModal -->
1347
    </div> <!-- /#bundleMissingModal -->
1348
    [% END %]
1348
    [% END %]
1349
1349
1350
[% IF ( Koha.Preference('CatalogConcerns') ) %]
1351
[% INCLUDE 'modals/add_catalog_concern.inc' %]
1352
[% END %]
1353
1350
[% MACRO jsinclude BLOCK %]
1354
[% MACRO jsinclude BLOCK %]
1351
    [% INCLUDE 'datatables.inc' %]
1355
    [% INCLUDE 'datatables.inc' %]
1352
    [% INCLUDE 'columns_settings.inc' %]
1356
    [% INCLUDE 'columns_settings.inc' %]
Lines 1359-1365 Link Here
1359
        </script>
1363
        </script>
1360
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1364
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1361
    [% END %]
1365
    [% END %]
1362
1366
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
1367
        <script>
1368
            /* Set a variable needed by add_catalog_concern.js */
1369
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1370
        </script>
1371
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1372
    [% END %]
1363
    <script>
1373
    <script>
1364
        function Dopop(link) {
1374
        function Dopop(link) {
1365
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1375
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/add_catalog_concern.js (-1 / +26 lines)
Line 0 Link Here
0
- 
1
$(document).ready(function() {
2
    $('#addConcernModal').on('click', '#addConfirm', function(e) {
3
        let biblio_id = $('#biblio_add').val();
4
        let message = $('#message_add').val();
5
6
        let params = {
7
            message: message,
8
            biblio_id: biblio_id,
9
            reporter_id: logged_in_user_borrowernumber,
10
        };
11
12
        $.ajax({
13
            url: '/api/v1/catalog/concerns',
14
            type: 'POST',
15
            data: JSON.stringify(params),
16
            success: function(data) {
17
                $('#addConcernModal').modal('hide');
18
19
                if ($.fn.dataTable.isDataTable("#table_concerns")) {
20
                    $("#table_concerns").DataTable().ajax.reload();
21
                }
22
            },
23
            contentType: "json"
24
        });
25
    });
26
});

Return to bug 31028