Bugzilla – Attachment 156391 Details for
Bug 34934
Remove the use of event attributes from OPAC lists page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34934: Remove the use of event attributes from OPAC lists page
Bug-34934-Remove-the-use-of-event-attributes-from-.patch (text/plain), 5.10 KB, created by
Katrin Fischer
on 2023-09-29 13:23:07 UTC
(
hide
)
Description:
Bug 34934: Remove the use of event attributes from OPAC lists page
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-09-29 13:23:07 UTC
Size:
5.10 KB
patch
obsolete
>From 0ab6d1238247e1fc3e4bb99e5f481712c6eb3686 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 27 Sep 2023 15:42:26 +0000 >Subject: [PATCH] Bug 34934: Remove the use of event attributes from OPAC lists > page > >This patch removes the use of event attributes (onclick, onchange) from >the OPAC lists template. These events are defined now along with the >other in-page JS. > >The patch also removes a "delete list" button which was only shown >when viewing an empty list and which was redundant. > >To test, apply the patch and log into the OPAC. > >- Go to Lists -> New list. >- Change the category to "Private" and the "Allow changes" dropdown to > "Staff only." > - You should see a message, 'The "Staff only" permission has no actual > effect while this list is strictly private' >- Change the category to "Public." The message should disappear. > >- View the contents of a list. > - Click the "Send list" button at the top of the table of titles. > - It should trigger the "Sending your list" popup window. > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > .../bootstrap/en/modules/opac-shelves.tt | 24 ++++++++++--------- > 1 file changed, 13 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 6e352839c4..671e0c33d3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -39,7 +39,7 @@ > [% BLOCK list_permissions %] > <li> > <label for="allow_changes_from">Allow changes to contents from: </label> >- <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()"> >+ <select name="allow_changes_from" id="allow_changes_from"> > > [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %] > >@@ -241,7 +241,7 @@ > </div> > > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >- <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | uri %]" class="btn btn-link send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=yes,resizable=yes,height=400,width=500,top=50,left=100'); return false; "><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send list</a></span> >+ <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | uri %]" class="btn btn-link send"><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send list</a></span> > [% END %] > > <a class="btn btn-link print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | html %]&sortfield=[% sortfield | html %]&direction=[% direction | uri %]&print=1"><i class="fa fa-fw fa-print" aria-hidden="true"></i> Print list</a> >@@ -567,14 +567,6 @@ > [% END %] > </div> > >- [% IF can_manage_shelf %] >- <form method="post" action="opac-shelves.pl"> >- <input type="hidden" name="op" value="delete" /> >- <input type="hidden" name="referer" value="list" /> >- <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]"/> >- <input type="submit" class="btn btn-danger" value="Delete this list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" /> >- </form> >- [% END %] > [% END # / IF itemsloop %] > [% END # /IF shelf AND op == 'view' %] > >@@ -630,7 +622,7 @@ > [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %] > <li> > <label for="public">Category:</label> >- <select name="public" id="public" onchange="AdjustRemark()"> >+ <select name="public" id="public"> > [% IF shelf.is_private %] > <option value="0" selected="selected">Private</option> > [% ELSE %] >@@ -1079,6 +1071,16 @@ $(function() { > $("#download_list").submit(); > }); > >+ $("#allow_changes_from, #public").on("change", function(){ >+ AdjustRemark(); >+ }); >+ >+ $(".send").on("click", function(e){ >+ e.preventDefault(); >+ let link = this.href; >+ Dopop( link ); >+ }); >+ > }); // document.ready > > function sortMenu( sorting_form ){ >-- >2.30.2
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 34934
:
156298
|
156313
| 156391