Bugzilla – Attachment 103147 Details for
Bug 8132
Batch delete tool deletes items with holds on them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8132: No changes but disable checkboxes
Bug-8132-No-changes-but-disable-checkboxes.patch (text/plain), 3.91 KB, created by
ByWater Sandboxes
on 2020-04-17 12:34:05 UTC
(
hide
)
Description:
Bug 8132: No changes but disable checkboxes
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-04-17 12:34:05 UTC
Size:
3.91 KB
patch
obsolete
>From 8f5fbcd256714f52c00c6417d5691aec3a6eb2da Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 2 Dec 2019 16:15:59 +0100 >Subject: [PATCH] Bug 8132: No changes but disable checkboxes > >When the list of items is displayed we already know if there will be a >problem during the deletion. So let's disable the checkbox to tell the >user in advance that items cannot be deleted. > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >--- > .../prog/en/modules/tools/batchMod-del.tt | 20 +++++++++++++++++--- > tools/batchMod.pl | 2 ++ > 2 files changed, 19 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >index 3d11fafd52..8701d9e2c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Asset %] > [% SET footerjs = 1 %] >+[% PROCESS 'i18n.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Batch item deletion</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -108,9 +109,22 @@ > <tr> > [% IF show %] > [% IF item_loo.nomod %] >- <td class="error">Cannot edit</td> >- [% ELSE %] >- <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" data-is-onloan="[% item_loo.onloan | html %]" /></td> >+ <td class="error">Cannot delete</td> >+ [% ELSE %] >+ [% SET can_be_deleted = item_loo.item.safe_to_delete %] >+ [% IF can_be_deleted == 1 %] >+ <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" /></td> >+ [% ELSE %] >+ [% SWITCH can_be_deleted %] >+ [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %] >+ [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belongs to your library") %] >+ [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %] >+ [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %] >+ [% CASE %][% SET cannot_delete_reason = t("Unknown reason") %] >+ [% END %] >+ >+ <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" disabled="disabled" title="[% cannot_delete_reason %]"/></td> >+ [% END %] > [% END %] > [% ELSE %] > <td> </td> >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 8b13257e5d..a7e3188ef0 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -633,6 +633,7 @@ sub BuildItemsData{ > $this_row{biblionumber} = $biblio->biblionumber; > $this_row{holds} = $biblio->holds->count; > $this_row{item_holds} = Koha::Holds->search( { itemnumber => $itemnumber } )->count; >+ $this_row{item} = Koha::Items->find($itemnumber); > > if (%this_row) { > push(@big_array, \%this_row); >@@ -658,6 +659,7 @@ sub BuildItemsData{ > $row_data{biblionumber} = $row->{biblionumber}; > $row_data{holds} = $row->{holds}; > $row_data{item_holds} = $row->{item_holds}; >+ $row_data{item} = $row->{item}; > my $is_on_loan = C4::Circulation::IsItemIssued( $row->{itemnumber} ); > $row_data{onloan} = $is_on_loan ? 1 : 0; > push(@item_value_loop,\%row_data); >-- >2.11.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 8132
:
95936
|
95937
|
95938
|
95939
|
95997
|
96147
|
96148
|
96149
|
96150
|
98694
|
98695
|
98696
|
98697
|
101404
|
101405
|
101406
|
101407
|
103147
|
103148
|
103149
|
103150
|
103166
|
103167
|
103168
|
103169
|
104567
|
104568
|
104569
|
104570
|
104571
|
104682