Bugzilla – Attachment 75321 Details for
Bug 19490
Add a 'holds' column to the Batch Item Modification Tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19490: Add a 'Holds' column to the items batchmodification tool
Bug-19490-Add-a-Holds-column-to-the-items-batchmod.patch (text/plain), 5.72 KB, created by
Nick Clemens (kidclamp)
on 2018-05-14 21:00:47 UTC
(
hide
)
Description:
Bug 19490: Add a 'Holds' column to the items batchmodification tool
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2018-05-14 21:00:47 UTC
Size:
5.72 KB
patch
obsolete
>From 31aa37893e336c950ad1f6f74c7158698ff39afc Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 14 May 2018 20:57:57 +0000 >Subject: [PATCH] Bug 19490: Add a 'Holds' column to the items > batchmodification tool > >To test: >1 - Add some items to bathc modification >2 - Note there is no indication fo holds >3 - Apply patch >4 - Reload and note you can see how many holds (or none) >5 - Note you can hide this column with css: > #batchMod-edit .holds_count { display: none; } >6 - Note the column has a tooltip to indicate item vs. record holds >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt | 2 ++ > koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js | 10 +++++----- > tools/batchMod.pl | 4 ++++ > 3 files changed, 11 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >index 32577c8..9b5079f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >@@ -137,6 +137,7 @@ $(document).ready(function(){ > <tr> > <th> </th> > <th class="anti-the">Title</th> >+ <th class="holds_count" title="Item holds / Total holds">Holds</th> > [% FOREACH item_header_loo IN item_header_loop %] > <th> [% item_header_loo.header_value %] </th> > [% END %] >@@ -155,6 +156,7 @@ $(document).ready(function(){ > <td> </td> > [% END %] > <td><label for="row[% item_loo.itemnumber %]"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">[% item_loo.title %]</a>[% IF ( item_loo.author ) %], by [% item_loo.author %][% END %]</label></td> >+ <td class="holds_count"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber %]">[% IF item_loo.holds %][% item_loo.item_holds %]/[% item_loo.holds %][% ELSE %][% item_loo.holds %][% END %]</a></td> > [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> > [% END %] </tr> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js b/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js >index 40ae5bd..c20a415 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js >@@ -11,7 +11,7 @@ function hideColumns(){ > $("#showall").prop("checked", false).parent().removeClass("selected"); > for( i=0; i<valCookie.length; i++ ){ > if(valCookie[i] !== ''){ >- index = valCookie[i] - 2; >+ index = valCookie[i] - 3; > $("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle(); > $("#checkheader"+index).prop("checked", false).parent().removeClass("selected"); > } >@@ -24,7 +24,7 @@ function hideColumn(num) { > valCookie = $.cookie("showColumns"); > // set the index of the table column to hide > $("#"+num).parent().removeClass("selected"); >- var hide = Number(num.replace("checkheader","")) + 2; >+ var hide = Number(num.replace("checkheader","")) + 3; > // hide header and cells matching the index > $("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle(); > // set or modify cookie with the hidden column's index >@@ -60,7 +60,7 @@ function showColumn(num){ > $("#"+num).parent().addClass("selected"); > valCookie = $.cookie("showColumns"); > // set the index of the table column to hide >- show = Number(num.replace("checkheader","")) + 2; >+ show = Number(num.replace("checkheader","")) + 3; > // hide header and cells matching the index > $("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle(); > // set or modify cookie with the hidden column's index >@@ -82,14 +82,14 @@ function showColumn(num){ > function showAllColumns(){ > $("#selections").checkCheckboxes(); > $("#selections span").addClass("selected"); >- $("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show(); >+ $("#itemst td:nth-child(3),#itemst tr th:nth-child(3)").nextAll().show(); > $.removeCookie("showColumns", { path: '/' }); > $("#hideall").prop("checked", false).parent().removeClass("selected"); > } > function hideAllColumns(){ > $("#selections").unCheckCheckboxes(); > $("#selections span").removeClass("selected"); >- $("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide(); >+ $("#itemst td:nth-child(3),#itemst th:nth-child(3)").nextAll().hide(); > $("#hideall").prop("checked", true).parent().addClass("selected"); > var cookieString = allColumns.join("/"); > $.cookie("showColumns", cookieString, { expires : date, path: '/' }); >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index f24b2f6..22271a8 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -581,6 +581,8 @@ sub BuildItemsData{ > $this_row{author} = $biblio->author; > $this_row{isbn} = $biblio->biblioitem->isbn; > $this_row{biblionumber} = $biblio->biblionumber; >+ $this_row{holds} = $biblio->holds->count; >+ $this_row{item_holds} = Koha::Holds->search( itemnumber => $itemnumber )->count; > > if (%this_row) { > push(@big_array, \%this_row); >@@ -604,6 +606,8 @@ sub BuildItemsData{ > $row_data{title} = $row->{title}; > $row_data{isbn} = $row->{isbn}; > $row_data{biblionumber} = $row->{biblionumber}; >+ $row_data{holds} = $row->{holds}; >+ $row_data{item_holds} = $row->{item_holds}; > my $is_on_loan = C4::Circulation::IsItemIssued( $row->{itemnumber} ); > $row_data{onloan} = $is_on_loan ? 1 : 0; > push(@item_value_loop,\%row_data); >-- >2.1.4
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 19490
:
75321
|
75489
|
75516
|
75533
|
75534
|
79429
|
79430
|
80170
|
80171
|
80705
|
80708