From c8c0906d87c89d6bc921067f6b54d680b9a2fd6e Mon Sep 17 00:00:00 2001 From: Owen Leonard <oleonard@myacpl.org> Date: Sat, 14 Oct 2023 14:20:00 +0000 Subject: [PATCH] Bug 34980: Remove the use of event attributes from title-actions-menu.inc in OPAC This patch updates the include file used to show actions with each search result, removing two instances of "onclick" in favor of an event handler class which was already in use elsewhere. To test, apply the patch and log in to the OPAC. - Perform a catalog search which will return results. - Test the "Save to lists" link under any search result. The "Save to lists" pop-up window should appear. - View the contents of a list which contains some titles. - Test the "Save to another list" control. The same pop-up window should be triggered. - Tag at least one title in the catalog and view the "Tag cloud" page. - Perform the same test with the "Save to lists" button in the table of our tags. --- .../opac-tmpl/bootstrap/en/includes/title-actions-menu.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc index ecb91cf1b25..6a57bdc1836 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc @@ -50,12 +50,12 @@ [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %] [% IF ( shelf AND op == 'view' ) %] - <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]'); return false;" class="btn btn-link btn-sm"><i class="fa fa-list" aria-hidden="true"></i> Save to another list</a></span> + <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" class="addtoshelf btn btn-link btn-sm"><i class="fa fa-list" aria-hidden="true"></i> Save to another list</a></span> [% IF can_remove_biblios %] <span class="actions"><a class="btn btn-link btn-sm removefromlist" href="/cgi-bin/koha/opac-shelves.pl?op=remove_biblios&shelfnumber=[% shelf.shelfnumber | html %]&biblionumber=[% items.biblionumber | html %]"><i class="fa fa-times" aria-hidden="true"></i> Remove from this list</a></span> [% END %] [% ELSE %] - <span class="actions"><a class="addtoshelf btn btn-link btn-sm" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]'); return false;"><i class="fa fa-list" aria-hidden="true"></i> Save to lists</a></span> + <span class="actions"><a class="addtoshelf btn btn-link btn-sm" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-list" aria-hidden="true"></i> Save to lists</a></span> [% END # /IF ( shelf AND op == 'view' ) %] [% END # /IF Koha.Preference( 'opacuserlogin' ) %] -- 2.30.2