Bugzilla – Attachment 47337 Details for
Bug 15663
Can't delete label from checkbox
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15663: Fix 'remove selected items', add a 'delete batch' button
Bug-15663-Fix-remove-selected-items-add-a-delete-b.patch (text/plain), 4.34 KB, created by
Jonathan Druart
on 2016-01-27 13:08:26 UTC
(
hide
)
Description:
Bug 15663: Fix 'remove selected items', add a 'delete batch' button
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-27 13:08:26 UTC
Size:
4.34 KB
patch
obsolete
>From 50b058aaa986c93e20c908fb124f2a3e5391a6d5 Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >Date: Tue, 26 Jan 2016 02:57:38 +0000 >Subject: [PATCH] Bug 15663: Fix 'remove selected items', add a 'delete batch' > button > >In this patch I have fixed the 'Remove selected items' button. >I have also added a 'Delete batch' button like there is in the Patron Card Creator. > >To test: >1) Go to Tools -> Label creator -> New label batch >2) Add 2 items >3) Select the checkbox next to an item you just added and click 'Remove selected items' >4) A pop-up will say that you are yet to select an item. (Please ignore the mistake in the pop-up message, this is being fixed in Bug 15662) >5) Apply patch and refresh. Confirm there is now a 'Delete batch' button in the toolbar >6) Select one item and click 'Remove selected items' >7) Confirm the item is deleted from the batch >8) Select the final item and click 'Remove selected items' >9) Pop-up message will tell you that deleting this item will delete the batch. Click 'Okay' >10) Click 'Delete batch' then 'Okay' >11) Confirm you are redirected to the Labels page and the batch has been deleted. > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/labels/label-edit-batch.tt | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 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 eb89d6e..ee03e2e 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 >@@ -8,6 +8,16 @@ > <script type="text/javascript"> > //<![CDATA[ > var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this?"); >+ function DeleteConfirm() { >+ var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]"); >+ var answer = confirm(msg); >+ if (answer) { >+ window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=batch&element_id=[% batch_id %]"; >+ } >+ else { >+ return; // abort delete >+ } >+ }; > function dofocus() { // named function req'd for body onload event by some FF and IE7 security models > $(".focus:last").select(); > } >@@ -30,13 +40,12 @@ > item_num.push(i+1); > } > } >- if (items.length < 1) { >- alert(_("Please select at least one item to delete.")); >- return; // no item selected >- } > getstr = items.join("&"); > item_msg = item_num.join(", "); > var msg = "Are you sure you want to remove label number(s): " + item_msg + " from this batch?" >+ } else if (document.items.action.checked) { >+ alert(_("Deletion of label from a batch with only one label will delete the batch.") + "\n\n" + _("If this is what you want, select the 'Delete batch' option from the toolbar")); >+ return; // no deletion for single item batch > } > else { > alert(_("Please select at least label to delete.")); >@@ -211,6 +220,7 @@ > <div id="batch-manage" class="btn-toolbar"> > <a class="btn btn-small" id="additems" href="#"><icon class="fa fa-plus"></icon> Add item(s)</a>[% IF ( table_loop ) %] > <a class="btn btn-small" id="removeitems" href="#"><icon class="fa fa-trash"></icon> Remove selected items</a> >+ <a class="btn btn-small" id="deletebatch" href="#"><icon class="fa fa-minus-square"></icon> Delete batch</a> > <a class="btn btn-small" id="deduplicate" href="#"><icon class="fa fa-minus"></icon> Remove duplicates</a> > <a class="btn btn-small" id="exportitems" href="#"><icon class="fa fa-share-square-o"></icon> Export selected items</a> > <a class="btn btn-small" id="exportbatch" href="#"><icon class="fa fa-share-square-o"></icon> Export full batch</a>[% END %] >-- >2.1.0
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 15663
:
47293
|
47309
| 47337