View | Details | Raw Unified | Return to bug 8215
Collapse All | Expand All

(-)a/C4/CourseReserves.pm (-3 / +3 lines)
Lines 46-52 BEGIN { Link Here
46
46
47
      &SearchCourses
47
      &SearchCourses
48
48
49
      &GetItemReservesInfo
49
      &GetItemCourseReservesInfo
50
    );
50
    );
51
    %EXPORT_TAGS = ( 'all' => \@EXPORT_OK );
51
    %EXPORT_TAGS = ( 'all' => \@EXPORT_OK );
52
52
Lines 934-947 sub DelCourseReserve { Link Here
934
934
935
=head2 GetReservesInfo
935
=head2 GetReservesInfo
936
936
937
    my $arrayref = GetItemReservesInfo( itemnumber => $itemnumber );
937
    my $arrayref = GetItemCourseReservesInfo( itemnumber => $itemnumber );
938
938
939
    For a given item, returns an arrayref of reserves hashrefs,
939
    For a given item, returns an arrayref of reserves hashrefs,
940
    with a course hashref under the key 'course'
940
    with a course hashref under the key 'course'
941
941
942
=cut
942
=cut
943
943
944
sub GetItemReservesInfo {
944
sub GetItemCourseReservesInfo {
945
    my (%params) = @_;
945
    my (%params) = @_;
946
    warn identify_myself(%params) if $DEBUG;
946
    warn identify_myself(%params) if $DEBUG;
947
947
(-)a/catalogue/detail.pl (-2 / +2 lines)
Lines 41-47 use C4::XSLT; Link Here
41
use C4::Images;
41
use C4::Images;
42
use Koha::DateUtils;
42
use Koha::DateUtils;
43
use C4::HTML5Media;
43
use C4::HTML5Media;
44
use C4::CourseReserves qw(GetItemReservesInfo);
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
45
46
# use Smart::Comments;
46
# use Smart::Comments;
47
47
Lines 271-277 foreach my $item (@items) { Link Here
271
    }
271
    }
272
272
273
    if ( C4::Context->preference('UseCourseReserves') ) {
273
    if ( C4::Context->preference('UseCourseReserves') ) {
274
        $item->{'course_reserves'} = GetItemReservesInfo( itemnumber => $item->{'itemnumber'} );
274
        $item->{'course_reserves'} = GetItemCourseReservesInfo( itemnumber => $item->{'itemnumber'} );
275
    }
275
    }
276
276
277
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
277
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
(-)a/opac/opac-detail.pl (-2 / +2 lines)
Lines 50-56 use List::MoreUtils qw/any none/; Link Here
50
use C4::Images;
50
use C4::Images;
51
use Koha::DateUtils;
51
use Koha::DateUtils;
52
use C4::HTML5Media;
52
use C4::HTML5Media;
53
use C4::CourseReserves qw(GetItemReservesInfo);
53
use C4::CourseReserves qw(GetItemCourseReservesInfo);
54
54
55
BEGIN {
55
BEGIN {
56
	if (C4::Context->preference('BakerTaylorEnabled')) {
56
	if (C4::Context->preference('BakerTaylorEnabled')) {
Lines 1058-1064 $template->{VARS}->{'trackclicks'} = C4::Context->preference('TrackClicks'); Link Here
1058
1058
1059
if ( C4::Context->preference('UseCourseReserves') ) {
1059
if ( C4::Context->preference('UseCourseReserves') ) {
1060
    foreach my $i ( @items ) {
1060
    foreach my $i ( @items ) {
1061
        $i->{'course_reserves'} = GetItemReservesInfo( itemnumber => $i->{'itemnumber'} );
1061
        $i->{'course_reserves'} = GetItemCourseReservesInfo( itemnumber => $i->{'itemnumber'} );
1062
    }
1062
    }
1063
}
1063
}
1064
1064
(-)a/t/db_dependent/CourseReserves.t (-2 / +1 lines)
Lines 70-76 ok( $course_reserve->{'cr_id'} eq $cr_id, "GetCourseReserve returns valid data" Link Here
70
my $course_reserves = GetCourseReserves( 'course_id' => $course_id );
70
my $course_reserves = GetCourseReserves( 'course_id' => $course_id );
71
ok( $course_reserves->[0]->{'ci_id'} eq $ci_id, "GetCourseReserves returns valid data." );
71
ok( $course_reserves->[0]->{'ci_id'} eq $ci_id, "GetCourseReserves returns valid data." );
72
72
73
my $info = GetItemReservesInfo( itemnumber => $items[0]->{'itemnumber'} );
73
my $info = GetItemCourseReservesInfo( itemnumber => $items[0]->{'itemnumber'} );
74
ok( $info->[0]->{'itemnumber'} eq $items[0]->{'itemnumber'}, "GetItemReservesInfo returns valid data." );
74
ok( $info->[0]->{'itemnumber'} eq $items[0]->{'itemnumber'}, "GetItemReservesInfo returns valid data." );
75
75
76
DelCourseReserve( 'cr_id' => $cr_id );
76
DelCourseReserve( 'cr_id' => $cr_id );
77
- 

Return to bug 8215