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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc (-1 / +1 lines)
Lines 41-47 Link Here
41
            <div class="modal-footer">
41
            <div class="modal-footer">
42
                <input type="hidden" name="biblio_id" id="concern_biblio" value="[% biblio.biblionumber | html %]">
42
                <input type="hidden" name="biblio_id" id="concern_biblio" value="[% biblio.biblionumber | html %]">
43
                <input type="hidden" name="reporter_id" id="concern_reporter" value="[% borrowernumber | html %]">
43
                <input type="hidden" name="reporter_id" id="concern_reporter" value="[% borrowernumber | html %]">
44
                <button type="submit" id="addConfirm" class="btn btn-primary">Submit</button>
44
                <button type="submit" id="addConfirm" class="btn btn-primary">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>
45
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
46
            </div>
46
            </div>
47
        </div>
47
        </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js (-1 / +10 lines)
Lines 41-53 $(document).ready(function() { Link Here
41
            reporter_id: reporter_id,
41
            reporter_id: reporter_id,
42
        };
42
        };
43
43
44
        $('#concern-submit-spinner').show();
45
        $('#addConfirm').prop('disabled', true);
44
        $.ajax({
46
        $.ajax({
45
            url: '/api/v1/public/tickets',
47
            url: '/api/v1/public/tickets',
46
            type: 'POST',
48
            type: 'POST',
47
            data: JSON.stringify(params),
49
            data: JSON.stringify(params),
48
            success: function(data) {
50
            success: function(data) {
51
                $('#concern-submit-spinner').hide();
49
                $('#addConcernModal').modal('hide');
52
                $('#addConcernModal').modal('hide');
50
                $('#concern_body').val('');
53
                $('#concern_body').val('');
54
                $('#concern_title').val('');
55
                $('h1:first').before('<div class="alert alert-success">Your concern was sucessfully submitted.</div>');
56
            },
57
            error: function(data) {
58
                $('#concern-submit-spinner').hide();
59
                $('#addConcernModal').modal('hide');
60
                $('h1:first').before('<div class="alert alert-error">There was an error when submitting your concern, please contact a librarian.</div>');
51
            },
61
            },
52
            contentType: "json"
62
            contentType: "json"
53
        });
63
        });
54
- 

Return to bug 31028