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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-45 / +23 lines)
Lines 2-11 Link Here
2
<title>Koha &rsaquo; Tools &rsaquo; [% branchname %] Calendar</title>
2
<title>Koha &rsaquo; Tools &rsaquo; [% branchname %] Calendar</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'calendar.inc' %]
4
[% INCLUDE 'calendar.inc' %]
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
6
<script language="JavaScript" type="text/javascript">
9
<script language="JavaScript" type="text/javascript">
7
//<![CDATA[
10
//<![CDATA[
8
11
    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
9
	var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
12
	var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
10
13
11
    /* Creates all the structures to deal with all diferents kinds of holidays */
14
    /* Creates all the structures to deal with all diferents kinds of holidays */
Lines 153-198 Link Here
153
156
154
	$(document).ready(function() {
157
	$(document).ready(function() {
155
158
156
[% IF ( dateformat_metric ) %]		$.tablesorter.addParser({ // http://tablesorter.com/docs/example-parsers.html
157
			id: 'shortDates',
158
			is: function(s){
159
				return false;
160
			},
161
			format: function(s){
162
				var datepattern = new RegExp("[0-9]\/[0-9]");
163
				if( datepattern.test(s)){ // sorting a date without a year: "01/12"
164
					var dateparts = s.split("/").reverse().join("-"); // build an ISO date to be sorted as text
165
					s = "2000-" + dateparts; // use 2000 as the default year
166
				}
167
				return s;
168
			},
169
			type: 'text'
170
		});
171
[% END %]
172
		$(".hint").hide();
159
		$(".hint").hide();
173
		$("#branch").change(function(){
160
		$("#branch").change(function(){
174
			changeBranch();
161
			changeBranch();
175
		});
162
		});
176
		$("#holidayexceptions").tablesorter({[% IF ( dateformat_metric ) %]
163
        $("#holidayexceptions,#holidayweeklyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
177
		  dateFormat: 'uk',[% END %]
164
            "sDom": 't',
178
		  sortList: [[0,0]], widgets: ['zebra']
165
            "bPaginate": false
179
		});
166
        }));
180
		$("#holidayweeklyrepeatable").tablesorter({[% IF ( dateformat_metric ) %]
167
        $("#holidaysyearlyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
181
		  dateFormat: 'uk',[% END %]
168
            "sDom": 't',
182
		  sortList: [[0,0]], widgets: ['zebra']
169
            "aoColumns": [
183
		});
170
                { "sType": "title-string" },null,null
184
		$("#holidaysyearlyrepeatable").tablesorter({[% IF ( dateformat_metric ) %]
171
            ],
185
			headers : {
172
            "bPaginate": false
186
				0: {
173
        }));
187
					sorter : 'shortDates'
188
				}
189
			},[% END %]
190
			sortList: [[0,0]], widgets: ['zebra']
191
		});
192
		$("#holidaysunique").tablesorter({[% IF ( dateformat_metric ) %]
193
		  dateFormat: 'uk',[% END %]
194
		  sortList: [[0,0]], widgets: ['zebra']
195
		});
196
		$("a.helptext").click(function(){
174
		$("a.helptext").click(function(){
197
			$(this).parent().find(".hint").toggle(); return false;
175
			$(this).parent().find(".hint").toggle(); return false;
198
		});
176
		});
