Bugzilla – Attachment 165005 Details for
Bug 30987
Adding relationship to PatronQuickAddFields causes it to be added 2x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30987: Fix relationship fields for patron full and quick add forms
Bug-30987-Fix-relationship-fields-for-patron-full-.patch (text/plain), 11.31 KB, created by
Martin Renvoize (ashimema)
on 2024-04-17 12:41:11 UTC
(
hide
)
Description:
Bug 30987: Fix relationship fields for patron full and quick add forms
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-17 12:41:11 UTC
Size:
11.31 KB
patch
obsolete
>From 443fcbc5f807e6066b9a878a6bbb87e4140ca41e Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 26 Feb 2024 15:59:29 +0000 >Subject: [PATCH] Bug 30987: Fix relationship fields for patron full and quick > add forms > >To test: >1. APPLY PATACH and restart services. >2. Find the borrowerRelationship system preference. The description should no longer include the words "Leave empty to deactivate." >3. Populate the system preference with at least 1 choice. >4. Find a patron category with can_be_guarantee set to 'Yes'. >5. Quick add a patron of that type, making sure the relationship field shows in the Patron guarantor section. ( You have to +Add gaurantor before this field will show ) >6. The values in the dropdown should refelct the borrowerRelationship values. >7. With BorrowerMandatoryField make relationship mandatory. >8. Try step 5 again, this time the Relationship field should be mandatory. >9. Remove the field from BorrowerMandatoryField and add it to BorrowerUnwantedField. >10. Do step 5 again, the relationship field should not show on the quick add form. > >Signed-off-by: Myka Kennedy Stephens <mkstephens@fosgail.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../en/modules/admin/preferences/patrons.pref | 2 +- > .../prog/en/modules/members/memberentrygen.tt | 50 +++++++++++-------- > members/memberentry.pl | 5 -- > 3 files changed, 30 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 75088bba463..4bbdcb4fea5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -328,7 +328,7 @@ Patrons: > - "Guarantors can be the following of those they guarantee:" > - pref: borrowerRelationship > class: multi >- - (input multiple choices separated by |). Leave empty to deactivate. >+ - (input multiple choices separated by |). > - > - "When adding a guarantee to a guarantor, whether it's from the guarantor's form or the guarantee's form, fill the following fields in the guarantee's member entry form from the guarantors record:" > - pref: PrefillGuaranteeField >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 56468946bc3..f684abe2d2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -508,9 +508,9 @@ legend:hover { > <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/> > </li> > >- [% IF possible_relationships %] >+ [% UNLESS norelationship %] > <li> >- [% UNLESS empty_relationship_allowed %] >+ [% IF mandatoryrelationship %] > <label for="guarantor_relationship" class="required">Relationship: </label> > <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required"> > [% ELSE %] >@@ -524,7 +524,7 @@ legend:hover { > [% END %] > [% END %] > </select> >- [% UNLESS empty_relationship_allowed %] >+ [% UNLESS mandatoryrelationship %] > <span class="required">Required</span> > [% END %] > </li> >@@ -552,9 +552,9 @@ legend:hover { > <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/> > </li> > >- [% IF possible_relationships %] >+ [% UNLESS norelationship %] > <li> >- [% UNLESS empty_relationship_allowed %] >+ [% IF mandatoryrelationship %] > <label for="guarantor_relationship" class="required">Relationship: </label> > <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required"> > [% ELSE %] >@@ -568,7 +568,7 @@ legend:hover { > [% END %] > [% END %] > </select> >- [% UNLESS empty_relationship_allowed %] >+ [% IF mandatoryrelationship %] > <span class="required">Required</span> > [% END %] > </li> >@@ -665,21 +665,27 @@ legend:hover { > [% END # /UNLESS noaltcontactfirstname %] > > [% UNLESS norelationship %] >- [% IF possible_relationships %] >- <li> >+ <li> >+ [% IF mandatoryrelationship %] >+ <label for="relationship" class="required">Relationship: </label> >+ <select class="relationship" name="relationship" required="required"> >+ [% ELSE %] > <label for="relationship">Relationship: </label> > <select class="relationship" name="relationship"> >- <option value=""></option> >- [% FOREACH pr IN possible_relationships.split('\|') %] >- [% IF pr == borrower_data.relationship %] >- <option value="[% pr | html %]" selected="selected">[% pr | html %]</option> >- [% ELSE %] >- <option value="[% pr | html %]">[% pr | html %]</option> >- [% END %] >+ [% END %] >+ <option value=""></option> >+ [% FOREACH pr IN possible_relationships.split('\|') %] >+ [% IF pr == borrower_data.relationship %] >+ <option value="[% pr | html %]" selected="selected">[% pr | html %]</option> >+ [% ELSE %] >+ <option value="[% pr | html %]">[% pr | html %]</option> > [% END %] >- </select> >- </li> >- [% END #/IF possible_relationships %] >+ [% END %] >+ </select> >+ [% IF mandatoryrelationship %] >+ <span class="required">Required</span> >+ [% END %] >+ </li> > [% END # /UNLESS norelationship %] > </ol> > </fieldset> <!-- /#non_patron_guarantor --> >@@ -1943,9 +1949,11 @@ legend:hover { > new_field.appendTo("#quick_add_list"); > } else { > let orig_input_id = orig_li.children("input,textarea,select").attr("id"); >- let new_field = orig_li.clone(); >- new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add"); >- new_field.appendTo("#quick_add_list"); >+ if ( orig_input_id ) { >+ let new_field = orig_li.clone(); >+ new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add"); >+ new_field.appendTo("#quick_add_list"); >+ } > [% UNLESS mandatorypassword %] > if( input_label == 'password' ){ > let orig_p2 = $("#entryform label[for='password2']").parent(); >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 702f2c68980..e28e8c14498 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -100,11 +100,6 @@ my @messages; > ## Deal with guarantor stuff > $template->param( relationships => $patron->guarantor_relationships ) if $patron; > >-my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1; >-@relations = ('') unless @relations; >-my $empty_relationship_allowed = grep {$_ eq ""} @relations; >-$template->param( empty_relationship_allowed => $empty_relationship_allowed ); >- > my $guarantor_id = $input->param('guarantor_id'); > my $guarantor = undef; > $guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; >-- >2.44.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 30987
:
162461
|
162860
| 165005