Bugzilla – Attachment 160368 Details for
Bug 35657
Add ability to assign tickets to librarians for catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35657: Add option to set assignee during update
Bug-35657-Add-option-to-set-assignee-during-update.patch (text/plain), 6.04 KB, created by
Martin Renvoize (ashimema)
on 2023-12-29 12:13:17 UTC
(
hide
)
Description:
Bug 35657: Add option to set assignee during update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-12-29 12:13:17 UTC
Size:
6.04 KB
patch
obsolete
>From 56c6204edc739cb4da6d6aad53dc5a3a4c7bfdaa Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 29 Dec 2023 11:53:25 +0000 >Subject: [PATCH] Bug 35657: Add option to set assignee during update > >--- > .../en/includes/modals/display_ticket.inc | 2 + > .../prog/en/modules/cataloguing/concerns.tt | 1 + > .../prog/js/modals/display_ticket.js | 86 ++++++++++++++++++- > 3 files changed, 88 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >index 5a3479a0de5..8b4768c5258 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >@@ -20,6 +20,8 @@ > <li class="rows"> > <label for="public">Notify: </label> > <input type="checkbox" name="public" id="public"> >+ <label for="assignee_id">Change assignee: </label> >+ <select name="assignee_id" id="assignee_id"></select> > </li> > </ol> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >index 2d09c5e4afb..78d00438603 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >@@ -243,6 +243,7 @@ > [% END %] > }); > </script> >+ [% INCLUDE 'select2.inc' %] > [% Asset.js("js/modals/display_ticket.js") | $raw %] > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >index 0070801128c..0eac1dc5f4e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >@@ -67,16 +67,100 @@ $(document).ready(function() { > // Clear any previously entered update message > $('#update_message').val(''); > $('#public').prop( "checked", false ); >+ >+ // Patron select2 >+ $("#assignee_id").kohaSelect({ >+ dropdownParent: $(".modal-content", "#ticketDetailsModal"), >+ width: '50%', >+ dropdownAutoWidth: true, >+ allowClear: true, >+ minimumInputLength: 3, >+ ajax: { >+ url: '/api/v1/patrons', >+ delay: 250, >+ dataType: 'json', >+ headers: { >+ "x-koha-embed": "library" >+ }, >+ data: function(params) { >+ let q = buildPatronSearchQuery(params.term); >+ let query = { >+ 'q': JSON.stringify(q), >+ '_page': params.page, >+ '_order_by': '+me.surname,+me.firstname', >+ }; >+ return query; >+ }, >+ processResults: function(data, params) { >+ let results = []; >+ data.results.forEach(function(patron) { >+ patron.id = patron.patron_id; >+ results.push(patron); >+ }); >+ return { >+ "results": results, "pagination": { "more": data.pagination.more } >+ }; >+ }, >+ }, >+ templateResult: function (patron) { >+ if (patron.library_id == loggedInLibrary) { >+ loggedInClass = "ac-currentlibrary"; >+ } else { >+ loggedInClass = ""; >+ } >+ >+ let $patron = $("<span></span>") >+ .append( >+ "" + >+ (patron.surname >+ ? escape_str(patron.surname) + ", " >+ : "") + >+ (patron.firstname >+ ? escape_str(patron.firstname) + " " >+ : "") + >+ (patron.cardnumber >+ ? " (" + escape_str(patron.cardnumber) + ")" >+ : "") + >+ "<small>" + >+ (patron.date_of_birth >+ ? ' <span class="age_years">' + >+ $get_age(patron.date_of_birth) + >+ " " + >+ __("years") + >+ "</span>" >+ : "") + >+ (patron.library ? >+ " <span class=\"ac-library\">" + >+ escape_str(patron.library.name) + >+ "</span>" >+ : "") + >+ "</small>" >+ ) >+ .addClass(loggedInClass); >+ return $patron; >+ }, >+ templateSelection: function (patron) { >+ if (!patron.surname) { >+ return patron.text; >+ } >+ return ( >+ escape_str(patron.surname) + ", " + escape_str(patron.firstname) >+ ); >+ }, >+ placeholder: "Search for a patron" >+ }); > }); > > $('#ticketDetailsModal').on('click', '.updateSubmit', function(e) { > let clicked = $(this); > let ticket_id = $('#ticket_id').val(); >+ let assignee_id = $('#assignee_id').val(); > let params = { > 'public': $('#public').is(":checked"), > 'message': $('#update_message').val(), > 'user_id': logged_in_user_borrowernumber, >- 'status': clicked.data('status') >+ 'status': clicked.data('status'), >+ 'assignee_id': assignee_id > }; > > $('#comment-spinner').show(); >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35657
:
160365
|
160366
|
160367
|
160368
|
160369
|
160372
|
160373
|
160374
|
160375
|
160376
|
160377
|
164923
|
164924
|
164925
|
164926
|
164927
|
164928
|
164932
|
164933
|
164934
|
164935
|
164974
|
164975
|
164976
|
164977
|
165666
|
165667
|
165668
|
165669
|
165670
|
165671
|
165672
|
165673
|
165674
|
165675
|
165676
|
165677
|
165678
|
165679
|
165786
|
165787
|
165788
|
165789
|
165790
|
165791
|
165792
|
165878
|
165879
|
165880
|
165881
|
165882
|
165883
|
165884
|
165885
|
165886
|
166067