From 941ddb89ec0cb0698727781e36a17b2aede8f04d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 23 Jul 2013 12:14:09 -0400 Subject: [PATCH] Bug 10632 - Enable datatables for courses and course details in the OPAC We should use datatables for the courses and course items tables. This will make the tables sortable and searchable from the client side. Test Plan: 1) Apply this patch 2) View the courses in the OPAC, try sorting and searching 3) View the course details for a course, try sorting and searching the items. --- .../prog/en/modules/opac-course-details.tt | 17 +++++++++++++- .../prog/en/modules/opac-course-reserves.tt | 23 +++++++++++++------- opac/opac-course-reserves.pl | 12 ++------- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt index 4d0e121..d3a3194 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt @@ -6,6 +6,21 @@ [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Course reserves for [% course.course_name %] [% INCLUDE 'doc-head-close.inc' %] + + + +[% INCLUDE 'datatables-strings.inc' %] + + + [% IF ( OpacNav ) %]
[% ELSE %]
[% END %] @@ -35,7 +50,7 @@
[% IF ( course_reserves ) %] - +
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt index d00748e..f3b5735 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-reserves.tt @@ -4,6 +4,21 @@ [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Courses [% INCLUDE 'doc-head-close.inc' %] + + + +[% INCLUDE 'datatables-strings.inc' %] + + + [% IF ( OpacNav ) %]
[% ELSE %]
[% END %] @@ -17,14 +32,6 @@

Courses

-
-
-
- - -
- -
Title
diff --git a/opac/opac-course-reserves.pl b/opac/opac-course-reserves.pl index 83852c4..b8ca85f 100755 --- a/opac/opac-course-reserves.pl +++ b/opac/opac-course-reserves.pl @@ -38,13 +38,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -my $search_on = $cgi->param('search_on'); +my $courses = SearchCourses( enabled => 'yes' ); -my $courses = SearchCourses( term => $search_on, enabled => 'yes' ); - -if ( @$courses == 1 ) { - print $cgi->redirect( "/cgi-bin/koha/opac-course-details.pl?course_id=" . $courses->[0]->{'course_id'} ); -} else { - $template->param( courses => $courses ); - output_html_with_http_headers $cgi, $cookie, $template->output; -} +$template->param( courses => $courses ); +output_html_with_http_headers $cgi, $cookie, $template->output; -- 1.7.2.5