Bugzilla – Attachment 63294 Details for
Bug 18276
Koha::Biblio - Remove GetBiblioFromItemNumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 18276: Remove GetBiblioFromItemNumber - Course reserves
SIGNED-OFF-Bug-18276-Remove-GetBiblioFromItemNumbe.patch (text/plain), 8.86 KB, created by
Josef Moravec
on 2017-05-09 15:14:21 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 18276: Remove GetBiblioFromItemNumber - Course reserves
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-05-09 15:14:21 UTC
Size:
8.86 KB
patch
obsolete
>From 39931304730e22d4c40dbdd8a6c5ae8a5ad99528 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Mar 2017 10:15:30 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 18276: Remove GetBiblioFromItemNumber - > Course reserves > >Values from the items, biblio and biblioitems tables are used in the template, >so we need to pass all of them to the template, but separately. >That way we easily see which field from which table we are displaying. > >Test plan: >Create a course reserve and add items. >Correct information must be displayed on the detail page of the course >reserve, on staff and OPAC interface. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/CourseReserves.pm | 8 ++++++-- > course_reserves/add_items.pl | 7 ++++--- > .../prog/en/modules/course_reserves/add_items-step2.tt | 4 ++-- > .../prog/en/modules/course_reserves/course-details.tt | 10 +++++----- > .../opac-tmpl/bootstrap/en/modules/opac-course-details.tt | 8 ++++---- > 5 files changed, 21 insertions(+), 16 deletions(-) > >diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm >index 4215422..3a3f422 100644 >--- a/C4/CourseReserves.pm >+++ b/C4/CourseReserves.pm >@@ -21,7 +21,6 @@ use List::MoreUtils qw(any); > > use C4::Context; > use C4::Items qw(GetItem ModItem); >-use C4::Biblio qw(GetBiblioFromItemNumber); > use C4::Circulation qw(GetOpenIssue); > > use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG @FIELDS); >@@ -877,8 +876,13 @@ sub GetCourseReserves { > > if ($include_items) { > foreach my $cr (@$course_reserves) { >+ my $item = Koha::Items->find( $cr->{itemnumber} ); >+ my $biblio = $item->biblio; >+ my $biblioitem = $biblio->biblioitem; > $cr->{'course_item'} = GetCourseItem( ci_id => $cr->{'ci_id'} ); >- $cr->{'item'} = GetBiblioFromItemNumber( $cr->{'itemnumber'} ); >+ $cr->{'item'} = $item; >+ $cr->{'biblio'} = $biblio; >+ $cr->{'biblioitem'} = $biblioitem; > $cr->{'issue'} = GetOpenIssue( $cr->{'itemnumber'} ); > } > } >diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl >index 89cbb47..f48c113 100755 >--- a/course_reserves/add_items.pl >+++ b/course_reserves/add_items.pl >@@ -30,6 +30,7 @@ use Koha::Items; > > use C4::CourseReserves qw(GetCourse GetCourseItem GetCourseReserve ModCourseItem ModCourseReserve); > >+use Koha::Items; > use Koha::ItemTypes; > > my $cgi = new CGI; >@@ -60,8 +61,8 @@ $template->param( ERROR_BARCODE_NOT_FOUND => $barcode . $inumber ) > > $template->param( course => GetCourse($course_id) ); > >-if ( $action eq 'lookup' ) { >- my $course_item = GetCourseItem( itemnumber => $item->{'itemnumber'} ); >+if ( $action eq 'lookup' and $item ) { >+ my $course_item = GetCourseItem( itemnumber => $item->itemnumber ); > my $course_reserve = > ($course_item) > ? GetCourseReserve( >@@ -73,7 +74,7 @@ if ( $action eq 'lookup' ) { > my $itemtypes = Koha::ItemTypes->search; > $template->param( > item => $item, >- title => $title, >+ biblio => $item->biblio, > course_item => $course_item, > course_reserve => $course_reserve, > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >index bc5831a..7ab45a2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >@@ -9,7 +9,7 @@ > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> › Reserve <i><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]">[% title %]</a></i> for <i><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id %]">[% course.course_name %]</a></i></div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> › Reserve <i><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></i> for <i><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id %]">[% course.course_name %]</a></i></div> > > <div id="doc" class="yui-t7"> > <div id="bd"> >@@ -23,7 +23,7 @@ > <input type="hidden" name="action" value="add" /> > > <fieldset class="rows"> >- <legend>Add <i>[% title %]</i> to <i>[% course.course_name %]</i></legend> >+ <legend>Add <i>[% biblio.title %]</i> to <i>[% course.course_name %]</i></legend> > <ol> > <li> > <span class="label">Barcode:</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index 7ab27d8..3e6f8c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -102,9 +102,9 @@ > <tbody> > [% FOREACH cr IN course_reserves %] > <tr> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td> >- <td>[% cr.item.author %]</td> >- <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% cr.item.itemnumber %]&biblionumber=[% cr.item.biblionumber %]&bi=[% cr.item.biblioitemnumber %]">[% cr.item.barcode %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cr.biblio.biblionumber %]">[% cr.biblio.title %]</a></td> >+ <td>[% cr.biblio.author %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% cr.item.itemnumber %]&biblionumber=[% cr.biblio.biblionumber %]&bi=[% cr.biblioitem.biblioitemnumber %]">[% cr.item.barcode %]</a></td> > <td>[% cr.item.itemcallnumber %]</td> > [% IF item_level_itypes %] > <td> >@@ -180,8 +180,8 @@ > <td> > [% IF (cr.item.uri) %] > <a href="[% cr.item.uri %]">Item URI</a> >- [% ELSIF (cr.item.url) %] >- <a href="[% cr.item.url %]">Record URL</a> >+ [% ELSIF (cr.biblioitem.url) %] >+ <a href="[% cr.biblioitem.url %]">Record URL</a> > [% END %] > </td> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt >index fd2e739..3cab2f9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt >@@ -66,8 +66,8 @@ > <tbody> > [% FOREACH cr IN course_reserves %] > <tr> >- <td><a href="opac-detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td> >- <td>[% cr.item.author %]</td> >+ <td><a href="opac-detail.pl?biblionumber=[% cr.biblio.biblionumber %]">[% cr.biblio.title %]</a></td> >+ <td>[% cr.biblio.author %]</td> > <td>[% ItemTypes.GetDescription( cr.item.itype ) %]</td> > <td>[% Branches.GetName( cr.item.holdingbranch ) %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]</i></td> > <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]</td> >@@ -83,8 +83,8 @@ > </td> > <td>[% IF (cr.item.uri) %] > <a href="[% cr.item.uri %]">Item URI</a> >- [% ELSIF (cr.item.url) %] >- <a href="[% cr.item.url %]">Record URL</a> >+ [% ELSIF (cr.biblioitem.url) %] >+ <a href="[% cr.biblioitem.url %]">Record URL</a> > [% END %] > </td> > </tr> >-- >2.1.4
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 18276
:
61122
|
61123
|
61124
|
61125
|
61126
|
61177
|
61178
|
61179
|
61180
|
61181
|
62081
|
62082
|
62083
|
62084
|
62085
|
62476
|
62477
|
62478
|
62479
|
62480
|
62481
|
63121
|
63122
|
63123
|
63124
|
63125
|
63126
|
63166
|
63294
|
63295
|
63296
|
63297
|
63298
|
63299
|
63300
|
64748
|
64809
|
64810
|
64811
|
64812
|
64813
|
64814
|
64815
|
64816
|
64817
|
64878
|
64879
|
64880
|
64881
|
64882
|
64883
|
64884
|
64885
|
64886
|
64887
|
64974
|
64975