Bugzilla – Attachment 93009 Details for
Bug 23543
Adding withdrawn to the item search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23543: Adding Withdrawn to the Item Search
Bug-23543-Adding-Withdrawn-to-the-Item-Search.patch (text/plain), 9.77 KB, created by
ByWater Sandboxes
on 2019-09-20 15:51:58 UTC
(
hide
)
Description:
Bug 23543: Adding Withdrawn to the Item Search
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2019-09-20 15:51:58 UTC
Size:
9.77 KB
patch
obsolete
>From f5adc38859c2d057327d75df41389144f636a252 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 6 Sep 2019 15:37:43 +0000 >Subject: [PATCH] Bug 23543: Adding Withdrawn to the Item Search > >This patch adds "Withdrawn" status to the item search form and item >search results. > >To test you should have one or more items in your catalog which have a >'Withdrawn' status. > >Perform an item search and limit to a widthdrawn status. Verify that the >search returns the correct results and that the withdrawn column in >search results shows the correct information. > >Test the "Export results to CSV" button. The resulting file should >contain the correct data, including withdrawn status. > >Signed-off-by: joe <joe@flo.org> >--- > catalogue/itemsearch.pl | 20 +++++++++++++++++++- > .../en/includes/catalogue/itemsearch_item.csv.inc | 2 +- > .../en/includes/catalogue/itemsearch_item.json.inc | 1 + > .../en/includes/csv_headers/catalogue/itemsearch.tt | 2 +- > .../prog/en/modules/catalogue/itemsearch.tt | 11 +++++++++++ > 5 files changed, 33 insertions(+), 3 deletions(-) > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 36e22b67f5..090192e231 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -106,6 +106,9 @@ my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_v > $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); > my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; > >+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); >+my $withdrawn_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; >+ > if (scalar keys %params > 0) { > # Parameters given, it's a search > >@@ -114,7 +117,7 @@ if (scalar keys %params > 0) { > filters => [], > }; > >- foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost)) { >+ foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) { > if (my @q = $cgi->multi_param($p)) { > if ($q[0] ne '') { > my $f = { >@@ -241,6 +244,12 @@ if (scalar keys %params > 0) { > $itemlost_map->{$il_value->{authorised_value}} = $il_value->{lib}; > } > >+ # Get withdrawn labels >+ my $withdrawn_map = {}; >+ foreach my $wd_value (@$withdrawn_values) { >+ $withdrawn_map->{$wd_value->{authorised_value}} = $wd_value->{lib}; >+ } >+ > foreach my $item (@$results) { > my $biblio = Koha::Biblios->find( $item->{biblionumber} ); > $item->{biblio} = $biblio; >@@ -321,6 +330,14 @@ foreach my $value (@$itemlost_values) { > }; > } > >+my @withdrawns; >+foreach my $value (@$withdrawn_values) { >+ push @withdrawns, { >+ value => $value->{authorised_value}, >+ label => $value->{lib}, >+ }; >+} >+ > my @items_search_fields = GetItemSearchFields(); > > my $authorised_values = {}; >@@ -337,6 +354,7 @@ $template->param( > ccodes => \@ccodes, > notforloans => \@notforloans, > itemlosts => \@itemlosts, >+ withdrawns => \@withdrawns, > items_search_fields => \@items_search_fields, > authorised_values_json => to_json($authorised_values), > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc >index a1101c6eed..f52e3a6934 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc >@@ -4,4 +4,4 @@ > [% USE AuthorisedValues %] > [%- SET biblio = item.biblio -%] > [%- SET biblioitem = item.biblioitem -%] >-"[% biblio.title | html %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | html %]", "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", "[% biblioitem.publishercode | html %]", "[% AuthorisedValues.GetByCode( 'CCODE', item.ccode ) | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]","[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) || "" | html %]", "[% (item.issues || 0) | html %]" >+"[% biblio.title | html %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | html %]", "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", "[% biblioitem.publishercode | html %]", "[% AuthorisedValues.GetByCode( 'CCODE', item.ccode ) | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]","[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) || "" | html %]","[% AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn ) || "" | html %]", "[% (item.issues || 0) | html %]" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc >index 16db6ad5f4..b0ca870087 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc >@@ -23,6 +23,7 @@ > "[% item.stocknumber | html %]", > "[% item.status | html %]", > "[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) || "" | html %]", >+ "[% AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn ) || "" | html %]", > "[% (item.issues || 0) | html %]", > "[% FILTER escape_quotes ~%] > <div class="btn-group dropup"><button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-pencil"></i> Edit <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | uri %]&itemnumber=[% item.itemnumber | uri %]">Edit item</a></li> <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% item.biblionumber | html %]">Edit record</a></li> </ul> </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt >index e19e6c23f3..34c6d315d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt >@@ -1 +1 @@ >-[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Itemtype, Inventory number, Not for loan status, Lost status, Checkouts[%- END -%] >+[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Itemtype, Inventory number, Not for loan status, Lost status, Withdrawn status, Checkouts[%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index 7adecfe6ac..8c9a625dc3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -27,6 +27,7 @@ > [% CASE 'All statuses' %]<span>All statuses</span> > [% CASE 'damaged' %]<span>Damaged</span> > [% CASE 'itemlost' %]<span>Lost</span> >+ [% CASE 'withdrawn' %]<span>Withdrawn</span> > [% END %] > [% END %] > >@@ -158,6 +159,9 @@ > [% IF itemlosts.size %] > [% INCLUDE form_field_select name="itemlost" options = itemlosts empty_option = "All statuses" %] > [% END %] >+ [% IF withdrawns.size %] >+ [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %] >+ [% END %] > </fieldset> > <fieldset> > [% INCLUDE form_field_select_text %] >@@ -275,6 +279,7 @@ > + ' <th id="item_inventoryno">' + _("Inventory number") + '</th>' > + ' <th id="items_status">' + _("Not for loan status") + '</th>' > + ' <th id="items_itemlost">' + _("Lost status") + '</th>' >+ + ' <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>' > + ' <th id="items_checkouts">' + _("Checkouts") + '</th>' > + ' <th id=""></th>' > + ' </tr>' >@@ -378,6 +383,7 @@ > { 'sName': 'stocknumber' }, > { 'sName': 'notforloan' }, > { 'sName': 'itemlost' }, >+ { 'sName': 'withdrawn' }, > { 'sName': 'issues' }, > { 'sName': 'checkbox', 'bSortable': false } > ], >@@ -418,6 +424,11 @@ > [% ELSE %] > null, > [% END %] >+ [% IF withdrawns.size %] >+ { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => withdrawns %] }, >+ [% ELSE %] >+ null, >+ [% END %] > { 'type': 'text' }, > null > ] >-- >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 23543
:
92651
|
93009
|
93163
|
93500
|
93506