Bugzilla – Attachment 97514 Details for
Bug 24393
Remove event attributes from patron clubs list template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24393: Remove event attributes from patron clubs list template
Bug-24393-Remove-event-attributes-from-patron-club.patch (text/plain), 5.44 KB, created by
David Nind
on 2020-01-17 12:17:47 UTC
(
hide
)
Description:
Bug 24393: Remove event attributes from patron clubs list template
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-01-17 12:17:47 UTC
Size:
5.44 KB
patch
obsolete
>From 09a7f3aa3ec32daacdbc4ca03ebdfe270d3e1c13 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 9 Jan 2020 19:09:31 +0000 >Subject: [PATCH] Bug 24393: Remove event attributes from patron clubs list > template > >This patch removes some instances of the "onclick" attributes from the >template that lists patron clubs and templates. > >To test, apply the patch and go to Tools -> Patron clubs. > > - Test the process of deleting a club template. Clicking the "Delete" > button should trigger a confirmation. Confirming should delete the > template. > > - Test the process of deleting a club. In the "Clubs" section of the > page, click the "Actions" menu next to any club. Clicking the > "Delete" link should trigger a confirmation. Confirming should delete > the club. > > - Also in the "Clubs" section of the page, find a club which has > enrollments. Select "Search to hold" from the "Actions" menu. It > should take you to the advanced search. On the search results page > you should have the option to place a hold for the club you selected. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/en/includes/clubs-table.inc | 4 ++-- > .../intranet-tmpl/prog/en/modules/clubs/clubs.tt | 26 +++++++++++++++++++--- > 2 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc >index 62027b1a38..06869538aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc >@@ -89,14 +89,14 @@ > </a> > </li> > <li> >- <a href="#" onclick='ConfirmDeleteClub([% c.id | html %], "[% c.name | html %]", $(this) ); return false;'> >+ <a href="#" class="delete_club" data-id="[% c.id | html %]" data-name="[% c.name | html %]"> > <i class="fa fa-trash"></i> Delete > </a> > </li> > [% END %] > [% IF ( c.club_enrollments.count ) %] > <li> >- <a href="#" onclick="SearchToHold([% c.id | html %])"> >+ <a href="#" class="club_hold_search" data-id="[% c.id | html %]"> > <i class="fa fa-search"></i> Search to hold > </a> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >index e4176a9da0..2258635d92 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >@@ -87,7 +87,7 @@ > <a class="btn btn-xs btn-default" style="white-space:nowrap" href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id | html %]"> > <i class="fa fa-pencil"></i> Edit > </a> >- <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id | html %], "[% t.name | html %]", $(this) ); return false;'> >+ <a class="btn btn-xs btn-default delete_template" href="#" data-id="[% t.id | html %]" data-name="[% t.name | html %]"> > <i class="fa fa-trash"></i> Delete > </a> > [% END %] >@@ -159,9 +159,29 @@ > { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, > ] > } )); >+ >+ $(".delete_club").on("click", function(e){ >+ e.preventDefault(); >+ var club_id = $(this).data("id"); >+ var club_name = $(this).data("name"); >+ ConfirmDeleteClub( club_id, club_name ); >+ }); >+ >+ $(".delete_template").on("click", function(e){ >+ e.preventDefault(); >+ var template_id = $(this).data("id"); >+ var template_name = $(this).data("name"); >+ ConfirmDeleteTemplate( template_id, template_name ); >+ }); >+ >+ $(".club_hold_search").on("click", function(e){ >+ e.preventDefault; >+ var club_id = $(this).data("id"); >+ SearchToHold( club_id ); >+ }); > }); > >- function ConfirmDeleteTemplate( id, name, a ) { >+ function ConfirmDeleteTemplate( id, name ) { > if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) { > $.ajax({ > type: "POST", >@@ -179,7 +199,7 @@ > } > } > >- function ConfirmDeleteClub( id, name, a ) { >+ function ConfirmDeleteClub( id, name ) { > if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) { > $.ajax({ > type: "POST", >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24393
:
97139
|
97514
|
97599