Bugzilla – Attachment 139563 Details for
Bug 6936
Allow to limit on multiple itemtypes when exporting bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6936: Allow multiple itemtypes for bib record export
Bug-6936-Allow-multiple-itemtypes-for-bib-record-e.patch (text/plain), 3.30 KB, created by
Katrin Fischer
on 2022-08-21 22:01:38 UTC
(
hide
)
Description:
Bug 6936: Allow multiple itemtypes for bib record export
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-08-21 22:01:38 UTC
Size:
3.30 KB
patch
obsolete
>From b2287c41cdbc8291fe5448ecdd61c79170b9c53e Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 8 Aug 2022 02:23:57 +0000 >Subject: [PATCH] Bug 6936: Allow multiple itemtypes for bib record export > >This patch allows multiple item types to be chosen when exporting >bib records from the Tools module. > >Test plan: >0. Apply patch and koha-plack --restart kohadev >1. Go to http://localhost:8081/cgi-bin/koha/tools/export.pl >2. Select "All" for "Item type" and note 435 bibs are exported >3. Select "Books" and note 360 bibs are exported >4. Select "Books" and "Visual Materials" and note 380 bibs are exported > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../intranet-tmpl/prog/en/modules/tools/export.tt | 2 +- > tools/export.pl | 11 +++++++---- > 2 files changed, 8 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >index fe01cf2b1f..b55aa7ff30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >@@ -88,7 +88,7 @@ > > <li> > <label for="itemtype">Item type: </label> >- <select name="itemtype" id="itemtype"> >+ <select name="itemtype" id="itemtype" multiple> > <option value="">-- All --</option> > [% FOREACH itemtype IN itemtypes %] > <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option> >diff --git a/tools/export.pl b/tools/export.pl >index b738afc60b..345158eedd 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -105,9 +105,12 @@ if ( $op eq "export" ) { > # No need to retrieve the record_ids if we already get them > unless ( @record_ids ) { > if ( $record_type eq 'bibs' ) { >+ >+ my %it_map = map { $_->itemtype => 1 } Koha::ItemTypes->search->as_list; >+ my @itemtypes = map { $it_map{$_} ? $_ : () } $query->multi_param('itemtype'); #Validate inputs against map >+ > my $starting_biblionumber = $query->param("StartingBiblionumber"); > my $ending_biblionumber = $query->param("EndingBiblionumber"); >- my $itemtype = $query->param("itemtype"); > my $start_callnumber = $query->param("start_callnumber"); > my $end_callnumber = $query->param("end_callnumber"); > my $start_accession = >@@ -148,11 +151,11 @@ if ( $op eq "export" ) { > ) > : (), > ( @branchcodes ? ( 'items.homebranch' => { in => \@branchcodes } ) : () ), >- ( $itemtype >+ ( @itemtypes > ? > C4::Context->preference('item-level_itypes') >- ? ( 'items.itype' => $itemtype ) >- : ( 'me.itemtype' => $itemtype ) >+ ? ( 'items.itype' => { in => \@itemtypes } ) >+ : ( 'me.itemtype' => { in => \@itemtypes } ) > : () > ), > >-- >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 6936
:
138765
|
139411
| 139563