Lines 32-358
Link Here
|
32 |
<div class="col-sm-10 col-sm-push-2"> |
32 |
<div class="col-sm-10 col-sm-push-2"> |
33 |
<main> |
33 |
<main> |
34 |
|
34 |
|
35 |
<h2>[% Branches.GetName( branch ) | html %] calendar</h2> |
35 |
<h2>[% Branches.GetName( branch ) | html %] calendar</h2> |
36 |
|
36 |
|
37 |
<div class="row"> |
37 |
<div class="row"> |
38 |
<div class="col-sm-6"> |
38 |
<div class="col-sm-6"> |
39 |
<label for="branch">Define the holidays for:</label> |
39 |
<label for="branch">Define the holidays for:</label> |
40 |
<select id="branch" name="branch"> |
40 |
<select id="branch" name="branch"> |
41 |
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] |
41 |
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] |
42 |
</select> |
42 |
</select> |
43 |
|
43 |
|
44 |
<!-- ******************************** FLAT PANELS ******************************************* --> |
44 |
<!-- ******************************** FLAT PANELS ******************************************* --> |
45 |
<!-- ***** Makes all the flat panel to deal with holidays ***** --> |
45 |
<!-- ***** Makes all the flat panel to deal with holidays ***** --> |
46 |
<!-- **************************************************************************************** --> |
46 |
<!-- **************************************************************************************** --> |
47 |
|
47 |
|
48 |
<!-- ********************** Panel for showing already loaded holidays *********************** --> |
48 |
<!-- ********************** Panel for showing already loaded holidays *********************** --> |
49 |
<div class="panel" id="showHoliday"> |
49 |
<div class="panel" id="showHoliday"> |
50 |
<form action="/cgi-bin/koha/tools/exceptionHolidays.pl" method="post"> |
50 |
<form action="/cgi-bin/koha/tools/exceptionHolidays.pl" method="post"> |
51 |
<input type="hidden" id="showHolidayType" name="showHolidayType" value="" /> |
51 |
<input type="hidden" id="showHolidayType" name="showHolidayType" value="" /> |
52 |
<fieldset class="brief"> |
52 |
<fieldset class="brief"> |
53 |
<h3>Edit this holiday</h3> |
53 |
<h3>Edit this holiday</h3> |
54 |
<span id="holtype"></span> |
54 |
<span id="holtype"></span> |
55 |
<ol> |
55 |
<ol> |
56 |
<li> |
56 |
<li> |
57 |
<strong>Library:</strong> <span id="showBranchNameOutput"></span> |
57 |
<strong>Library:</strong> <span id="showBranchNameOutput"></span> |
58 |
<input type="hidden" id="showBranchName" name="showBranchName" /> |
58 |
<input type="hidden" id="showBranchName" name="showBranchName" /> |
59 |
</li> |
59 |
</li> |
60 |
<li> |
60 |
<li> |
61 |
<strong>From date:</strong> |
61 |
<strong>From date:</strong> |
62 |
<span id="showDaynameOutput"></span>, |
62 |
<span id="showDaynameOutput"></span>, |
63 |
|
63 |
[% IF ( dateformat == "us" ) %] |
64 |
[% 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 %] |
64 |
<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>/<span id="showYearOutput"></span> |
65 |
|
65 |
[% ELSIF ( dateformat == "metric") %] |
66 |
<input type="hidden" id="showDayname" name="showDayname" /> |
66 |
<span id="showDayOutput"></span>/<span id="showMonthOutput"></span>/<span id="showYearOutput"></span> |
67 |
<input type="hidden" id="showWeekday" name="showWeekday" /> |
67 |
[% ELSIF ( dateformat == "dmydot") %] |
68 |
<input type="hidden" id="showDay" name="showDay" /> |
68 |
<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> |
69 |
<input type="hidden" id="showMonth" name="showMonth" /> |
69 |
[% END %] |
70 |
<input type="hidden" id="showYear" name="showYear" /> |
70 |
|
71 |
</li> |
71 |
<input type="hidden" id="showDayname" name="showDayname" /> |
72 |
<li class="dateinsert"> |
72 |
<input type="hidden" id="showWeekday" name="showWeekday" /> |
73 |
<strong>To date: </strong> |
73 |
<input type="hidden" id="showDay" name="showDay" /> |
74 |
<input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange | html %]" class="datepicker"/> |
74 |
<input type="hidden" id="showMonth" name="showMonth" /> |
75 |
</li> |
75 |
<input type="hidden" id="showYear" name="showYear" /> |
76 |
<li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li> |
76 |
</li> |
77 |
<!-- showTitle is necessary for exception radio button to work properly --> |
77 |
<li class="dateinsert"> |
78 |
<li> |
78 |
<strong>To date: </strong> |
79 |
<label for="showDescription">Description:</label> |
79 |
<input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange | html %]" class="datepicker"/> |
80 |
<textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea> |
80 |
</li> |
81 |
</li> |
81 |
<li> |
82 |
<li class="radio"><div class="exceptionPossibility" style="position:static"> |
82 |
<label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /> |
83 |
<input type="radio" name="showOperation" id="showOperationExc" value="exception" /> <label for="showOperationExc">Generate an exception for this repeated holiday.</label> |
83 |
</li> |
84 |
<a href="#" class="helptext">[?]</a> |
84 |
<!-- showTitle is necessary for exception radio button to work properly --> |
85 |
<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> |
85 |
<li> |
86 |
</div></li> |
86 |
<label for="showDescription">Description:</label> |
87 |
<li class="radio"><div class="exceptionPossibility" style="position:static"> |
87 |
<textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea> |
88 |
<input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" /> |
88 |
</li> |
89 |
<label for="showOperationExcRange">Generate exceptions on a range of dates.</label> |
89 |
<li class="radio"> |
90 |
<a href="#" class="helptext">[?]</a> |
90 |
<div class="exceptionPossibility" style="position:static"> |
91 |
<div class="hint">You can make an exception on a range of dates repeated yearly.</div> |
91 |
<input type="radio" name="showOperation" id="showOperationExc" value="exception" /> <label for="showOperationExc">Generate an exception for this repeated holiday.</label> |
92 |
</div></li> |
92 |
<a href="#" class="helptext">[?]</a> |
93 |
<li class="radio"><input type="radio" name="showOperation" id="showOperationDel" value="delete" /> <label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label> |
93 |
<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> |
94 |
<a href="#" class="helptext">[?]</a> |
94 |
</div> |
95 |
<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> |
95 |
</li> |
96 |
<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>. |
96 |
<li class="radio"> |
97 |
<a href="#" class="helptext">[?]</a> |
97 |
<div class="exceptionPossibility" style="position:static"> |
98 |
<div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div> |
98 |
<input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" /> |
99 |
</li> |
99 |
<label for="showOperationExcRange">Generate exceptions on a range of dates.</label> |
100 |
<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>. |
100 |
<a href="#" class="helptext">[?]</a> |
101 |
<a href="#" class="helptext">[?]</a> |
101 |
<div class="hint">You can make an exception on a range of dates repeated yearly.</div> |
102 |
<div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div> |
102 |
</div> |
103 |
</li> |
103 |
</li> |
104 |
<li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>. |
104 |
<li class="radio"> |
105 |
<a href="#" class="helptext">[?]</a> |
105 |
<input type="radio" name="showOperation" id="showOperationDel" value="delete" /> |
106 |
<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> |
106 |
<label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label> |
107 |
</li> |
107 |
<a href="#" class="helptext">[?]</a> |
108 |
<li class="radio"><input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label> |
108 |
<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> |
109 |
<a href="#" class="helptext">[?]</a> |
109 |
</li> |
110 |
<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> |
110 |
<li class="radio"> |
111 |
<li class="checkbox"> |
111 |
<input type="radio" name="showOperation" id="showOperationDelRange" value="deleterange" /> <label for="showOperationDelRange" id="showOperationDelLabelRange">Delete the single holidays on a range</label>. |
112 |
<input type="checkbox" name="allBranches" id="allBranches" /> |
112 |
<a href="#" class="helptext">[?]</a> |
113 |
<label for="allBranches">Copy changes to all libraries</label>. |
113 |
<div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div> |
114 |
<a href="#" class="helptext">[?]</a> |
114 |
</li> |
115 |
<div class="hint">If checked, changes for this holiday will be copied to all libraries. If the holiday doesn't exists for a library, no change is made.</div> |
115 |
<li class="radio"> |
116 |
</li> |
116 |
<input type="radio" name="showOperation" id="showOperationDelRangeRepeat" value="deleterangerepeat" /> <label for="showOperationDelRangeRepeat" id="showOperationDelLabelRangeRepeat">Delete the repeated holidays on a range</label>. |
117 |
</ol> |
117 |
<a href="#" class="helptext">[?]</a> |
118 |
<fieldset class="action"> |
118 |
<div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div> |
119 |
<input type="submit" name="submit" value="Save" /> |
119 |
</li> |
120 |
<a href="#" class="cancel hidePanel showHoliday">Cancel</a> |
120 |
<li class="radio"> |
121 |
</fieldset> |
121 |
<input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>. |
122 |
</fieldset> |
122 |
<a href="#" class="helptext">[?]</a> |
123 |
</form> |
123 |
<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> |
124 |
</div> |
124 |
</li> |
125 |
|
125 |
<li class="radio"> |
126 |
<!-- ***************************** Panel to deal with new holidays ********************** --> |
126 |
<input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label> |
127 |
<div class="panel" id="newHoliday"> |
127 |
<a href="#" class="helptext">[?]</a> |
128 |
<form action="/cgi-bin/koha/tools/newHolidays.pl" method="post"> |
128 |
<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> |
129 |
<fieldset class="brief"> |
129 |
<li class="checkbox"> |
130 |
<h3>Add new holiday</h3> |
130 |
<input type="checkbox" name="allBranches" id="allBranches" /> |
131 |
<ol> |
131 |
<label for="allBranches">Copy changes to all libraries</label>. |
132 |
<li> |
132 |
<a href="#" class="helptext">[?]</a> |
133 |
<strong>Library:</strong> |
133 |
<div class="hint">If checked, changes for this holiday will be copied to all libraries. If the holiday doesn't exists for a library, no change is made.</div> |
134 |
<span id="newBranchNameOutput"></span> |
134 |
</li> |
135 |
<input type="hidden" id="newBranchName" name="newBranchName" /> |
135 |
</ol> |
136 |
</li> |
136 |
<fieldset class="action"> |
137 |
<li> |
137 |
<input type="submit" name="submit" value="Save" /> |
138 |
<strong>From date:</strong> |
138 |
<a href="#" class="cancel hidePanel showHoliday">Cancel</a> |
139 |
<span id="newDaynameOutput"></span>, |
139 |
</fieldset> |
140 |
|
140 |
</fieldset> |
141 |
[% 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 %] |
141 |
</form> |
142 |
|
142 |
</div> |
143 |
<input type="hidden" id="newDayname" name="showDayname" /> |
143 |
|
144 |
<input type="hidden" id="newWeekday" name="newWeekday" /> |
144 |
<!-- ***************************** Panel to deal with new holidays ********************** --> |
145 |
<input type="hidden" id="newDay" name="newDay" /> |
145 |
<div class="panel" id="newHoliday"> |
146 |
<input type="hidden" id="newMonth" name="newMonth" /> |
146 |
<form action="/cgi-bin/koha/tools/newHolidays.pl" method="post"> |
147 |
<input type="hidden" id="newYear" name="newYear" /> |
147 |
<fieldset class="brief"> |
148 |
</li> |
148 |
<h3>Add new holiday</h3> |
149 |
<li class="dateinsert"> |
149 |
<ol> |
150 |
<strong>To date: </strong> |
150 |
<li> |
151 |
<input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" class="datepicker" /> |
151 |
<strong>Library:</strong> |
152 |
</li> |
152 |
<span id="newBranchNameOutput"></span> |
153 |
<li><label for="title">Title: </label><input type="text" name="newTitle" id="title" size="35" /></li> |
153 |
<input type="hidden" id="newBranchName" name="newBranchName" /> |
154 |
<li><label for="newDescription">Description:</label> |
154 |
</li> |
155 |
<textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea> |
155 |
<li> |
156 |
</li> |
156 |
<strong>From date:</strong> |
157 |
<li class="radio"><input type="radio" name="newOperation" id="newOperationOnce" value="holiday" checked="checked" /> |
157 |
<span id="newDaynameOutput"></span>, |
158 |
<label for="newOperationOnce">Holiday only on this day</label>. |
158 |
|
159 |
<a href="#" class="helptext">[?]</a> |
159 |
[% IF ( dateformat == "us" ) %] |
160 |
<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> |
160 |
<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>/<span id="newYearOutput"></span> |
161 |
</li> |
161 |
[% ELSIF ( dateformat == "metric" ) %] |
162 |
<li class="radio"><input type="radio" name="newOperation" id="newOperationDay" value="weekday" /> |
162 |
<span id="newDayOutput"></span>/<span id="newMonthOutput"></span>/<span id="newYearOutput"></span> |
163 |
<label for="newOperationDay">Holiday repeated every same day of the week</label>. |
163 |
[% ELSIF ( dateformat == "dmydot" ) %] |
164 |
<a href="#" class="helptext">[?]</a> |
164 |
<span id="newDayOutput"></span>.<span id="newMonthOutput"></span>.<span id="newYearOutput"></span> |
165 |
<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> |
165 |
[% ELSE %] |
166 |
</li> |
166 |
<span id="newYearOutput"></span>/<span id="newMonthOutput"></span>/<span id="newDayOutput"></span> |
167 |
<li class="radio"><input type="radio" name="newOperation" id="newOperationYear" value="repeatable" /> |
167 |
[% END %] |
168 |
<label for="newOperationYear">Holiday repeated yearly on the same date</label>. |
168 |
|
169 |
<a href="#" class="helptext">[?]</a> |
169 |
<input type="hidden" id="newDayname" name="showDayname" /> |
170 |
<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> |
170 |
<input type="hidden" id="newWeekday" name="newWeekday" /> |
171 |
</li> |
171 |
<input type="hidden" id="newDay" name="newDay" /> |
172 |
<li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" /> |
172 |
<input type="hidden" id="newMonth" name="newMonth" /> |
173 |
<label for="newOperationField">Holidays on a range</label>. |
173 |
<input type="hidden" id="newYear" name="newYear" /> |
174 |
<a href="#" class="helptext">[?]</a> |
174 |
</li> |
175 |
<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> |
175 |
<li class="dateinsert"> |
176 |
</li> |
176 |
<strong>To date: </strong> |
177 |
<li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" /> |
177 |
<input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" class="datepicker" /> |
178 |
<label for="newOperationFieldyear">Holidays repeated yearly on a range</label>. |
178 |
</li> |
179 |
<a href="#" class="helptext">[?]</a> |
179 |
<li> |
180 |
<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> |
180 |
<label for="title">Title: </label> |
181 |
</li> |
181 |
<input type="text" name="newTitle" id="title" size="35" /></li> |
182 |
<li class="checkbox"> |
182 |
<li> |
183 |
<input type="checkbox" name="allBranches" id="allBranches" /> |
183 |
<label for="newDescription">Description:</label> |
184 |
<label for="allBranches">Copy to all libraries</label>. |
184 |
<textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea> |
185 |
<a href="#" class="helptext">[?]</a> |
185 |
</li> |
186 |
<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> |
186 |
<li class="radio"> |
187 |
</li></ol> |
187 |
<input type="radio" name="newOperation" id="newOperationOnce" value="holiday" checked="checked" /> |
188 |
<fieldset class="action"> |
188 |
<label for="newOperationOnce">Holiday only on this day</label>. |
189 |
<input type="submit" name="submit" value="Save" /> |
189 |
<a href="#" class="helptext">[?]</a> |
190 |
<a href="#" class="cancel hidePanel newHoliday">Cancel</a> |
190 |
<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> |
191 |
</fieldset> |
191 |
</li> |
192 |
</fieldset> |
192 |
<li class="radio"> |
193 |
</form> |
193 |
<input type="radio" name="newOperation" id="newOperationDay" value="weekday" /> |
194 |
</div> |
194 |
<label for="newOperationDay">Holiday repeated every same day of the week</label>. |
195 |
|
195 |
<a href="#" class="helptext">[?]</a> |
196 |
<!-- *************************************************************************************** --> |
196 |
<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> |
197 |
<!-- ****** END OF FLAT PANELS ****** --> |
197 |
</li> |
198 |
<!-- *************************************************************************************** --> |
198 |
<li class="radio"> |
199 |
|
199 |
<input type="radio" name="newOperation" id="newOperationYear" value="repeatable" /> |
200 |
<!-- ************************************************************************************** --> |
200 |
<label for="newOperationYear">Holiday repeated yearly on the same date</label>. |
201 |
<!-- ****** MAIN SCREEN CODE ****** --> |
201 |
<a href="#" class="helptext">[?]</a> |
202 |
<!-- ************************************************************************************** --> |
202 |
<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> |
203 |
<h3>Calendar information</h3> |
203 |
</li> |
204 |
<div id="jcalendar-container"></div> |
204 |
<li class="radio"> |
205 |
|
205 |
<input type="radio" name="newOperation" id="newOperationField" value="holidayrange" /> |
206 |
<div style="margin-top: 2em;"> |
206 |
<label for="newOperationField">Holidays on a range</label>. |
207 |
<form action="copy-holidays.pl" method="post"> |
207 |
<a href="#" class="helptext">[?]</a> |
208 |
<input type="hidden" name="from_branchcode" value="[% branch | html %]" /> |
208 |
<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> |
209 |
<label for="branchcode">Copy holidays to:</label> |
209 |
</li> |
210 |
<select id="branchcode" name="branchcode"> |
210 |
<li class="radio"> |
211 |
<option value=""></option> |
211 |
<input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" /> |
212 |
[% FOREACH l IN Branches.all() %] |
212 |
<label for="newOperationFieldyear">Holidays repeated yearly on a range</label>. |
213 |
<option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> |
213 |
<a href="#" class="helptext">[?]</a> |
214 |
[% END %] |
214 |
<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> |
215 |
</select> |
215 |
</li> |
216 |
<input type="submit" value="Copy" /> |
216 |
<li class="checkbox"> |
217 |
</form> |
217 |
<input type="checkbox" name="allBranches" id="allBranches" /> |
218 |
</div> |
218 |
<label for="allBranches">Copy to all libraries</label>. |
219 |
|
219 |
<a href="#" class="helptext">[?]</a> |
220 |
</div> |
220 |
<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> |
221 |
<div class="col-sm-6"> |
221 |
</li> |
222 |
<div class="help"> |
222 |
</ol> |
223 |
<h4>Hints</h4> |
223 |
<fieldset class="action"> |
224 |
<ul> |
224 |
<input type="submit" name="submit" value="Save" /> |
225 |
<li>Search in the calendar the day you want to set as holiday.</li> |
225 |
<a href="#" class="cancel hidePanel newHoliday">Cancel</a> |
226 |
<li>Click the date to add or edit a holiday.</li> |
226 |
</fieldset> |
227 |
<li>Enter a title and description for the holiday.</li> |
227 |
</fieldset> |
228 |
<li>Specify how the holiday should repeat.</li> |
228 |
</form> |
229 |
<li>Click Save to finish.</li> |
229 |
</div> |
230 |
</ul> |
230 |
|
231 |
<h4>Key</h4> |
231 |
<!-- *************************************************************************************** --> |
232 |
<p> |
232 |
<!-- ****** END OF FLAT PANELS ****** --> |
233 |
<span class="key normalday">Working day</span> |
233 |
<!-- *************************************************************************************** --> |
234 |
<span class="key holiday">Unique holiday</span> |
234 |
|
235 |
<span class="key repeatableweekly">Holiday repeating weekly</span> |
235 |
<!-- ************************************************************************************** --> |
236 |
<span class="key repeatableyearly">Holiday repeating yearly</span> |
236 |
<!-- ****** MAIN SCREEN CODE ****** --> |
237 |
<span class="key exception">Holiday exception</span> |
237 |
<!-- ************************************************************************************** --> |
238 |
</p> |
238 |
<h3>Calendar information</h3> |
239 |
</div> |
239 |
<div id="jcalendar-container"></div> |
240 |
<div id="holiday-list"> |
240 |
<div style="margin-top: 2em;"> |
241 |
<!-- Exceptions First --> |
241 |
<form action="copy-holidays.pl" method="post"> |
242 |
<!-- this will probably always have the least amount of data --> |
242 |
<input type="hidden" name="from_branchcode" value="[% branch | html %]" /> |
243 |
[% IF ( EXCEPTION_HOLIDAYS_LOOP ) %] |
243 |
<label for="branchcode">Copy holidays to:</label> |
244 |
<h3>Exceptions</h3> |
244 |
<select id="branchcode" name="branchcode"> |
245 |
<label class="controls"> |
245 |
<option value=""></option> |
246 |
<input type="checkbox" name="show_past" id="show_past_holidayexceptions" class="show_past" /> |
246 |
[% FOREACH l IN Branches.all() %] |
247 |
Show past entries |
247 |
<option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> |
248 |
</label> |
248 |
[% END %] |
249 |
<table id="holidayexceptions"> |
249 |
</select> |
250 |
<thead><tr> |
250 |
<input type="submit" value="Copy" /> |
251 |
<th class="exception">Date</th> |
251 |
</form> |
252 |
<th class="exception">Title</th> |
252 |
</div> |
253 |
<th class="exception">Description</th> |
253 |
</div> |
254 |
</tr> |
254 |
|
255 |
</thead> |
255 |
<div class="col-sm-6"> |
256 |
<tbody> |
256 |
<div class="help"> |
257 |
[% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] |
257 |
<h4>Hints</h4> |
258 |
<tr data-date="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]"> |
258 |
<ul> |
259 |
<td data-order="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]"> |
259 |
<li>Search in the calendar the day you want to set as holiday.</li> |
260 |
<a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE | uri %]"> |
260 |
<li>Click the date to add or edit a holiday.</li> |
261 |
[% EXCEPTION_HOLIDAYS_LOO.DATE | html %] |
261 |
<li>Enter a title and description for the holiday.</li> |
262 |
</a> |
262 |
<li>Specify how the holiday should repeat.</li> |
263 |
</td> |
263 |
<li>Click Save to finish.</li> |
264 |
<td>[% EXCEPTION_HOLIDAYS_LOO.TITLE | html %]</td> |
264 |
</ul> |
265 |
<td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | html %]</td> |
265 |
<h4>Key</h4> |
266 |
</tr> |
266 |
<p> |
267 |
[% END %] |
267 |
<span class="key normalday">Working day</span> |
268 |
</tbody> |
268 |
<span class="key holiday">Unique holiday</span> |
269 |
</table> |
269 |
<span class="key repeatableweekly">Holiday repeating weekly</span> |
270 |
[% END %] |
270 |
<span class="key repeatableyearly">Holiday repeating yearly</span> |
271 |
|
271 |
<span class="key exception">Holiday exception</span> |
272 |
[% IF ( WEEK_DAYS_LOOP ) %] |
272 |
</p> |
273 |
<h3>Weekly - Repeatable holidays</h3> |
273 |
</div> |
274 |
<table id="holidayweeklyrepeatable"> |
274 |
|
275 |
<thead> |
275 |
<div id="holiday-list"> |
276 |
<tr> |
276 |
<!-- Exceptions First --> |
277 |
<th class="repeatableweekly">Day of week</th> |
277 |
<!-- this will probably always have the least amount of data --> |
278 |
<th class="repeatableweekly">Title</th> |
278 |
[% IF ( EXCEPTION_HOLIDAYS_LOOP ) %] |
279 |
<th class="repeatableweekly">Description</th> |
279 |
<h3>Exceptions</h3> |
280 |
</tr> |
280 |
<label class="controls"> |
281 |
</thead> |
281 |
<input type="checkbox" name="show_past" id="show_past_holidayexceptions" class="show_past" /> |
282 |
<tbody> |
282 |
Show past entries |
283 |
[% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] |
283 |
</label> |
284 |
<tr> |
284 |
<table id="holidayexceptions"> |
285 |
<td>[% WEEK_DAYS_LOO.KEY | html %]</td> |
285 |
<thead> |
286 |
</td> |
286 |
<tr> |
287 |
<td>[% WEEK_DAYS_LOO.TITLE | html %]</td> |
287 |
<th class="exception">Date</th> |
288 |
<td>[% WEEK_DAYS_LOO.DESCRIPTION | html %]</td> |
288 |
<th class="exception">Title</th> |
289 |
</tr> |
289 |
<th class="exception">Description</th> |
290 |
[% END %] |
290 |
</tr> |
291 |
</tbody> |
291 |
</thead> |
292 |
</table> |
292 |
<tbody> |
293 |
[% END %] |
293 |
[% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] |
294 |
|
294 |
<tr data-date="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]"> |
295 |
[% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %] |
295 |
<td data-order="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]"> |
296 |
<h3>Yearly - Repeatable holidays</h3> |
296 |
<a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE | uri %]"> |
297 |
<table id="holidaysyearlyrepeatable"> |
297 |
[% EXCEPTION_HOLIDAYS_LOO.DATE | html %] |
298 |
<thead> |
298 |
</a> |
299 |
<tr> |
299 |
</td> |
300 |
[% IF ( dateformat == "metric" ) %] |
300 |
<td>[% EXCEPTION_HOLIDAYS_LOO.TITLE | html %]</td> |
301 |
<th class="repeatableyearly">Day/month</th> |
301 |
<td>[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | html %]</td> |
302 |
[% ELSE %] |
302 |
</tr> |
303 |
<th class="repeatableyearly">Month/day</th> |
303 |
[% END %] |
304 |
[% END %] |
304 |
</tbody> |
305 |
<th class="repeatableyearly">Title</th> |
305 |
</table> |
306 |
<th class="repeatableyearly">Description</th> |
306 |
[% END %] |
307 |
</tr> |
307 |
|
308 |
</thead> |
308 |
[% IF ( WEEK_DAYS_LOOP ) %] |
309 |
<tbody> |
309 |
<h3>Weekly - Repeatable holidays</h3> |
310 |
[% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] |
310 |
<table id="holidayweeklyrepeatable"> |
311 |
<tr> |
311 |
<thead> |
312 |
<td data-order="[% DAY_MONTH_HOLIDAYS_LOO.DATE_SORT | html %]"> |
312 |
<tr> |
313 |
[% DAY_MONTH_HOLIDAYS_LOO.DATE | html %] |
313 |
<th class="repeatableweekly">Day of week</th> |
314 |
</td> |
314 |
<th class="repeatableweekly">Title</th> |
315 |
<td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE | html %]</td> |
315 |
<th class="repeatableweekly">Description</th> |
316 |
<td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | html %]</td> |
316 |
</tr> |
317 |
</tr> |
317 |
</thead> |
318 |
[% END %] |
318 |
<tbody> |
319 |
</tbody> |
319 |
[% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] |
320 |
</table> |
320 |
<tr> |
321 |
[% END %] |
321 |
<td>[% WEEK_DAYS_LOO.KEY | html %]</td> |
322 |
|
322 |
<td>[% WEEK_DAYS_LOO.TITLE | html %]</td> |
323 |
[% IF ( HOLIDAYS_LOOP ) %] |
323 |
<td>[% WEEK_DAYS_LOO.DESCRIPTION | html %]</td> |
324 |
<h3>Unique holidays</h3> |
324 |
</tr> |
325 |
<label class="controls"> |
325 |
[% END %] |
326 |
<input type="checkbox" name="show_past" id="show_past_holidaysunique" class="show_past" /> |
326 |
</tbody> |
327 |
Show past entries |
327 |
</table> |
328 |
</label> |
328 |
[% END %] |
329 |
<table id="holidaysunique"> |
329 |
|
330 |
<thead> |
330 |
[% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %] |
331 |
<tr> |
331 |
<h3>Yearly - Repeatable holidays</h3> |
332 |
<th class="holiday">Date</th> |
332 |
<table id="holidaysyearlyrepeatable"> |
333 |
<th class="holiday">Title</th> |
333 |
<thead> |
334 |
<th class="holiday">Description</th> |
334 |
<tr> |
335 |
</tr> |
335 |
[% IF ( dateformat == "metric" ) %] |
336 |
</thead> |
336 |
<th class="repeatableyearly">Day/month</th> |
337 |
<tbody> |
337 |
[% ELSE %] |
338 |
[% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] |
338 |
<th class="repeatableyearly">Month/day</th> |
339 |
<tr data-date="[% HOLIDAYS_LOO.DATE_SORT | html %]"> |
339 |
[% END %] |
340 |
<td data-order="[% HOLIDAYS_LOO.DATE_SORT | html %]"> |
340 |
<th class="repeatableyearly">Title</th> |
341 |
<a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&calendardate=[% HOLIDAYS_LOO.DATE | uri %]"> |
341 |
<th class="repeatableyearly">Description</th> |
342 |
[% HOLIDAYS_LOO.DATE | html %] |
342 |
</tr> |
343 |
</a> |
343 |
</thead> |
344 |
</td> |
344 |
<tbody> |
345 |
<td>[% HOLIDAYS_LOO.TITLE | html %]</td> |
345 |
[% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] |
346 |
<td>[% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '<br />') | html %]</td> |
346 |
<tr> |
347 |
</tr> |
347 |
<td data-order="[% DAY_MONTH_HOLIDAYS_LOO.DATE_SORT | html %]"> |
348 |
[% END %] |
348 |
[% DAY_MONTH_HOLIDAYS_LOO.DATE | html %] |
349 |
</tbody> |
349 |
</td> |
350 |
</table> |
350 |
<td>[% DAY_MONTH_HOLIDAYS_LOO.TITLE | html %]</td> |
351 |
[% END %] |
351 |
<td>[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | html %]</td> |
352 |
</div> |
352 |
</tr> |
353 |
</div> |
353 |
[% END %] |
354 |
</div> |
354 |
</tbody> |
355 |
|
355 |
</table> |
|
|
356 |
[% END %] |
357 |
|
358 |
[% IF ( HOLIDAYS_LOOP ) %] |
359 |
<h3>Unique holidays</h3> |
360 |
<label class="controls"> |
361 |
<input type="checkbox" name="show_past" id="show_past_holidaysunique" class="show_past" /> |
362 |
Show past entries |
363 |
</label> |
364 |
<table id="holidaysunique"> |
365 |
<thead> |
366 |
<tr> |
367 |
<th class="holiday">Date</th> |
368 |
<th class="holiday">Title</th> |
369 |
<th class="holiday">Description</th> |
370 |
</tr> |
371 |
</thead> |
372 |
<tbody> |
373 |
[% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] |
374 |
<tr data-date="[% HOLIDAYS_LOO.DATE_SORT | html %]"> |
375 |
<td data-order="[% HOLIDAYS_LOO.DATE_SORT | html %]"> |
376 |
<a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&calendardate=[% HOLIDAYS_LOO.DATE | uri %]"> |
377 |
[% HOLIDAYS_LOO.DATE | html %] |
378 |
</a> |
379 |
</td> |
380 |
<td>[% HOLIDAYS_LOO.TITLE | html %]</td> |
381 |
<td>[% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '<br />') | html %]</td> |
382 |
</tr> |
383 |
[% END %] |
384 |
</tbody> |
385 |
</table> |
386 |
[% END %] |
387 |
</div> |
388 |
</div> |
389 |
</div> |
356 |
</main> |
390 |
</main> |
357 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
391 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
358 |
|
392 |
|
Lines 378-394
Link Here
|
378 |
var day_month_holidays = new Array(); |
412 |
var day_month_holidays = new Array(); |
379 |
var hola= "[% code | html %]"; |
413 |
var hola= "[% code | html %]"; |
380 |
[% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] |
414 |
[% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] |
381 |
week_days["[% WEEK_DAYS_LOO.KEY | html %]"] = {title:"[% WEEK_DAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
415 |
week_days["[% WEEK_DAYS_LOO.KEY | html %]"] = {title:"[% WEEK_DAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
382 |
[% END %] |
416 |
[% END %] |
383 |
[% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] |
417 |
[% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] |
384 |
holidates.push("[% HOLIDAYS_LOO.KEY | html %]"); |
418 |
holidates.push("[% HOLIDAYS_LOO.KEY | html %]"); |
385 |
holidays["[% HOLIDAYS_LOO.KEY | html %]"] = {title:"[% HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
419 |
holidays["[% HOLIDAYS_LOO.KEY | html %]"] = {title:"[% HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
386 |
[% END %] |
420 |
[% END %] |
387 |
[% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] |
421 |
[% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] |
388 |
exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
422 |
exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
389 |
[% END %] |
423 |
[% END %] |
390 |
[% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] |
424 |
[% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] |
391 |
day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
425 |
day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; |
392 |
[% END %] |
426 |
[% END %] |
393 |
|
427 |
|
394 |
function holidayOperation(formObject, opType) { |
428 |
function holidayOperation(formObject, opType) { |
Lines 499-531
Link Here
|
499 |
var dayName = weekdays[weekDay]; |
533 |
var dayName = weekdays[weekDay]; |
500 |
var dayMonth = month + '/' + day; |
534 |
var dayMonth = month + '/' + day; |
501 |
var dateString = year + '/' + month + '/' + day; |
535 |
var dateString = year + '/' + month + '/' + day; |
502 |
if (holidays[dateString] != null) { |
536 |
if (holidays[dateString] != null) { |
503 |
showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description, 'ymd'); |
537 |
showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description, 'ymd'); |
504 |
} else if (exception_holidays[dateString] != null) { |
538 |
} else if (exception_holidays[dateString] != null) { |
505 |
showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 'exception'); |
539 |
showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 'exception'); |
506 |
} else if (week_days[weekDay] != null) { |
540 |
} else if (week_days[weekDay] != null) { |
507 |
showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description, 'weekday'); |
541 |
showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description, 'weekday'); |
508 |
} else if (day_month_holidays[dayMonth] != null) { |
542 |
} else if (day_month_holidays[dayMonth] != null) { |
509 |
showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 'daymonth'); |
543 |
showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 'daymonth'); |
510 |
} else { |
544 |
} else { |
511 |
newHoliday(dayName, day, month, year, weekDay); |
545 |
newHoliday(dayName, day, month, year, weekDay); |
512 |
} |
546 |
} |
513 |
}; |
547 |
}; |
514 |
|
548 |
|
515 |
/* Custom table search configuration: If a table row |
549 |
/* Custom table search configuration: If a table row |
516 |
has an "expired" class, hide it UNLESS the |
550 |
has an "expired" class, hide it UNLESS the |
517 |
show_expired checkbox is checked */ |
551 |
show_expired checkbox is checked */ |
518 |
$.fn.dataTable.ext.search.push( |
552 |
$.fn.dataTable.ext.search.push( |
519 |
function( settings, searchData, index, rowData, counter ) { |
553 |
function( settings, searchData, index, rowData, counter ) { |
520 |
var table = settings.nTable.id; |
554 |
var table = settings.nTable.id; |
521 |
var row = $(settings.aoData[index].nTr); |
555 |
var row = $(settings.aoData[index].nTr); |
522 |
if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){ |
556 |
if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){ |
523 |
return false; |
557 |
return false; |
524 |
} else { |
558 |
} else { |
525 |
return true; |
559 |
return true; |
526 |
} |
|
|
527 |
} |
560 |
} |
528 |
); |
561 |
} |
|
|
562 |
); |
529 |
|
563 |
|
530 |
// Create current date variable |
564 |
// Create current date variable |
531 |
var date = new Date(); |
565 |
var date = new Date(); |
532 |
- |
|
|