From 82cea7fa1850250acb46ad64849a5d987afe7f56 Mon Sep 17 00:00:00 2001 From: simith Date: Thu, 26 Feb 2015 15:35:11 -0500 Subject: [PATCH] This patch adds the following warning during the return of a document that was reserved to a course: "Please return 'title' to the 'course name' class reserve." Testing: 1) Define a document as a course reserve see manual.koha-community.org/3.14/en/coursereserves.html 2) Checkout and checkin this document. Validade the warning http://bugs.koha-community.org/show_bug.cgi?id=13334 --- circ/returns.pl | 10 ++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/circ/returns.pl b/circ/returns.pl index a7e9c6e..1bacd21 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -44,6 +44,7 @@ use C4::Members; use C4::Branch; # GetBranches GetBranchName use C4::Koha; # FIXME : is it still useful ? use C4::RotatingCollections; +use C4::CourseReserves; use Koha::DateUtils; use Koha::Calendar; @@ -320,6 +321,15 @@ if ($barcode) { ); } } + # Verify if the item is in the course reserve + my $course_reserves = C4::CourseReserves::GetItemCourseReservesInfo( itemnumber => $itemnumber ); + if($course_reserves) { + $template->param( + found => 1, + course_reserve => 1, + course_name => $course_reserves->[0]->{course}->{course_name} + ); + } } elsif ( !$messages->{'BadBarcode'} ) { $input{duedate} = 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 3fe2e53..c71b785 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -271,6 +271,13 @@ $(document).ready(function () { [% END %] [% END %] + [% IF ( course_reserve ) %] + +
+

[% title or "item" |html %] is part of the [% course_name %] course reserve.

+
+ [% END %] + [% IF ( needstransfer ) %] [% IF ( soundon ) %] -- 1.9.1