Bug 14399: Results form also needs a few interface changes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / holidays.tt
1 [% USE Branches %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; [% Branches.GetName( branch ) %] calendar</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript">
9 //<![CDATA[
10     var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
11
12     /* Creates all the structures to deal with all different kinds of holidays */
13     var week_days = new Array();
14     var holidays = new Array();
15     var holidates = new Array();
16     var exception_holidays = new Array();
17     var day_month_holidays = new Array();
18     var hola= "[% code %]";
19     [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %]
20     week_days["[% WEEK_DAYS_LOO.KEY %]"] = {title:"[% WEEK_DAYS_LOO.TITLE %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION %]"};
21     [% END %]
22     [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
23     holidates.push("[% HOLIDAYS_LOO.KEY %]");
24     holidays["[% HOLIDAYS_LOO.KEY %]"] = {title:"[% HOLIDAYS_LOO.TITLE %]", description:"[% HOLIDAYS_LOO.DESCRIPTION %]"};
25
26     [% END %]
27     [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
28     exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION %]"};
29     [% END %]
30     [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
31     day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION %]"};
32     [% END %]
33
34     function holidayOperation(formObject, opType) {
35         var op = document.getElementsByName('operation');
36         op[0].value = opType;
37         formObject.submit();
38     }
39
40     // This function shows the "Show Holiday" panel //
41     function showHoliday (exceptionPosibility, dayName, day, month, year, weekDay, title, description, holidayType) {
42         $("#newHoliday").slideUp("fast");
43         $("#showHoliday").slideDown("fast");
44         $('#showDaynameOutput').html(dayName);
45         $('#showDayname').val(dayName);
46         $('#showBranchNameOutput').html($("#branch :selected").text());
47         $('#showBranchName').val($("#branch").val());
48         $('#showDayOutput').html(day);
49         $('#showDay').val(day);
50         $('#showMonthOutput').html(month);
51         $('#showMonth').val(month);
52         $('#showYearOutput').html(year);
53         $('#showYear').val(year);
54         $('#showDescription').val(description);
55         $('#showWeekday:first').val(weekDay);
56         $('#showTitle').val(title);
57         $('#showHolidayType').val(holidayType);
58
59         if (holidayType == 'exception') {
60             $("#showOperationDelLabel").html(_("Delete this exception."));
61             $("#holtype").attr("class","key exception").html(_("Holiday exception"));
62         } else if(holidayType == 'weekday') {
63             $("#showOperationDelLabel").html(_("Delete this holiday."));
64             $("#holtype").attr("class","key repeatableweekly").html(_("Holiday repeating weekly"));
65         } else if(holidayType == 'daymonth') {
66             $("#showOperationDelLabel").html(_("Delete this holiday."));
67             $("#holtype").attr("class","key repeatableyearly").html(_("Holiday repeating yearly"));
68         } else {
69             $("#showOperationDelLabel").html(_("Delete this holiday."));
70             $("#holtype").attr("class","key holiday").html(_("Unique holiday"));
71         }
72         
73         if (exceptionPosibility == 1) {
74             $("#exceptionPosibility").parent().show();
75         } else {
76             $("#exceptionPosibility").parent().hide();
77         }
78     }
79
80     // This function shows the "Add Holiday" panel //
81     function newHoliday (dayName, day, month, year, weekDay) {
82         $("#showHoliday").slideUp("fast");
83         $("#newHoliday").slideDown("fast");
84         $("#newDaynameOutput").html(dayName);
85         $("#newDayname").val(dayName);
86         $("#newBranchNameOutput").html($('#branch :selected').text());
87         $("#newBranchName").val($('#branch').val());
88         $("#newDayOutput").html(day);
89         $("#newDay").val(day);
90         $("#newMonthOutput").html(month);
91         $("#newMonth").val(month);
92         $("#newYearOutput").html(year);
93         $("#newYear").val(year);
94         $("#newWeekday:first").val(weekDay);
95     }
96
97     function hidePanel(aPanelName) {
98         $("#"+aPanelName).slideUp("fast");
99     }
100
101     function changeBranch () {
102         var branch = $("#branch option:selected").val();
103         location.href='/cgi-bin/koha/tools/holidays.pl?branch=' + branch + '&calendardate=' + "[% calendardate %]";
104     }
105
106     function Help() {
107         newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
108     }
109
110     /* This function gives css clases to each kind of day */
111     function dateStatusHandler(date) {
112         date = new Date(date);
113         var day = date.getDate();
114         var month = date.getMonth() + 1;
115         var year = date.getFullYear();
116         var weekDay = date.getDay();
117         var dayMonth = month + '/' + day;
118         var dateString = year + '/' + month + '/' + day;
119         if (exception_holidays[dateString] != null) {
120             return [true, "exception", _("Exception: %s").format(exception_holidays[dateString].title)];
121         } else if ( week_days[weekDay] != null ){
122             return [true, "repeatableweekly", _("Weekly holiday: %s").format(week_days[weekDay].title)];
123         } else if ( day_month_holidays[dayMonth] != null ) {
124             return [true, "repeatableyearly", _("Yearly holiday: %s").format(day_month_holidays[dayMonth].title)];
125         } else if (holidays[dateString] != null) {
126             return [true, "holiday", _("Single holiday: %s").format(holidays[dateString].title)];
127         } else {
128             return [true, "normalday", _("Normal day")];
129         }
130     }
131
132     /* This function is in charge of showing the correct panel considering the kind of holiday */
133     function dateChanged(calendar) {
134         calendar = new Date(calendar);
135         var day = calendar.getDate();
136         var month = calendar.getMonth() + 1;
137         var year = calendar.getFullYear();
138         var weekDay = calendar.getDay();
139         var dayName = weekdays[weekDay];
140         var dayMonth = month + '/' + day;
141         var dateString = year + '/' + month + '/' + day;
142             if (holidays[dateString] != null) {
143                 showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title,     holidays[dateString].description, 'ymd');
144             } else if (exception_holidays[dateString] != null) {
145                 showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 'exception');
146             } else if (week_days[weekDay] != null) {
147                 showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title,     week_days[weekDay].description, 'weekday');
148             } else if (day_month_holidays[dayMonth] != null) {
149                 showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 'daymonth');
150             } else {
151                 newHoliday(dayName, day, month, year, weekDay);
152             }
153     };
154
155     $(document).ready(function() {
156
157         $(".hint").hide();
158         $("#branch").change(function(){
159             changeBranch();
160         });
161         $("#holidayweeklyrepeatable>tbody>tr").each(function(){
162             var first_td = $(this).find('td').first();
163             first_td.html(weekdays[first_td.html()]);
164         });
165         $("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
166             "sDom": 't',
167             "bPaginate": false
168         }));
169         $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
170             "sDom": 't',
171             "aoColumns": [
172                 { "sType": "title-string" },null,null
173             ],
174             "bPaginate": false
175         }));
176         $("a.helptext").click(function(){
177             $(this).parent().find(".hint").toggle(); return false;
178         });
179         $("#dateofrange").datepicker();
180         $("#datecancelrange").datepicker();
181         $("#dateofrange").each(function () { this.value = "" });
182         $("#datecancelrange").each(function () { this.value = "" });
183         $("#jcalendar-container").datepicker({
184           beforeShowDay: function(thedate) {
185             var day = thedate.getDate();
186             var month = thedate.getMonth() + 1;
187             var year = thedate.getFullYear();
188             var dateString = year + '/' + month + '/' + day;
189             return dateStatusHandler(dateString);
190             },
191         onSelect: function(dateText, inst) {
192             dateChanged($(this).datepicker("getDate"));
193         },
194         defaultDate: new Date("[% keydate %]")
195         });
196         $(".hidePanel").on("click",function(){
197             if( $(this).hasClass("showHoliday") ){
198                 hidePanel("showHoliday");
199             } else {
200                 hidePanel("newHoliday");
201             }
202         })
203     });
204 //]]>
205 </script>
206 <style type="text/css"> .key { padding : 3px; white-space:nowrap; line-height:230%; }
207 .ui-datepicker { font-size : 150%; }
208 .ui-datepicker th, .ui-datepicker .ui-datepicker-title select { font-size : 80%; }
209 .ui-datepicker td a { padding : .5em; }
210 .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { font-size : 80%; }
211 .key { padding : 3px; white-space:nowrap; line-height:230%; }
212 .normalday { background-color :  #EDEDED; color :  Black; border : 1px solid #BCBCBC; }
213 .exception { background-color :  #b3d4ff; color :  Black; border : 1px solid #BCBCBC; }
214 .holiday {  background-color :  #ffaeae; color :  Black;  border : 1px solid #BCBCBC; }
215 .repeatableweekly {  background-color :  #FFFF99; color :  Black;  border : 1px solid #BCBCBC; }
216 .repeatableyearly {  background-color :  #FFCC66; color :  Black;  border : 1px solid #BCBCBC; }
217 td.exception a.ui-state-default { background:  #b3d4ff none; color :  Black; border : 1px solid #BCBCBC; }
218 td.holiday a.ui-state-default {  background:  #ffaeae none; color :  Black;  border : 1px solid #BCBCBC; }
219 td.repeatableweekly a.ui-state-default {  background:  #FFFF99 none; color :  Black;  border : 1px solid #BCBCBC; }
220 td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Black;  border : 1px solid #BCBCBC; }
221 .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; }
222 .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; }
223 #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; }
224 </style>
225 </head>
226 <body id="tools_holidays" class="tools">
227 [% INCLUDE 'header.inc' %]
228 [% INCLUDE 'cat-search.inc' %]
229
230 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% Branches.GetName( branch ) %] calendar</div>
231
232 <div id="doc3" class="yui-t1">
233    
234    <div id="bd">
235     <div id="yui-main">
236     <div class="yui-b">
237     <h2>[% Branches.GetName( branch ) %] calendar</h2>
238     <div class="yui-g">
239     <div class="yui-u first">
240         <label for="branch">Define the holidays for:</label>
241             <select id="branch" name="branch">
242                 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
243             </select>
244     
245     <!-- ******************************** FLAT PANELS ******************************************* -->
246     <!-- *****           Makes all the flat panel to deal with holidays                     ***** -->
247     <!-- **************************************************************************************** -->
248
249     <!-- ********************** Panel for showing already loaded holidays *********************** -->
250     <div class="panel" id="showHoliday">
251          <form action="/cgi-bin/koha/tools/exceptionHolidays.pl" method="post">
252              <input type="hidden" id="showHolidayType" name="showHolidayType" value="" />
253             <fieldset class="brief">
254             <h3>Edit this holiday</h3>
255             <span id="holtype"></span>
256             <ol>
257             <li>
258                 <strong>Library:</strong> <span id="showBranchNameOutput"></span>
259                 <input type="hidden" id="showBranchName" name="showBranchName" />
260             </li>
261             <li>
262                 <strong>From date:</strong>
263                 <span id="showDaynameOutput"></span>, 
264                 
265                                 [% 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 %]
266
267                 <input type="hidden" id="showDayname" name="showDayname" />
268                 <input type="hidden" id="showWeekday" name="showWeekday" />
269                 <input type="hidden" id="showDay" name="showDay" />
270                 <input type="hidden" id="showMonth" name="showMonth" />
271                 <input type="hidden" id="showYear" name="showYear" />
272             </li>
273             <li class="dateinsert">
274                 <b>To Date : </b>
275                 <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange %]" class="datepicker"/>
276             </li>
277             <li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li>
278             <!-- showTitle is necessary for exception radio button to work properly -->
279             <li>
280                 <label for="showDescription">Description:</label>
281                 <textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea>
282             </li>
283             <li class="radio"><div id="exceptionPosibility" style="position:static">
284                 <input type="radio" name="showOperation" id="showOperationExc" value="exception" /> <label for="showOperationExc">Generate an exception for this repeated holiday.</label>
285                 <a href="#" class="helptext">[?]</a>
286                 <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>
287             </div></li>
288             <li class="radio"><input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" />
289                 <label for="showOperationExcRange">Generate exceptions on a range of dates.</label>
290                 <a href="#" class="helptext">[?]</a>
291                 <div class="hint">You can make an exception on a range of dates repeated yearly.</div>
292             </li>
293             <li class="radio"><input type="radio" name="showOperation" id="showOperationDel" value="delete" /> <label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label>
294                 <a href="#" class="helptext">[?]</a>
295                 <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>
296             <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>.
297                 <a href="#" class="helptext">[?]</a>
298                 <div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div>
299             </li>
300             <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>.
301                 <a href="#" class="helptext">[?]</a>
302                 <div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div>
303             </li>
304             <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>.
305                 <a href="#" class="helptext">[?]</a>
306                 <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>
307             </li>
308             <li class="radio"><input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label>
309                 <a href="#" class="helptext">[?]</a>
310                 <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>
311             </ol>
312             <fieldset class="action">
313                 <input type="submit" name="submit" value="Save" />
314                 <a href="#" class="cancel hidePanel showHoliday">Cancel</a>
315             </fieldset>
316             </fieldset>
317         </form>
318     </div>
319
320     <!-- ***************************** Panel to deal with new holidays **********************  -->
321     <div class="panel" id="newHoliday">
322          <form action="/cgi-bin/koha/tools/newHolidays.pl" method="post">
323             <fieldset class="brief">
324             <h3>Add new holiday</h3>
325             <ol>
326             <li>
327                 <strong>Library:</strong>
328                 <span id="newBranchNameOutput"></span>
329                 <input type="hidden" id="newBranchName" name="newBranchName" />
330             </li>
331             <li>
332                 <strong>From date:</strong>
333                 <span id="newDaynameOutput"></span>, 
334
335                          [% 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 %]
336
337                 <input type="hidden" id="newDayname" name="showDayname" />
338                 <input type="hidden" id="newWeekday" name="newWeekday" />
339                 <input type="hidden" id="newDay" name="newDay" />
340                 <input type="hidden" id="newMonth" name="newMonth" />
341                 <input type="hidden" id="newYear" name="newYear" />
342             </li>
343             <li class="dateinsert">
344                 <b>To date: </b>
345                 <input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange %]" class="datepicker" />
346             </li>
347             <li><label for="title">Title: </label><input type="text" name="newTitle" id="title" size="35" /></li>
348             <li><label for="newDescription">Description:</label>
349                 <textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea>
350             </li>
351             <li class="radio"><input type="radio" name="newOperation" id="newOperationOnce" value="holiday" checked="checked" />
352             <label for="newOperationOnce">Holiday only on this day</label>.
353             <a href="#" class="helptext">[?]</a>
354             <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>
355             </li>
356             <li class="radio"><input type="radio" name="newOperation" id="newOperationDay" value="weekday" />
357                             <label for="newOperationDay">Holiday repeated every same day of the week</label>.
358                             <a href="#" class="helptext">[?]</a>
359                             <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>
360                             </li>
361             <li class="radio"><input type="radio" name="newOperation" id="newOperationYear" value="repeatable" />
362                             <label for="newOperationYear">Holiday repeated yearly on the same date</label>.
363                             <a href="#" class="helptext">[?]</a>
364                             <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>
365                             </li>
366             <li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
367                             <label for="newOperationField">Holidays on a range</label>.
368                             <a href="#" class="helptext">[?]</a>
369                             <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>
370                             </li>
371             <li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
372                             <label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
373                             <a href="#" class="helptext">[?]</a>
374                             <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>
375                             </li>
376                 <li class="checkbox">
377                 <input type="checkbox" name="allBranches" id="allBranches" />
378                 <label for="allBranches">Copy to all libraries</label>.
379                 <a href="#" class="helptext">[?]</a>
380                 <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>
381                 </li></ol>
382                 <fieldset class="action">
383                     <input type="submit" name="submit" value="Save" />
384                     <a href="#" class="cancel hidePanel newHoliday">Cancel</a>
385                 </fieldset>
386                 </fieldset>
387          </form>
388     </div>
389
390     <!-- *************************************************************************************** -->
391     <!-- ******                          END OF FLAT PANELS                               ****** -->
392     <!-- *************************************************************************************** -->
393
394 <!-- ************************************************************************************** -->
395 <!-- ******                              MAIN SCREEN CODE                            ****** -->
396 <!-- ************************************************************************************** -->
397 <h3>Calendar information</h3>
398 <div id="jcalendar-container"></div>
399
400 <div style="margin-top: 2em;">
401 <form action="copy-holidays.pl" method="post">
402     <input type="hidden" name="from_branchcode" value="[% branch %]" />
403   <label for="branchcode">Copy holidays to:</label>
404   <select id="branchcode" name="branchcode">
405     <option value=""></option>
406     [% FOREACH l IN Branches.all() %]
407     <option value="[% l.branchcode %]">[% l.branchname %]</option>
408     [% END %]
409   </select>
410     <input type="submit" value="Copy" />
411 </form>
412 </div>
413
414 </div>
415 <div class="yui-u">
416 <div class="help">
417 <h4>Hints</h4>
418     <ul>
419         <li>Search in the calendar the day you want to set as holiday.</li>
420         <li>Click the date to add or edit a holiday.</li>
421         <li>Enter a title and description for the holiday.</li>
422         <li>Specify how the holiday should repeat.</li>
423         <li>Click Save to finish.</li>
424     </ul>
425 <h4>Key</h4>
426     <p>
427         <span class="key normalday">Working day</span>
428         <span class="key holiday">Unique holiday</span>
429         <span class="key repeatableweekly">Holiday repeating weekly</span>
430         <span class="key repeatableyearly">Holiday repeating yearly</span>
431         <span class="key exception">Holiday exception</span>
432     </p>
433 </div>
434 <div id="holiday-list">
435 <!-- Exceptions First -->
436 <!--   this will probably always have the least amount of data -->
437 [% IF ( EXCEPTION_HOLIDAYS_LOOP ) %]
438 <h3>Exceptions</h3>
439   <table id="holidayexceptions">
440 <thead><tr>
441   <th class="exception">Date</th>
442   <th class="exception">Title</th>
443   <th class="exception">Description</th>
444 </tr>
445 </thead>
446 <tbody>
447   [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
448   <tr>
449   <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>
450   <td>[% EXCEPTION_HOLIDAYS_LOO.TITLE %]</td>
451   <td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION %]</td> 
452   </tr>
453   [% END %] 
454 </tbody>
455 </table>
456 [% END %]
457
458 [% IF ( WEEK_DAYS_LOOP ) %]
459 <h3>Weekly - Repeatable holidays</h3>
460 <table id="holidayweeklyrepeatable">
461 <thead>
462 <tr>
463   <th class="repeatableweekly">Day of week</th>
464   <th class="repeatableweekly">Title</th>
465   <th class="repeatableweekly">Description</th>
466 </tr>
467 </thead>
468 <tbody>
469   [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %]
470   <tr>
471   <td>[% WEEK_DAYS_LOO.KEY %]</td>
472   </td> 
473   <td>[% WEEK_DAYS_LOO.TITLE %]</td> 
474   <td>[% WEEK_DAYS_LOO.DESCRIPTION %]</td> 
475   </tr>
476   [% END %] 
477 </tbody>
478 </table>
479 [% END %]
480
481 [% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %]
482 <h3>Yearly - Repeatable holidays</h3>
483 <table id="holidaysyearlyrepeatable">
484 <thead>
485 <tr>
486   [% IF ( dateformat == "metric" ) %]
487   <th class="repeatableyearly">Day/month</th>
488   [% ELSE %]
489   <th class="repeatableyearly">Month/day</th>
490   [% END %]
491   <th class="repeatableyearly">Title</th>
492   <th class="repeatableyearly">Description</th>
493 </tr>
494 </thead>
495 <tbody>
496   [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
497   <tr>
498   <td><span title="[% DAY_MONTH_HOLIDAYS_LOO.DATE_SORT %]">[% DAY_MONTH_HOLIDAYS_LOO.DATE %]</span></td>
499   <td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE %]</td> 
500   <td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION %]</td> 
501   </tr>
502   [% END %] 
503 </tbody>
504 </table>
505 [% END %]
506
507 [% IF ( HOLIDAYS_LOOP ) %]
508 <h3>Unique holidays</h3>
509 <table id="holidaysunique">
510 <thead>
511 <tr>
512   <th class="holiday">Date</th>
513   <th class="holiday">Title</th>
514   <th class="holiday">Description</th>
515 </tr>
516 </thead>
517 <tbody>
518     [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
519 <tr>
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>
521   <td>[% HOLIDAYS_LOO.TITLE %]</td>
522   <td>[% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '<br />') %]</td>
523 </tr>
524   [% END %] 
525 </tbody>
526 </table>
527 [% END %]
528 </div>
529 </div>
530 </div>
531 </div>
532 </div>
533
534 <div class="yui-b noprint">
535 [% INCLUDE 'tools-menu.inc' %]
536 </div>
537 </div>
538 [% INCLUDE 'intranet-bottom.inc' %]