4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › [% Branches.GetName( branch ) %] calendar</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.css("css/datatables.css") %]
8 <style type="text/css"> .key { padding : 3px; white-space:nowrap; line-height:230%; }
9 .ui-datepicker { font-size : 150%; }
10 .ui-datepicker th, .ui-datepicker .ui-datepicker-title select { font-size : 80%; }
11 .ui-datepicker td a { padding : .5em; }
12 .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { font-size : 80%; }
13 .key { padding : 3px; white-space:nowrap; line-height:230%; }
14 .normalday { background-color : #EDEDED; color : Black; border : 1px solid #BCBCBC; }
15 .exception { background-color : #b3d4ff; color : Black; border : 1px solid #BCBCBC; }
16 .holiday { background-color : #ffaeae; color : Black; border : 1px solid #BCBCBC; }
17 .repeatableweekly { background-color : #FFFF99; color : Black; border : 1px solid #BCBCBC; }
18 .repeatableyearly { background-color : #FFCC66; color : Black; border : 1px solid #BCBCBC; }
19 td.exception a.ui-state-default { background: #b3d4ff none; color : Black; border : 1px solid #BCBCBC; }
20 td.holiday a.ui-state-default { background: #ffaeae none; color : Black; border : 1px solid #BCBCBC; }
21 td.repeatableweekly a.ui-state-default { background: #FFFF99 none; color : Black; border : 1px solid #BCBCBC; }
22 td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Black; border : 1px solid #BCBCBC; }
23 .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; }
24 .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; }
25 #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; }
28 <body id="tools_holidays" class="tools">
29 [% INCLUDE 'header.inc' %]
30 [% INCLUDE 'cat-search.inc' %]
32 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% Branches.GetName( branch ) %] calendar</div>
34 <div id="doc3" class="yui-t1">
39 <h2>[% Branches.GetName( branch ) %] calendar</h2>
41 <div class="yui-u first">
42 <label for="branch">Define the holidays for:</label>
43 <select id="branch" name="branch">
44 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
47 <!-- ******************************** FLAT PANELS ******************************************* -->
48 <!-- ***** Makes all the flat panel to deal with holidays ***** -->
49 <!-- **************************************************************************************** -->
51 <!-- ********************** Panel for showing already loaded holidays *********************** -->
52 <div class="panel" id="showHoliday">
53 <form action="/cgi-bin/koha/tools/exceptionHolidays.pl" method="post">
54 <input type="hidden" id="showHolidayType" name="showHolidayType" value="" />
55 <fieldset class="brief">
56 <h3>Edit this holiday</h3>
57 <span id="holtype"></span>
60 <strong>Library:</strong> <span id="showBranchNameOutput"></span>
61 <input type="hidden" id="showBranchName" name="showBranchName" />
64 <strong>From date:</strong>
65 <span id="showDaynameOutput"></span>,
67 [% IF ( dateformat == "us" ) %]<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>/<span id="showYearOutput"></span>[% ELSIF ( dateformat == "metric") %]<span id="showDayOutput"></span>/<span id="showMonthOutput"></span>/<span id="showYearOutput"></span>[% ELSIF ( dateformat == "dmydot") %]<span id="showDayOutput"></span>.<span id="showMonthOutput"></span>.<span id="showYearOutput"></span>[% ELSE %]<span id="showYearOutput"></span>/<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>[% END %]
69 <input type="hidden" id="showDayname" name="showDayname" />
70 <input type="hidden" id="showWeekday" name="showWeekday" />
71 <input type="hidden" id="showDay" name="showDay" />
72 <input type="hidden" id="showMonth" name="showMonth" />
73 <input type="hidden" id="showYear" name="showYear" />
75 <li class="dateinsert">
77 <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange %]" class="datepicker"/>
79 <li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li>
80 <!-- showTitle is necessary for exception radio button to work properly -->
82 <label for="showDescription">Description:</label>
83 <textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea>
85 <li class="radio"><div id="exceptionPosibility" style="position:static">
86 <input type="radio" name="showOperation" id="showOperationExc" value="exception" /> <label for="showOperationExc">Generate an exception for this repeated holiday.</label>
87 <a href="#" class="helptext">[?]</a>
88 <div class="hint">You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.</div>
90 <li class="radio"><input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" />
91 <label for="showOperationExcRange">Generate exceptions on a range of dates.</label>
92 <a href="#" class="helptext">[?]</a>
93 <div class="hint">You can make an exception on a range of dates repeated yearly.</div>
95 <li class="radio"><input type="radio" name="showOperation" id="showOperationDel" value="delete" /> <label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label>
96 <a href="#" class="helptext">[?]</a>
97 <div class="hint">This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.</div></li>
98 <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRange" value="deleterange" /> <label for="showOperationDelRange" id="showOperationDelLabelRange">Delete the single holidays on a range</label>.
99 <a href="#" class="helptext">[?]</a>
100 <div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div>
102 <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeat" value="deleterangerepeat" /> <label for="showOperationDelRangeRepeat" id="showOperationDelLabelRangeRepeat">Delete the repeated holidays on a range</label>.
103 <a href="#" class="helptext">[?]</a>
104 <div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div>
106 <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>.
107 <a href="#" class="helptext">[?]</a>
108 <div class="hint">This will delete the exceptions inside a given range. Be careful about your scope range; if it is oversized you could slow down Koha.</div>
110 <li class="radio"><input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label>
111 <a href="#" class="helptext">[?]</a>
112 <div class="hint">This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.</div></li>
114 <fieldset class="action">
115 <input type="submit" name="submit" value="Save" />
116 <a href="#" class="cancel hidePanel showHoliday">Cancel</a>
122 <!-- ***************************** Panel to deal with new holidays ********************** -->
123 <div class="panel" id="newHoliday">
124 <form action="/cgi-bin/koha/tools/newHolidays.pl" method="post">
125 <fieldset class="brief">
126 <h3>Add new holiday</h3>
129 <strong>Library:</strong>
130 <span id="newBranchNameOutput"></span>
131 <input type="hidden" id="newBranchName" name="newBranchName" />
134 <strong>From date:</strong>
135 <span id="newDaynameOutput"></span>,
137 [% IF ( dateformat == "us" ) %]<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>/<span id="newYearOutput"></span>[% ELSIF ( dateformat == "metric" ) %]<span id="newDayOutput"></span>/<span id="newMonthOutput"></span>/<span id="newYearOutput"></span>[% ELSIF ( dateformat == "dmydot" ) %]<span id="newDayOutput"></span>.<span id="newMonthOutput"></span>.<span id="newYearOutput"></span>[% ELSE %]<span id="newYearOutput"></span>/<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>[% END %]
139 <input type="hidden" id="newDayname" name="showDayname" />
140 <input type="hidden" id="newWeekday" name="newWeekday" />
141 <input type="hidden" id="newDay" name="newDay" />
142 <input type="hidden" id="newMonth" name="newMonth" />
143 <input type="hidden" id="newYear" name="newYear" />
145 <li class="dateinsert">
147 <input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange %]" class="datepicker" />
149 <li><label for="title">Title: </label><input type="text" name="newTitle" id="title" size="35" /></li>
150 <li><label for="newDescription">Description:</label>
151 <textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea>
153 <li class="radio"><input type="radio" name="newOperation" id="newOperationOnce" value="holiday" checked="checked" />
154 <label for="newOperationOnce">Holiday only on this day</label>.
155 <a href="#" class="helptext">[?]</a>
156 <div class="hint">Make a single holiday. For example, selecting August 1, 2012 will make it a holiday, but will not affect August 1 in other years.</div>
158 <li class="radio"><input type="radio" name="newOperation" id="newOperationDay" value="weekday" />
159 <label for="newOperationDay">Holiday repeated every same day of the week</label>.
160 <a href="#" class="helptext">[?]</a>
161 <div class="hint">Make this weekday a holiday, every week. For example, if your library is closed on Saturdays, use this option to make every Saturday a holiday.</div>
163 <li class="radio"><input type="radio" name="newOperation" id="newOperationYear" value="repeatable" />
164 <label for="newOperationYear">Holiday repeated yearly on the same date</label>.
165 <a href="#" class="helptext">[?]</a>
166 <div class="hint">This will take this day and month as a reference to make it a holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1 will make August 1 a holiday every year.</div>
168 <li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
169 <label for="newOperationField">Holidays on a range</label>.
170 <a href="#" class="helptext">[?]</a>
171 <div class="hint">Make a single holiday on a range. For example, selecting August 1, 2012 and August 10, 2012 will make all days between August 1 and 10 a holiday, but will not affect August 1-10 in other years.</div>
173 <li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
174 <label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
175 <a href="#" class="helptext">[?]</a>
176 <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1, 2012 and August 10, 2012 will make all days between August 1 and 10 a holiday, and will affect August 1-10 in other years.</div>
178 <li class="checkbox">
179 <input type="checkbox" name="allBranches" id="allBranches" />
180 <label for="allBranches">Copy to all libraries</label>.
181 <a href="#" class="helptext">[?]</a>
182 <div class="hint">If checked, this holiday will be copied to all libraries. If the holiday already exists for a library, no change is made.</div>
184 <fieldset class="action">
185 <input type="submit" name="submit" value="Save" />
186 <a href="#" class="cancel hidePanel newHoliday">Cancel</a>
192 <!-- *************************************************************************************** -->
193 <!-- ****** END OF FLAT PANELS ****** -->
194 <!-- *************************************************************************************** -->
196 <!-- ************************************************************************************** -->
197 <!-- ****** MAIN SCREEN CODE ****** -->
198 <!-- ************************************************************************************** -->
199 <h3>Calendar information</h3>
200 <div id="jcalendar-container"></div>
202 <div style="margin-top: 2em;">
203 <form action="copy-holidays.pl" method="post">
204 <input type="hidden" name="from_branchcode" value="[% branch %]" />
205 <label for="branchcode">Copy holidays to:</label>
206 <select id="branchcode" name="branchcode">
207 <option value=""></option>
208 [% FOREACH l IN Branches.all() %]
209 <option value="[% l.branchcode %]">[% l.branchname %]</option>
212 <input type="submit" value="Copy" />
221 <li>Search in the calendar the day you want to set as holiday.</li>
222 <li>Click the date to add or edit a holiday.</li>
223 <li>Enter a title and description for the holiday.</li>
224 <li>Specify how the holiday should repeat.</li>
225 <li>Click Save to finish.</li>
229 <span class="key normalday">Working day</span>
230 <span class="key holiday">Unique holiday</span>
231 <span class="key repeatableweekly">Holiday repeating weekly</span>
232 <span class="key repeatableyearly">Holiday repeating yearly</span>
233 <span class="key exception">Holiday exception</span>
236 <div id="holiday-list">
237 <!-- Exceptions First -->
238 <!-- this will probably always have the least amount of data -->
239 [% IF ( EXCEPTION_HOLIDAYS_LOOP ) %]
241 <table id="holidayexceptions">
243 <th class="exception">Date</th>
244 <th class="exception">Title</th>
245 <th class="exception">Description</th>
249 [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
251 <td><a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch %]&calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE %]"><span title="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT %]">[% EXCEPTION_HOLIDAYS_LOO.DATE %]</span></a></td>
252 <td>[% EXCEPTION_HOLIDAYS_LOO.TITLE |html %]</td>
253 <td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION |html %]</td>
260 [% IF ( WEEK_DAYS_LOOP ) %]
261 <h3>Weekly - Repeatable holidays</h3>
262 <table id="holidayweeklyrepeatable">
265 <th class="repeatableweekly">Day of week</th>
266 <th class="repeatableweekly">Title</th>
267 <th class="repeatableweekly">Description</th>
271 [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %]
273 <td>[% WEEK_DAYS_LOO.KEY %]</td>
275 <td>[% WEEK_DAYS_LOO.TITLE |html %]</td>
276 <td>[% WEEK_DAYS_LOO.DESCRIPTION |html %]</td>
283 [% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %]
284 <h3>Yearly - Repeatable holidays</h3>
285 <table id="holidaysyearlyrepeatable">
288 [% IF ( dateformat == "metric" ) %]
289 <th class="repeatableyearly">Day/month</th>
291 <th class="repeatableyearly">Month/day</th>
293 <th class="repeatableyearly">Title</th>
294 <th class="repeatableyearly">Description</th>
298 [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
300 <td><span title="[% DAY_MONTH_HOLIDAYS_LOO.DATE_SORT %]">[% DAY_MONTH_HOLIDAYS_LOO.DATE %]</span></td>
301 <td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE |html %]</td>
302 <td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION |html %]</td>
309 [% IF ( HOLIDAYS_LOOP ) %]
310 <h3>Unique holidays</h3>
311 <table id="holidaysunique">
314 <th class="holiday">Date</th>
315 <th class="holiday">Title</th>
316 <th class="holiday">Description</th>
320 [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
322 <td><a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch %]&calendardate=[% HOLIDAYS_LOO.DATE %]"><span title="[% HOLIDAYS_LOO.DATE_SORT %]">[% HOLIDAYS_LOO.DATE %]</span></a></td>
323 <td>[% HOLIDAYS_LOO.TITLE |html %]</td>
324 <td>[% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '<br />') |html %]</td>
336 <div class="yui-b noprint">
337 [% INCLUDE 'tools-menu.inc' %]
341 [% MACRO jsinclude BLOCK %]
342 [% INCLUDE 'calendar.inc' %]
343 [% INCLUDE 'datatables.inc' %]
344 [% Asset.js("js/tools-menu.js") %]
345 <script type="text/javascript">
346 var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
348 /* Creates all the structures to deal with all different kinds of holidays */
349 var week_days = new Array();
350 var holidays = new Array();
351 var holidates = new Array();
352 var exception_holidays = new Array();
353 var day_month_holidays = new Array();
354 var hola= "[% code %]";
355 [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %]
356 week_days["[% WEEK_DAYS_LOO.KEY %]"] = {title:"[% WEEK_DAYS_LOO.TITLE | replace('"','\"') |html %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION | replace('"','\"') |html %]"};
358 [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
359 holidates.push("[% HOLIDAYS_LOO.KEY %]");
360 holidays["[% HOLIDAYS_LOO.KEY %]"] = {title:"[% HOLIDAYS_LOO.TITLE | replace('"','\"') |html %]", description:"[% HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') |html %]"};
362 [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
363 exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE | replace('"','\"') |html %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') |html %]"};
365 [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
366 day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE | replace('"','\"') |html %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') |html %]"};
369 function holidayOperation(formObject, opType) {
370 var op = document.getElementsByName('operation');
371 op[0].value = opType;
375 // This function shows the "Show Holiday" panel //
376 function showHoliday (exceptionPosibility, dayName, day, month, year, weekDay, title, description, holidayType) {
377 $("#newHoliday").slideUp("fast");
378 $("#showHoliday").slideDown("fast");
379 $('#showDaynameOutput').html(dayName);
380 $('#showDayname').val(dayName);
381 $('#showBranchNameOutput').html($("#branch :selected").text());
382 $('#showBranchName').val($("#branch").val());
383 $('#showDayOutput').html(day);
384 $('#showDay').val(day);
385 $('#showMonthOutput').html(month);
386 $('#showMonth').val(month);
387 $('#showYearOutput').html(year);
388 $('#showYear').val(year);
389 $('#showDescription').val(description);
390 $('#showWeekday:first').val(weekDay);
391 $('#showTitle').val(title);
392 $('#showHolidayType').val(holidayType);
394 if (holidayType == 'exception') {
395 $("#showOperationDelLabel").html(_("Delete this exception."));
396 $("#holtype").attr("class","key exception").html(_("Holiday exception"));
397 } else if(holidayType == 'weekday') {
398 $("#showOperationDelLabel").html(_("Delete this holiday."));
399 $("#holtype").attr("class","key repeatableweekly").html(_("Holiday repeating weekly"));
400 } else if(holidayType == 'daymonth') {
401 $("#showOperationDelLabel").html(_("Delete this holiday."));
402 $("#holtype").attr("class","key repeatableyearly").html(_("Holiday repeating yearly"));
404 $("#showOperationDelLabel").html(_("Delete this holiday."));
405 $("#holtype").attr("class","key holiday").html(_("Unique holiday"));
408 if (exceptionPosibility == 1) {
409 $("#exceptionPosibility").parent().show();
411 $("#exceptionPosibility").parent().hide();
415 // This function shows the "Add Holiday" panel //
416 function newHoliday (dayName, day, month, year, weekDay) {
417 $("#showHoliday").slideUp("fast");
418 $("#newHoliday").slideDown("fast");
419 $("#newDaynameOutput").html(dayName);
420 $("#newDayname").val(dayName);
421 $("#newBranchNameOutput").html($('#branch :selected').text());
422 $("#newBranchName").val($('#branch').val());
423 $("#newDayOutput").html(day);
424 $("#newDay").val(day);
425 $("#newMonthOutput").html(month);
426 $("#newMonth").val(month);
427 $("#newYearOutput").html(year);
428 $("#newYear").val(year);
429 $("#newWeekday:first").val(weekDay);
432 function hidePanel(aPanelName) {
433 $("#"+aPanelName).slideUp("fast");
436 function changeBranch () {
437 var branch = $("#branch option:selected").val();
438 location.href='/cgi-bin/koha/tools/holidays.pl?branch=' + branch + '&calendardate=' + "[% calendardate %]";
442 newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
445 /* This function gives css clases to each kind of day */
446 function dateStatusHandler(date) {
447 date = new Date(date);
448 var day = date.getDate();
449 var month = date.getMonth() + 1;
450 var year = date.getFullYear();
451 var weekDay = date.getDay();
452 var dayMonth = month + '/' + day;
453 var dateString = year + '/' + month + '/' + day;
454 if (exception_holidays[dateString] != null) {
455 return [true, "exception", _("Exception: %s").format(exception_holidays[dateString].title)];
456 } else if ( week_days[weekDay] != null ){
457 return [true, "repeatableweekly", _("Weekly holiday: %s").format(week_days[weekDay].title)];
458 } else if ( day_month_holidays[dayMonth] != null ) {
459 return [true, "repeatableyearly", _("Yearly holiday: %s").format(day_month_holidays[dayMonth].title)];
460 } else if (holidays[dateString] != null) {
461 return [true, "holiday", _("Single holiday: %s").format(holidays[dateString].title)];
463 return [true, "normalday", _("Normal day")];
467 /* This function is in charge of showing the correct panel considering the kind of holiday */
468 function dateChanged(calendar) {
469 calendar = new Date(calendar);
470 var day = calendar.getDate();
471 var month = calendar.getMonth() + 1;
472 var year = calendar.getFullYear();
473 var weekDay = calendar.getDay();
474 var dayName = weekdays[weekDay];
475 var dayMonth = month + '/' + day;
476 var dateString = year + '/' + month + '/' + day;
477 if (holidays[dateString] != null) {
478 showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description, 'ymd');
479 } else if (exception_holidays[dateString] != null) {
480 showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 'exception');
481 } else if (week_days[weekDay] != null) {
482 showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description, 'weekday');
483 } else if (day_month_holidays[dayMonth] != null) {
484 showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 'daymonth');
486 newHoliday(dayName, day, month, year, weekDay);
490 $(document).ready(function() {
493 $("#branch").change(function(){
496 $("#holidayweeklyrepeatable>tbody>tr").each(function(){
497 var first_td = $(this).find('td').first();
498 first_td.html(weekdays[first_td.html()]);
500 $("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
504 $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
507 { "sType": "title-string" },null,null
511 $("a.helptext").click(function(){
512 $(this).parent().find(".hint").toggle(); return false;
514 $("#dateofrange").datepicker();
515 $("#datecancelrange").datepicker();
516 $("#dateofrange").each(function () { this.value = "" });
517 $("#datecancelrange").each(function () { this.value = "" });
518 $("#jcalendar-container").datepicker({
519 beforeShowDay: function(thedate) {
520 var day = thedate.getDate();
521 var month = thedate.getMonth() + 1;
522 var year = thedate.getFullYear();
523 var dateString = year + '/' + month + '/' + day;
524 return dateStatusHandler(dateString);
526 onSelect: function(dateText, inst) {
527 dateChanged($(this).datepicker("getDate"));
529 defaultDate: new Date("[% keydate %]")
531 $(".hidePanel").on("click",function(){
532 if( $(this).hasClass("showHoliday") ){
533 hidePanel("showHoliday");
535 hidePanel("newHoliday");
542 [% INCLUDE 'intranet-bottom.inc' %]