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

(-)a/C4/CourseReserves.pm (-49 / +27 lines)
Lines 241-247 sub EnableOrDisableCourseItems { Link Here
241
    warn identify_myself(%params) if $DEBUG;
241
    warn identify_myself(%params) if $DEBUG;
242
242
243
    my $course_id = $params{'course_id'};
243
    my $course_id = $params{'course_id'};
244
    my $enabled   = $params{'enabled'} || 0;
244
    my $enabled = $params{'enabled'} || 0;
245
245
246
    my $lookfor = ( $enabled eq 'yes' ) ? 'no' : 'yes';
246
    my $lookfor = ( $enabled eq 'yes' ) ? 'no' : 'yes';
247
247
Lines 252-264 sub EnableOrDisableCourseItems { Link Here
252
252
253
    if ( $enabled eq 'yes' ) {
253
    if ( $enabled eq 'yes' ) {
254
        foreach my $course_reserve (@$course_reserves) {
254
        foreach my $course_reserve (@$course_reserves) {
255
            if (
255
            if (CountCourseReservesForItem(
256
                CountCourseReservesForItem(
257
                    ci_id   => $course_reserve->{'ci_id'},
256
                    ci_id   => $course_reserve->{'ci_id'},
258
                    enabled => 'yes'
257
                    enabled => 'yes'
259
                )
258
                )
260
              )
259
              ) {
261
            {
262
                EnableOrDisableCourseItem(
260
                EnableOrDisableCourseItem(
263
                    ci_id   => $course_reserve->{'ci_id'},
261
                    ci_id   => $course_reserve->{'ci_id'},
264
                    enabled => 'yes',
262
                    enabled => 'yes',
Lines 273-280 sub EnableOrDisableCourseItems { Link Here
273
                    ci_id   => $course_reserve->{'ci_id'},
271
                    ci_id   => $course_reserve->{'ci_id'},
274
                    enabled => 'yes'
272
                    enabled => 'yes'
275
                )
273
                )
276
              )
274
              ) {
277
            {
278
                EnableOrDisableCourseItem(
275
                EnableOrDisableCourseItem(
279
                    ci_id   => $course_reserve->{'ci_id'},
276
                    ci_id   => $course_reserve->{'ci_id'},
280
                    enabled => 'no',
277
                    enabled => 'no',
Lines 376-382 sub ModCourseInstructors { Link Here
376
    return unless ( $cardnumbers || $borrowernumbers );
373
    return unless ( $cardnumbers || $borrowernumbers );
377
    return if ( $cardnumbers && $borrowernumbers );
374
    return if ( $cardnumbers && $borrowernumbers );
378
375
379
    my (@cardnumbers, @borrowernumbers);
376
    my ( @cardnumbers, @borrowernumbers );
380
    @cardnumbers = @$cardnumbers if ( ref($cardnumbers) eq 'ARRAY' );
377
    @cardnumbers = @$cardnumbers if ( ref($cardnumbers) eq 'ARRAY' );
381
    @borrowernumbers = @$borrowernumbers
378
    @borrowernumbers = @$borrowernumbers
382
      if ( ref($borrowernumbers) eq 'ARRAY' );
379
      if ( ref($borrowernumbers) eq 'ARRAY' );
Lines 387-394 sub ModCourseInstructors { Link Here
387
384
388
    my $dbh = C4::Context->dbh;
385
    my $dbh = C4::Context->dbh;
389
386
390
    $dbh->do( "DELETE FROM course_instructors WHERE course_id = ?",
387
    $dbh->do( "DELETE FROM course_instructors WHERE course_id = ?", undef, $course_id )
391
        undef, $course_id )
392
      if ( $mode eq 'replace' );
388
      if ( $mode eq 'replace' );
393
389
394
    my $query;
390
    my $query;
Lines 400-407 sub ModCourseInstructors { Link Here
400
            FROM borrowers
396
            FROM borrowers
401
            WHERE $field IN ( $placeholders )
397
            WHERE $field IN ( $placeholders )
402
        ";
398
        ";
403
    }
399
    } else {
404
    else {
405
        $query = "
400
        $query = "
406
            DELETE FROM course_instructors
401
            DELETE FROM course_instructors
407
            WHERE course_id = ?
402
            WHERE course_id = ?
Lines 485-492 sub ModCourseItem { Link Here
485
            course_item => $course_item,
480
            course_item => $course_item,
486
            %params
481
            %params
487
        );
482
        );
488
    }
483
    } else {
489
    else {
490
        $ci_id = _AddCourseItem(%params);
484
        $ci_id = _AddCourseItem(%params);
491
    }
485
    }
492
486
Lines 570-577 sub _UpdateCourseItem { Link Here
570
    foreach (@FIELDS) {
564
    foreach (@FIELDS) {
571
        if (   $params{$_}
565
        if (   $params{$_}
572
            && $course_item->{$_}
566
            && $course_item->{$_}
573
            && $params{$_} ne $course_item->{$_} )
567
            && $params{$_} ne $course_item->{$_} ) {
574
        {
575
            $mod_params{$_} = $params{$_};
568
            $mod_params{$_} = $params{$_};
576
        }
569
        }
577
    }
570
    }
Lines 618-627 sub _ModStoredFields { Link Here
618
        }
611
        }
619
    }
612
    }
620
613
621
    my $query =
614
    my $query = "UPDATE course_items SET " . join( ',', map { "$_=?" } @fields_to_update ) . " WHERE ci_id = ?";
622
        "UPDATE course_items SET "
623
      . join( ',', map { "$_=?" } @fields_to_update )
624
      . " WHERE ci_id = ?";
625
615
626
    C4::Context->dbh->do( $query, undef, @values_to_update, $params{'ci_id'} )
616
    C4::Context->dbh->do( $query, undef, @values_to_update, $params{'ci_id'} )
627
      if (@values_to_update);
617
      if (@values_to_update);
Lines 660-669 sub _RevertFields { Link Here
660
    }
650
    }
661
    ModItem( $mod_item_params, undef, $course_item->{'itemnumber'} );
651
    ModItem( $mod_item_params, undef, $course_item->{'itemnumber'} );
662
652
663
    my $query =
653
    my $query = "UPDATE course_items SET " . join( ',', map { "$_=NULL" } @fields_to_null ) . " WHERE ci_id = ?";
664
        "UPDATE course_items SET "
665
      . join( ',', map { "$_=NULL" } @fields_to_null )
666
      . " WHERE ci_id = ?";
667
654
668
    C4::Context->dbh->do( $query, undef, $ci_id ) if (@fields_to_null);
655
    C4::Context->dbh->do( $query, undef, $ci_id ) if (@fields_to_null);
669
}
656
}
Lines 785-792 sub GetCourseReserve { Link Here
785
        ";
772
        ";
786
        $sth = $dbh->prepare($query);
773
        $sth = $dbh->prepare($query);
787
        $sth->execute($cr_id);
774
        $sth->execute($cr_id);
788
    }
775
    } else {
789
    else {
790
        my $query = "
776
        my $query = "
791
            SELECT * FROM course_reserves
777
            SELECT * FROM course_reserves
792
            WHERE course_id = ? AND ci_id = ?
778
            WHERE course_id = ? AND ci_id = ?
Lines 816-823 sub ModCourseReserve { Link Here
816
802
817
    return unless ( $course_id && $ci_id );
803
    return unless ( $course_id && $ci_id );
818
804
819
    my $course_reserve =
805
    my $course_reserve = GetCourseReserve( course_id => $course_id, ci_id => $ci_id );
820
      GetCourseReserve( course_id => $course_id, ci_id => $ci_id );
821
    my $cr_id;
806
    my $cr_id;
822
807
823
    my $dbh = C4::Context->dbh;
808
    my $dbh = C4::Context->dbh;
Lines 831-838 sub ModCourseReserve { Link Here
831
            WHERE cr_id = ?
816
            WHERE cr_id = ?
832
        ";
817
        ";
833
        $dbh->do( $query, undef, $staff_note, $public_note, $cr_id );
818
        $dbh->do( $query, undef, $staff_note, $public_note, $cr_id );
834
    }
819
    } else {
835
    else {
836
        my $query = "
820
        my $query = "
837
            INSERT INTO course_reserves SET
821
            INSERT INTO course_reserves SET
838
            course_id = ?,
822
            course_id = ?,
Lines 840-849 sub ModCourseReserve { Link Here
840
            staff_note = ?,
824
            staff_note = ?,
841
            public_note = ?
825
            public_note = ?
842
        ";
826
        ";
843
        $dbh->do( $query, undef, $course_id, $ci_id, $staff_note,
827
        $dbh->do( $query, undef, $course_id, $ci_id, $staff_note, $public_note );
844
            $public_note );
828
        $cr_id = $dbh->last_insert_id( undef, undef, 'course_reserves', 'cr_id' );
845
        $cr_id =
846
          $dbh->last_insert_id( undef, undef, 'course_reserves', 'cr_id' );
847
    }
829
    }
848
830
849
    my $course = GetCourse($course_id);
831
    my $course = GetCourse($course_id);
Lines 872-881 sub GetCourseReserves { Link Here
872
    my (%params) = @_;
854
    my (%params) = @_;
873
    warn identify_myself(%params) if $DEBUG;
855
    warn identify_myself(%params) if $DEBUG;
874
856
875
    my $course_id     = $params{'course_id'};
857
    my $course_id       = $params{'course_id'};
876
    my $ci_id         = $params{'ci_id'};
858
    my $ci_id           = $params{'ci_id'};
877
    my $include_items = $params{'include_items'};
859
    my $include_items   = $params{'include_items'};
878
    my $include_count = $params{'include_count'};
860
    my $include_count   = $params{'include_count'};
879
    my $include_courses = $params{'include_courses'};
861
    my $include_courses = $params{'include_courses'};
880
862
881
    return unless ( $course_id || $ci_id );
863
    return unless ( $course_id || $ci_id );
Lines 898-919 sub GetCourseReserves { Link Here
898
    if ($include_items) {
880
    if ($include_items) {
899
        foreach my $cr (@$course_reserves) {
881
        foreach my $cr (@$course_reserves) {
900
            $cr->{'course_item'} = GetCourseItem( ci_id => $cr->{'ci_id'} );
882
            $cr->{'course_item'} = GetCourseItem( ci_id => $cr->{'ci_id'} );
901
            $cr->{'item'} = GetBiblioFromItemNumber( $cr->{'itemnumber'} );
883
            $cr->{'item'}        = GetBiblioFromItemNumber( $cr->{'itemnumber'} );
902
            $cr->{'issue'} = GetOpenIssue( $cr->{'itemnumber'} );
884
            $cr->{'issue'}       = GetOpenIssue( $cr->{'itemnumber'} );
903
        }
885
        }
904
    }
886
    }
905
887
906
    if ($include_count) {
888
    if ($include_count) {
907
        foreach my $cr (@$course_reserves) {
889
        foreach my $cr (@$course_reserves) {
908
            $cr->{'reserves_count'} =
890
            $cr->{'reserves_count'} = CountCourseReservesForItem( ci_id => $cr->{'ci_id'} );
909
              CountCourseReservesForItem( ci_id => $cr->{'ci_id'} );
910
        }
891
        }
911
    }
892
    }
912
893
913
    if ($include_courses) {
894
    if ($include_courses) {
914
        foreach my $cr (@$course_reserves) {
895
        foreach my $cr (@$course_reserves) {
915
            $cr->{'courses'} =
896
            $cr->{'courses'} = GetCourses( itemnumber => $cr->{'itemnumber'} );
916
              GetCourses( itemnumber => $cr->{'itemnumber'} );
917
        }
897
        }
918
    }
898
    }
919
899
Lines 946-953 sub DelCourseReserve { Link Here
946
926
947
    ## If there are no other course reserves for this item
927
    ## If there are no other course reserves for this item
948
    ## delete the course_item as well
928
    ## delete the course_item as well
949
    unless ( CountCourseReservesForItem( ci_id => $course_reserve->{'ci_id'} ) )
929
    unless ( CountCourseReservesForItem( ci_id => $course_reserve->{'ci_id'} ) ) {
950
    {
951
        DelCourseItem( ci_id => $course_reserve->{'ci_id'} );
930
        DelCourseItem( ci_id => $course_reserve->{'ci_id'} );
952
    }
931
    }
953
932
Lines 1007-1014 sub CountCourseReservesForItem { Link Here
1007
986
1008
    return unless ( $ci_id || $itemnumber );
987
    return unless ( $ci_id || $itemnumber );
1009
988
1010
    my $course_item =
989
    my $course_item = GetCourseItem( ci_id => $ci_id, itemnumber => $itemnumber );
1011
      GetCourseItem( ci_id => $ci_id, itemnumber => $itemnumber );
1012
990
1013
    my @params = ( $course_item->{'ci_id'} );
991
    my @params = ( $course_item->{'ci_id'} );
1014
    push( @params, $enabled ) if ($enabled);
992
    push( @params, $enabled ) if ($enabled);
Lines 1082-1088 sub SearchCourses { Link Here
1082
    my $dbh = C4::Context->dbh;
1060
    my $dbh = C4::Context->dbh;
1083
    my $sth = $dbh->prepare($query);
1061
    my $sth = $dbh->prepare($query);
1084
1062
1085
    $sth->execute(@params, $enabled);
1063
    $sth->execute( @params, $enabled );
1086
1064
1087
    my $courses = $sth->fetchall_arrayref( {} );
1065
    my $courses = $sth->fetchall_arrayref( {} );
1088
1066
(-)a/Koha/Template/Plugin/AuthorisedValues.pm (-1 / +1 lines)
Lines 28-34 use C4::Koha; Link Here
28
28
29
sub GetByCode {
29
sub GetByCode {
30
    my ( $self, $category, $code, $opac ) = @_;
30
    my ( $self, $category, $code, $opac ) = @_;
31
    return encode('UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
31
    return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
32
}
32
}
33
33
34
1;
34
1;
(-)a/Koha/Template/Plugin/Branches.pm (-1 / +1 lines)
Lines 32-38 sub GetName { Link Here
32
    my $sth   = C4::Context->dbh->prepare($query);
32
    my $sth   = C4::Context->dbh->prepare($query);
33
    $sth->execute($branchcode);
33
    $sth->execute($branchcode);
34
    my $b = $sth->fetchrow_hashref();
34
    my $b = $sth->fetchrow_hashref();
35
    return encode('UTF-8', $b->{'branchname'});
35
    return encode( 'UTF-8', $b->{'branchname'} );
36
}
36
}
37
37
38
1;
38
1;
(-)a/Koha/Template/Plugin/ItemTypes.pm (-1 / +1 lines)
Lines 32-38 sub GetDescription { Link Here
32
    my $sth   = C4::Context->dbh->prepare($query);
32
    my $sth   = C4::Context->dbh->prepare($query);
33
    $sth->execute($itemtype);
33
    $sth->execute($itemtype);
34
    my $d = $sth->fetchrow_hashref();
34
    my $d = $sth->fetchrow_hashref();
35
    return encode('UTF-8', $d->{'description'});
35
    return encode( 'UTF-8', $d->{'description'} );
36
36
37
}
37
}
38
38
(-)a/course_reserves/add_items.pl (-6 / +5 lines)
Lines 40-49 my $item = GetBiblioFromItemNumber( undef, $barcode ); Link Here
40
40
41
my $step = ( $action eq 'lookup' && $item ) ? '2' : '1';
41
my $step = ( $action eq 'lookup' && $item ) ? '2' : '1';
42
42
43
my $tmpl = ( $course_id ) ? "add_items-step$step.tt" : "invalid-course.tt";
43
my $tmpl = ($course_id) ? "add_items-step$step.tt" : "invalid-course.tt";
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
45
    {
45
    {   template_name   => "course_reserves/$tmpl",
46
        template_name   => "course_reserves/$tmpl",
47
        query           => $cgi,
46
        query           => $cgi,
48
        type            => "intranet",
47
        type            => "intranet",
49
        authnotrequired => 0,
48
        authnotrequired => 0,
Lines 57-63 $template->param( course => GetCourse($course_id) ); Link Here
57
56
58
if ( $action eq 'lookup' ) {
57
if ( $action eq 'lookup' ) {
59
    my $course_item = GetCourseItem( itemnumber => $item->{'itemnumber'} );
58
    my $course_item = GetCourseItem( itemnumber => $item->{'itemnumber'} );
60
    my $course_reserve = ($course_item)
59
    my $course_reserve =
60
      ($course_item)
61
      ? GetCourseReserve(
61
      ? GetCourseReserve(
62
        course_id => $course_id,
62
        course_id => $course_id,
63
        ci_id     => $course_item->{'ci_id'}
63
        ci_id     => $course_item->{'ci_id'}
Lines 75-82 if ( $action eq 'lookup' ) { Link Here
75
        branches  => GetBranchesLoop(),
75
        branches  => GetBranchesLoop(),
76
    );
76
    );
77
77
78
}
78
} elsif ( $action eq 'add' ) {
79
elsif ( $action eq 'add' ) {
80
    my $ci_id = ModCourseItem(
79
    my $ci_id = ModCourseItem(
81
        itemnumber    => $cgi->param('itemnumber'),
80
        itemnumber    => $cgi->param('itemnumber'),
82
        itype         => $cgi->param('itype'),
81
        itype         => $cgi->param('itype'),
(-)a/course_reserves/course-details.pl (-3 / +2 lines)
Lines 36-45 my $course_id = $cgi->param('course_id'); Link Here
36
my $flagsrequired;
36
my $flagsrequired;
37
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' );
37
$flagsrequired->{coursereserves} = 'delete_reserves' if ( $action eq 'del_reserve' );
38
38
39
my $tmpl = ( $course_id ) ? "course-details.tt" : "invalid-course.tt";
39
my $tmpl = ($course_id) ? "course-details.tt" : "invalid-course.tt";
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
    {
41
    {   template_name   => "course_reserves/$tmpl",
42
        template_name   => "course_reserves/$tmpl",
43
        query           => $cgi,
42
        query           => $cgi,
44
        type            => "intranet",
43
        type            => "intranet",
45
        authnotrequired => 0,
44
        authnotrequired => 0,
(-)a/course_reserves/course.pl (-3 / +2 lines)
Lines 31-38 use C4::CourseReserves; Link Here
31
my $cgi = new CGI;
31
my $cgi = new CGI;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
34
    {   template_name   => "course_reserves/course.tt",
35
        template_name   => "course_reserves/course.tt",
36
        query           => $cgi,
35
        query           => $cgi,
37
        type            => "intranet",
36
        type            => "intranet",
38
        authnotrequired => 0,
37
        authnotrequired => 0,
Lines 49-55 if ($course_id) { Link Here
49
48
50
$template->param(
49
$template->param(
51
    departments => GetAuthorisedValues('DEPARTMENT'),
50
    departments => GetAuthorisedValues('DEPARTMENT'),
52
    terms => GetAuthorisedValues('TERM'),
51
    terms       => GetAuthorisedValues('TERM'),
53
);
52
);
54
53
55
output_html_with_http_headers $cgi, $cookie, $template->output;
54
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/course_reserves/mod_course.pl (-7 / +4 lines)
Lines 29-36 use C4::CourseReserves; Link Here
29
29
30
my $cgi = new CGI;
30
my $cgi = new CGI;
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {   template_name   => "about.tmpl",
33
        template_name   => "about.tmpl",
34
        query           => $cgi,
33
        query           => $cgi,
35
        type            => "intranet",
34
        type            => "intranet",
36
        authnotrequired => 0,
35
        authnotrequired => 0,
Lines 43-50 my $action = $cgi->param('action'); Link Here
43
if ( $action eq 'del' ) {
42
if ( $action eq 'del' ) {
44
    DelCourse( $cgi->param('course_id') );
43
    DelCourse( $cgi->param('course_id') );
45
    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl");
44
    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl");
46
}
45
} else {
47
else {
48
    my %params;
46
    my %params;
49
47
50
    $params{'course_id'} = $cgi->param('course_id')
48
    $params{'course_id'} = $cgi->param('course_id')
Lines 57-63 else { Link Here
57
    $params{'staff_note'}     = $cgi->param('staff_note');
55
    $params{'staff_note'}     = $cgi->param('staff_note');
58
    $params{'public_note'}    = $cgi->param('public_note');
56
    $params{'public_note'}    = $cgi->param('public_note');
59
    $params{'students_count'} = $cgi->param('students_count');
57
    $params{'students_count'} = $cgi->param('students_count');
60
    $params{'enabled'} = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no';
58
    $params{'enabled'}        = ( $cgi->param('enabled') eq 'on' ) ? 'yes' : 'no';
61
59
62
    my $course_id = ModCourse(%params);
60
    my $course_id = ModCourse(%params);
63
61
Lines 67-72 else { Link Here
67
        cardnumbers => \@instructors,
65
        cardnumbers => \@instructors,
68
        course_id   => $course_id
66
        course_id   => $course_id
69
    );
67
    );
70
    print $cgi->redirect(
68
    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$course_id");
71
        "/cgi-bin/koha/course_reserves/course-details.pl?course_id=$course_id");
72
}
69
}
(-)a/opac/opac-course-details.pl (-5 / +4 lines)
Lines 31-38 use C4::CourseReserves; Link Here
31
my $cgi = new CGI;
31
my $cgi = new CGI;
32
32
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
    {
34
    {   template_name   => "opac-course-details.tmpl",
35
        template_name   => "opac-course-details.tmpl",
36
        query           => $cgi,
35
        query           => $cgi,
37
        type            => "opac",
36
        type            => "opac",
38
        authnotrequired => 1,
37
        authnotrequired => 1,
Lines 43-59 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
43
my $action = $cgi->param('action') || '';
42
my $action = $cgi->param('action') || '';
44
my $course_id = $cgi->param('course_id');
43
my $course_id = $cgi->param('course_id');
45
44
46
die( "No course_id given" ) unless ( $course_id );
45
die("No course_id given") unless ($course_id);
47
46
48
if ( $action eq 'del_reserve' ) {
47
if ( $action eq 'del_reserve' ) {
49
    DelCourseReserve( cr_id => $cgi->param('cr_id') );
48
    DelCourseReserve( cr_id => $cgi->param('cr_id') );
50
}
49
}
51
50
52
my $course = GetCourse( $course_id );
51
my $course = GetCourse($course_id);
53
my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, include_count => 1 );
52
my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, include_count => 1 );
54
53
55
$template->param(
54
$template->param(
56
    course => $course,
55
    course          => $course,
57
    course_reserves => $course_reserves,
56
    course_reserves => $course_reserves,
58
);
57
);
59
58
(-)a/opac/opac-course-reserves.pl (-4 / +2 lines)
Lines 30-37 use C4::CourseReserves; Link Here
30
my $cgi = new CGI;
30
my $cgi = new CGI;
31
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
33
    {   template_name   => "opac-course-reserves.tmpl",
34
        template_name   => "opac-course-reserves.tmpl",
35
        query           => $cgi,
34
        query           => $cgi,
36
        type            => "opac",
35
        type            => "opac",
37
        authnotrequired => 1,
36
        authnotrequired => 1,
Lines 44-50 my $search_on = $cgi->param('search_on'); Link Here
44
my $courses = SearchCourses( term => $search_on, enabled => 'yes' );
43
my $courses = SearchCourses( term => $search_on, enabled => 'yes' );
45
44
46
if ( @$courses == 1 ) {
45
if ( @$courses == 1 ) {
47
    print $cgi->redirect("/cgi-bin/koha/opac-course-details.pl?course_id=" . $courses->[0]->{'course_id'});
46
    print $cgi->redirect( "/cgi-bin/koha/opac-course-details.pl?course_id=" . $courses->[0]->{'course_id'} );
48
} else {
47
} else {
49
    $template->param( courses => $courses );
48
    $template->param( courses => $courses );
50
    output_html_with_http_headers $cgi, $cookie, $template->output;
49
    output_html_with_http_headers $cgi, $cookie, $template->output;
51
- 

Return to bug 8215