Bug 34085 - Remove the use of event attributes from basket groups template
Summary: Remove the use of event attributes from basket groups template
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 17858
  Show dependency treegraph
 
Reported: 2023-06-21 17:23 UTC by Owen Leonard
Modified: 2023-12-28 20:47 UTC (History)
4 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:
23.11.00


Attachments
Bug 34085: Remove the use of event attributes from basket groups template (14.26 KB, patch)
2023-06-21 17:58 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34085: Remove the use of event attributes from basket groups template (14.31 KB, patch)
2023-08-24 06:26 UTC, David Cook
Details | Diff | Splinter Review
Bug 34085: [follow-up] remove typo in Javascript (1.03 KB, patch)
2023-08-24 06:26 UTC, David Cook
Details | Diff | Splinter Review
Bug 34085: Remove the use of event attributes from basket groups template (14.46 KB, patch)
2023-09-08 11:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 34085: [follow-up] remove typo in Javascript (1.08 KB, patch)
2023-09-08 11:12 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-06-21 17:23:29 UTC
There are some event attributes in the basket groups template. These should be removed in favor of defining events in JavaScript.
Comment 1 Owen Leonard 2023-06-21 17:58:48 UTC Comment hidden (obsolete)
Comment 2 David Cook 2023-08-24 06:26:24 UTC Comment hidden (obsolete)
Comment 3 David Cook 2023-08-24 06:26:27 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2023-09-08 11:12:39 UTC
Created attachment 155399 [details] [review]
Bug 34085: Remove the use of event attributes from basket groups template

This patch removes the use of event attributes (onclick, onsubmit) from
the basket groups template. These events are defined now along with the
other in-page JS.

This change allows us to move the scripts to the bottom of the page.

Unrelated changes: There was no confirmation tied to the process of
deleting a basket group. I've added one. And there were several "MSG_"
variables defined which were unused and have been removed.

To test you should have at least one vendor with at least one basket
group.

- Apply the patch and go to Acquisitions.
- Locate a vendor with an associated basket group.
- Edit a basketgroup
  - Confirm that editing works correctly (leaving "Close basket group"
    unchecked")
  - Confirm that editing works correctly with "Close basket group"
    checked.
- In the list of closed basket groups, confirm that all the controls
  work correctly.
- Create an empty basket group and confirm that clicking the associated
  "Delete" button in the list of basket groups triggers a confirmation,
  "Are you sure you want to delete this basket group?" Test that both
  confirming and cancelling work correctly.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 5 Katrin Fischer 2023-09-08 11:12:42 UTC
Created attachment 155400 [details] [review]
Bug 34085: [follow-up] remove typo in Javascript

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 6 Tomás Cohen Arazi 2023-09-08 14:40:19 UTC
(In reply to Katrin Fischer from comment #5)
> Created attachment 155400 [details] [review] [review]
> Bug 34085: [follow-up] remove typo in Javascript

^^ please run the QA script!
Comment 7 Tomás Cohen Arazi 2023-09-08 14:54:12 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 8 Fridolin Somers 2023-09-08 19:56:52 UTC
Does not apply on 23.05.x, one cause is the FA version difference.

Please provide patches for 23.05.x if needed.