Bug 32435: Add resolution states to Catalog concerns
This patch adds resolution types to the catalog concerns feature. It allows libraries to define a list of 'TICKET_RESOLUTION' authorized values from which librarians can then pick at the point of resolving a catalog concern. To test: 1) Apply the patches and run the database updates 2) Enable catalog concerns (staff or opac will do the trick) 3) Submit a catalog concern 4) Confirm that you can still resolve a concern from the catalog concerns management page as before. 5) Add some values to the new TICKET_RESOLUTION authorized values 6) Submit a new catalog concern 7) Confirm that the 'Resolve' button in the management modal is now a dropdown containing the list of resolution values defined above. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
038ac93103
commit
eec197565c
|
|
@ -196,6 +196,16 @@ sub strings_map {
|
|||
}
|
||||
);
|
||||
|
||||
# Fall back to TICKET_RESOLUTION as needed
|
||||
if ( !$av->count ) {
|
||||
$av = Koha::AuthorisedValues->search(
|
||||
{
|
||||
category => 'TICKET_RESOLUTION',
|
||||
authorised_value => $self->status,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
my $status_str =
|
||||
$av->count
|
||||
? $params->{public}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,16 @@ sub strings_map {
|
|||
}
|
||||
);
|
||||
|
||||
# Fall back to TICKET_RESOLUTION as needed
|
||||
if ( !$av->count ) {
|
||||
$av = Koha::AuthorisedValues->search(
|
||||
{
|
||||
category => 'TICKET_RESOLUTION',
|
||||
authorised_value => $self->status,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
my $status_str =
|
||||
$av->count
|
||||
? $params->{public}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
[% USE AuthorisedValues %]
|
||||
[% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %]
|
||||
[% SET resolutions = AuthorisedValues.GetAuthValueDropbox('TICKET_RESOLUTION') %]
|
||||
<!-- Display updates concern modal -->
|
||||
<div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
|
|
@ -25,7 +26,22 @@
|
|||
</div> <!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<input type="hidden" name="ticket_id" id="ticket_id">
|
||||
<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>
|
||||
[% IF resolutions.count %]
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-danger dropdown-toggle" id="resolveTicket" data-toggle="dropdown" aria-expanded="false">
|
||||
Resolve <span class="caret"></span> <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
[% FOR resolution IN resolutions %]
|
||||
<li>
|
||||
<a class="dropdown-item resolveSubmit" type="button" data-resolution="[% resolution.authorised_value | html %]">[% resolution.lib | html_entity %]</a>
|
||||
</li>
|
||||
[% END %]
|
||||
</ul>
|
||||
</div>
|
||||
[% ELSE %]
|
||||
<button type="button" class="btn btn-danger resolveSubmit" id="resolveTicket">Resolve <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button>
|
||||
[% END %]
|
||||
[% IF status.count %]
|
||||
<div class="btn-group">
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -166,10 +166,14 @@
|
|||
"render": function(data, type, row, meta) {
|
||||
let result = '';
|
||||
if (row.resolved_date) {
|
||||
result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, {
|
||||
result += _("Resolved by") + ' <span>' + $patron_to_html(row.resolver, {
|
||||
display_cardnumber: false,
|
||||
url: true
|
||||
}) + '</span>';
|
||||
if (row.status) {
|
||||
result += ' ' + _("as") + ' ';
|
||||
result += row._strings.status ? escape_str(row._strings.status.str) : "";
|
||||
}
|
||||
result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
|
||||
} else {
|
||||
if (row.status) {
|
||||
|
|
|
|||
|
|
@ -130,13 +130,15 @@ $(document).ready(function () {
|
|||
});
|
||||
});
|
||||
|
||||
$("#ticketDetailsModal").on("click", "#resolveTicket", function (e) {
|
||||
$("#ticketDetailsModal").on("click", ".resolveSubmit", function (e) {
|
||||
let clicked = $(this);
|
||||
let ticket_id = $("#ticket_id").val();
|
||||
let params = {
|
||||
public: $("#public").is(":checked"),
|
||||
message: $("#update_message").val(),
|
||||
user_id: logged_in_user_borrowernumber,
|
||||
state: "resolved",
|
||||
status: clicked.data("resolution"),
|
||||
};
|
||||
|
||||
$("#resolve-spinner").show();
|
||||
|
|
|
|||
Loading…
Reference in New Issue