Agenda
Errorea gertatu da txantiloia prozesatzerakoan.
The following has evaluated to null or missing: ==> BuscadorAgendaService.getEvento(calendarBookingIdNumber, instanceIndexNumber, themeDisplay.getLocale(), themeDisplay.getPortalURL()) [in template "20907#20945#32977040" at line 54, column 27] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign evento = BuscadorAgendaServic... [in template "20907#20945#32977040" at line 54, column 9] ----
1<#assign HttpUtil = staticUtil["com.liferay.portal.kernel.util.HttpUtil"] />
2<#assign url = themeDisplay.getURLPortal()+themeDisplay.getURLCurrent()>
3<#assign currentCompleteURL = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
4<#assign groupIdGipuzkoa = 20933 />
5<#assign calendarBookingId = HttpUtil.getParameter(url,"entryId")>
6<#assign instanceIndex = HttpUtil.getParameter(url,"instanceIndex")>
7<#assign parameters = HttpUtil.getParameterMap(url)>
8<#list parameters as key, parameter>
9 <#if key?contains("entryId") && parameter[0]!="">
10 <#assign calendarBookingId = parameter[0]>
11 <#elseif key?contains("instanceIndex") && parameter[0]!="">
12 <#assign instanceIndex = parameter[0]>
13 </#if>
14</#list>
15
16<#assign BuscadorAgendaService = serviceLocator.findService("net.izfe.gipuzkoa.agenda.buscador.api.BuscadorAgendaService") />
17<#assign CalendarBookingLocalService = serviceLocator.findService("com.liferay.calendar.service.CalendarBookingLocalService") />
18
19<#if themeDisplay.getLocale() == "es_ES" >
20 <#assign abrir_mapa ="Abrir mapa en otra ventana">
21 <#assign mas_informacion_es ="Más información sobre el evento ">
22 <#assign mas_informacion_eus ="">
23 <#assign add_calendario ="Añadir a calendario">
24 <#assign add_calendar ="Añadir a Google Calendar">
25<#else>
26 <#assign abrir_mapa ="Ireki mapa beste leiho batean">
27 <#assign mas_informacion_eus =" ekitaldiari buruz">
28 <#assign mas_informacion_es ="Informazio gehiago">
29 <#assign add_calendario ="Egutegira gehitu">
30 <#assign add_calendar ="Google Calendar-era gehitu">
31</#if>
32
33<#assign calendarBookingIdNumber = -1>
34<#attempt>
35 <#if calendarBookingId != "" >
36 <#assign calendarBookingIdNumber = calendarBookingId?number>
37 </#if>
38<#recover>
39 <#assign calendarBookingIdNumber = -1>
40</#attempt>
41
42<#assign instanceIndexNumber = -1>
43<#attempt>
44 <#if instanceIndex != "" >
45 <#assign instanceIndexNumber = instanceIndex?number>
46 </#if>
47<#recover>
48 <#assign instanceIndexNumber = -1>
49</#attempt>
50<#if calendarBookingIdNumber != -1 >
51 <#assign calendarBooking = CalendarBookingLocalService.getCalendarBooking(calendarBookingIdNumber) />
52
53 <#if instanceIndexNumber != -1 >
54 <#assign evento = BuscadorAgendaService.getEvento(calendarBookingIdNumber, instanceIndexNumber, themeDisplay.getLocale(), themeDisplay.getPortalURL()) />
55 <#else>
56 <#assign evento = BuscadorAgendaService.getEvento(calendarBookingId?number, themeDisplay.getLocale(), themeDisplay.getPortalURL()) />
57 </#if>
58 <#assign images_folder = themeDisplay.getPathThemeImages() />
59 <#assign direccion="" />
60 <#if evento.direccion?has_content >
61 <#assign direccion=direccion+evento.direccion />
62 </#if>
63 <#if evento.direccion?has_content && evento.localizacion?has_content>
64 <#assign direccion=direccion+"/" />
65 </#if>
66 <#if evento.localizacion?has_content >
67 <#assign direccion=direccion+evento.localizacion />
68 </#if>
69
70 <@liferay_util["html-top"]>
71 <#if evento.title?has_content >
72 <meta property="og:title" content='${evento.title}'>
73 </#if>
74 <#if evento.imagenPath?has_content >
75 <meta property="og:image" content='${evento.imagenPath}'>
76 </#if>
77 <#if evento.direccion?has_content >
78 <meta property="og:description" content='${evento.direccion}'>
79 </#if>
80 <meta property="og:url" content='${currentCompleteURL}'>
81 </@>
82
83 <div class="container margen-seccion mb-4">
84 <div class="row">
85 <div class="col-12 col-md-8">
86 <h2 class="izfe-semibold mb-4">
87 ${evento.title}
88 </h2>
89
90 <!-- SEPARAR FECHAS Y HORAS-->
91
92 <#assign fechaInicio = evento.getStartDate() />
93 <#assign horaInicio = evento.getStartOnlyTime() />
94
95 <#assign fechaFin = evento.getEndDate() />
96
97 <#assign esIdiomaEuskera = themeDisplay.getLanguageId() == "eu_ES">
98
99 <#function obtenerNombreMes(numeroMes, idioma)>
100 <#assign nombresMesesPorIdioma = {
101 "es_ES": ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"],
102 "en_US": ["jan", "feb", "mar", "apr", "May", "jun", "jul", "aug", "sep", "oct", "nov", "dec"],
103 "eu_ES": ["urt", "ots", "mar", "api", "mai", "eka", "uzt", "abu", "ira", "urr", "aza", "abe"],
104 "fr_FR": ["jan", "fév", "mar", "avr", "mai", "jui", "jui", "aoû", "sep", "oct", "nov", "déc"]
105 }>
106
107 <#assign nombresMeses = nombresMesesPorIdioma[idioma]>
108
109 <#return nombresMeses[numeroMes?number - 1]>
110 </#function>
111
112 <#macro imprimirFecha fecha idioma>
113 <#assign partesFecha = fecha?split("/")>
114
115 <#if esIdiomaEuskera>
116 <#assign dia = partesFecha[2]?trim />
117 <#else>
118 <#assign dia = partesFecha[0]?trim />
119 </#if>
120 <#assign numeroMes = partesFecha[1]?trim />
121 <#assign anio = partesFecha[2]?trim />
122
123 ${obtenerNombreMes(numeroMes, idioma)}. ${dia}<!--${anio}-->
124 </#macro>
125
126 <div class="bg-primary izfe-bg-blue-dark p-2">
127 <#if fechaInicio == fechaFin >
128 <div class="d-flex align-items-center ml-3">
129 <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30">
130 <g id="Grupo_5" data-name="Grupo 5" transform="translate(-953 -515)">
131 <rect id="Rectángulo_1" data-name="Rectángulo 1" width="30" height="30" transform="translate(953 515)" fill="#fff"/>
132 <g id="Grupo_1" data-name="Grupo 1" transform="translate(0 1)">
133 <path id="Trazado_1" data-name="Trazado 1" d="M21.891,21.526H1.547A1.534,1.534,0,0,1,0,20.009V3.971A1.534,1.534,0,0,1,1.547,2.454H5.276V.284a.284.284,0,1,1,.568,0v2.17H17.595V.515a.284.284,0,1,1,.567,0V2.454h3.729a1.533,1.533,0,0,1,1.546,1.517V20.009a1.533,1.533,0,0,1-1.546,1.517M.568,6.846V20.009a.965.965,0,0,0,.979.949H21.891a.966.966,0,0,0,.98-.949V6.846Zm0-.568h22.3V3.971a.966.966,0,0,0-.98-.949H18.162V4.441a.284.284,0,1,1-.567,0V3.022H5.844V4.21a.284.284,0,0,1-.568,0V3.022H1.547a.966.966,0,0,0-.979.949ZM19.427,18H17.848a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567m-4.736,0H13.112a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567M9.955,18H8.376a.284.284,0,0,1,0-.567H9.955a.284.284,0,1,1,0,.567M5.219,18H3.641a.284.284,0,1,1,0-.567H5.219a.284.284,0,1,1,0,.567m14.208-3.7H17.848a.284.284,0,0,1,0-.568h1.579a.284.284,0,0,1,0,.568m-4.736,0H13.112a.284.284,0,0,1,0-.568h1.579a.284.284,0,0,1,0,.568m-4.736,0H8.376a.284.284,0,0,1,0-.568H9.955a.284.284,0,1,1,0,.568m-4.736,0H3.641a.284.284,0,1,1,0-.568H5.219a.284.284,0,1,1,0,.568m14.208-3.7H17.848a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567m-4.736,0H13.112a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567m-4.736,0H8.376a.284.284,0,0,1,0-.567H9.955a.284.284,0,1,1,0,.567m-4.736,0H3.641a.284.284,0,1,1,0-.567H5.219a.284.284,0,1,1,0,.567" transform="translate(956 518)" fill="#161615"/>
134 </g>
135 </g>
136 </svg>
137 <p class="text-white izfe-semibold mb-0 ml-2 izfe-h4">
138 <span>${fechaInicio}</span>
139
140 <#if horaInicio != "00:00" >
141 <span class="ml-3">
142 ${horaInicio}
143 </span>
144 </#if>
145 </p>
146 </div>
147 <#else>
148 <div class="d-flex align-items-center ml-3">
149 <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30">
150 <g id="Grupo_5" data-name="Grupo 5" transform="translate(-953 -515)">
151 <rect id="Rectángulo_1" data-name="Rectángulo 1" width="30" height="30" transform="translate(953 515)" fill="#fff"/>
152 <g id="Grupo_1" data-name="Grupo 1" transform="translate(0 1)">
153 <path id="Trazado_1" data-name="Trazado 1" d="M21.891,21.526H1.547A1.534,1.534,0,0,1,0,20.009V3.971A1.534,1.534,0,0,1,1.547,2.454H5.276V.284a.284.284,0,1,1,.568,0v2.17H17.595V.515a.284.284,0,1,1,.567,0V2.454h3.729a1.533,1.533,0,0,1,1.546,1.517V20.009a1.533,1.533,0,0,1-1.546,1.517M.568,6.846V20.009a.965.965,0,0,0,.979.949H21.891a.966.966,0,0,0,.98-.949V6.846Zm0-.568h22.3V3.971a.966.966,0,0,0-.98-.949H18.162V4.441a.284.284,0,1,1-.567,0V3.022H5.844V4.21a.284.284,0,0,1-.568,0V3.022H1.547a.966.966,0,0,0-.979.949ZM19.427,18H17.848a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567m-4.736,0H13.112a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567M9.955,18H8.376a.284.284,0,0,1,0-.567H9.955a.284.284,0,1,1,0,.567M5.219,18H3.641a.284.284,0,1,1,0-.567H5.219a.284.284,0,1,1,0,.567m14.208-3.7H17.848a.284.284,0,0,1,0-.568h1.579a.284.284,0,0,1,0,.568m-4.736,0H13.112a.284.284,0,0,1,0-.568h1.579a.284.284,0,0,1,0,.568m-4.736,0H8.376a.284.284,0,0,1,0-.568H9.955a.284.284,0,1,1,0,.568m-4.736,0H3.641a.284.284,0,1,1,0-.568H5.219a.284.284,0,1,1,0,.568m14.208-3.7H17.848a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567m-4.736,0H13.112a.284.284,0,0,1,0-.567h1.579a.284.284,0,0,1,0,.567m-4.736,0H8.376a.284.284,0,0,1,0-.567H9.955a.284.284,0,1,1,0,.567m-4.736,0H3.641a.284.284,0,1,1,0-.567H5.219a.284.284,0,1,1,0,.567" transform="translate(956 518)" fill="#161615"/>
154 </g>
155 </g>
156 </svg>
157 <p class="text-white izfe-semibold mb-0 ml-2 izfe-h4">
158 <!--${fechaInicio}-->
159 <@imprimirFecha fecha=fechaInicio idioma=themeDisplay.getLanguageId() />
160 </p>
161 <span class="text-white izfe-semibold ml-2 mr-2">-</span>
162 <p class="text-white izfe-semibold mb-0 izfe-h4">
163 <!--${fechaFin}-->
164 <@imprimirFecha fecha=fechaFin idioma=themeDisplay.getLanguageId() />
165 </p>
166 </div>
167 </#if>
168 </div>
169
170 <#if evento.localizacion?has_content || evento.direccion?has_content>
171 <div class="izfe-evento-localizacion-direccion d-flex align-items-center pl-3 pr-3 pt-2 pb-2">
172 <div class="d-flex flex-column flex-lg-row align-items-lg-center">
173 <#if evento.urlDireccion != "">
174 <a class="ml-2 d-flex align-items-center" href="${evento.urlDireccion}" target="_blank">
175 <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30">
176 <g id="Grupo_6" data-name="Grupo 6" transform="translate(-953 -560)">
177 <g id="Grupo_4" data-name="Grupo 4">
178 <rect id="Rectángulo_2" data-name="Rectángulo 2" width="30" height="30" transform="translate(953 560)" fill="#fff"/>
179 <g id="Grupo_2" data-name="Grupo 2" transform="translate(0 15)">
180 <path id="Trazado_2" data-name="Trazado 2" d="M11.719,53.668a.284.284,0,0,1-.235-.124c-.3-.446-7.41-10.978-7.41-14.971a7.552,7.552,0,0,1,7.645-7.437,7.551,7.551,0,0,1,7.645,7.437c0,3.993-7.108,14.525-7.41,14.971a.284.284,0,0,1-.235.124m0-21.966a6.985,6.985,0,0,0-7.077,6.871c0,3.426,5.825,12.41,7.077,14.3C12.971,50.983,18.8,42,18.8,38.573A6.986,6.986,0,0,0,11.719,31.7m0,10.488a3.855,3.855,0,1,1,3.958-3.855,3.911,3.911,0,0,1-3.958,3.855m0-7.142a3.289,3.289,0,1,0,3.392,3.287,3.344,3.344,0,0,0-3.392-3.287" transform="translate(956 518)" fill="#161615"/>
181 </g>
182 </g>
183 </g>
184 </svg>
185 <p class="izfe-semibold mb-0 ml-2 izfe-h5">
186 <#if evento.direccion?has_content >
187 ${evento.direccion}
188 </#if>
189 <#if evento.direccion?has_content && evento.localizacion?has_content>
190 <span class="ml-1 mr-1">/</span>
191 </#if>
192 <#if evento.localizacion?has_content >
193 ${evento.localizacion}
194 </#if>
195 </p>
196 </a>
197 <#else>
198 <div class="ml-2 d-flex align-items-center">
199 <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30">
200 <g id="Grupo_6" data-name="Grupo 6" transform="translate(-953 -560)">
201 <g id="Grupo_4" data-name="Grupo 4">
202 <rect id="Rectángulo_2" data-name="Rectángulo 2" width="30" height="30" transform="translate(953 560)" fill="#fff"/>
203 <g id="Grupo_2" data-name="Grupo 2" transform="translate(0 15)">
204 <path id="Trazado_2" data-name="Trazado 2" d="M11.719,53.668a.284.284,0,0,1-.235-.124c-.3-.446-7.41-10.978-7.41-14.971a7.552,7.552,0,0,1,7.645-7.437,7.551,7.551,0,0,1,7.645,7.437c0,3.993-7.108,14.525-7.41,14.971a.284.284,0,0,1-.235.124m0-21.966a6.985,6.985,0,0,0-7.077,6.871c0,3.426,5.825,12.41,7.077,14.3C12.971,50.983,18.8,42,18.8,38.573A6.986,6.986,0,0,0,11.719,31.7m0,10.488a3.855,3.855,0,1,1,3.958-3.855,3.911,3.911,0,0,1-3.958,3.855m0-7.142a3.289,3.289,0,1,0,3.392,3.287,3.344,3.344,0,0,0-3.392-3.287" transform="translate(956 518)" fill="#161615"/>
205 </g>
206 </g>
207 </g>
208 </svg>
209 <p class="izfe-semibold mb-0 ml-2 izfe-h5">
210 <#if evento.direccion?has_content >
211 ${evento.direccion}</p>
212 </#if>
213 <#if evento.direccion?has_content && evento.localizacion?has_content>
214 <span class="ml-1 mr-1">/</span>
215 </#if>
216 <#if evento.localizacion?has_content >
217 ${evento.localizacion}
218 </#if>
219 </p>
220 </div>
221 </#if>
222 </div>
223 </div>
224 </#if>
225
226 <div class="row mt-4">
227 <div class="col-12" id="izfe-evento-descripcion">
228 <#if evento.descripcion != "">
229 ${evento.descripcion}
230 <#-- ${HtmlUtil.render(evento.descripcion)} -->
231 </#if>
232
233 <#assign startDateArr=evento.getStartDate()?split("/") />
234 <#assign endDateArr=evento.getEndDate()?split("/") />
235 <#assign startTime=evento.getStartOnlyTime()?replace(":","")+"00" />
236 <#assign endTime=evento.getEndOnlyTime()?replace(":","")+"00" />
237
238 <#assign startTimeStamp=startDateArr[2]+startDateArr[1]+startDateArr[0]+"T"+startTime+"" />
239 <#assign endTimeStamp=endDateArr[2]+endDateArr[1]+endDateArr[0]+"T"+endTime+"" />
240
241
242 </div>
243
244 </div>
245 </div>
246
247 <div class="col-12 col-md-4">
248 <#attempt>
249 <#if evento.imagenPath != "" >
250 <img
251 alt="${evento.title?replace('"',' ')}"
252 title="${evento.title?replace('"',' ')}"
253 class="w-100 mb-3"
254 src="${evento.imagenPath}"
255 />
256 <#else>
257 <img
258 alt="img-not-found"
259 title="img-not-found"
260 class="w-100"
261 src="${images_folder}/izfe/img-not-found.png"
262 />
263 </#if>
264 <#recover>
265
266 </#attempt>
267
268
269 <#assign listaCategorias = evento.listaCategorias />
270
271
272
273
274
275 <div class="calendar-btns">
276 <#if evento.webEvento != "" >
277 <a class="boton-evento boton-mas-info" href="${evento.webEvento}" target="_blank">
278 <@liferay.language key="DGN.mas-informacion-evento" />
279 </a>
280 </#if>
281 <button id="add-calendar" class="boton-evento boton-evento-calendar ">${add_calendario}</button>
282 <a class="boton-evento boton-evento-google" href="https://calendar.google.com/calendar/render?action=TEMPLATE&text=${evento.title?replace("\n", "")?replace("\t", "")?replace('<[^>]+>','','r')?trim?replace('\"',"'")}&dates=${startTimeStamp}/${endTimeStamp}&details=${evento.descripcion?replace("\n", "")?replace("\t", "")?replace('<[^>]+>','','r')?trim}&recur=&location=${direccion}&trp=false">${add_calendar}</a>
283 </div>
284
285
286 </div>
287 </div>
288
289
290
291 <div class="row mt-4 mb-4" id="izfe-evento-relacionados">
292 <#assign categoriasEventoActual = evento.listaCategorias />
293 <#assign categoriasIds = [] />
294
295 <#if categoriasEventoActual?has_content >
296 <#list categoriasEventoActual as categoriaEventoActual >
297 <#assign categoriasIds = categoriasIds + [categoriaEventoActual.categoryId] />
298 </#list>
299 </#if>
300
301
302 <#assign eventosRelacionados = BuscadorAgendaService.listaProximosEventos(themeDisplay.getCompanyId(), themeDisplay.getLocale(), themeDisplay.getPortalURL(), categoriasIds,
303 3, [groupIdGipuzkoa]) />
304
305 <#if eventosRelacionados?has_content>
306 <#assign mostrarTituloRelacionados = true>
307 <#assign contadorRelacionados = 0 >
308
309 <#list eventosRelacionados as eventoRelacionado>
310 <#if eventoRelacionado.calendarBookingId != evento.calendarBookingId >
311 <#if mostrarTituloRelacionados >
312 <div class="col-12">
313 <h3 class="izfe-semibold mb-3">
314 <@liferay.language key="DGN.otros-eventos"/>
315 </h3>
316 </div>
317 </#if>
318
319 <#if contadorRelacionados < 3 >
320 <div class=" izfe-agenda-relacionado col-12 col-lg-4 mb-3 mb-lg-0">
321 <#assign urlRelacionado="/actualidad/agenda/evento?entryId="+eventoRelacionado.calendarBookingId />
322
323 <#if eventoRelacionado.isRecurring() >
324
325 <#assign urlRelacionado=urlRelacionado+"&instanceIndex=" + eventoRelacionado.getInstanceIndex() />
326
327 </#if>
328
329 <a href="${urlRelacionado}">
330 <div class="bg-primary izfe-bg-blue-dark-second p-2 eventoRelacionado">
331 <p class="small text-white">${eventoRelacionado.startTime}</p>
332 <h3 class="text-white izfe-h4">${eventoRelacionado.title}</h3>
333 <p class="small text-white">${eventoRelacionado.localizacion}</p>
334 </div>
335 </a>
336 </div>
337 </#if>
338 <#assign contadorRelacionados++ />
339 <#assign mostrarTituloRelacionados = false />
340 </#if>
341 </#list>
342 </#if>
343 </div>
344 </div>
345
346
347 <style>
348 #izfe-evento-descripcion *{
349 font-family: 'Poppins', Helvetica, Arial, sans-serif !important;
350 font-size: 15px !important;
351 line-height: 20px;
352 }
353 #izfe-evento-relacionados a{
354 text-decoration: none !important;
355 }
356 #izfe-evento-relacionados a:hover *{
357 opacity: .7;
358 }
359
360 #izfe-evento-relacionados .eventoRelacionado {
361 min-height: 200px;
362 }
363 .izfe-evento-localizacion-direccion{
364 border: 1.5px solid #007bff;
365 }
366
367 .izfe-float-left{
368 float: left;
369 }
370 .izfe-float-right{
371 float: left;
372 }
373
374 .izfe-btn-blue {
375 font-size: 19px;
376 padding: .5em 2em;
377 border-radius: 50px;
378 background: #fff;
379 border: 4px solid #007bff;
380 font-weight: bold;
381 color: #007bff;
382 }
383 .izfe-btn-blue:hover {
384 opacity: .5;
385 text-decoration: none;
386 }
387 .izfe-btn-blue:focus {
388 background-color: #fff;
389 box-shadow: none;
390 outline: -webkit-focus-ring-color auto 1px !important;
391 }
392 </style>
393
394<style>
395
396
397 /*.calendar-btns {
398 display: flex;
399 flex-direction: column;
400 align-items: flex-start;
401 gap: 1rem;
402 margin-top: 1.5rem;
403 }
404
405 .calendar-btns > * {
406 background-color: transparent;
407 border: 3px solid #004996;
408 padding: 0.5rem 1rem;
409 border-radius: 100px;
410 color: #004996 !important;
411 font-weight: bold;
412 transition: all ease 0.25s;
413 }
414
415 .calendar-btns > *:hover {
416 background-color: #004996;
417 color: #fff !important;
418 text-decoration: none;
419 border: 3px solid #004996;
420 }
421
422 .calendar-btns > a {
423 border: 3px solid #004996;
424 }*/
425
426
427
428 </style>
429<script type="text/javascript">
430var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}
431
432var ics=function(e,t){"use strict";{if(!(navigator.userAgent.indexOf("MSIE")>-1&&-1==navigator.userAgent.indexOf("MSIE 10"))){void 0===e&&(e="default"),void 0===t&&(t="Calendar");var r=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",n=[],i=["BEGIN:VCALENDAR","PRODID:"+t,"VERSION:2.0"].join(r),o=r+"END:VCALENDAR",a=["SU","MO","TU","WE","TH","FR","SA"];return{events:function(){return n},calendar:function(){return i+r+n.join(r)+o},addEvent:function(t,i,o,l,u,s){if(void 0===t||void 0===i||void 0===o||void 0===l||void 0===u)return!1;if(s&&!s.rrule){if("YEARLY"!==s.freq&&"MONTHLY"!==s.freq&&"WEEKLY"!==s.freq&&"DAILY"!==s.freq)throw"Recurrence rrule frequency must be provided and be one of the following: 'YEARLY', 'MONTHLY', 'WEEKLY', or 'DAILY'";if(s.until&&isNaN(Date.parse(s.until)))throw"Recurrence rrule 'until' must be a valid date string";if(s.interval&&isNaN(parseInt(s.interval)))throw"Recurrence rrule 'interval' must be an integer";if(s.count&&isNaN(parseInt(s.count)))throw"Recurrence rrule 'count' must be an integer";if(void 0!==s.byday){if("[object Array]"!==Object.prototype.toString.call(s.byday))throw"Recurrence rrule 'byday' must be an array";if(s.byday.length>7)throw"Recurrence rrule 'byday' array must not be longer than the 7 days in a week";s.byday=s.byday.filter(function(e,t){return s.byday.indexOf(e)==t});for(var c in s.byday)if(a.indexOf(s.byday[c])<0)throw"Recurrence rrule 'byday' values must include only the following: 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'"}}var g=new Date(l),d=new Date(u),f=new Date,S=("0000"+g.getFullYear().toString()).slice(-4),E=("00"+(g.getMonth()+1).toString()).slice(-2),v=("00"+g.getDate().toString()).slice(-2),y=("00"+g.getHours().toString()).slice(-2),A=("00"+g.getMinutes().toString()).slice(-2),T=("00"+g.getSeconds().toString()).slice(-2),b=("0000"+d.getFullYear().toString()).slice(-4),D=("00"+(d.getMonth()+1).toString()).slice(-2),N=("00"+d.getDate().toString()).slice(-2),h=("00"+d.getHours().toString()).slice(-2),I=("00"+d.getMinutes().toString()).slice(-2),R=("00"+d.getMinutes().toString()).slice(-2),M=("0000"+f.getFullYear().toString()).slice(-4),w=("00"+(f.getMonth()+1).toString()).slice(-2),L=("00"+f.getDate().toString()).slice(-2),O=("00"+f.getHours().toString()).slice(-2),p=("00"+f.getMinutes().toString()).slice(-2),Y=("00"+f.getMinutes().toString()).slice(-2),U="",V="";y+A+T+h+I+R!=0&&(U="T"+y+A+T,V="T"+h+I+R);var B,C=S+E+v+U,j=b+D+N+V,m=M+w+L+("T"+O+p+Y);if(s)if(s.rrule)B=s.rrule;else{if(B="rrule:FREQ="+s.freq,s.until){var x=new Date(Date.parse(s.until)).toISOString();B+=";UNTIL="+x.substring(0,x.length-13).replace(/[-]/g,"")+"000000Z"}s.interval&&(B+=";INTERVAL="+s.interval),s.count&&(B+=";COUNT="+s.count),s.byday&&s.byday.length>0&&(B+=";BYDAY="+s.byday.join(","))}(new Date).toISOString();var H=["BEGIN:VEVENT","UID:"+n.length+"@"+e,"CLASS:PUBLIC","DESCRIPTION:"+i,"DTSTAMP;VALUE=DATE-TIME:"+m,"DTSTART;VALUE=DATE-TIME:"+C,"DTEND;VALUE=DATE-TIME:"+j,"LOCATION:"+o,"SUMMARY;LANGUAGE=en-us:"+t,"TRANSP:TRANSPARENT","END:VEVENT"];return B&&H.splice(4,0,B),H=H.join(r),n.push(H),H},download:function(e,t){if(n.length<1)return!1;t=void 0!==t?t:".ics",e=void 0!==e?e:"calendar";var a,l=i+r+n.join(r)+o;if(-1===navigator.userAgent.indexOf("MSIE 10"))a=new Blob([l]);else{var u=new BlobBuilder;u.append(l),a=u.getBlob("text/x-vCalendar;charset="+document.characterSet)}return saveAs(a,e+t),l},build:function(){return!(n.length<1)&&i+r+n.join(r)+o}}}console.log("Unsupported Browser")}};
433</script>
434
435 <script type="text/javascript">
436 cal_event = ics();
437 var descripcion=`${evento.descripcion?replace("\n", "")?replace("\t", "")?replace('<[^>]+>','','r')?trim}`;
438 <#assign startDateArr=evento.getStartDate()?split("/") />
439 <#assign endDateArr=evento.getEndDate()?split("/") />
440 var startDate="${startDateArr[1]}/${startDateArr[0]}/${startDateArr[2]}";
441 var endDate="${endDateArr[1]}/${endDateArr[0]}/${endDateArr[2]}";
442 <#assign direccion="" />
443 <#if evento.direccion?has_content >
444 <#assign direccion=direccion+evento.direccion />
445 </#if>
446 <#if evento.direccion?has_content && evento.localizacion?has_content>
447 <#assign direccion=direccion+"/" />
448 </#if>
449 <#if evento.localizacion?has_content >
450 <#assign direccion=direccion+evento.localizacion />
451 </#if>
452
453 cal_event.addEvent(
454 '${evento.title?replace('<[^>]+>','','r')?replace('\'','"')}',
455 descripcion,
456 '${direccion}',
457 startDate+' ${evento.getStartOnlyTime()}',
458 endDate+' ${evento.getEndOnlyTime()}');
459
460 document.getElementById("add-calendar").addEventListener("click", function() {
461 cal_event.download('${evento.title?replace('<[^>]+>','','r')?replace('\'','"')}');
462 });
463
464</script>
465</#if>