Bugzilla – Attachment 92319 Details for
Bug 14570
Make it possible to add multiple guarantors to a record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14570: (QA follow-up) Fix issues in Guarantee context
Bug-14570-QA-follow-up-Fix-issues-in-Guarantee-con.patch (text/plain), 7.26 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-08-16 19:46:39 UTC
(
hide
)
Description:
Bug 14570: (QA follow-up) Fix issues in Guarantee context
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-08-16 19:46:39 UTC
Size:
7.26 KB
patch
obsolete
>From e682515498a761f8a9a344f3c9d47f32e8b0d2fd Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 12 Aug 2019 14:14:39 -0400 >Subject: [PATCH] Bug 14570: (QA follow-up) Fix issues in Guarantee context > >Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../prog/en/modules/members/memberentrygen.tt | 12 ++-- > koha-tmpl/intranet-tmpl/prog/js/members.js | 62 +++++++++++-------- > 2 files changed, 42 insertions(+), 32 deletions(-) > >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 bdb7bf89f2..3ad4a6b121 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -327,8 +327,8 @@ > [% FOREACH r IN relationships %] > <fieldset class="rows"> > <ol> >- [% IF category_type == 'P' %] >- <li id="contact-details"> >+ [% IF category_type == 'I' %] >+ <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]"> > <span class="label">Organization #:</span> [% IF ( r.guarantor_id ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor_id | html %]</a>[% END %] > </li> > >@@ -337,7 +337,7 @@ > <span>[% r.guarantor.surname | html %]</span> > </li> > [% ELSE %] >- <li id="contact-details"> >+ <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]"> > <span class="label">Patron #:</span> > <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor_id | html %]</a> > </li> >@@ -362,7 +362,7 @@ > </li> > > <li> >- <label for="delete_guarantor-[% r.id | uri %]">Delete: </label> >+ <label for="delete_guarantor-[% r.id | uri %]">Remove: </label> > <input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" /> > </li> > [% END %] >@@ -373,7 +373,7 @@ > > <fieldset class="rows guarantor" id="guarantor_template"> > <ol> >- <li class="guarantor_id"> >+ <li class="guarantor-details" data-borrowernumber="0"> > <span class="label">Patron #:</span> > <span class="new_guarantor_id_text"></span> > <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/> >@@ -411,7 +411,7 @@ > <input name="guarantor_firstname" id="guarantor_firstname" type="hidden" /> > > <li> >- <a href="#" id="guarantor_search" class="btn btn-sm"><i class="fa fa-search"></i> Search</a> >+ <a href="#" id="guarantor_search" class="btn btn-sm"><i class="fa fa-plus"></i> Search to add</a> > </li> > > [% IF relationships && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 5e12bb76fa..3579dbeed5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -166,38 +166,48 @@ function update_category_code(category_code) { > } > > function select_user(borrowernumber, borrower) { >- $('#guarantor_id').val(borrower.borrowernumber); >- $('#guarantor_surname').val(borrower.surname); >- $('#guarantor_firstname').val(borrower.firstname); >+ let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length; >+ console.log("LEN: " + is_guarantor ); > >- var fieldset = $('#guarantor_template').clone(); >- fieldset.removeAttr('id'); >- >- var guarantor_id = $('#guarantor_id').val(); >- if ( guarantor_id ) { >- fieldset.find('.new_guarantor_id').first().val( guarantor_id ); >- fieldset.find('.new_guarantor_id_text').first().text( guarantor_id ); >+ if ( is_guarantor ) { >+ alert("Patron is already a guarantor for this patron"); > } else { >- fieldset.find('.guarantor_id').first().hide(); >- } >- $('#guarantor_id').val(""); >+ $('#guarantor_id').val(borrower.borrowernumber); >+ $('#guarantor_surname').val(borrower.surname); >+ $('#guarantor_firstname').val(borrower.firstname); >+ >+ var fieldset = $('#guarantor_template').clone(); >+ fieldset.removeAttr('id'); >+ >+ var guarantor_id = $('#guarantor_id').val(); >+ if ( guarantor_id ) { >+ fieldset.find('.new_guarantor_id').first().val( guarantor_id ); >+ fieldset.find('.new_guarantor_id_text').first().text( guarantor_id ); >+ } else { >+ fieldset.find('.guarantor_id').first().hide(); >+ } >+ $('#guarantor_id').val(""); > >- var guarantor_surname = $('#guarantor_surname').val(); >- fieldset.find('.new_guarantor_surname').first().val( guarantor_surname ); >- fieldset.find('.new_guarantor_surname_text').first().text( guarantor_surname ); >- $('#guarantor_surname').val(""); >+ var guarantor_surname = $('#guarantor_surname').val(); >+ fieldset.find('.new_guarantor_surname').first().val( guarantor_surname ); >+ fieldset.find('.new_guarantor_surname_text').first().text( guarantor_surname ); >+ $('#guarantor_surname').val(""); > >- var guarantor_firstname = $('#guarantor_firstname').val(); >- fieldset.find('.new_guarantor_firstname').first().val( guarantor_firstname ); >- fieldset.find('.new_guarantor_firstname_text').first().text( guarantor_firstname ); >- $('#guarantor_firstname').val(""); >+ var guarantor_firstname = $('#guarantor_firstname').val(); >+ fieldset.find('.new_guarantor_firstname').first().val( guarantor_firstname ); >+ fieldset.find('.new_guarantor_firstname_text').first().text( guarantor_firstname ); >+ $('#guarantor_firstname').val(""); > >- var guarantor_relationship = $('#relationship').val(); >- fieldset.find('.new_guarantor_relationship').first().val( guarantor_relationship ); >- $('#relationship').find('option:eq(0)').prop('selected', true);; >+ var guarantor_relationship = $('#relationship').val(); >+ fieldset.find('.new_guarantor_relationship').first().val( guarantor_relationship ); >+ $('#relationship').find('option:eq(0)').prop('selected', true); > >- $('#guarantor_relationships').append( fieldset ); >- fieldset.show(); >+ fieldset.find('.guarantor-details').first().attr( 'data-borrowernumber', borrower.borrowernumber ); >+ console.log( fieldset.find('.guarantor-details').first().data() ); >+ >+ $('#guarantor_relationships').append( fieldset ); >+ fieldset.show(); >+ } > > return 0; > } >-- >2.22.1
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 14570
:
52400
|
52401
|
52402
|
52403
|
52406
|
52407
|
58146
|
58147
|
58159
|
58202
|
58391
|
58399
|
58412
|
58688
|
58689
|
58739
|
58762
|
58763
|
58764
|
58834
|
58835
|
58836
|
58837
|
58838
|
58839
|
58949
|
58950
|
58951
|
58952
|
58953
|
58954
|
58972
|
58973
|
58974
|
58975
|
58976
|
58977
|
58978
|
58979
|
58980
|
62450
|
62451
|
62452
|
64124
|
64125
|
64126
|
71160
|
71161
|
71162
|
71163
|
73283
|
73284
|
73583
|
73584
|
74950
|
74951
|
74952
|
74953
|
74954
|
74976
|
74977
|
74978
|
74979
|
77029
|
77030
|
77031
|
77032
|
77033
|
77034
|
77040
|
77041
|
77042
|
77043
|
77044
|
77045
|
77046
|
77047
|
77048
|
77049
|
77067
|
77068
|
77069
|
77070
|
77071
|
77072
|
77073
|
77074
|
77075
|
77076
|
77077
|
77078
|
77290
|
77291
|
77346
|
77347
|
77348
|
80842
|
80849
|
81932
|
81933
|
85411
|
85412
|
85431
|
89889
|
89890
|
89891
|
89892
|
89909
|
89910
|
89911
|
89912
|
89921
|
89922
|
89929
|
90048
|
91231
|
91439
|
91440
|
91441
|
91442
|
91443
|
91444
|
91445
|
91694
|
91695
|
91696
|
91697
|
91698
|
91699
|
91700
|
92157
|
92158
|
92161
|
92162
|
92163
|
92180
|
92181
|
92182
|
92183
|
92232
|
92233
|
92234
|
92235
|
92277
|
92278
|
92279
|
92280
|
92281
|
92282
|
92283
|
92284
|
92285
|
92286
|
92287
|
92288
|
92289
|
92290
|
92291
|
92292
|
92298
|
92299
|
92300
|
92301
|
92302
|
92303
|
92304
|
92305
|
92306
|
92307
|
92308
|
92309
|
92310
|
92311
|
92312
|
92313
|
92314
|
92315
|
92316
|
92317
|
92318
| 92319 |
92320
|
92321
|
92322
|
92323
|
92324
|
92325
|
92346
|
92347
|
92348
|
92349
|
92350