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

(-)a/installer/data/mysql/atomicupdate/bug_31028.pl (+8 lines)
Lines 125-129 return { Link Here
125
            }
125
            }
126
        );
126
        );
127
        say $out "Added new notice 'TICKET_NOTIFY'";
127
        say $out "Added new notice 'TICKET_NOTIFY'";
128
129
        $dbh->do(
130
            q{
131
                INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
132
	            ('CatalogConcerns', '0', NULL, 'Allow users to report catalog concerns', 'YesNo')
133
	        }
134
        );
135
        say $out "`CatalogConcerns` preference added";
128
    }
136
    }
129
}
137
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 131-136 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
131
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
131
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
132
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
132
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
133
('casServerVersion','2', '2|3','Version of the CAS server Koha will connect to.','Choice'),
133
('casServerVersion','2', '2|3','Version of the CAS server Koha will connect to.','Choice'),
134
('CatalogConcerns', '0', NULL, 'Allow users to report catalog concerns', 'YesNo'),
134
('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free'),
135
('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free'),
135
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
136
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
136
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
137
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc (-2 / +2 lines)
Lines 29-35 Link Here
29
        </ul>
29
        </ul>
30
        [% END %]
30
        [% END %]
31
31
32
        [% IF ( CAN_user_tools_inventory || ( Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue ) ) %]
32
        [% IF ( CAN_user_tools_inventory || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) ) %]
33
        <h5>Reports</h5>
33
        <h5>Reports</h5>
34
        <ul>
34
        <ul>
35
            [% IF ( CAN_user_tools_inventory ) %]
35
            [% IF ( CAN_user_tools_inventory ) %]
Lines 37-43 Link Here
37
                <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
37
                <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
38
            </li>
38
            </li>
39
            [% END %]
39
            [% END %]
40
            [% IF Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue %]
40
            [% IF ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue %]
41
            <li>
41
            <li>
42
                <a href="/cgi-bin/koha/cataloguing/concerns.pl">Catalog concerns</a>
42
                <a href="/cgi-bin/koha/cataloguing/concerns.pl">Catalog concerns</a>
43
            </li>
43
            </li>
(-)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 (+49 lines)
Line 0 Link Here
1
[% USE AdditionalContents %]
2
[% SET CatalogConcernHelp = AdditionalContents.get( location => "CatalogConcernHelp", lang => lang, library => logged_in_user.branchcode ) %]
3
[% SET CatalogConcernTemplate = AdditionalContents.get( location => "CatalogConcernTemplate", lang => lang, library => logged_in_user.branchcode ) %]
4
<!-- Add concern modal -->
5
<div class="modal" id="addConcernModal" tabindex="-1" role="dialog" aria-labelledby="addConcernModalLabel" aria-hidden="true">
6
    <div class="modal-dialog modal-lg" role="document">
7
        <div class="modal-content modal-lg">
8
            <div class="modal-header">
9
                <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
10
                    <span aria-hidden="true">&times;</span>
11
                </button>
12
                <h4 class="modal-title" id="addConcernModalLabel">Add concern</h4>
13
            </div>
14
            <div class="modal-body">
15
                <fieldset id="concern_fieldset">
16
                    <ol>
17
                        <li class="form-group row">
18
                            <label for="concern_title" class="col-sm-1 col-form-label">Title: </label>
19
                            <div class="col-sm-11">
20
                                <input type="text" name="concern_title" id="concern_title" class="form-control" required="required"/>
21
                            </div>
22
                        </li>
23
                        <li class="form-group">
24
                            <label class="required" for="concern_body">Please describe your concern: </label>
25
                            <textarea class="form-control" id="concern_body" name="concern_body" required="required" rows="15"></textarea>
26
                            [%- IF CatalogConcernHelp && CatalogConcernHelp.content && CatalogConcernHelp.content.count > 0 -%]
27
                            [%- FOREACH help IN CatalogConcernHelp.content -%]
28
                            <p id="helpBlock" class="help-block">[%- help.content | $raw -%]</p>
