Bugzilla – Attachment 54538 Details for
Bug 16450
Remove the use of "onclick" from guarantor search template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[3.22.x] Bug 16450 - Remove the use of "onclick" from guarantor search template
Bug-16450---Remove-the-use-of-onclick-from-guarant.patch (text/plain), 3.62 KB, created by
Julian Maurice
on 2016-08-17 14:41:41 UTC
(
hide
)
Description:
[3.22.x] Bug 16450 - Remove the use of "onclick" from guarantor search template
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2016-08-17 14:41:41 UTC
Size:
3.62 KB
patch
obsolete
>From a85aea7a61c0ee87c386c28cca0ee3ce2b2ce4c3 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 4 May 2016 09:34:46 -0400 >Subject: [PATCH] Bug 16450 - Remove the use of "onclick" from guarantor search > template > >This patch updates the guarantor search template so that event >definition is done in the script rather than in an onclick attribute. > >This patch also increases the size of the popup window to help prevent >the need for horizontal scrolling and adds Bootstrap style to the >"select" button. > >To test, apply the patch and clear your browser cache if necessary. > >- Go to Patrons and add a patron with a "child" category type. >- In the "Guarantor information" section, click the "Set to patron" > button. >- In the pop-up window, search for a patron. >- Click the "Select" button next to a patron. >- The window should close, and the patron you selected should now appear > as the guarantor. The guarantor's address information should be added > to the "Main address" section. > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/en/js/members.js | 3 +-- > koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt | 8 ++++++++ > .../prog/en/modules/members/tables/guarantor_search.tt | 2 +- > 3 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/members.js b/koha-tmpl/intranet-tmpl/prog/en/js/members.js >index 75e230b..2fae9e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/members.js >@@ -143,8 +143,7 @@ function Dopop(link) { > } > > function Dopopguarantor(link) { >- >- var newin=window.open(link,'popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); >+ var newin=window.open(link,'popup','width=800,height=500,resizable=no,toolbar=false,scrollbars=yes,top'); > } > > $(document).ready(function(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >index ff8ed90..b45084f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >@@ -100,6 +100,14 @@ $(document).ready(function(){ > e.preventDefault(); > filterByFirstLetterSurname($(this).text()); > }); >+ >+ $("body").on("click",".select_user",function(e){ >+ e.preventDefault(); >+ var borrowernumber = $(this).data("borrowernumber"); >+ var guarantor_data = $("#guarantor_data"+borrowernumber).val(); >+ select_user( borrowernumber, JSON.parse(guarantor_data) ); >+ }); >+ > }); > > function filter() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >index 33cb95f..fee361b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >@@ -17,7 +17,7 @@ > "dt_address": > "[% INCLUDE escape_address data=data %]", > "dt_action": >- "<a style='cursor:pointer' onclick='select_user(\"[% data.borrowernumber %]\", [% To.json(data) | html %] );'>Select</a>" >+ "<a href=\"#\" class=\"btn btn-mini select_user\" data-borrowernumber=\"[% data.borrowernumber %]\">Select</a><input type=\"hidden\" id=\"guarantor_data[% data.borrowernumber %]\" name=\"guarantor_data\" value=\"[% To.json(data) | html %]\" />" > }[% UNLESS loop.last %],[% END %] > [% END %] > ] >-- >2.1.4
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 16450
:
51241
|
51252
|
51293
| 54538