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

(-)a/Koha/REST/V1/Tickets.pm (+6 lines)
Lines 202-207 sub add_update { Link Here
202
            )->store;
202
            )->store;
203
        }
203
        }
204
204
205
        # Update ticket status if needed
206
        if ( $ticket_update->{status} ) {
207
            my $ticket = $update->ticket;
208
            $ticket->set( { status => $ticket_update->{status} } )->store;
209
        }
210
205
        # Optionally add to message_queue here to notify reporter
211
        # Optionally add to message_queue here to notify reporter
206
        if ( $update->public ) {
212
        if ( $update->public ) {
207
            my $notice =
213
            my $notice =
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc (-1 / +20 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
2
[% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %]
1
<!-- Display updates concern modal -->
3
<!-- Display updates concern modal -->
2
<div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel">
4
<div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel">
3
    <div class="modal-dialog modal-lg" role="document">
5
    <div class="modal-dialog modal-lg" role="document">
Lines 24-30 Link Here
24
            <div class="modal-footer">
26
            <div class="modal-footer">
25
                <input type="hidden" name="ticket_id" id="ticket_id">
27
                <input type="hidden" name="ticket_id" id="ticket_id">
26
                <button type="button" class="btn btn-default" id="resolveTicket">Resolve <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
28
                <button type="button" class="btn btn-default" id="resolveTicket">Resolve <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
27
                <button type="submit" class="btn btn-primary" id="updateTicket">Comment <i id="comment-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
29
                [% IF status.count %]
30
                <div class="btn-group">
31
                  <button type="button" class="btn btn-primary" id="updateTicket">Update <i id="comment-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
32
                  <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
33
                    <span class="caret"></span>
34
                    <span class="sr-only">Select status</span>
35
                  </button>
36
                  <ul class="dropdown-menu">
37
                    [% FOR st IN status %]
38
                    <li>
39
                      <a class="dropdown-item updateSubmit" type="button" data-status="[% st.authorised_value | html %]">[% st.lib | html_entity %]</a>
40
                    </li>
41
                    [% END %]
42
                  </ul>
43
                </div>
44
                [% ELSE %]
45
                <button type="submit" class="btn btn-primary updateSubmit" id="updateTicket">Update <i id="comment-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
46
                [% END %]
28
            </div> <!-- /.modal-footer -->
47
            </div> <!-- /.modal-footer -->
29
        </div> <!-- /.modal-content -->
48
        </div> <!-- /.modal-content -->
30
    </div> <!-- /.modal-dialog -->
49
    </div> <!-- /.modal-dialog -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt (-2 / +6 lines)
Lines 156-162 Link Here
156
                        "orderable": true
156
                        "orderable": true
157
                    },
157
                    },
158
                    {
158
                    {
159
                        "data": "resolver.firstname:resolver.surname:resolved_date",
159
                        "data": "resolver.firstname:resolver.surname:resolved_date:status",
160
                        "render": function(data, type, row, meta) {
160
                        "render": function(data, type, row, meta) {
161
                            let result = '';
161
                            let result = '';
162
                            if (row.resolved_date) {
162
                            if (row.resolved_date) {
Lines 166-172 Link Here
166
                                }) + '</span>';
166
                                }) + '</span>';
167
                                result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
167
                                result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
168
                            } else {
168
                            } else {
169
                                result += _("Open");
169
                                if (row.status) {
170
                                    result += row.status;
171
                                } else {
172
                                    result += _("Open");
173
                                }
170
                            }
174
                            }
171
                            return result;
175
                            return result;
172
                        },
176
                        },
(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js (-2 / +9 lines)
Lines 66-71 $(document).ready(function () { Link Here
66
                        " (" +
66
                        " (" +
67
                        $datetime(item.date) +
67
                        $datetime(item.date) +
68
                        ")</span>";
68
                        ")</span>";
69
                    if (item.status) {
70
                        updates +=
71
                            '<span class="pull-right">' +
72
                            item.status +
73
                            "</span>";
74
                    }
69
                    updates += "</div>";
75
                    updates += "</div>";
70
                });
76
                });
71
                updates_display.html(updates);
77
                updates_display.html(updates);
Lines 77-88 $(document).ready(function () { Link Here
77
        $("#public").prop("checked", false);
83
        $("#public").prop("checked", false);
78
    });
84
    });
79
85
80
    $("#ticketDetailsModal").on("click", "#updateTicket", function (e) {
86
    $("#ticketDetailsModal").on("click", ".updateSubmit", function (e) {
87
        let clicked = $(this);
81
        let ticket_id = $("#ticket_id").val();
88
        let ticket_id = $("#ticket_id").val();
82
        let params = {
89
        let params = {
83
            public: $("#public").is(":checked"),
90
            public: $("#public").is(":checked"),
84
            message: $("#update_message").val(),
91
            message: $("#update_message").val(),
85
            user_id: logged_in_user_borrowernumber,
92
            user_id: logged_in_user_borrowernumber,
93
            status: clicked.data("status"),
86
        };
94
        };
87
95
88
        $("#comment-spinner").show();
96
        $("#comment-spinner").show();
89
- 

Return to bug 35628