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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt (-1 / +16 lines)
Lines 6-11 Link Here
6
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Course reserves for [% course.course_name %]
7
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Course reserves for [% course.course_name %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
9
10
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
12
[% INCLUDE 'datatables-strings.inc' %]
13
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
14
<script type="text/javascript" id="js">
15
$(document).ready(function() {
16
    $("#course-items-table").dataTable($.extend(true, {}, dataTablesDefaults, {
17
        "sPaginationType": "four_button",
18
        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
19
        "iDisplayLength": 20
20
    }));
21
});
22
</script>
23
9
</head>
24
</head>
10
<body id="opac-main">
25
<body id="opac-main">
11
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
26
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
Lines 35-41 Link Here
35
        </div>
50
        </div>
36
51
37
        [% IF ( course_reserves ) %]
52
        [% IF ( course_reserves ) %]
38
            <table>
53
            <table id="course-items-table">
39
                <thead>
54
                <thead>
40
                    <tr>
55
                    <tr>
41
                        <th>Title</th>
56
                        <th>Title</th>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt (-8 / +15 lines)
Lines 4-9 Link Here
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Courses
5
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Courses
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
8
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
10
[% INCLUDE 'datatables-strings.inc' %]
11
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
12
<script type="text/javascript" id="js">
13
$(document).ready(function() {
14
    $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
15
        "sPaginationType": "four_button",
16
        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
17
        "iDisplayLength": 20
18
    }));
19
});
20
</script>
21
7
</head>
22
</head>
8
<body id="opac-main">
23
<body id="opac-main">
9
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
24
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
Lines 17-30 Link Here
17
                <div class="yui-g">
32
                <div class="yui-g">
18
33
19
                    <h1>Courses</h1>
34
                    <h1>Courses</h1>
20
                    <div id="search-toolbar">
21
                        <form action="/cgi-bin/koha/opac-course-reserves.pl" method="get" id="search_courses_form">
22
                            <fieldset>
23
                                <label for="search_on">Search courses:</label> <input type="text" name="search_on" id="search_on" />
24
                                <input type="submit" value="Search" />
25
                            </fieldset>
26
                        </form>
27
                    </div><!-- /search-toolbar -->
28
35
29
                    <table id="course_reserves_table">
36
                    <table id="course_reserves_table">
30
                        <thead>
37
                        <thead>
(-)a/opac/opac-course-reserves.pl (-10 / +3 lines)
Lines 38-50 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
38
    }
38
    }
39
);
39
);
40
40
41
my $search_on = $cgi->param('search_on');
41
my $courses = SearchCourses( enabled => 'yes' );
42
42
43
my $courses = SearchCourses( term => $search_on, enabled => 'yes' );
43
$template->param( courses => $courses );
44
44
output_html_with_http_headers $cgi, $cookie, $template->output;
45
if ( @$courses == 1 ) {
46
    print $cgi->redirect( "/cgi-bin/koha/opac-course-details.pl?course_id=" . $courses->[0]->{'course_id'} );
47
} else {
48
    $template->param( courses => $courses );
49
    output_html_with_http_headers $cgi, $cookie, $template->output;
50
}
51
- 

Return to bug 10632