Bug 16557 - Remove the use of "onclick" from several include files
Summary: Remove the use of "onclick" from several include files
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 16494 16553
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-19 14:26 UTC by Owen Leonard
Modified: 2017-12-07 22:17 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16557 - Remove the use of "onclick" from several include files (20.79 KB, patch)
2016-05-19 14:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16557 - Remove the use of "onclick" from several include files (20.80 KB, patch)
2016-06-03 11:04 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 16557 - Remove the use of "onclick" from several include files (20.87 KB, patch)
2016-06-21 13:20 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-05-19 14:26:16 UTC
There are several remaining include files in the staff client which use "onclick." These should be updated so that events are defined in the JavaScript instead.

 includes/acquisitions-search.inc
 includes/borrower_debarments.inc
 includes/help-bottom.inc
 includes/messaging-preference-form.inc
 includes/serials-toolbar.inc
 includes/subscriptions-search.inc
 includes/subtypes_unimarc.inc
Comment 1 Owen Leonard 2016-05-19 14:59:41 UTC Comment hidden (obsolete)
Comment 2 Claire Gravely 2016-06-03 11:04:36 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-06-21 13:20:43 UTC
Created attachment 52648 [details] [review]
Bug 16557 - Remove the use of "onclick" from several include files

This patch modifies several include files, removing "onclick" attributes
in favor of defining events in JavaScript.

A reusable "toggle" function has been added to the global JS file so
that clicking elements with the class "toggle_element" will toggle the
display of elements as defined in the click target's "data-element"
attribute.

Also changed: In subtypes_unimarc.inc some capitalization errors have
been fixed and label/id pairs corrected.

To test, apply the patch and clear your browser cache if necessary.

- On the Acquisitions home page, click the "Orders search" header search
  tab. Clicking the [+] link should expand and collapse the additional
  search fields.

- On the checkout or patron detail page, view the "Restrictions" tab.
  Click to add a restriction and use the datepicker to select a date.
  Clicking the "Clear date" link should clear the date.

- Trigger the help window on any page. Clicking the "close window"
  button should work correctly.

- Go to Administration -> Patron categories -> Edit. Checking and
  unchecking messaging preference options should work correctly. The "do
  not notify" checkbox should clear other checkboxes in that row and
  vice versa.

- In Serials, from a subscription detail page, clicking the "Renew"
  button should trigger the renew popup.

- Go to Acquisitions -> Vendor -> Add to basket -> From a subscription.
  Clicking the "Advanced search" link in the left hand sidebar should
  toggle the sidebar search form.

- In a UNIMARC system, view the advanced search page. Clicking the "Show
  coded information filters" link should show additional search fields.
  (I tested in my MARC21 system by temporarily moving line 174 of
  advsearch.tt to line 172).

Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Kyle M Hall 2016-06-24 13:51:34 UTC
Pushed to master for Koha 16.11, thanks Owen!
Comment 5 Frédéric Demians 2016-08-01 13:18:11 UTC
Pushed in 16.05. Will be in 16.05.02.