Bug 16262 - Remove the use of "onclick" from acquisitions basket template
Summary: Remove the use of "onclick" from acquisitions basket template
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/acqui/basket.pl
Keywords:
Depends on: 16206
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-14 17:59 UTC by Owen Leonard
Modified: 2016-12-05 21:27 UTC (History)
2 users (show)

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


Attachments
Bug 16262 - Remove the use of "onclick" from acquisitions basket template (15.06 KB, patch)
2016-04-14 18:50 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16262 - Remove the use of "onclick" from acquisitions basket template (15.20 KB, patch)
2016-04-15 14:01 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16262 - Remove the use of "onclick" from acquisitions basket template (15.27 KB, patch)
2016-04-15 16:01 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-04-14 17:59:07 UTC
There are many place where an "onclick" attribute is used in acqui/basket.tt. These should be rewritten so that JS functionality can be separate from the markup.
Comment 1 Owen Leonard 2016-04-14 18:50:15 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-04-15 13:24:47 UTC
Followed testplan, works OK, but EDIFACT part of test plan not tested.
See comments on Bug 7736.
Comment 3 Marc Véron 2016-04-15 14:01:23 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-04-15 16:01:36 UTC
Created attachment 50282 [details] [review]
Bug 16262 - Remove the use of "onclick" from acquisitions basket template

In order to bring the acquisitions basket template into compliance with
coding guideline JS9, this patch changes with way some JavaScript events
are handled by moving JS handling out of the HTML markup.

Also changed: Replaced the use of [% script_name %] (which is
undefined), with the actual script path.

To test, apply the patch and locate an open basket in Acquisitions which
has more than one order in it.

- Test the "Managed by: Add user" button and verify that it triggers a
  popup where you can search for patrons.
  - Select two or more patrons to be managers for the basket.
  - Close the search windows and confirm that your choices appear on the
    basket page.
  - Click "Delete user" next to one of the patrons. The patron should be
    removed.
  - Click "Save changes" and verify that your choices are correctly
    saved.
  - Click "Delete user" next to one of the remaining patrons. The patron
    should be removed.
  - Click "Save changes" and verify that the patron stays deleted.
- In the list of orders, click the "Transfer" link and confirm that the
  correct pop-up window is triggered.
- Test the "Delete this basket" button in the toolbar. A modal window
  should be triggered.
  - In a basket with orders:
    - The "Delete basket and orders" button should do what it says,
      leaving associated bibliographic records intact.
    - The "Delete basket, orders, and records" button should do what it
      says, deleting any bibliographic records associated with orders.
  - In a basket with no orders:
    - The "Delete basket" button should work correctly.
- Test the "Create edifact order" button.
  - Click "Send EDI order" on the resulting page.
  - In the resulting dialog, "Are you sure you want to generate an
    edifact order," verify that both the "Yes" and "No" options work
    correctly.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Kyle M Hall 2016-04-29 14:49:10 UTC
Pushed to master for the 16.05 release. Thanks Owen!