Bugzilla – Attachment 118977 Details for
Bug 20310
Article requests: Use details from the host record when submitting an article request on an analytic record without attached items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20310: Redirect article record without items for article requests
Bug-20310-Redirect-article-record-without-items-fo.patch (text/plain), 5.96 KB, created by
Nick Clemens (kidclamp)
on 2021-03-29 18:42:45 UTC
(
hide
)
Description:
Bug 20310: Redirect article record without items for article requests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-03-29 18:42:45 UTC
Size:
5.96 KB
patch
obsolete
>From 7d0b32a625ef5f58ef5cc33afd567c8e0d839046 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 19 Mar 2018 14:14:39 +0100 >Subject: [PATCH] Bug 20310: Redirect article record without items for article > requests > >If an article record has been catalogued separately, has no items and >contains a reference to its host via MARC21 field 773 (host item entry), >this patch makes an article request redirect to the host record while >copying title, author and page info (from 773$g). > >This is accomplished by using the new Koha::Biblio->host_record method. > >Note: Subfield 773$g may contain additional information on volume and >issue number etc. It will be very hard or perhaps impossible to parse $g >and copy these details into the corresponding fields of the article >request form for all possible variations used in libraries. A similar >remark can be made for selecting the correct item (when item level is >used). We could try this on a future report, but will probably need at >least a preference to define the expected format. > >Test plan: >[1] Enable article requests. Add rules for an ART and a SER itemtype. >[2] Create a SER host biblio record. >[3] Create an ART biblio record, no items. Include a 773w pointing to the > SER record with '(MARCorgcode)[recno]' (keep the parentheses, remove > the square brackets when inserting the biblionumber). > Include text in 773$g too. >[4] Place an article request on the ART record. Verify that it redirects > you to the SER record while copying title, author, page info. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Hugo Agud <hagud@orex.es> > >https://bugs.koha-community.org/show_bug.cgi?id=20130 >--- > .../opac-tmpl/bootstrap/en/modules/opac-request-article.tt | 12 ++++++------ > opac/opac-request-article.pl | 10 +++++++++- > 2 files changed, 15 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >index 82e3ac5fb6..d7e94ee0ef 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >@@ -46,20 +46,20 @@ > <li> > [% IF mandatory_fields.search('title') %] > <label for="title" class="required">Title:</label> >- <input type="text" required="required" name="title" id="title" size="50"/> >+ <input type="text" required="required" name="title" id="title" size="50" value="[% title | html %]"/> > [% ELSE %] > <label for="title">Title:</label> >- <input type="text" name="title" id="title" size="50"/> >+ <input type="text" name="title" id="title" size="50" value="[% title | html %]"/> > [% END %] > </li> > > <li> > [% IF mandatory_fields.search('author') %] > <label for="author" class="required">Author:</label> >- <input type="text" required="required" name="author" id="author" size="50"/> >+ <input type="text" required="required" name="author" id="author" size="50" value="[% author | html %]"/> > [% ELSE %] > <label for="author">Author:</label> >- <input type="text" name="author" id="author" size="50"/> >+ <input type="text" name="author" id="author" size="50" value="[% author | html %]"/> > [% END %] > </li> > >@@ -96,10 +96,10 @@ > <li> > [% IF mandatory_fields.search('pages') %] > <label for="pages" class="required">Pages:</label> >- <input type="text" required="required" name="pages" id="pages" size="50"/> >+ <input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/> > [% ELSE %] > <label for="pages">Pages:</label> >- <input type="text" name="pages" id="pages" size="50"/> >+ <input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/> > [% END %] > </li> > >diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl >index d6ce08f8ad..730f60283d 100755 >--- a/opac/opac-request-article.pl >+++ b/opac/opac-request-article.pl >@@ -40,6 +40,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my $action = $cgi->param('action') || q{}; > my $biblionumber = $cgi->param('biblionumber'); >+my $biblio = Koha::Biblios->find($biblionumber); > > if ( $action eq 'create' ) { > my $branchcode = $cgi->param('branchcode'); >@@ -73,9 +74,16 @@ if ( $action eq 'create' ) { > > print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests"); > exit; >+} elsif ( !$action ) { >+ # Should we redirect? >+ # Conditions: no items, host item entry (MARC21 773) >+ my ( $host, $pageinfo ) = $biblio->host_record({ no_items => 1 }); >+ if( $host ) { >+ $template->param( pageinfo => $pageinfo, title => $biblio->title, author => $biblio->author ); >+ $biblio = $host; >+ } > } > >-my $biblio = Koha::Biblios->find($biblionumber); > my $patron = Koha::Patrons->find($borrowernumber); > > $template->param( >-- >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 20310
:
73142
|
73143
|
73805
|
73998
|
74000
|
74992
|
74993
|
74994
|
88887
|
88888
|
88889
|
109750
|
109751
|
109752
|
109753
|
111467
|
111468
|
111469
|
111470
|
118976
|
118977
|
118978
|
118979
|
119346
|
122469
|
122470
|
122471
|
122472
|
122473
|
122474
|
122475
|
122725
|
122726
|
122727
|
122728
|
122729
|
122730
|
122731
|
122732