Bugzilla – Attachment 160713 Details for
Bug 35745
Setting suggester on the suggestion edit form does not show library and category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35745: Fix 'Set suggester' of a suggestion
Bug-35745-Fix-Set-suggester-of-a-suggestion.patch (text/plain), 2.76 KB, created by
Owen Leonard
on 2024-01-09 16:58:57 UTC
(
hide
)
Description:
Bug 35745: Fix 'Set suggester' of a suggestion
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-01-09 16:58:57 UTC
Size:
2.76 KB
patch
obsolete
>From e61fbb15c13ebe82660187b26241abfc9a2bd6d5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 Jan 2024 13:16:40 +0100 >Subject: [PATCH] Bug 35745: Fix 'Set suggester' of a suggestion > >On the suggestion edit form, if a suggester is selected using the "Set >to patron" (and patron search), the details of the selected patron will >contained "undefined" for the library's name and patron's category >description. > >Test plan: >Edit a suggestion, click "Set to patron", select a patron >Notice that with this patch the library's name and patron category is >correctly displayed. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/suggestion/suggestion.tt | 25 ++++++++++++++----- > 1 file changed, 19 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 657a2a5cbd..6b8ec6aacc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -1299,12 +1299,25 @@ > } > > function select_suggester(borrowernumber, borrower) { >- var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />'; >- suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">'; >- suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')'; >- suggested += '</a> '; >- suggested += borrower.branchname + ' (' + borrower.category_description + ')'; >- $("#tdsuggestedby").html(suggested); >+ $.ajax({ >+ type: 'GET', >+ url: '/api/v1/patrons/' + borrowernumber, >+ headers: { >+ "x-koha-embed": "+strings" >+ }, >+ success: function (data) { >+ var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + data.borrowernumber + '" />'; >+ suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + data.borrowernumber + '">'; >+ suggested += data.surname + ', ' + data.firstname + ' (' + data.cardnumber + ')'; >+ suggested += '</a> '; >+ suggested += data._strings.library_id.str + ' (' + data._strings.category_id.str + ')'; >+ $("#tdsuggestedby").html(suggested); >+ >+ }, >+ error: function (data) { >+ alert(_("Cannot retrieve info for this patron.")); >+ }, >+ }); > return 0; > } > $(document).ready(function(){ >-- >2.30.2
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 35745
:
160697
|
160713
|
161091