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

(-)a/course_reserves/course-reserves.pl (-13 / +3 lines)
Lines 39-54 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
39
    }
39
    }
40
);
40
);
41
41
42
my $search_on = $cgi->param('search_on');
42
my $courses = GetCourses();
43
my %params;
43
$template->param( courses => $courses );
44
if ($search_on) {
44
output_html_with_http_headers $cgi, $cookie, $template->output;
45
    $params{'course_name'} = "%$search_on%";
46
}
47
48
my $courses = GetCourses(%params);
49
if ( $search_on && @$courses == 1 ) {
50
    print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=" . $courses->[0]->{'course_id'});
51
} else {
52
    $template->param( courses => $courses );
53
    output_html_with_http_headers $cgi, $cookie, $template->output;
54
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt (-22 lines)
Lines 29-55 Link Here
29
                    </div><!-- /toolbar -->
29
                    </div><!-- /toolbar -->
30
                    [% END %]
30
                    [% END %]
31
31
32
                    <!--
33
                    <div id="search-toolbar">
34
                        <script type="text/javascript">
35
                        //<![CDATA[
36
                            function submitSearchForm(p_oEvent){
37
                                $('#search_courses_form').submit();
38
                            }
39
40
                            $(document).ready(function(){
41
                                newCourseButton = new YAHOO.widget.Button("search_courses");
42
                                newCourseButton.on("click", submitSearchForm );
43
                            });
44
                        //]]>
45
                        </script>
46
                        <ul class="toolbar">
47
                            <li><form id="search_courses_form"><input type="text" name="search_on" id="search_on"></form></li>
48
                            <li><a id="search_courses">Search courses</a></li>
49
                        </ul>
50
                    </div>
51
                    -->
52
53
                    <h1>Courses</h1>
32
                    <h1>Courses</h1>
54
                    <table id="course_reserves_table">
33
                    <table id="course_reserves_table">
55
                        <thead>
34
                        <thead>
56
- 

Return to bug 21501