Bugzilla – Attachment 154585 Details for
Bug 34570
Remove use of onclick for PopupMARCFieldDoc()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()
Bug-34570-Remove-use-of-onclick-for-PopupMARCField.patch (text/plain), 2.96 KB, created by
Owen Leonard
on 2023-08-18 06:23:27 UTC
(
hide
)
Description:
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-08-18 06:23:27 UTC
Size:
2.96 KB
patch
obsolete
>From 8b0fcb8a4529e9bbd0f308b85436c38f376ba966 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Fri, 18 Aug 2023 03:02:30 +0000 >Subject: [PATCH] Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc() > >This change removes the "onclick" attribute for the MARC doc >link in the cataloguing editor. > >Test plan: >0. Apply patch >1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=# >2. Click on the question mark (?) next to any of the MARC fields >3. Press the "Repeat this tag" button >4. Click on the question mark (?) on the cloned MARC field >5. Note that both times it worked > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/cataloguing/addbiblio.tt | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 1c1e7db0a3e..7e88dd9d7c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -435,7 +435,8 @@ function AutomaticLinker() { > } > > >-function PopupMARCFieldDoc(field) { >+function PopupMARCFieldDoc() { >+ let field = this.dataset.tag; > [% IF Koha.Preference('marcfielddocurl') %] > var docurl = "[% Koha.Preference('marcfielddocurl').replace('"','"') | html %]"; > docurl = docurl.replace("{MARC}", "[% marcflavour | html %]"); >@@ -447,7 +448,13 @@ function PopupMARCFieldDoc(field) { > [% ELSIF ( marcflavour == 'UNIMARC' ) %] > _UNIMARCFieldDoc(field); > [% END %] >+ return false; > } >+[%# Attach to body, so that cloned nodes will still have the event listener %] >+$(document).ready(function(){ >+ $('body').on('click','.marcdocs',PopupMARCFieldDoc); >+}); >+ > function confirmnotdup(redirect){ > $("#confirm_not_duplicate").attr("value","1"); > $("#redirect").attr("value",redirect); >@@ -1040,7 +1047,7 @@ function PopupMARCFieldDoc(field) { > <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to expand this tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag | html %]</a> > [% ELSE %] > <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span> >- <a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;"> ?</a> >+ <a href="#" class="marcdocs" data-tag="[% innerloo.tag | html %]"> ?</a> > [% END %] > > [% IF ( innerloo.fixedfield ) %] >-- >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 34570
:
154583
|
154585
|
154792