Bugzilla – Attachment 114178 Details for
Bug 16522
Add 773 (Host item entry) to the cart and list displays and e-mails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16522: Adding 773 to basket and cart WIP
Bug-16522-Adding-773-to-basket-and-cart-WIP.patch (text/plain), 6.64 KB, created by
Aleisha Amohia
on 2020-12-04 03:02:18 UTC
(
hide
)
Description:
Bug 16522: Adding 773 to basket and cart WIP
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-12-04 03:02:18 UTC
Size:
6.64 KB
patch
obsolete
>From 6ab9df7aa2b4e6acc3b44a32d9df0c74672bf2f0 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Fri, 4 Dec 2020 16:00:31 +1300 >Subject: [PATCH] Bug 16522: Adding 773 to basket and cart WIP > >Not yet ready for testing. >--- > Koha/Biblio.pm | 19 +++++++++++++++ > basket/basket.pl | 2 ++ > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 28 ++++++++++++++++++++++ > virtualshelves/sendshelf.pl | 2 ++ > 4 files changed, 51 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 4d335e2c23..76a9e40a91 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -813,6 +813,25 @@ sub to_api { > return { %$response, %$biblioitem }; > } > >+=head2 get_host_item_entries >+ >+ my @host_item_entries = $biblio->get_host_item_entries; >+ >+Returns a list of MARC::Field objects of the 773 tag which contain host item entry information. >+Returns undef if no 773 defined. >+ >+=cut >+ >+sub get_host_item_entries { >+ my ( $self ) = @_; >+ >+ my $record = $self->metadata->record; >+ >+ my @host_item_entries = $record->field('773'); >+ >+ return ( @host_item_entries > 0 ) ? \@host_item_entries : undef; >+} >+ > =head3 to_api_mapping > > This method returns the mapping for representing a Koha::Biblio object >diff --git a/basket/basket.pl b/basket/basket.pl >index aa4cd97dcf..aa5b356646 100755 >--- a/basket/basket.pl >+++ b/basket/basket.pl >@@ -61,6 +61,7 @@ foreach my $biblionumber ( @bibs ) { > > my $dat = &GetBiblioData($biblionumber); > next unless $dat; >+ my $biblio = Koha::Biblios->find($biblionumber); > my $record = &GetMarcBiblio({ biblionumber => $biblionumber }); > my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); > my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); >@@ -101,6 +102,7 @@ foreach my $biblionumber ( @bibs ) { > $dat->{MARCSERIES} = $marcseriesarray; > $dat->{MARCURLS} = $marcurlsarray; > $dat->{HASAUTHORS} = $hasauthors; >+ $dat->{HOSTITEMENTRIES} = $biblio->get_host_item_entries; > > if ( C4::Context->preference("IntranetBiblioDefaultView") eq "normal" ) { > $dat->{dest} = "/cgi-bin/koha/catalogue/detail.pl"; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >index a68c3b7292..c51bab64d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -217,6 +217,23 @@ > </tr> > [% END %] > >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <tr> >+ <th scope="row">Host item entries</th> >+ <td> >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <p> >+ [% IF entry.subfield('0') %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% entry.subfield('0') | uri %]">[% entry.subfield('t') | html %]</a> >+ [% ELSE %] >+ [% entry.subfield('t') | html %] >+ [% END %] >+ </p> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ > <tr> > <th scope="row">Location(s)</th> > <td> >@@ -281,6 +298,17 @@ > [% IF ( BIBLIO_RESULT.notes ) %] > <p>[% BIBLIO_RESULT.notes | html %]</p> > [% END %] >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <p>Host item entry: >+ [% IF entry.subfield('0') %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% entry.subfield('0') | uri %]">[% entry.subfield('t') | html %]</a> >+ [% ELSE %] >+ [% entry.subfield('t') | html %] >+ [% END %] >+ </p> >+ [% END %] >+ [% END %] > <!-- COinS / Openurl --> > <span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.au=[% BIBLIO_RESULT.author | html %]&rft.btitle=[% BIBLIO_RESULT.title |url %]&rft.date=[% BIBLIO_RESULT.publicationyear | html %]&rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&rft.isbn=[% BIBLIO_RESULT.isbn |url %]&rft.aucorp=&rft.place=[% BIBLIO_RESULT.place | html %]&rft.pub=[% BIBLIO_RESULT.publisher |url %]&rft.edition=[% BIBLIO_RESULT.edition | html %]&rft.series=[% BIBLIO_RESULT.series | html %]&rft.genre="></span> > </td> >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index f15e2c9f64..1080c3ffed 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -67,6 +67,7 @@ if ($to_address) { > > while ( my $content = $contents->next ) { > my $biblionumber = $content->biblionumber; >+ my $biblio = Koha::Biblios->find($biblionumber); > my $dat = GetBiblioData($biblionumber); > my $record = GetMarcBiblio({ > biblionumber => $biblionumber, >@@ -82,6 +83,7 @@ if ($to_address) { > $dat->{'biblionumber'} = $biblionumber; > $dat->{ITEM_RESULTS} = \@items; > $dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray; >+ $dat->{HOSTITEMENTRIES} = $biblio->get_host_item_entries; > > $iso2709 .= $record->as_usmarc(); > >-- >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 16522
:
114178
|
114429
|
120425
|
130250
|
133509
|
135416
|
137196
|
137197
|
139168
|
139169
|
139846
|
139847
|
139848
|
141058
|
141059
|
141060
|
141061
|
141062
|
141063
|
142036
|
142037
|
142038
|
142039
|
142040
|
142041
|
142042
|
142843
|
144455
|
144456
|
145047
|
145521
|
145522
|
145523
|
145524
|
145525
|
145526
|
145527
|
145528