Bugzilla – Attachment 168226 Details for
Bug 37187
Label batches and label templates cannot be deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37187: Fix deletion of label batches and label templates
Bug-37187-Fix-deletion-of-label-batches-and-label-.patch (text/plain), 6.23 KB, created by
Marcel de Rooy
on 2024-06-28 07:46:05 UTC
(
hide
)
Description:
Bug 37187: Fix deletion of label batches and label templates
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-06-28 07:46:05 UTC
Size:
6.23 KB
patch
obsolete
>From b890de8f3f8bbec3a0bc0f8b152a2505a76f9e0d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 26 Jun 2024 14:56:58 +0000 >Subject: [PATCH] Bug 37187: Fix deletion of label batches and label templates >Content-Type: text/plain; charset=utf-8 > >This patch uses the new form-submit JS to convert the label management >deletion link from a GET operation to POST. > >To test, apply the patch and go to Cataloging -> Label creator. > >- Click Manage -> Label batches. Create a batch if necessary. >- Click the "Delete" button in the "Actions" column. You should get a > confirmation message, "Are you sure you want to delete this?" > - Test both the confirming and cancelling. >- Perform the same test with Manage -> Label templates. >- From the Manage -> Label batches page, click "edit" on one of the > batches. >- Right above the "Items in batch number X" is a toolbar which should > have a button, "Delete batch." Test that it works correctly to delete > the batch. > >Sponsored-by: Athens County Public Libraries >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../en/modules/labels/label-edit-batch.tt | 20 +++++-------------- > .../prog/en/modules/labels/label-manage.tt | 4 +++- > 2 files changed, 8 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >index 73855dbef5..ddf93049e0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >@@ -124,7 +124,9 @@ > <a class="btn btn-default" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %] > <a class="btn btn-default" id="savedesc" href="#" data-batch_id="[% batch_id | html %]"><i class="fa fa-save"></i> Save description</a> > <a class="btn btn-default" id="removeitems" href="#"><i class="fa fa-trash-can"></i> Remove selected items</a> >- <a class="btn btn-default" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a> >+ >+ <a class="btn btn-default submit-form-link" id="deletebatch" href="#" data-op="cud-delete" data-label_element="batch" data-element_id="[% batch_id | html %]" data-action="/cgi-bin/koha/labels/label-manage.pl" data-method="post" data-confirmation-msg="[% tx("Are you sure you want to delete batch {batch_number}?", { batch_number = batch_id }) %]"><i class="fa fa-minus-square"></i> Delete batch</a> >+ > <a class="btn btn-default" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a> > <a class="btn btn-default" id="exportitems" href="#"><i class="fa-solid fa-share-from-square"></i> Export selected items</a> > <a class="btn btn-default" id="exportbatch" href="#"><i class="fa-solid fa-share-from-square"></i> Export full batch</a>[% END %] >@@ -206,17 +208,8 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'greybox.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% Asset.js("js/form-submit.js") | $raw %] > <script> >- function DeleteConfirm() { >- var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id | html %]"); >- var answer = confirm(msg); >- if (answer) { >- window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=batch&element_id=[% batch_id | html %]"; >- } >- else { >- return; // abort delete >- } >- } > function dofocus() { // named function req'd for body onload event by some FF and IE7 security models > $(".focus:last").select(); > } >@@ -343,10 +336,7 @@ > Remove(); > return false; > }); >- $("#deletebatch").click(function(){ >- DeleteConfirm(); >- return false; >- }); >+ > $("#deduplicate").click(function(){ > DeDuplicate(); > return false; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >index aa190503c0..582d7786a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >@@ -95,7 +95,8 @@ > [% IF ( text_field.select_field ) %] > <td class="actions"> > <a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit_form&element_id=[% text_field.field_value |url %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >- <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=[% label_element | html %]&element_id=[% text_field.field_value |url %]"><i class="fa fa-trash-can"></i> Delete</a> >+ >+ <a class="btn btn-default btn-xs submit-form-link" href="#" data-label_element="[% label_element | html %]" data-element_id="[% text_field.field_value | html %]" data-action="label-manage.pl" data-method="post" data-op="cud-delete" data-confirmation-msg="[% t('Are you sure you want to delete this?') | html %]"><i class="fa fa-trash-can"></i> Delete</a> > </td> > [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %] > [% ELSIF ( text_field.field_value ) %] >@@ -134,6 +135,7 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'greybox.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% Asset.js("js/form-submit.js") | $raw %] > <script> > function Xport() { > batches= new Array; >-- >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 37187
:
168156
|
168179
|
168182
| 168226