29
                            [%- END -%]
30
                            [%- END -%]
31
                            <div class="hidden" id="concern_template">
32
                            [%- IF CatalogConcernTemplate && CatalogConcernTemplate.content && CatalogConcernTemplate.content.count > 0 -%]
33
                            [%- FOREACH template IN CatalogConcernTemplate.content -%]
34
                            [%- template.content | $raw -%]
35
                            [%- END -%]
36
                            [%- END -%]
37
                            </div>
38
                        </li>
39
                    </ol>
40
                </fieldset>
41
            </div> <!-- /.modal-body -->
42
            <div class="modal-footer">
43
                <input type="hidden" id="concern_biblio" name="biblio_id" value="[% biblionumber %]">
44
                <button type="submit" class="btn btn-primary" id="addConfirm">Submit <i id="concern-submit-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
45
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
46
            </div> <!-- /.modal-footer -->
47
        </div> <!-- /.modal-content -->
48
    </div> <!-- /.modal-dialog -->
49
</div> <!-- /#addConcernModal -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+8 lines)
Lines 42-47 Cataloging: Link Here
42
                  1: "Allow"
42
                  1: "Allow"
43
                  0: "Don't allow"
43
                  0: "Don't allow"
44
            - authorized values to be created within the cataloguing module. Librarian will need the manage_auth_values subpermission.
44
            - authorized values to be created within the cataloguing module. Librarian will need the manage_auth_values subpermission.
45
        -
46
            - pref: CatalogConcerns
47
              default: 0
48
              choices:
49
                  0: "Don't allow"
50
                  1: Allow
51
            - "staff to report concerns about catalog records."
52
            - '<p><strong>Note:</strong> You can also enable `<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacCatalogConcerns">OpacCatalogConcerns</a>` to allow OPAC users the same option.</p>'
45
        -
53
        -
46
            - "Use "
54
            - "Use "
47
            - pref: CatalogerEmails
55
            - pref: CatalogerEmails
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+1 lines)
Lines 342-347 OPAC: Link Here
342
                  0: "Don't allow"
342
                  0: "Don't allow"
343
                  1: Allow
343
                  1: Allow
344
            - "OPAC users to report concerns about catalog records."
344
            - "OPAC users to report concerns about catalog records."
345
            - '<p><strong>Note:</strong> Enabling `<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CatalogConcerns">CatalogConcerns</a>` will allow concern submissions from the staff client.</p>'
345
        -
346
        -
346
            - pref: OPACReportProblem
347
            - pref: OPACReportProblem
347
              choices:
348
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt (+11 lines)
Lines 85-94 Link Here
85
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
85
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
86
     </div> <!-- /.row -->
86
     </div> <!-- /.row -->
87
87
88
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
89
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
90
    [% END %]
91
88
[% MACRO jsinclude BLOCK %]
92
[% MACRO jsinclude BLOCK %]
89
    [% INCLUDE 'catalog-strings.inc' %]
93
    [% INCLUDE 'catalog-strings.inc' %]
90
    [% Asset.js("js/catalog.js") | $raw %]
94
    [% Asset.js("js/catalog.js") | $raw %]
91
    [% Asset.js("js/browser.js") | $raw %]
95
    [% Asset.js("js/browser.js") | $raw %]
96
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
97
        <script>
98
            /* Set a variable needed by add_catalog_concern.js */
99
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
100
        </script>
101
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
102
    [% END %]
92
    <script>
103
    <script>
93
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
104
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
94
        browser.show();
105
        browser.show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (+10 lines)
Lines 209-219 Link Here
209
209
210
[% END %]
210
[% END %]
211
211
212
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
213
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
214
    [% END %]
212
215
213
[% MACRO jsinclude BLOCK %]
216
[% MACRO jsinclude BLOCK %]
214
    [% INCLUDE 'catalog-strings.inc' %]
217
    [% INCLUDE 'catalog-strings.inc' %]
215
    [% Asset.js("js/catalog.js") | $raw %]
