Bug 16372

Summary: Replace the use of "onclick" for deletion confirmation in some templates
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Arslan Farooq <arslanone>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: arslanone, julian.maurice, kyle
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 16058    
Bug Blocks: 16386    
Attachments: Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates
Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates
[PASSED QA] Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates

Description Owen Leonard 2016-04-27 16:30:09 UTC
Several templates include the use of an "onclick" attribute to handle deletion confirmations:

intranet-main.tt
patron_lists/lists.tt
patroncards/image-manage.tt
tools/koha-news.tt

These should be modified so that events are handled in JavaScript.
Comment 1 Owen Leonard 2016-04-27 16:39:59 UTC Comment hidden (obsolete)
Comment 2 Arslan Farooq 2016-04-28 03:50:39 UTC Comment hidden (obsolete)
Comment 3 Arslan Farooq 2016-04-28 03:52:21 UTC
Did QA tools as well, and it passed. However, there was that Plugins.pm message again "Compilation failed in require at /usr/local/lib/perl/5.14.2/Template/Plugins.pm line 206."

-----------------------------------------------------
FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
   OK	  forbidden patterns
   SKIP	  spelling
   OK	  tt_valid
   FAIL	  valid_template
		Attempt to reload Koha/Template/Plugin/Koha.pm aborted.
Compilation failed in require at /usr/local/lib/perl/5.14.2/Template/Plugins.pm line 206.



 OK	koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt
   OK	  forbidden patterns
   SKIP	  spelling
   OK	  tt_valid
   OK	  valid_template

 OK	koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt
   OK	  forbidden patterns
   SKIP	  spelling
   OK	  tt_valid
   OK	  valid_template

 OK	koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
   OK	  forbidden patterns
   SKIP	  spelling
   OK	  tt_valid
   OK	  valid_template
-----------------------------------------------------
Comment 4 Katrin Fischer 2016-04-28 09:54:32 UTC
Created attachment 50887 [details] [review]
[PASSED QA] Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates

This patch removes the use of event attributes from several templates
where the attributes were used to handle deletion operations. I've
grouped these changes in one patch because each template had only small
changes to be made.

Unrelated change: Reformatted the "no news items" message which is
displayed if there are no news items.

To test, apply the patch and test deletion operations on the following
pages. Clicking "delete" should prompty you to confirm. Test both the
confirm and cancel actions.

- On the staff client home page, test deletion of a news item.
- On the patron lists page, test deletion of a patron list.
- In the patron card creator, choose Manage -> Images. Test the "Delete"
  button for a single image.
- On the news page, test deletion of a single news item.
- On the news page, test deletion of multiple items.

Signed-off-by: Arslan Farooq <arslanone@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Kyle M Hall (khall) 2016-04-29 16:12:29 UTC
Pushed to master for the 16.05 release. Thanks Owen!