Bugzilla – Attachment 148597 Details for
Bug 26597
Transfer information from guarantor when adding a guarantor to an existing patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26597: Transfer informations from guarantor when adding a guarantor to an existing patron
Bug-26597-Transfer-informations-from-guarantor-whe.patch (text/plain), 3.69 KB, created by
PTFS Europe Sandboxes
on 2023-03-23 10:21:23 UTC
(
hide
)
Description:
Bug 26597: Transfer informations from guarantor when adding a guarantor to an existing patron
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2023-03-23 10:21:23 UTC
Size:
3.69 KB
patch
obsolete
>From e7e84a23996011b181b9f4c8e8cd1c8aa0b02758 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 7 Dec 2022 16:51:20 +0000 >Subject: [PATCH] Bug 26597: Transfer informations from guarantor when adding a > guarantor to an existing patron > >When creating a new guarantee from the guarantor, the preference PrefillGuaranteeField dictates some fields to be transfered from guarantor to guarantee. This patch makes it so those informations are also transfered when adding a new guarantor relationship to an existing patron. > >To test: >1) Apply patch >2) Search PrefillGuaranteeField preference and make sure some fields are selected >3) Select a user that can have a guarantor >4) In the edit form, click on 'Search to add' in 'Patron guarantor' fieldset >5) Choose a patron who has at least one of the fields in 1) set >6) Click 'Select' >7) Confirm guarantee's information is filled from the guarantor's record >8) Check that any preexisting information is not overwritten > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > .../prog/en/modules/members/memberentrygen.tt | 3 +++ > koha-tmpl/intranet-tmpl/prog/js/members.js | 16 ++++++++++++++++ > members/memberentry.pl | 1 + > 3 files changed, 20 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 10a4a4d601..59337ea988 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1929,6 +1929,9 @@ legend:hover { > }); > [% END %] > $("#guarantor_template").hide(); >+ [% IF guarantor_attributes %] >+ guarantor_attributes = [% To.json(guarantor_attributes) %]; >+ [% END %] > > var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %]; > var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %]; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 597bb5d141..9195d91ffd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -121,6 +121,22 @@ function select_user(borrowernumber, borrower, relationship) { > if ( relationship ) { > fieldset.find('.new_guarantor_relationship').val(relationship); > } >+ >+ if(typeof guarantor_attributes !== 'undefined') { >+ $.ajax({ >+ url: '/api/v1/patrons/'+borrowernumber, >+ method: "GET", >+ dataType: 'json', >+ success: function(data){ >+ for (var i = 0; i < parseInt(guarantor_attributes.length, 10); i++) { >+ var attribute = guarantor_attributes[i]; >+ if ( data[attribute] != null && document.forms.entryform[attribute].value == "" ) { >+ document.forms.entryform[attribute].value = data[attribute]; >+ } >+ } >+ } >+ }); >+ } > } > > return 0; >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 0193cc3777..61b46ba12c 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -612,6 +612,7 @@ if (C4::Context->preference("IndependentBranches")) { > # Define the fields to be pre-filled in guarantee records > my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField"); > my @prefill_fields=split(/\,/,$prefillguarantorfields); >+$template->param( guarantor_attributes => \@prefill_fields ); > > if ($op eq 'add'){ > if ($guarantor_id) { >-- >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 26597
:
111054
|
111319
|
112196
|
142443
|
144475
|
144560
|
148564
|
148597
|
148598
|
148599
|
151850
|
151851
|
151878
|
154501
|
154503
|
154504
|
154505
|
154506
|
158119
|
158300
|
161510
|
161511
|
161512
|
161513
|
161514
|
161515
|
161516