Skip to content

Commit

Permalink
Bug 11735 - Use new DataTables include in calendar template
Browse files Browse the repository at this point in the history
Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to the
calendar template and corrects some table sorting configuration errors.

To test you should have multiple calendar entries in various categories
of holiday: Unique holidays, repeating yearly holidays, repeating weekly
holidays, and exceptions. Sorting of date columns should work regardless
of your dateformat system preference.

Signed-off-by: merlissia <manuelimel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Note: Day of week is not correctly sorted: Sundays, Mondays, Thursdays.
But it is not a regression. It is caused by the ugly way to display
weekdays (document.write).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
  • Loading branch information
oleonard authored and gmcharlt committed Feb 13, 2014
1 parent 26696e3 commit ef65eee
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
Expand Up @@ -3,12 +3,9 @@
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
[% INCLUDE 'datatables-strings.inc' %]
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
[% INCLUDE 'datatables.inc' %]
<script language="JavaScript" type="text/javascript">
//<![CDATA[
[% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));

/* Creates all the structures to deal with all diferents kinds of holidays */
Expand Down Expand Up @@ -160,11 +157,11 @@
$("#branch").change(function(){
changeBranch();
});
$("#holidayexceptions,#holidayweeklyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
$("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"bPaginate": false
}));
$("#holidaysyearlyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
$("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"aoColumns": [
{ "sType": "title-string" },null,null
Expand Down

0 comments on commit ef65eee

Please sign in to comment.