218
    [% Asset.js("js/catalog.js") | $raw %]
216
    [% Asset.js("js/browser.js") | $raw %]
219
    [% Asset.js("js/browser.js") | $raw %]
220
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
221
        <script>
222
            /* Set a variable needed by add_catalog_concern.js */
223
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
224
        </script>
225
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
226
    [% END %]
217
    <script>
227
    <script>
218
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
228
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
219
        browser.show();
229
        browser.show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+11 lines)
Lines 1304-1315 Note that permanent location is a code, and location may be an authval. Link Here
1304
    </div>
1304
    </div>
1305
    [% END %]
1305
    [% END %]
1306
1306
1307
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
1308
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
1309
    [% END %]
1310
1307
[% MACRO jsinclude BLOCK %]
1311
[% MACRO jsinclude BLOCK %]
1308
    [% INCLUDE 'catalog-strings.inc' %]
1312
    [% INCLUDE 'catalog-strings.inc' %]
1309
    [% Asset.js("js/catalog.js") | $raw %]
1313
    [% Asset.js("js/catalog.js") | $raw %]
1310
    [% Asset.js("js/recalls.js") | $raw %]
1314
    [% Asset.js("js/recalls.js") | $raw %]
1311
    [% Asset.js("js/coce.js") | $raw %]
1315
    [% Asset.js("js/coce.js") | $raw %]
1312
    [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1316
    [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1317
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
1318
        <script>
1319
            /* Set a variable needed by add_catalog_concern.js */
1320
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1321
        </script>
1322
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1323
    [% END %]
1313
    <script>
1324
    <script>
1314
        var interface = "[% interface | html %]";
1325
        var interface = "[% interface | html %]";
1315
        var theme = "[% theme | html %]";
1326
        var theme = "[% theme | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (+11 lines)
Lines 133-141 Link Here
133
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
133
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
134
     </div> <!-- /.row -->
134
     </div> <!-- /.row -->
135
135
136
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
137
    [% INCLUDE 'modals/add_catalog_concern.inc' %]
138
    [% END %]
139
136
[% MACRO jsinclude BLOCK %]
140
[% MACRO jsinclude BLOCK %]
137
    [% INCLUDE 'catalog-strings.inc' %]
141
    [% INCLUDE 'catalog-strings.inc' %]
138
    [% Asset.js("js/catalog.js") | $raw %]
142
    [% Asset.js("js/catalog.js") | $raw %]
143
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
144
        <script>
145
            /* Set a variable needed by add_catalog_concern.js */
146
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
147
        </script>
148
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
149
    [% END %]
139
    <script>
150
    <script>
140
        var interface = "[% interface | html %]";
151
        var interface = "[% interface | html %]";
141
        var theme = "[% theme | html %]";
152
        var theme = "[% theme | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (+11 lines)
Lines 95-104 Link Here
95
     </div> <!-- /.row -->
95
     </div> <!-- /.row -->
96
[% END %]
96
[% END %]
97
97
98
[% IF ( Koha.Preference('CatalogConcerns') ) %]
99
[% INCLUDE 'modals/add_catalog_concern.inc' %]
100
[% END %]
101
98
[% MACRO jsinclude BLOCK %]
102
[% MACRO jsinclude BLOCK %]
99
    [% INCLUDE 'catalog-strings.inc' %]
103
    [% INCLUDE 'catalog-strings.inc' %]
100
    [% Asset.js("js/catalog.js") | $raw %]
104
    [% Asset.js("js/catalog.js") | $raw %]
101
    [% Asset.js("js/browser.js") | $raw %]
105
    [% Asset.js("js/browser.js") | $raw %]
106
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
107
        <script>
108
            /* Set a variable needed by add_catalog_concern.js */
109
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
110
        </script>
111
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
112
    [% END %]
102
    <script>
113
    <script>
103
    //<![CDATA[
114
    //<![CDATA[
104
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
115
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+11 lines)
Lines 389-394 Link Here
389
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
389
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
390
     </div> <!-- /.row -->
390
     </div> <!-- /.row -->
391
391
392
[% IF ( Koha.Preference('CatalogConcerns') ) %]
393
[% INCLUDE 'modals/add_catalog_concern.inc' %]
394
[% END %]
395
392
[% MACRO jsinclude BLOCK %]
396
[% MACRO jsinclude BLOCK %]
393
    [% INCLUDE 'catalog-strings.inc' %]
397
    [% INCLUDE 'catalog-strings.inc' %]
394
    [% INCLUDE 'modals/checkout_renewals.inc' %]
398
    [% INCLUDE 'modals/checkout_renewals.inc' %]
Lines 398-403 Link Here
398
    [% Asset.js("js/catalog.js") | $raw %]
402
    [% Asset.js("js/catalog.js") | $raw %]
399
    [% Asset.js("js/browser.js") | $raw %]
403
    [% Asset.js("js/browser.js") | $raw %]
400
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
404
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
405
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
406
        <script>
407
            /* Set a variable needed by add_catalog_concern.js */
408
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
409
        </script>
410
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
411
    [% END %]
401
    <script>
412
    <script>
402
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
413
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
403
        browser.show();
414
        browser.show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt (-2 / +2 lines)
Lines 91-97 Link Here
91
                        </ul>
91
                        </ul>
92
                        [% END %]
92
                        [% END %]
93
93
94
                        [% IF ( CAN_user_tools_inventory || ( Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue ) ) %]
94
                        [% IF ( CAN_user_tools_inventory || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) ) %]
