Bugzilla – Attachment 163662 Details for
Bug 36326
Batch deletion of selected items from detail page is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36326: PoC followup
Bug-36326-PoC-followup.patch (text/plain), 3.82 KB, created by
Marcel de Rooy
on 2024-03-22 08:24:07 UTC
(
hide
)
Description:
Bug 36326: PoC followup
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-03-22 08:24:07 UTC
Size:
3.82 KB
patch
obsolete
>From 1bd3383ad53b153f7c7682ade522fbde94ca16c6 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 15 Mar 2024 14:47:24 +0000 >Subject: [PATCH] Bug 36326: PoC followup >Content-Type: text/plain; charset=utf-8 > >I've moved the static elements to the form instead of appending them. >This does not overlap 100% with bug 36193 or 34478 as in those cases we're not adding inputs to the form dynamically, so we should/have to keep that in here. >Let me know what you think. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/catalogue/detail.tt | 27 ++++++++++++------- > 1 file changed, 18 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 993f67fdcb..b0d159f874 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -334,7 +334,14 @@ > <span class="itemselection_actions"> > | Actions: > [% IF CAN_user_tools_items_batchdel %] >- <a class="itemselection_action_delete"><i class="fa fa-trash-can"></i> Delete selected items</a> >+ <form id="itemselection_action_delete_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input name='src' type='hidden' value='CATALOGUING'/> >+ <input name='biblionumber' type='hidden' value='" + [% biblionumber | uri %] + "'/> >+ <input name='op' type='hidden' value='cud-show'/> >+ <input name='del' type='hidden' value='1'/> >+ </form> >+ <a href="#" class="itemselection_action_delete"><i class="fa fa-trash-can"></i> Delete selected items</a> > [% END %] > [% IF CAN_user_tools_items_batchmod %] > <a class="itemselection_action_modify"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Modify selected items</a> >@@ -1630,16 +1637,13 @@ > [% IF StaffDetailItemSelection %] > function itemSelectionBuildDeleteLink(div) { > var itemnumbers = new Array(); >+ $('#itemselection_action_delete_form fieldset').remove(); >+ $('#itemselection_action_delete_form').append('<fieldset></fieldset>'); >+ var delete_form_fieldset_el = $('#itemselection_action_delete_form fieldset'); > $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() { >- itemnumbers.push($(this).val()); >+ delete_form_fieldset_el.append("<input name='itemnumber' type='hidden' value='"+$(this).val()+"'/>"); > }); >- if (itemnumbers.length > 0) { >- var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1'; >- url += '&itemnumber=' + itemnumbers.join('&itemnumber='); >- url += '&biblionumber=[% biblionumber | uri %]'; >- url += '&src=CATALOGUING'; >- $('a.itemselection_action_delete').attr('href', url); >- } else { >+ if (delete_form_fieldset_el.children().length == 0) { > return false; > } > return true >@@ -1674,6 +1678,11 @@ > } > > $(document).ready(function() { >+ $('.itemselection_actions').on('click', 'a.itemselection_action_delete', function(e) { >+ e.preventDefault(); >+ $('#itemselection_action_delete_form').submit(); >+ }); >+ > $('table.items_table').each(function() { > var div = $(this).parent().attr("id"); > itemSelectionBuildActionLinks(div); >-- >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 36326
:
163227
|
163238
|
163250
|
163276
|
163661
|
163662
|
163663