Bug 16450

Summary: Remove the use of "onclick" from guarantor search template
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, cbrannon, edischer, f.demians, julian.maurice, philippe.blouin, veron
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/members/guarantor_search.pl
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16458
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16756
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13041, 16386    
Bug Blocks: 16457    
Attachments: Bug 16450 - Remove the use of "onclick" from guarantor search template
Bug 16450 - Remove the use of "onclick" from guarantor search template
Bug 16450 - Remove the use of "onclick" from guarantor search template
[3.22.x] Bug 16450 - Remove the use of "onclick" from guarantor search template

Description Owen Leonard 2016-05-05 14:27:00 UTC
When adding a guantor to a patron record, a search form is shown in a popup window. This page should be reworked to avoid the use of "onclick."
Comment 1 Owen Leonard 2016-05-05 14:42:01 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-05-05 19:08:21 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-05-06 14:20:35 UTC
Created attachment 51293 [details] [review]
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.

Tested on top of Bug 13041 and Bug 16386, works as expected, however see
Bug 16458
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Owen Leonard 2016-05-13 16:38:06 UTC
*** Bug 14744 has been marked as a duplicate of this bug. ***
Comment 5 Brendan Gallagher 2016-05-31 11:53:47 UTC
Pushed to Master - Should be in the November 2016 Release.  Thanks!
Comment 6 Frédéric Demians 2016-06-15 07:32:54 UTC
Pushed in 16.05. Will be in 16.05.01.
Comment 7 Owen Leonard 2016-06-16 17:16:39 UTC
I think this patch will fix Bug 16756 (a 3.22.x bug), but is it problematic that it depends on Bug 16386?
Comment 8 Jonathan Druart 2016-06-18 12:59:04 UTC
*** Bug 16756 has been marked as a duplicate of this bug. ***
Comment 9 Christopher Brannon 2016-06-20 14:32:49 UTC
Would like to see this and 16386 in 3.22.x.
Comment 10 Julian Maurice 2016-08-17 14:30:32 UTC
(In reply to Owen Leonard from comment #7)
> I think this patch will fix Bug 16756 (a 3.22.x bug), but is it problematic
> that it depends on Bug 16386?

This patch seems not to be really dependent on bug 16386 (except that it was written on top of it).
I'll try to write a patch for 3.22.x
Comment 11 Christopher Brannon 2016-08-17 14:35:57 UTC
(In reply to Julian Maurice from comment #10)
> (In reply to Owen Leonard from comment #7)
> > I think this patch will fix Bug 16756 (a 3.22.x bug), but is it problematic
> > that it depends on Bug 16386?
> 
> This patch seems not to be really dependent on bug 16386 (except that it was
> written on top of it).
> I'll try to write a patch for 3.22.x

That is awesome.  Thank you.  :)
Comment 12 Julian Maurice 2016-08-17 14:41:41 UTC
Created attachment 54538 [details] [review]
[3.22.x] 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>
Comment 13 Julian Maurice 2016-08-17 14:42:13 UTC
Patch pushed to 3.22.x, will be in 3.22.10