Lines 227-236 Link Here
227
.holiday {  background-color :  #ffaeae; color :  Black;  border : 1px solid #BCBCBC; }
205
.holiday {  background-color :  #ffaeae; color :  Black;  border : 1px solid #BCBCBC; }
228
.repeatableweekly {  background-color :  #FFFF99; color :  Black;  border : 1px solid #BCBCBC; }
206
.repeatableweekly {  background-color :  #FFFF99; color :  Black;  border : 1px solid #BCBCBC; }
229
.repeatableyearly {  background-color :  #FFCC66; color :  Black;  border : 1px solid #BCBCBC; }
207
.repeatableyearly {  background-color :  #FFCC66; color :  Black;  border : 1px solid #BCBCBC; }
230
td.exception a.ui-state-default, .exception { background:  #b3d4ff none; color :  Black; border : 1px solid #BCBCBC; }
208
td.exception a.ui-state-default { background:  #b3d4ff none; color :  Black; border : 1px solid #BCBCBC; }
231
td.holiday a.ui-state-default, .holiday {  background:  #ffaeae none; color :  Black;  border : 1px solid #BCBCBC; }
209
td.holiday a.ui-state-default {  background:  #ffaeae none; color :  Black;  border : 1px solid #BCBCBC; }
232
td.repeatableweekly a.ui-state-default, .repeatableweekly {  background:  #D8EFB3 none; color :  Black;  border : 1px solid #BCBCBC; }
210
td.repeatableweekly a.ui-state-default {  background:  #D8EFB3 none; color :  Black;  border : 1px solid #BCBCBC; }
233
td.repeatableyearly a.ui-state-default, .repeatableyearly {  background:  #FFFF99 none; color :  Black;  border : 1px solid #BCBCBC; }
211
td.repeatableyearly a.ui-state-default {  background:  #FFFF99 none; color :  Black;  border : 1px solid #BCBCBC; }
234
.information { z-index : 1; background-color :  #DCD2F1; width : 300px; display : none; border : 1px solid #000000; color :  #000000; font-size :  8pt; font-weight :  bold; background-color :  #FFD700; cursor :  pointer; padding : 2px; }
212
.information { z-index : 1; background-color :  #DCD2F1; width : 300px; display : none; border : 1px solid #000000; color :  #000000; font-size :  8pt; font-weight :  bold; background-color :  #FFD700; cursor :  pointer; padding : 2px; }
235
.panel { z-index : 1; display : none; border : 3px solid #CCC; padding : 3px; margin-top: .3em;  background-color: #FEFEFE; } fieldset.brief { border : 0; margin-top: 0; }
213
.panel { z-index : 1; display : none; border : 3px solid #CCC; padding : 3px; margin-top: .3em;  background-color: #FEFEFE; } fieldset.brief { border : 0; margin-top: 0; }
236
#showHoliday { margin : .5em 0; } h1 select { width: 20em; } div.yui-b fieldset.brief ol { font-size:100%; } div.yui-b fieldset.brief li, div.yui-b fieldset.brief li.radio  { padding:0.2em 0; } .help { margin:.3em 0;border:1px solid #EEE;padding:.3em .7em; font-size : 90%; } #holidayweeklyrepeatable, #holidaysyearlyrepeatable, #holidaysunique, #holidayexceptions { font-size : 90%; margin-bottom : 1em;} .calendar td, .calendar th, .calendar .button, .calendar tbody .day { padding : .7em; font-size: 110%; } .calendar { width: auto; border : 0; }
214
#showHoliday { margin : .5em 0; } h1 select { width: 20em; } div.yui-b fieldset.brief ol { font-size:100%; } div.yui-b fieldset.brief li, div.yui-b fieldset.brief li.radio  { padding:0.2em 0; } .help { margin:.3em 0;border:1px solid #EEE;padding:.3em .7em; font-size : 90%; } #holidayweeklyrepeatable, #holidaysyearlyrepeatable, #holidaysunique, #holidayexceptions { font-size : 90%; margin-bottom : 1em;} .calendar td, .calendar th, .calendar .button, .calendar tbody .day { padding : .7em; font-size: 110%; } .calendar { width: auto; border : 0; }
Lines 465-471 td.repeatableyearly a.ui-state-default, .repeatableyearly { background: #FFFF9 Link Here
465
<tbody>
443
<tbody>
466
  [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
444
  [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
467
  <tr>
445
  <tr>
468
  <td><a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch %]&amp;calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE %]">[% EXCEPTION_HOLIDAYS_LOO.DATE %]</a></td>
446
  <td><a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch %]&amp;calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE %]"><span title="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT %]">[% EXCEPTION_HOLIDAYS_LOO.DATE %]</span></a></td>
469
  <td>[% EXCEPTION_HOLIDAYS_LOO.TITLE %]</td>
447
  <td>[% EXCEPTION_HOLIDAYS_LOO.TITLE %]</td>
470
  <td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION %]</td> 
448
  <td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION %]</td> 
471
  </tr>
449
  </tr>
Lines 517-523 td.repeatableyearly a.ui-state-default, .repeatableyearly { background: #FFFF9 Link Here
517
<tbody>
495
<tbody>
518
  [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
496
  [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
519
  <tr>
497
  <tr>
520
  <td>[% DAY_MONTH_HOLIDAYS_LOO.DATE %]</td>
498
  <td><span title="[% DAY_MONTH_HOLIDAYS_LOO.DATE_SORT %]">[% DAY_MONTH_HOLIDAYS_LOO.DATE %]</span></td>
521
  <td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE %]</td> 
499
  <td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE %]</td> 
522
  <td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION %]</td> 
500
  <td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION %]</td> 
523
  </tr>
501
  </tr>
Lines 539-545 td.repeatableyearly a.ui-state-default, .repeatableyearly { background: #FFFF9 Link Here
539
<tbody>
517
<tbody>
540
    [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
518
    [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
541
<tr>
519
<tr>
542
  <td><a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch %]&amp;calendardate=[% HOLIDAYS_LOO.DATE %]">[% HOLIDAYS_LOO.DATE %]</a></td>
520
  <td><a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch %]&amp;calendardate=[% HOLIDAYS_LOO.DATE %]"><span title="[% HOLIDAYS_LOO.DATE_SORT %]">[% HOLIDAYS_LOO.DATE %]</span></a></td>
543
  <td>[% HOLIDAYS_LOO.TITLE %]</td>
521
  <td>[% HOLIDAYS_LOO.TITLE %]</td>
544
  <td>[% HOLIDAYS_LOO.DESCRIPTION %]</td>
522
  <td>[% HOLIDAYS_LOO.DESCRIPTION %]</td>
545
</tr>
523
</tr>
(-)a/tools/holidays.pl (-1 / +7 lines)
Lines 99-113 my @day_month_holidays; Link Here
99
foreach my $monthDay (keys %$day_month_holidays) {
99
foreach my $monthDay (keys %$day_month_holidays) {
100
    # Determine date format on month and day.
100
    # Determine date format on month and day.
101
    my $day_monthdate;
101
    my $day_monthdate;
102
    my $day_monthdate_sort;
102
    if (C4::Context->preference("dateformat") eq "metric") {
103
    if (C4::Context->preference("dateformat") eq "metric") {
104
      $day_monthdate_sort = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}";
103
      $day_monthdate = "$day_month_holidays->{$monthDay}{day}/$day_month_holidays->{$monthDay}{month}";
105
      $day_monthdate = "$day_month_holidays->{$monthDay}{day}/$day_month_holidays->{$monthDay}{month}";
104
    } elsif (C4::Context->preference("dateformat") eq "us") {
106
    } elsif (C4::Context->preference("dateformat") eq "us") {
105
      $day_monthdate = "$day_month_holidays->{$monthDay}{month}/$day_month_holidays->{$monthDay}{day}";
107
      $day_monthdate = "$day_month_holidays->{$monthDay}{month}/$day_month_holidays->{$monthDay}{day}";
108
      $day_monthdate_sort = $day_monthdate;
106
    } else {
109
    } else {
107
      $day_monthdate = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}";
110
      $day_monthdate = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}";
111
      $day_monthdate_sort = $day_monthdate;
108
    }
112
    }
109
    my %day_month;
113
    my %day_month;
110
    %day_month = (KEY => $monthDay,
114
    %day_month = (KEY => $monthDay,
115
                  DATE_SORT => $day_monthdate_sort,
111
                  DATE => $day_monthdate,
116
                  DATE => $day_monthdate,
112
                  TITLE => $day_month_holidays->{$monthDay}{title},
117
                  TITLE => $day_month_holidays->{$monthDay}{title},
113
                  DESCRIPTION => $day_month_holidays->{$monthDay}{description});
118
                  DESCRIPTION => $day_month_holidays->{$monthDay}{description});
Lines 120-125 foreach my $yearMonthDay (keys %$exception_holidays) { Link Here
120
    my $exceptiondate = C4::Dates->new($exception_holidays->{$yearMonthDay}{date}, "iso");
125
    my $exceptiondate = C4::Dates->new($exception_holidays->{$yearMonthDay}{date}, "iso");
121
    my %exception_holiday;
126
    my %exception_holiday;
122
    %exception_holiday = (KEY => $yearMonthDay,
127
    %exception_holiday = (KEY => $yearMonthDay,
128
                          DATE_SORT => $exception_holidays->{$yearMonthDay}{date},
123
                          DATE => $exceptiondate->output("syspref"),
129
                          DATE => $exceptiondate->output("syspref"),
124
                          TITLE => $exception_holidays->{$yearMonthDay}{title},
130
                          TITLE => $exception_holidays->{$yearMonthDay}{title},
125
                          DESCRIPTION => $exception_holidays->{$yearMonthDay}{description});
131
                          DESCRIPTION => $exception_holidays->{$yearMonthDay}{description});
Lines 132-137 foreach my $yearMonthDay (keys %$single_holidays) { Link Here
132
    my $holidaydate = C4::Dates->new($single_holidays->{$yearMonthDay}{date}, "iso");
138
    my $holidaydate = C4::Dates->new($single_holidays->{$yearMonthDay}{date}, "iso");
133
    my %holiday;
139
    my %holiday;
134
    %holiday = (KEY => $yearMonthDay,
140
    %holiday = (KEY => $yearMonthDay,
141
                DATE_SORT => $single_holidays->{$yearMonthDay}{date},
135
                DATE => $holidaydate->output("syspref"),
142
                DATE => $holidaydate->output("syspref"),
136
                TITLE => $single_holidays->{$yearMonthDay}{title},
143
                TITLE => $single_holidays->{$yearMonthDay}{title},
137
                DESCRIPTION => $single_holidays->{$yearMonthDay}{description});
144
                DESCRIPTION => $single_holidays->{$yearMonthDay}{description});
138
- 

Return to bug 9905