Bugzilla – Attachment 104879 Details for
Bug 25503
Add option to export items bundle contents in checkouts table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25503: Add option to export items bundle contents in checkouts table
Bug-25503-Add-option-to-export-items-bundle-conten.patch (text/plain), 3.41 KB, created by
Julian Maurice
on 2020-05-14 12:36:56 UTC
(
hide
)
Description:
Bug 25503: Add option to export items bundle contents in checkouts table
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-05-14 12:36:56 UTC
Size:
3.41 KB
patch
obsolete
>From 500d2ecec814d1a249c95f798bd844d92cb144f4 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 14 May 2020 11:56:23 +0200 >Subject: [PATCH] Bug 25503: Add option to export items bundle contents in > checkouts table > >This patch depends on bug 24023 > >Test plan: >1. Apply bug 24023 + this patch, run updatedatabase && update_dbix. >2. Enable system preference ExportCircHistory >3. Create a biblio record with one item >4. On the biblio details page, click on 'Edit -> Link elements'. Link at > least one item >5. Check out the item created at step 3 >6. In the checkouts table, check the box in column "Export", > choose export format 'MARC with items', check "Export items bundle > contents" and click on "Export" button > The exported file should contain the biblio and item created at step > 3, but also the item linked at step 4 with its biblio record >--- > .../prog/en/includes/checkouts-table.inc | 1 + > tools/export.pl | 18 ++++++++++++++++++ > 2 files changed, 19 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index 7b967bec89..4d9f0f844c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -71,6 +71,7 @@ > [% END %] > </select> > [% END %] >+ <label for="export_items_bundle_contents">Export items bundle contents</label> <input type="checkbox" name="export_items_bundle_contents" id="export_items_bundle_contents"> > <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% Koha.Preference('ExportRemoveFields') | html %]" title="Use for MARC exports" /> > <input type="hidden" name="op" value="export" /> > <input type="hidden" id="output_format" name="output_format" value="iso2709" /> >diff --git a/tools/export.pl b/tools/export.pl >index 97ff255da0..71e045e41f 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -197,6 +197,24 @@ if ( $op eq "export" ) { > @record_ids = grep $record_ids{$_}, @filter_record_ids; > } > >+ my $export_items_bundle_contents = $query->param('export_items_bundle_contents'); >+ if ($export_items_bundle_contents and $record_type eq 'bibs') { >+ my $schema = Koha::Database->new->schema; >+ my $items_bundle_rs = $schema->resultset('ItemsBundle'); >+ foreach my $record_id (@record_ids) { >+ my $item_bundle = $items_bundle_rs->find({ biblionumber => $record_id }); >+ if ($item_bundle) { >+ foreach my $items_bundle_item ($item_bundle->items_bundle_items) { >+ my $biblionumber = $items_bundle_item->itemnumber->get_column('biblionumber'); >+ my $itemnumber = $items_bundle_item->get_column('itemnumber'); >+ push @record_ids, $biblionumber; >+ push @itemnumbers, $itemnumber; >+ } >+ } >+ } >+ @record_ids = uniq @record_ids; >+ } >+ > print CGI->new->header( > -type => 'application/octet-stream', > -charset => 'utf-8', >-- >2.20.1
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 25503
:
104879
|
140901
|
140956
|
141206
|
142715
|
143165
|
143166
|
143167
|
143168
|
146005
|
146006
|
146007
|
146008