95
                        <h3>Reports</h3>
95
                        <h3>Reports</h3>
96
                        <ul class="buttons-list">
96
                        <ul class="buttons-list">
97
                            [% IF ( CAN_user_tools_inventory ) %]
97
                            [% IF ( CAN_user_tools_inventory ) %]
Lines 100-106 Link Here
100
                            </li>
100
                            </li>
101
                            [% END %]
101
                            [% END %]
102
102
103
                            [% IF ( Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue ) %]
103
                            [% IF ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
104
                            <li>
104
                            <li>
105
                                <a class="circ-button" href="/cgi-bin/koha/cataloguing/concerns.pl"><i class="fa fa-list-ul"></i> Catalog concerns</a>
105
                                <a class="circ-button" href="/cgi-bin/koha/cataloguing/concerns.pl"><i class="fa fa-list-ul"></i> Catalog concerns</a>
106
                            </li>
106
                            </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +11 lines)
Lines 1364-1369 Link Here
1364
    </div> <!-- /#bundleMissingModal -->
1364
    </div> <!-- /#bundleMissingModal -->
1365
    [% END %]
1365
    [% END %]
1366
1366
1367
[% IF ( Koha.Preference('CatalogConcerns') ) %]
1368
[% INCLUDE 'modals/add_catalog_concern.inc' %]
1369
[% END %]
1370
1367
[% MACRO jsinclude BLOCK %]
1371
[% MACRO jsinclude BLOCK %]
1368
    [% INCLUDE 'datatables.inc' %]
1372
    [% INCLUDE 'datatables.inc' %]
1369
    [% INCLUDE 'columns_settings.inc' %]
1373
    [% INCLUDE 'columns_settings.inc' %]
Lines 1376-1382 Link Here
1376
        </script>
1380
        </script>
1377
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1381
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1378
    [% END %]
1382
    [% END %]
1379
1383
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
1384
        <script>
1385
            /* Set a variable needed by add_catalog_concern.js */
1386
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1387
        </script>
1388
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1389
    [% END %]
1380
    <script>
1390
    <script>
