Bug 15758: Koha::Libraries - Remove GetBranchName
[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                 [% FOREACH branchloo IN branchloop %]
243                     [% IF ( branchloo.selected ) %]
244                         <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
245                     [% ELSE %]
246                         <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
247                     [% END %]
248                 [% END %]
249             </select>
250     
251     <!-- ******************************** FLAT PANELS ******************************************* -->
252     <!-- *****           Makes all the flat panel to deal with holidays                     ***** -->
253     <!-- **************************************************************************************** -->
254
255     <!-- ********************** Panel for showing already loaded holidays *********************** -->
256     <div class="panel" id="showHoliday">
257          <form action="/cgi-bin/koha/tools/exceptionHolidays.pl" method="post">
258              <input type="hidden" id="showHolidayType" name="showHolidayType" value="" />
259             <fieldset class="brief">
260             <h3>Edit this holiday</h3>
261             <span id="holtype"></span>
262             <ol>
263             <li>
264                 <strong>Library:</strong> <span id="showBranchNameOutput"></span>
265                 <input type="hidden" id="showBranchName" name="showBranchName" />
266             </li>
267             <li>
268                 <strong>From date:</strong>
269                 <span id="showDaynameOutput"></span>, 
270                 
271                                 [% 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 %]
272
273                 <input type="hidden" id="showDayname" name="showDayname" />
274                 <input type="hidden" id="showWeekday" name="showWeekday" />
275                 <input type="hidden" id="showDay" name="showDay" />
276                 <input type="hidden" id="showMonth" name="showMonth" />
277                 <input type="hidden" id="showYear" name="showYear" />
278             </li>
279             <li class="dateinsert">
280                 <b>To Date : </b>
281                 <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange %]" class="datepicker"/>
282             </li>
283             <li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li>
284             <!-- showTitle is necessary for exception radio button to work properly -->
285             <li>
286                 <label for="showDescription">Description:</label>
287                 <textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea>
288             </li>
289             <li class="radio"><div id="exceptionPosibility" style="position:static">
290                 <input type="radio" name="showOperation" id="showOperationExc" value="exception" /> <label for="showOperationExc">Generate an exception for this repeated holiday.</label>
291                 <a href="#" class="helptext">[?]</a>
292                 <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>
293             </div></li>
294             <li class="radio"><input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" />
295                 <label for="showOperationExcRange">Generate exceptions on a range of dates.</label>
296                 <a href="#" class="helptext">[?]</a>
297                 <div class="hint">You can make an exception on a range of dates repeated yearly.</div>
298             </li>
299             <li class="radio"><input type="radio" name="showOperation" id="showOperationDel" value="delete" /> <label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label>
300                 <a href="#" class="helptext">[?]</a>
301                 <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>
302             <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>.
303                 <a href="#" class="helptext">[?]</a>
304                 <div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div>
305             </li>
306             <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>.
307                 <a href="#" class="helptext">[?]</a>
308                 <div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div>
309             </li>
310             <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>.
311                 <a href="#" class="helptext">[?]</a>
312                 <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>
313             </li>
314             <li class="radio"><input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label>
315                 <a href="#" class="helptext">[?]</a>
316                 <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>
317             </ol>
318             <fieldset class="action">
319                 <input type="submit" name="submit" value="Save" />
320                 <a href="#" class="cancel hidePanel showHoliday">Cancel</a>
321             </fieldset>
322             </fieldset>
323         </form>
324     </div>
325
326     <!-- ***************************** Panel to deal with new holidays **********************  -->
327     <div class="panel" id="newHoliday">
328          <form action="/cgi-bin/koha/tools/newHolidays.pl" method="post">
329                 <input type="hidden" name="branchCodes" id="branchCodes" value="[% branchcodes %]" /> 
330             <fieldset class="brief">
331             <h3>Add new holiday</h3>
332             <ol>
333             <li>
334                 <strong>Library:</strong>
335                 <span id="newBranchNameOutput"></span>
336                 <input type="hidden" id="newBranchName" name="newBranchName" />
337             </li>
338             <li>
339                 <strong>From date:</strong>
340                 <span id="newDaynameOutput"></span>, 
341
342                          [% 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 %]
343
344                 <input type="hidden" id="newDayname" name="showDayname" />
345                 <input type="hidden" id="newWeekday" name="newWeekday" />
346                 <input type="hidden" id="newDay" name="newDay" />
347                 <input type="hidden" id="newMonth" name="newMonth" />
348                 <input type="hidden" id="newYear" name="newYear" />
349             </li>
350             <li class="dateinsert">
351                 <b>To date: </b>
352                 <input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange %]" class="datepicker" />
353             </li>
354             <li><label for="title">Title: </label><input type="text" name="newTitle" id="title" size="35" /></li>
355             <li><label for="newDescription">Description:</label>
356                 <textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea>
357             </li>
358             <li class="radio"><input type="radio" name="newOperation" id="newOperationOnce" value="holiday" checked="checked" />
359             <label for="newOperationOnce">Holiday only on this day</label>.
360             <a href="#" class="helptext">[?]</a>
361             <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>
362             </li>
363             <li class="radio"><input type="radio" name="newOperation" id="newOperationDay" value="weekday" />
364                             <label for="newOperationDay">Holiday repeated every same day of the week</label>.
365                             <a href="#" class="helptext">[?]</a>
366                             <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>
367                             </li>
368             <li class="radio"><input type="radio" name="newOperation" id="newOperationYear" value="repeatable" />
369                             <label for="newOperationYear">Holiday repeated yearly on the same date</label>.
370                             <a href="#" class="helptext">[?]</a>
371                             <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>
372                             </li>
373             <li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
374                             <label for="newOperationField">Holidays on a range</label>.
375                             <a href="#" class="helptext">[?]</a>
376                             <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>
377                             </li>
378             <li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
379                             <label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
380                             <a href="#" class="helptext">[?]</a>
381                             <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>
382                             </li>
383                 <li class="radio">
384                 <input type="checkbox" name="allBranches" id="allBranches" />
385                 <label for="allBranches">Copy to all libraries</label>.
386                 <a href="#" class="helptext">[?]</a>
387                 <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>
388                 </li></ol>
389                 <fieldset class="action">
390                     <input type="submit" name="submit" value="Save" />
391                     <a href="#" class="cancel hidePanel newHoliday">Cancel</a>
392                 </fieldset>
393                 </fieldset>
394          </form>
395     </div>
396
397     <!-- *************************************************************************************** -->
398     <!-- ******                          END OF FLAT PANELS                               ****** -->
399     <!-- *************************************************************************************** -->
400
401 <!-- ************************************************************************************** -->
402 <!-- ******                              MAIN SCREEN CODE                            ****** -->
403 <!-- ************************************************************************************** -->
404 <h3>Calendar information</h3>
405 <div id="jcalendar-container"></div>
406
407 <div style="margin-top: 2em;">
408 <form action="copy-holidays.pl" method="post">
409     <input type="hidden" name="from_branchcode" value="[% branch %]" />
410   <label for="branchcode">Copy holidays to:</label>
411   <select id="branchcode" name="branchcode">
412     <option value=""></option>
413     [% FOREACH branchloo IN branchloop %]
414     <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
415     [% END %]
416   </select>
417     <input type="submit" value="Copy" />
418 </form>
419 </div>
420
421 </div>
422 <div class="yui-u">
423 <div class="help">
424 <h4>Hints</h4>
425     <ul>
426         <li>Search in the calendar the day you want to set as holiday.</li>
427         <li>Click the date to add or edit a holiday.</li>
428         <li>Enter a title and description for the holiday.</li>
429         <li>Specify how the holiday should repeat.</li>
430         <li>Click Save to finish.</li>
431     </ul>
432 <h4>Key</h4>
433     <p>
434         <span class="key normalday">Working day</span>
435         <span class="key holiday">Unique holiday</span>
436         <span class="key repeatableweekly">Holiday repeating weekly</span>
437         <span class="key repeatableyearly">Holiday repeating yearly</span>
438         <span class="key exception">Holiday exception</span>
439     </p>
440 </div>
441 <div id="holiday-list">
442 <!-- Exceptions First -->
443 <!--   this will probably always have the least amount of data -->
444 [% IF ( EXCEPTION_HOLIDAYS_LOOP ) %]
445 <h3>Exceptions</h3>
446   <table id="holidayexceptions">
447 <thead><tr>
448   <th class="exception">Date</th>
449   <th class="exception">Title</th>
450   <th class="exception">Description</th>
451 </tr>
452 </thead>
453 <tbody>
454   [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
455   <tr>
456   <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>
457   <td>[% EXCEPTION_HOLIDAYS_LOO.TITLE %]</td>
458   <td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION %]</td> 
459   </tr>
460   [% END %] 
461 </tbody>
462 </table>
463 [% END %]
464
465 [% IF ( WEEK_DAYS_LOOP ) %]
466 <h3>Weekly - Repeatable holidays</h3>
467 <table id="holidayweeklyrepeatable">
468 <thead>
469 <tr>
470   <th class="repeatableweekly">Day of week</th>
471   <th class="repeatableweekly">Title</th>
472   <th class="repeatableweekly">Description</th>
473 </tr>
474 </thead>
475 <tbody>
476   [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %]
477   <tr>
478   <td>[% WEEK_DAYS_LOO.KEY %]</td>
479   </td> 
480   <td>[% WEEK_DAYS_LOO.TITLE %]</td> 
481   <td>[% WEEK_DAYS_LOO.DESCRIPTION %]</td> 
482   </tr>
483   [% END %] 
484 </tbody>
485 </table>
486 [% END %]
487
488 [% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %]
489 <h3>Yearly - Repeatable holidays</h3>
490 <table id="holidaysyearlyrepeatable">
491 <thead>
492 <tr>
493   [% IF ( dateformat == "metric" ) %]
494   <th class="repeatableyearly">Day/month</th>
495   [% ELSE %]
496   <th class="repeatableyearly">Month/day</th>
497   [% END %]
498   <th class="repeatableyearly">Title</th>
499   <th class="repeatableyearly">Description</th>
500 </tr>
501 </thead>
502 <tbody>
503   [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %]
504   <tr>
505   <td><span title="[% DAY_MONTH_HOLIDAYS_LOO.DATE_SORT %]">[% DAY_MONTH_HOLIDAYS_LOO.DATE %]</span></td>
506   <td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE %]</td> 
507   <td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION %]</td> 
508   </tr>
509   [% END %] 
510 </tbody>
511 </table>
512 [% END %]
513
514 [% IF ( HOLIDAYS_LOOP ) %]
515 <h3>Unique holidays</h3>
516 <table id="holidaysunique">
517 <thead>
518 <tr>
519   <th class="holiday">Date</th>
520   <th class="holiday">Title</th>
521   <th class="holiday">Description</th>
522 </tr>
523 </thead>
524 <tbody>
525     [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
526 <tr>
527   <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>
528   <td>[% HOLIDAYS_LOO.TITLE %]</td>
529   <td>[% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '<br />') %]</td>
530 </tr>
531   [% END %] 
532 </tbody>
533 </table>
534 [% END %]
535 </div>
536 </div>
537 </div>
538 </div>
539 </div>
540
541 <div class="yui-b noprint">
542 [% INCLUDE 'tools-menu.inc' %]
543 </div>
544 </div>
545 [% INCLUDE 'intranet-bottom.inc' %]