Bugzilla – Attachment 163238 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
Bug-36326-PoC.patch (text/plain), 3.57 KB, created by
Pedro Amorim
on 2024-03-15 14:06:12 UTC
(
hide
)
Description:
Bug 36326: PoC
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-03-15 14:06:12 UTC
Size:
3.57 KB
patch
obsolete
>From 5cdd20df87adde2b59af8ebfde2504b34f74117b Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 15 Mar 2024 14:05:58 +0000 >Subject: [PATCH] Bug 36326: PoC > >Joubu, whats your opinion on this approach? >--- > .../prog/en/modules/catalogue/detail.tt | 27 +++++++++++++------ > 1 file changed, 19 insertions(+), 8 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 9124612b81f..73520867194 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,12 @@ > <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' %] >+ <fieldset> >+ </fieldset> >+ </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,15 +1635,16 @@ > [% IF StaffDetailItemSelection %] > function itemSelectionBuildDeleteLink(div) { > var itemnumbers = new Array(); >+ var delete_form_fieldset_el = $('#itemselection_action_delete_form fieldset'); >+ delete_form_fieldset_el.empty(); > $("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); >+ if (delete_form_fieldset_el.children().length > 0) { >+ delete_form_fieldset_el.append("<input name='src' type='hidden' value='CATALOGUING'/>"); >+ delete_form_fieldset_el.append("<input name='biblionumber' type='hidden' value='" + [% biblionumber | uri %] + "'/>"); >+ delete_form_fieldset_el.append("<input name='op' type='hidden' value='cud-show'/>"); >+ delete_form_fieldset_el.append("<input name='del' type='hidden' value='1'/>"); > } else { > return false; > } >@@ -1674,6 +1680,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