1381
        function Dopop(link) {
1391
        function Dopop(link) {
1382
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1392
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-2 / +2 lines)
Lines 177-183 Link Here
177
                <div class="row">
177
                <div class="row">
178
                    <div class="col-sm-12">
178
                    <div class="col-sm-12">
179
                        [%# Following statement must be in one line for translatability %]
179
                        [%# Following statement must be in one line for translatability %]
180
                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( Koha.preference('OpacCatalogConcerns') && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %]
180
                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %]
181
                            <div id="area-pending" class="page-section">
181
                            <div id="area-pending" class="page-section">
182
                                [% IF pending_article_requests %]
182
                                [% IF pending_article_requests %]
183
                                <div class="pending-info" id="article_requests_pending">
183
                                <div class="pending-info" id="article_requests_pending">
Lines 232-238 Link Here
232
                                </div>
232
                                </div>
233
                                [% END %]
233
                                [% END %]
234
234
235
                                [% IF ( Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue ) %]
235
                                [% IF ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
236
                                <div class="pending-info" id="catalog_concerns_pending">
236
                                <div class="pending-info" id="catalog_concerns_pending">
237
                                    <a href="/cgi-bin/koha/cataloguing/concerns.pl">Catalog concerns pending</a>:
237
                                    <a href="/cgi-bin/koha/cataloguing/concerns.pl">Catalog concerns pending</a>:
238
                                    <span class="pending-number-link">[% pending_biblio_tickets | html %]</span>
238
                                    <span class="pending-number-link">[% pending_biblio_tickets | html %]</span>
(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/add_catalog_concern.js (+51 lines)
Line 0 Link Here
1
$(document).ready(function() {
2
3
    // Pre-populate empty message with template
4
    $('#addConcernModal').on('show.bs.modal', function (e) {
5
        $('#addConfirm').prop('disabled', false);
6
        let concern_body = $('#concern_body');
7
        if ( concern_body.val() === "" ) {
8
            let template = $('#concern_template').text();
9
            concern_body.val(template);
10
        }
11
    });
12
13
    $('#addConcernModal').on('click', '#addConfirm', function(e) {
14
        let concern_title = $('#concern_title').val();
15
        let concern_body = $('#concern_body').val();
16
        let biblio_id = $('#concern_biblio').val();
17
        let reporter_id = $('#concern_reporter').val();
18
19
        let params = {
20
            title: concern_title,
21
            body: concern_body,
22
            biblio_id: biblio_id,
23
            reporter_id: logged_in_user_borrowernumber,
24
        };
25
26
        $('#concern-submit-spinner').show();
27
        $('#addConfirm').prop('disabled', true);
28
29
        $.ajax({
30
            url: '/api/v1/tickets',
31
            type: 'POST',
32
            data: JSON.stringify(params),
33
            success: function(data) {
34
                $('#concern-submit-spinner').hide();
35
                $('#addConcernModal').modal('hide');
36
                $('#concern_body').val('');
37
                $('#concern_title').val('');
38
                $('#toolbar').before('<div class="alert alert-success">Your concern was sucessfully submitted.</div>');
39
                if ($.fn.dataTable.isDataTable("#table_concerns")) {
40
                    $("#table_concerns").DataTable().ajax.reload();
41
                }
42
            },
43
            error: function(data) {
44
                $('#concern-submit-spinner').hide();
45
                $('#addConcernModal').modal('hide');
46
                $('#toolbar').before('<div class="alert alert-error">There was an error when submitting your concern, please contact a librarian.</div>');
47
            },
48
            contentType: "json"
49
        });
50
    });
51
});
(-)a/mainpage.pl (-2 / +1 lines)
Lines 104-110 my $pending_article_requests = Koha::ArticleRequests->search_limited( Link Here
104
)->count;
104
)->count;
105
my $pending_problem_reports = Koha::ProblemReports->search({ status => 'New' });
105
my $pending_problem_reports = Koha::ProblemReports->search({ status => 'New' });
106
106
107
if ( C4::Context->preference('OpacCatalogConcerns') ) {
107
if ( C4::Context->preference('OpacCatalogConcerns') || C4::Context->preference('CatalogConcerns') ) {
108
    my $pending_biblio_tickets = Koha::Tickets->search(
108
    my $pending_biblio_tickets = Koha::Tickets->search(
109
        {
109
        {
110
            resolved_date => undef,
110
            resolved_date => undef,
111
- 

Return to bug 31028