Bugzilla – Attachment 32103 Details for
Bug 10632
Enable datatables for courses and course details in the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10632 - Enable datatables for courses and course details in the OPAC
Bug-10632---Enable-datatables-for-courses-and-cour.patch (text/plain), 5.22 KB, created by
Kyle M Hall (khall)
on 2014-10-09 16:47:29 UTC
(
hide
)
Description:
Bug 10632 - Enable datatables for courses and course details in the OPAC
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-10-09 16:47:29 UTC
Size:
5.22 KB
patch
obsolete
>From 29cae4df9b494118683c714e8bd545e622043ddd Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 9 Oct 2014 10:01:16 -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. >--- > .../bootstrap/en/modules/opac-course-details.tt | 15 +++++++++++- > .../bootstrap/en/modules/opac-course-reserves.tt | 23 ++++++++++--------- > opac/opac-course-reserves.pl | 12 ++------- > 3 files changed, 28 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt >index 2bab190..6608394 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt >@@ -6,7 +6,10 @@ > [% INCLUDE 'doc-head-open.inc' %] > [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Course reserves for [% course.course_name %] > [% INCLUDE 'doc-head-close.inc' %] >-[% BLOCK cssinclude %][% END %] >+[% BLOCK cssinclude %] >+ <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% END %] >+ > </head> > [% INCLUDE 'bodytag.inc' bodyid='opac-main' %] > [% INCLUDE 'masthead.inc' %] >@@ -43,7 +46,7 @@ > </div> > > [% IF ( course_reserves ) %] >- <table class="table table-bordered table-striped table-condensed"> >+ <table id="course-items-table" class="table table-bordered table-striped table-condensed"> > <thead> > <tr> > <th>Title</th> >@@ -86,4 +89,12 @@ > </div> <!-- / .main --> > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $("#course-items-table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": '<"bottom"flp>rt<"clear">', >+ })); >+ }); >+ </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt >index e68fa25..0fe898c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt >@@ -4,7 +4,10 @@ > [% INCLUDE 'doc-head-open.inc' %] > [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Courses > [% INCLUDE 'doc-head-close.inc' %] >-[% BLOCK cssinclude %][% END %] >+[% BLOCK cssinclude %] >+ <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% END %] >+ > </head> > [% INCLUDE 'bodytag.inc' bodyid='opac-main' %] > [% INCLUDE 'masthead.inc' %] >@@ -20,16 +23,6 @@ > <div class="span12"> > > <h1>Courses</h1> >- <div id="search-toolbar"> >- <form action="/cgi-bin/koha/opac-course-reserves.pl" method="get" id="search_courses_form" class="form-inline"> >- >- <fieldset><div class="input-append"> >- <label for="search_on">Search courses:</label> <input type="text" name="search_on" id="search_on" /> >- <input type="submit" class="btn" value="Search" /> >- </div></fieldset> >- >- </form> >- </div><!-- /search-toolbar --> > > <table id="course_reserves_table" class="table table-bordered table-striped table-condensed"> > <thead> >@@ -67,4 +60,12 @@ > </div> <!-- / .main --> > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": '<"bottom"flp>rt<"clear">', >+ })); >+ }); >+ </script> > [% END %] >diff --git a/opac/opac-course-reserves.pl b/opac/opac-course-reserves.pl >index 6518ef4..b6a18ae 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10632
:
19876
|
32103
|
32131
|
32132
|
32134
|
32250
|
32251
|
33465