@@ -, +, @@ template - 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. --- .../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(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc @@ -89,14 +89,14 @@
  • - + Delete
  • [% END %] [% IF ( c.club_enrollments.count ) %]
  • - + Search to hold
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -87,7 +87,7 @@ Edit - + Delete [% 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", --