Se ha producido un error al procesar la plantilla.
Expression layout.getExpandoBridge().getAttribute("max-height") is undefined on line 8, column 33 in 10154#10194#72205.
1<!--[if lte IE 9]>
2<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.0/jquery.xdomainrequest.min.js'></script>
3<![endif]-->
4<#assign liferayUi = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"]/>
5<#assign smart = taglibLiferayHash["/WEB-INF/tld/smart.tld"]/>
6<#assign liferay_util = taglibLiferayHash["/WEB-INF/tld/liferay-util.tld"] />
7<#assign LayoutLocalService = serviceLocator.findService("com.liferay.portal.service.LayoutLocalService") />
8<#assign maxHeight = "maxh_" + layout.getExpandoBridge().getAttribute("max-height")>
9<#assign minHeight = "minh_" + layout.getExpandoBridge().getAttribute("min-height")>
10<#assign bkgColor = layout.getExpandoBridge().getAttribute("bkg-color")>
11<#assign bkgImg = layout.getExpandoBridge().getAttribute("bkg-img")>
12
13<#assign originalRequest = portalUtil.getOriginalServletRequest(portalUtil.getHttpServletRequest(renderRequest))>
14<#assign originalRequest = portalUtil.getOriginalServletRequest(portalUtil.getHttpServletRequest(renderRequest))>
15<#assign mostrarResultado = (originalRequest.getAttribute("mostrarResultado")?string)!"false" >
16<#assign selector = (originalRequest.getAttribute("selectorCategorias")?string)!"" >
17<#assign selectorLocalidades = (originalRequest.getAttribute("selectorLocalidades")?string)!"" >
18<#assign urlBuscador = propsUtil.get("recursos.turisticos.buscador")>
19<#assign urlMunicipios = propsUtil.get("recursos.turisticos.municipios")>
20<#assign urlRecursosvb = propsUtil.get("recursos.turisticos.recursosvb")>
21<#assign urlRecursosPrecios = propsUtil.get("recursos.turisticos.recursos.precios")>
22<#assign resultadosPagina=10>
23<#assign paramContent = (originalRequest.getParameter("categoria")?string)!"">
24<#assign paramContentPadre = (originalRequest.getParameter("categoriaPadre")?number)!"">
25<#assign paramCoordenadaX = (originalRequest.getParameter("coordenadaX")?number)!"">
26<#assign paramCoordenadaY = (originalRequest.getParameter("coordenadaY")?number)!"">
27<#assign fechaInicioKey = "fechaInicio">
28<#assign fechaFinKey = "fechaFin">
29<#assign paramFechaInicio = (originalRequest.getParameter(fechaInicioKey))!"">
30<#assign paramFechaFin = (originalRequest.getParameter(fechaFinKey))!"">
31<#assign fechaInicioUrlParam = "">
32<#assign fechaFinUrlParam = "">
33<#if paramFechaInicio != "">
34 <#assign fechaInicioUrlParam = "&" + fechaInicioKey + "=" + paramFechaInicio>
35</#if>
36<#if paramFechaFin != "">
37 <#assign fechaFinUrlParam = "&" + fechaFinKey + "=" + paramFechaFin>
38</#if>
39<#assign contador=0>
40
41
42<#--FRIENDLY URLS-->
43<#assign layoutInicio = LayoutLocalService.getFriendlyURLLayout(layout.getGroup().getGroupId(), layout.isPrivateLayout(), "/inicio")>
44<#assign layoutEscapate = LayoutLocalService.getFriendlyURLLayout(layout.getGroup().getGroupId(), layout.isPrivateLayout(), "/escapate")>
45<#assign layoutReserva = LayoutLocalService.getFriendlyURLLayout(layout.getGroup().getGroupId(), layout.isPrivateLayout(), "/reserva")>
46<#assign layoutRealizaReserva = LayoutLocalService.getFriendlyURLLayout(layout.getGroup().getGroupId(), layout.isPrivateLayout(), "/realiza-reserva")>
47
48<#assign urlInicio = layoutInicio.getRegularURL(request)>
49<#assign urlEscapate = layoutEscapate.getFriendlyURL(locale)>
50<#assign urlReserva = layoutReserva.getFriendlyURL(locale)>
51<#assign urlRealizaReserva = layoutRealizaReserva.getRegularURL(request)>
52
53<#assign urlCompleta = urlRealizaReserva>
54
55<@liferay_util["buffer"] var="listadosLib">
56 <@liferay_util["include"]
57 page="/html/listados.jsp"
58 strict=true
59 useCustomPage=false
60 />
61</@>
62<div class="panel listado recursosReserva clearfix ${maxHeight} ${minHeight}"
63 style="background-color: ${bkgColor}; background-image: url(${bkgImg}); background-position: bottom center; background-size: 100% auto;">
64 <#-- Anadir Tags SEO -->
65 <#assign srcFlood="http://4815714.fls.doubleclick.net/activityi;src=4815714;type=riasb0;cat=08-re0;ord="/>
66 <script type="text/javascript">
67 // Floodlight
68 var axel = Math.random() + "";
69 var a = axel * 10000000000000;
70 if (jQuery){
71 if (jQuery("body #floodLight").size() > 0) {
72 jQuery("#floodLight").remove();
73 }
74 jQuery("body").prepend('<iframe id="floodLight" src="${srcFlood}' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
75 }
76 </script>
77 <noscript>
78 <iframe id="floodLight" src="${srcFlood}1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
79 </noscript>
80 <#-- Fin tags SEO -->
81 <div class="container navBarTopPadding " id="reservasPanelContainer">
82 <div class="row-fluid">
83 <div class="span12 title">
84 <h2>
85 ${layout.getTitle(locale)}
86 </h2>
87 </div>
88 </div>
89
90 <#--
91 <div class="row-fluid row-gutter-small row-gutter-bottom">
92 <div class="span12 ">
93 <div class="text-bkg text-container text">
94 <@liferayUi["message"] key="portalweb.templates.listadoRecursos.recursosTuristicos.entradilla" />
95 </div>
96 </div>
97 </div>
98 -->
99
100 <div class="row-fluid">
101 <div class="accordion accordion-depo" id="accordionRecursos">
102 <div class="accordion-group ">
103 <div class="accordion-heading text-bkg-result">
104 <a class="accordion-toggle dont-intercept" data-toggle="collapse" data-parent="#accordionRecursos" href="#collapseFormRecursos">
105 <span class="link-show"><i class="link-icon icon-chevron-down"></i><@liferayUi["message"] key="portalweb.templates.listados.mostrarFiltros" /></span>
106 <span class="link-hide"><i class="link-icon icon-chevron-up"></i><@liferayUi["message"] key="portalweb.templates.listados.ocultarFiltros" /></span>
107 </a>
108 </div>
109 <div class="accordion-body in collapse" id="collapseFormRecursos">
110 <div class="span12 span12 text-bkg clearfix">
111 <form id="filtroMapaRecursosReserva" name="filtroListadoRecursos" action="" method="post" class="event-filters filtroExperiencias buscar">
112 <input type="hidden" value="true" id="mostrarResultado" name="mostrarResultado" >
113 <div class="row-fluid">
114 <div class="span4 form-item-group input-type-of">
115 <label for="txtBusca"><@liferayUi["message"] key="portalweb.templates.listadoRecursos.nombre" /></label>
116 <input type="text" placeholder="<@liferayUi["message"] key="portalweb.templates.listadoRecursos.plantillaBuscador" />" name="txtBusca" id="txtBusca">
117 </div>
118 <div class="span4 form-item-group input-type-of">
119 <label for="municipio"><@liferayUi["message"] key="portalweb.templates.listadoRecursos.localidad" /></label>
120 <select class=" sExp populate select2-offscreen" id="municipio" name="municipio" multiple="" tabindex="-1">
121 </select>
122 </div>
123 <div class="span4 form-item-group input-type-of">
124 <label for="categoria"><@liferayUi["message"] key="portalweb.templates.listadoRecursos.categoria" /></label>
125 <input class="sExp populate select2-offscreen" id="categoria" name="categoria" tabindex="-1">
126 </input>
127 </div>
128 </div>
129
130 <div class="row-fluid row-gutter-extra-small">
131 <div class="span2 form-item-group input-type-of">
132 <label for="fechaInicio"><@liferayUi["message"] key="start-date" /></label>
133 <input class="" id="fechaInicio" name="fechaInicio" tabindex="-1" value="${paramFechaInicio}">
134 </input>
135 </div>
136 <div class="span2 form-item-group input-type-of">
137 <label for="fechaFin"><@liferayUi["message"] key="end-date" /></label>
138 <input class="" id="fechaFin" name="fechaFin" tabindex="-1" value="${paramFechaFin}">
139 </input>
140 </div>
141 <div class="span4 form-item-group select-order">
142 <label for="ordenar"><@liferayUi["message"] key="portalweb.templates.listadoEventos.ordenar" /></label>
143 <select class="sExp populate select2-offscreen" id="ordenarRecurso" name="ordenarRecurso" >
144 <option value="2"><@liferayUi["message"] key="price" /></option>
145 <#if paramCoordenadaX?has_content >
146 <option value="cercano_ASC"><@liferayUi["message"] key="portalweb.templates.mapa.masCercano" /></option>
147 </#if>
148 <option value="1"><@liferayUi["message"] key="portalweb.templates.listadoEventos.titulo" /></option>
149 <option value="3"><@liferayUi["message"] key="portalweb.templates.mapa.masValorado" /></option>
150 </select>
151 </div>
152 </div>
153
154 <div class="row-fluid row-gutter-extra-large">
155 <div class="span4 offset8 form-item-group accions actions-container clearfix">
156 <input type="submit" value="Buscar" class="buscar btn btn-primary pull-right" name="buscar" >
157 <a href="#" class="restablecer pull-right dont-intercept"><@liferayUi["message"] key="portalweb.templates.listadoRecursos.restablecer" /></a>
158 </div>
159 </div>
160
161 </form>
162 </div>
163 </div>
164 </div>
165 </div>
166 </div>
167
168 <#if "true" == mostrarResultado>
169 <div id="resultado" >
170 </#if>
171 <#if "true" != mostrarResultado>
172 <div id="resultado" class="hidden">
173 </#if>
174
175 <div class="row-fluid row-gutter">
176 <div class="span12 vistas clearfix">
177 <div class="row-fluid">
178 <div class="span5" id="result-header">
179
180 </div>
181 <div class="span6" id="listaVistas">
182 <a class="cambioVista dont-intercept" href="#" data-rel="vista-mapa">
183 <i class="icon-map-marker"></i>
184 <span ><@liferayUi["message"] key="portalweb.templates.listadoRecursos.mapa" /></span>
185 </a>
186 <a class="cambioVista selected dont-intercept" href="#" data-rel="vista-listado">
187 <i class="icon-list"></i>
188 <span ><@liferayUi["message"] key="portalweb.templates.listadoRecursos.listado" /></span>
189 </a>
190 </div>
191 </div>
192 </div>
193 </div>
194
195 <div id="topPaginator" class="row-fluid row-gutter-bottom">
196 <div class="span12">
197 <div class=" vistas pag clearfix fake">
198
199 </div>
200 </div>
201 </div>
202
203 <div class="row-fluid clearfix" id="vista-listado">
204 <div class="row-fluid">
205 <div class="span12 clearfix">
206 <div id="result-listado">
207 <div class="row-fluid row-gutter row-gutter-bottom-large">
208 <div class="span12">
209 <div class="text-bkg text-container text ">
210 <span class="offset1">
211 <@liferayUi["message"] key="portalweb.templates.listados.buscandoRecursos" />
212 </span>
213 </div>
214 </div>
215 </div>
216 </div>
217 </div>
218 </div>
219 <div id ="bottomPaginator" class="row-fluid">
220 <div class="span12">
221 <div class=" vistas pag clearfix real">
222
223 </div>
224 </div>
225 </div>
226 </div>
227
228 <div class="row-fluid row-gutter-bottom hidden" id="vista-mapa">
229 <div class="span12 height-extra-large" id="listadoRecursosMapWrapper">
230 <@smart["mapanavegable"]
231 mapaElement="mapaLocBusqRec"
232 containerId="#listadoRecursosMapWrapper"
233 dimensionsFromContainer="true"
234 resizeWithContainer="true"
235 filtro="false"
236 />
237 </div>
238 </div>
239 </div>
240 </div>
241
242<#-- Se importan las librerias de funcionalidades comunes a los listados -->
243${listadosLib}
244
245<script type="text/x-tmpl" id="tmpl-cabecera-reserva">
246 {% if (o.marcadores.length > 0) { %}
247 <p class="numRes"><span class="mostramos-total"><@liferayUi["message"] key="portalweb.templates.listadoRecursos.mostramosTotal" /> </span> <span class="num-res"> {%=o.paginacion.resultadosTotales%} </span> <@liferayUi["message"] key="portalweb.templates.listadoRecursos.recursosEncontrados" /></p>
248 {% } else { %}
249 <p class="mostramos-ninguno" ><@liferayUi["message"] key="portalweb.templates.listadoRecursos.sinResultados" /></p>
250 {% } %}
251</script>
252
253<script type="text/x-tmpl" id="tmpl-listado-reserva">
254
255 <div class="listadoRecursosResp">
256
257 {%var it = 0;%}
258
259 {% for (var i=0; i<o.marcadores.length; i++) {
260 if((it >= ((o.paginacion.pagina-1)*o.paginacion.resultadosPagina)) && (it < (o.paginacion.pagina*o.paginacion.resultadosPagina))){
261 %}
262 <div class="row-fluid row-gutter-bottom">
263 <div class="span12 text-bkg">
264 <div id="it_{%=o.paginacion.resultadosPagina-1*o.paginacion.resultadosPagina +it%}" class="itemR clearfix">
265 <div class="row-fluid">
266 <div class="span9">
267 <div class="text-container">
268 <div class="row-fluid">
269 <div class="span12">
270 <div class="tit">
271 <#--/web/portal-web/inicio#!/escapate/reserva/realiza-reserva-->
272 <a href="${urlCompleta}?reservaId={%= o.marcadores[i].pt.id + '&fechaInicio=' + encodeURIComponent(fechaInicio) + '&fechaFin=' + encodeURIComponent(fechaFin) %}" class="enlazaDetalleReserva" title="Ver detalle">
273 {%=o.marcadores[i].pt.nombre%}
274 </a>
275 </div>
276 </div>
277 </div>
278 <div class="row-fluid">
279 <div class="span12">
280 <div class="info clearfix">
281 <div class="row-fluid">
282 <div class="span3">
283 {% if (o.marcadores[i].pt.imagen == "") { %}
284 <div style="background-image: url('${originalRequest.getContextPath()}/imaxes/imagenPrueba.png')" class="img">
285
286 {% } else { %}
287 {% if ((o.marcadores[i].pt.imagen).indexOf("/imaxes") == 0) { %}
288 <div style="background-image: url('{%= o.marcadores[i].pt.imagen%}')" class="img">
289 {% } else { %}
290 <div style="background-image: url('/imaxes/{%= o.marcadores[i].pt.imagen%}')" class="img">
291 {% } %}
292 {% } %}
293 </div>
294 </div>
295 <div class="span9">
296 <div class="row-fluid">
297 <div class="campos"">
298 <span class="cat">
299 {% if(o.marcadores[i].catPai == "" || o.marcadores[i].catPai == null){ %}
300
301 {%=o.marcadores[i].cat%}
302
303 {% }else{ %}
304
305 {%= $("#categoria option[value='padre_" + o.marcadores[i].catPai + "']").text() %}
306
307 {% } %}
308
309 > {%=o.marcadores[i].pt.nombreSubtipo%}
310
311 {% if(o.marcadores[i].pt.categoria) { %}
312 > {%=o.marcadores[i].pt.categoria %}
313 {% } %}
314
315 </span>
316
317 <span class="localidad">{%=o.marcadores[i].pt.localidad%}</span>
318
319 {% if (o.marcadores[i].pt.descripcion && ("" != o.marcadores[i].pt.descripcion)) { %}
320 <div class="row-fluid">
321 {%=o.marcadores[i].pt.descripcion %}
322 </div>
323 {% } %}
324 </div>
325 </div>
326 <div class="row-fluid row-gutter-small">
327 {% if ((o.marcadores[i].pt.telefono) || (o.marcadores[i].pt.telefonoMovil)) { %}
328 <div class="span5">
329 <div class="text-info link-list-phone">
330 <ul>
331 {% if (o.marcadores[i].pt.telefono) { %}
332 {% for (var j=0; j<o.marcadores[i].pt.telefono.length; j++) { %}
333 <li>{%=o.marcadores[i].pt.telefono[j]%}</li>
334 {% } %}
335 {% } %}
336 {% if (o.marcadores[i].pt.telefonoMovil) { %}
337 {% for (var j=0; j<o.marcadores[i].pt.telefonoMovil.length; j++) { %}
338 <li>{%=o.marcadores[i].pt.telefonoMovil[j]%}</li>
339 {% } %}
340 {% } %}
341 </ul>
342 </div>
343 </div>
344 {% } %}
345 {% if (o.marcadores[i].pt.web) { %}
346 <div class="span7">
347 <div class="text-info link-list-contact">
348 <ul>
349 {% if (o.marcadores[i].pt.web) { %}
350 <li><a href="{%=o.marcadores[i].pt.web%}" target="_blank" >{%=o.marcadores[i].pt.web%}</a></li>
351 {% } %}
352 </ul>
353 </div>
354 </div>
355 {% } %}
356 </div>
357 </div>
358 </div>
359 </div>
360 </div>
361 </div>
362 </div>
363 </div>
364 {%
365 var cssCol = "itemR-extra-info-container";
366 var totalTelefonos = 0;
367 if (o.marcadores[i].pt.descripcion && ("" != o.marcadores[i].pt.descripcion)) {
368 cssCol += " con-descripcion";
369 }
370 if (o.marcadores[i].pt.telefono) {
371 totalTelefonos += o.marcadores[i].pt.telefono.length;
372 }
373 if (o.marcadores[i].pt.telefonoMovil) {
374 totalTelefonos += o.marcadores[i].pt.telefonoMovil.length;
375 }
376 if (totalTelefonos > 0) {
377 cssCol += " con-telefonos-" + totalTelefonos;
378 }
379 if (o.marcadores[i].pt.web && ("" != o.marcadores[i].pt.web)) {
380 cssCol += " con-pweb";
381 }
382 if (o.marcadores[i].pt.esReservable == "1") {
383 cssCol += " offer";
384 }
385 %}
386 <div class="span3 {%= cssCol%}">
387 <div class="row-fluid boundary-row">
388 <div class="span12">
389 <div class="boundary-container" data-resource-id="{%=o.marcadores[i].pt.id%}">
390 {%
391 var precioMax = o.marcadores[i].pt.precioMax;
392 var precioMin = o.marcadores[i].pt.precioMin;
393 var estiloPrecioMin = '';
394 if ((precioMax == 0) || (precioMin == precioMax)) {
395 estiloPrecioMin = "unique-value";
396 }
397
398 if ((precioMin > 0) && (precioMax > 0)) {
399 %}
400 <div class="boundary-lower">
401 <span class="value {%=estiloPrecioMin%}">{%=precioMin%}</span><span class="units">€</span>
402 </div>
403 {% if (((precioMin > 0) && (precioMax > 0)) && (precioMin != precioMax)) { %}
404 <div class="boundary-separator">-</div>
405 {% } if ((precioMax > 0) && (precioMin != precioMax)) { %}
406 <div class="boundary-higher">
407 <span class="value">{%= precioMax %}</span><span class="units">€</span>
408 </div>
409 {% } %}
410 {% } %}
411 </div>
412 </div>
413 </div>
414 <div class="row-fluid text-bkg-primary-color item-options-container">
415 <div class="reservation-lnk-container" >
416 <span class="reservation-link-icon">
417 <#--/web/portal-web/inicio#!/escapate/reserva/realiza-reserva-->
418 <a href="${urlCompleta}?reservaId={%= o.marcadores[i].pt.id + '&fechaInicio=' + encodeURIComponent(fechaInicio) + '&fechaFin=' + encodeURIComponent(fechaFin) %}" class="reservation-link dont-intercept">
419 <@liferayUi["message"] key="portalweb.templates.detalleExperienciaPanel2.reserva" />
420 </a>
421 </div>
422 </div>
423 </div>
424 </div>
425 </div>
426 </div>
427 </div>
428 {%
429 }
430 it++;
431
432 %}
433 {% } %}
434
435 </div>
436
437 </script>
438<script type="text/javascript" src="/html/js/i18n/datepicker-${locale.getLanguage()}.js"></script>
439
440 <script type="text/javascript">
441 var recursos = '';
442 var parametro = '${paramContent}';
443 var parametroPadre = '${paramContentPadre}';
444 var parametroCoordenadaX = '${paramCoordenadaX}';
445 var parametroCoordenadaY = '${paramCoordenadaY}';
446 var fechaInicio = '${paramFechaInicio}';
447 var fechaFin = '${paramFechaInicio}';
448 var fechaInicioUrlParam = '${fechaInicioUrlParam}';
449 var fechaFinUrlParam = '${fechaFinUrlParam}';
450
451 //ajustarLinksReserva(".enlazaDetalleReserva");
452 //ajustarLinksReserva(".reservation-link");
453 jQuery("#ordenarRecurso").select2();
454
455 var today = new Date()
456 var tomorrow = new Date();
457 tomorrow.setDate(today.getDate()+1);
458
459 if ("" == fechaInicio) {
460 jQuery('#fechaInicio').datepicker({defaultDate: today, dateFormat: "dd/mm/yy",onSelect: function(date) {fecha=new Date(date);jQuery('#fechaFin').datepicker('option', 'minDate', date)}}).datepicker("setDate", today);
461 } else {
462 jQuery('#fechaInicio').datepicker({defaultDate: today, dateFormat: "dd/mm/yy",onSelect: function(date) {fecha=new Date(date);jQuery('#fechaFin').datepicker('option', 'minDate', date)}})
463 }
464 jQuery('#fechaInicio').datepicker("option", "dateFormat", "dd/mm/yy");
465 if ("" == fechaInicio) {
466 jQuery('#fechaFin').datepicker({dateFormat: "dd/mm/yy"}).datepicker("setDate", tomorrow);
467 } else {
468 jQuery('#fechaFin').datepicker({dateFormat: "dd/mm/yy"});
469 }
470 jQuery('#fechaFin').datepicker("option", "dateFormat", "dd/mm/yy");
471
472 //jQuery.datepicker.setDefaults( $.datepicker.regional[ "es" ] );
473
474 function obtenerPrecios(){
475 jQuery('.boundary-container').each(function(index){
476 // Se recupera el identificador del contenido
477 var id = parseInt(jQuery(this).attr("data-resource-id"));
478
479 // Se solicita el precio del contenido
480 jQuery.post("${urlRecursosPrecios}", {'codigo': id}, function(precio,textStatus){
481 if(textStatus=='success'){
482 // Se comprueba si el valor minimo es distinto de cero
483 if (precio.precioMin > 0 ){
484 jQuery('[data-resource-id=' + id + ']').find('.boundary-lower .value').html(precio.precioMin);
485 jQuery('[data-resource-id=' + id + ']').find('.boundary-lower .units').html('\u20AC');
486 } else {
487 jQuery('[data-resource-id=' + id + ']').find('.boundary-lower').addClass('hidden');
488 jQuery('[data-resource-id=' + id + ']').find('.boundary-separator').addClass('hidden');
489 }
490
491 // Se comprueba si el valor maximo es distinto de cero
492 if (precio.precioMax > 0 ){
493 jQuery('[data-resource-id=' + id + ']').find('.boundary-higher .value').html(precio.precioMax);
494 jQuery('[data-resource-id=' + id + ']').find('.boundary-higher .units').html('\u20AC');
495 } else {
496 jQuery('[data-resource-id=' + id + ']').find('.boundary-higher').addClass('hidden');
497 jQuery('[data-resource-id=' + id + ']').find('.boundary-separator').addClass('hidden');
498 }
499
500 if (!(jQuery('[data-resource-id=' + id + ']').find('.boundary-separator')).hasClass('hidden')) {
501 jQuery('[data-resource-id=' + id + ']').find('.boundary-separator').html('-');
502 }
503 } else {
504 //parar la animacion de carga si la hay, poner mensaje de error?
505 console.log("error %", textStatus);
506 }
507 },"json");
508 });
509 }
510
511
512 function cargarListadoRecursos(data){
513 numRes = 0;
514
515 if (data.marcadores){
516 for (var i=0; i<data.marcadores.length; i++) {
517 for (var j=0; j<data.marcadores[i].pt.length; j++) {
518 numRes++;
519 }
520 }
521
522 numResString=""+numRes;
523
524 var recursosOrd = new Array();
525
526 for (var i=0; i<data.marcadores.length; i++) {
527 for (var j=0; j<data.marcadores[i].pt.length; j++) {
528 var objetoMarcador = new Object();
529 objetoMarcador.cat= data.marcadores[i].catDesc;
530 objetoMarcador.catPai=data.marcadores[i].catPai;
531 objetoMarcador.pt= data.marcadores[i].pt[j];
532 recursosOrd.push(objetoMarcador);
533
534 }
535 }
536
537 //si hay coordenadas y el orden es por cercania
538 if(parametroCoordenadaX && parametroCoordenadaX!=''){
539 if (jQuery("#ordenarRecurso").val()=='cercano_ASC') {
540 recursosOrd.sort(function (a, b){
541 try {
542 return parseFloat(a.pt.distancia) > parseFloat(b.pt.distancia) ? 1: parseFloat(a.pt.distancia) < parseFloat(b.pt.distancia)? -1 :0;
543 } catch (error) {
544 return 0;
545 }
546 });
547 }
548 } else {
549 if (jQuery("#ordenarRecurso").val()=='2') {
550 //ordenamos primero por nombre
551 recursosOrd.sort(function (a, b){ return a.pt.nombre > b.pt.nombre ? 1: a.pt.nombre < b.pt.nombre? -1 :0;});
552 //y luego ordenar por precio
553 recursosOrd.sort(function (a, b){
554 try {
555 return parseFloat(a.pt.precioMin) > parseFloat(b.pt.precioMin) ? 1: parseFloat(a.pt.precioMin) < parseFloat(b.pt.precioMin)? -1 :0;
556 } catch (error) {
557 return 0;
558 }
559 });
560 }
561 else if (jQuery("#ordenarRecurso").val()=='3') {
562 //ordenamos primero por nombre
563 recursosOrd.sort(function (a, b){ return a.pt.nombre > b.pt.nombre ? 1: a.pt.nombre < b.pt.nombre? -1 :0;});
564 //y luego ordenar por valoracion
565 recursosOrd.sort(function (a, b){
566 try {
567 return parseFloat(a.pt.valoracionMedia) < parseFloat(b.pt.valoracionMedia) ? 1: parseFloat(a.pt.valoracionMedia) > parseFloat(b.pt.valoracionMedia)? -1 :0;
568 } catch (error) {
569 return 0;
570 }
571 });
572 } else {
573 recursosOrd.sort(function (a, b){ return a.pt.nombre > b.pt.nombre ? 1: a.pt.nombre < b.pt.nombre? -1 :0;});
574 }
575 }
576
577 recursos = {
578 "marcadores": recursosOrd,
579 "paginacion": {"pagina" : "1","resultadosPagina":"10","resultadosTotales":numResString}
580 };
581
582 //console.log(recursos);
583 document.getElementById("result-header").innerHTML = tmpl("tmpl-cabecera-reserva", recursos);
584 document.getElementById("result-listado").innerHTML = tmpl("tmpl-listado-reserva", recursos);
585
586
587 /* if(typeof jQuery('.pagination').jqPagination() !== 'undefined'){
588 console.log('paginacion destroy()');
589 jQuery('.pagination').jqPagination('destroy','', '');
590 }*/
591 }
592 if (numRes > 0) {
593 jQuery('.vistas').removeClass('result-none');
594 var pagination ="<div class='pagination'><a href='#' class='first dont-intercept' data-action='first'>«</a>";
595 pagination += "<a href='#' class='previous dont-intercept' data-action='previous'>‹</a>";
596 pagination += "<input type='text' readonly='readonly' >";
597 pagination +="<a href='#' class='next dont-intercept' data-action='next'>›</a>";
598 pagination +="<a href='#' class='last dont-intercept' data-action='last'>»</a></div>";
599
600 jQuery('.pagination').remove();
601 jQuery('.vistas.pag.real').append(pagination);
602 jQuery('.vistas.pag.fake').append(pagination);
603
604 jQuery('.pagination').jqPagination({
605 link_string : '#',
606 max_page : (numRes%${resultadosPagina}==0? (Math.floor(numRes/${resultadosPagina})) : (Math.floor(numRes/${resultadosPagina}))+1 ),
607 page_string : 'Página {current_page} de {max_page}',
608 page_string : '<@liferayUi["message"] key="portalweb.templates.listados.totalPagina" /> {current_page} <@liferayUi["message"] key="portalweb.templates.listados.totalPaginaDe" /> {max_page}',
609 paged: function(page) {
610 console.log('pagina cambiada' + page);
611 recursos.paginacion.pagina=page;
612 console.log('DUPLICADA===='+recursos)
613 document.getElementById("result-header").innerHTML = tmpl("tmpl-cabecera-reserva", recursos);
614 document.getElementById("result-listado").innerHTML = tmpl("tmpl-listado-reserva", recursos);
615 //ajustarLinksReserva(".enlazaDetalleReserva");
616 //ajustarLinksReserva(".reservation-link");
617
618 scrollToTopOfSearchPanel('.panel.recursosReserva');
619 // Se sincroniza el paginador falso con el real
620 synchronizePaginators();
621 }
622 });
623
624 // Se sincroniza por primera vez paginador falso con el real
625 synchronizePaginators();
626
627 // Se oculta el formulario de filtros
628 if (!restablecerEsOrigenBusqueda) {
629 jQuery('#collapseFormRecursos').collapse('hide');
630 jQuery('a.accordion-toggle').addClass('collapsed');
631 } else {
632 restablecerEsOrigenBusqueda = false;
633 }
634
635 if (jQuery('#reservasPanelContainer').parent().hasClass('resized')) {
636 var panel = jQuery('#reservasPanelContainer').parent();
637 var minHeight = panel.height();
638 panel.css({'min-height': minHeight, 'height': 'auto'});
639 }
640
641 } else {
642 jQuery('.vistas').addClass('result-none');
643 data.marcadores = new Array();
644 document.getElementById("result-header").innerHTML = tmpl("tmpl-cabecera-reserva", data);
645 jQuery("#result-listado").addClass("hidden");
646 }
647
648 jQuery(".listadoD").css({'height':'auto'});
649
650 //ajustarLinksReserva(".enlazaDetalleReserva");
651 //ajustarLinksReserva(".reservation-link");
652 //obtenerPrecios();
653
654 jQuery("#ordenarRecurso").select2();
655 jQuery("#radioBusqueda").select2();
656 }
657
658 filtro = '#RES:1#PROV:4';
659 if(parametro!=''){
660 filtro += '#TP:' + parametro;
661
662 }
663
664 if(parametroPadre!=''){
665 filtro += '#MTG:' + parametroPadre;
666
667 }
668 if(parametroCoordenadaX!=''){
669 filtro += '#X:' + parametroCoordenadaX;
670
671 }
672 if(parametroCoordenadaY!=''){
673 filtro += '#Y:' + parametroCoordenadaY;
674
675 }
676 console.log("FILTRO_RECURSOS:"+ filtro);
677
678
679
680
681
682
683
684
685 var haystack = [365, 402, 327, 350, 364, 326, 329, 383, 327, 350, 338, 1000529, 1000493, 1000494, 1000601, 1000620, 1000529, 1000602, 1000460, 1000512, 1000541, 1000537, 1000461, 1000500, 1000503, 1000505, 1000509, 1000524, 1000496, 1000485, 1000481, 1000526, 1000517, 1000483, 1000471, 1000477, 1000507, 1000507, 1000498, 1000519, 1000538];
686
687
688 var anyMatchInArray = function (target, toMatch) {
689 "use strict"
690 var found, targetMap, i, j, cur;
691
692 found = false;
693 targetMap = {};
694
695 // Put all values in the `target` array into a map, where
696 // the keys are the values from the array
697 for (i = 0, j = target.length; i < j; i++) {
698 cur = target[i];
699 targetMap[cur] = true;
700 }
701
702 // Loop over all items in the `toMatch` array and see if any of
703 // their values are in the map from before
704 for (i = 0, j = toMatch.length; !found && (i < j); i++) {
705 cur = toMatch[i];
706 found = !!targetMap[cur];
707 // If found, `targetMap[cur]` will return true, otherwise it
708 // will return `undefined`...that's what the `!!` is for
709 }
710
711 return found;
712 };
713
714
715 function includes(k) {
716 for(var i=0; i < this.length; i++){
717 if( this[i] === k || ( this[i] !== this[i] && k !== k ) ){
718 return true;
719 }
720 }
721 return false;
722}
723
724
725
726 /*
727 //Para IE la llamada POST la hacemos asi
728 if(jQuery("html").hasClass("ie") ) {
729 postIE(filtro);
730 }else{
731
732 jQuery.post("${urlBuscador}",{'filtro':filtro, 'locale':'${locale.toString()}'},function(data,textStatus){
733 if(textStatus=='success'){
734
735 //console.log("AQUI:");
736 console.log(data);
737 cargarListadoRecursos(data);
738 if (window.actualizarDatosNav){
739 actualizarDatosNav("mapaLocBusqRec", data);
740 }
741 }
742 },"json");
743
744 }*/
745
746 /**
747 * JQuery pagination no soporta la sincroncizacion de dos paginadores, se establece
748 * un workarround para simular este comportamiento.
749 */
750 function synchronizePaginators(){
751 // Se establece en el falso paginador el texto del autentico
752 jQuery('.vistas.pag.fake').html(jQuery('.vistas.pag.real').html());
753 // Se actualiza el texto del falso paginador
754 jQuery('.vistas.pag.fake input').val(jQuery('.vistas.pag.real input').val());
755 // Se establecen listeners en el falso paginador que disparan los eventos
756 // correspondientes en el paginador real
757 jQuery('.vistas.pag.fake .first').on("click", function (e){
758 e.preventDefault();
759 e.stopImmediatePropagation();
760 jQuery('.vistas.pag.real .first').trigger('click');
761 });
762 jQuery('.vistas.pag.fake .previous').on("click", function (e){
763 e.preventDefault();
764 e.stopImmediatePropagation();
765 jQuery('.vistas.pag.real .previous').trigger('click');
766 });
767 jQuery('.vistas.pag.fake .next').on("click", function (e){
768 e.preventDefault();
769 e.stopImmediatePropagation();
770 jQuery('.vistas.pag.real .next').trigger('click');
771 });
772 jQuery('.vistas.pag.fake .last').on("click", function (e){
773 e.preventDefault();
774 e.stopImmediatePropagation();
775 jQuery('.vistas.pag.real .last').trigger('click');
776 });
777 }
778
779
780
781
782
783
784
785
786 <#if "" != selectorLocalidades>
787 var localidades = ${selectorLocalidades} ;
788 cargaLocalidades(localidades);
789 function cargaLocalidades(data) {
790 options = '';
791 for(var i=0;i<data.municipios.length;i++) options+="<option value='"+ data.municipios[i].id +"'>"+data.municipios[i].nombre+"</option>";
792 //console.log(options);
793 jQuery("#municipio").append(options).select2();
794 }
795 </#if>
796
797
798
799 <#if "" != selector>
800
801
802
803 filtro = '';
804 var categorias = ${selector};
805 cargaCategorias(categorias);
806 function cargaCategorias(data) {
807 var arrayObjetos = new Array();
808
809 for (var i = 0; i < data.datos.length; i++) {
810
811 var objetoOption = new Object();
812
813 objetoOption.id = data.datos[i].id;
814 objetoOption.nombre = data.datos[i].nombre;
815
816 var arrayTipos = new Array();
817
818 if (!haystack.includes(data.datos[i].id)) {
819
820 for (var j = 0; j < data.datos[i].tipos.length; j++) {
821 var objetoOptionHijo = new Object();
822 objetoOptionHijo.id = data.datos[i].tipos[j].id;
823 objetoOptionHijo.nombre = data.datos[i].tipos[j].nombre;
824
825 if (!haystack.includes(data.datos[i].tipos[j].id)) {
826 arrayTipos.push(objetoOptionHijo);
827 }
828
829 }
830 if (data.datos[i].metagruposHijos != null) {
831 for (var k = 0; k < data.datos[i].metagruposHijos.length; k++) {
832 for (var m = 0; m < data.datos[i].metagruposHijos[k].tipos.length; m++) {
833 var objetoOptionHijo2 = new Object();
834 objetoOptionHijo2.id = data.datos[i].metagruposHijos[k].tipos[m].id;
835 objetoOptionHijo2.nombre = data.datos[i].metagruposHijos[k].tipos[m].nombre;
836
837 if (!haystack.includes(data.datos[i].metagruposHijos[k].tipos[m].id)) {
838
839 arrayTipos.push(objetoOptionHijo2);
840 }
841
842
843 }
844 }
845 }
846 arrayTipos.sort(function(a, b) {
847 return (a.nombre > b.nombre ? 1 : a.nombre < b.nombre ? -1 : 0)
848 });
849
850 objetoOption.tipos = arrayTipos;
851
852 arrayObjetos.push(objetoOption);
853 }
854
855 }
856
857 arrayObjetos.sort(function (a, b){
858 return (a.nombre > b.nombre ? 1 : a.nombre < b.nombre ? -1 : 0)});
859
860 var categoriasSelect = new Array();
861
862 for(var i=0; i<arrayObjetos.length; i++){
863
864 if (!haystack.includes(arrayObjetos[i].id)) {
865
866 categoriasSelect.push({id: 'padre_' + arrayObjetos[i].id, text: arrayObjetos[i].nombre, children: new Array()});
867
868
869 //Si unicamente se tiene una categoria hija, esta coincide en nombre con la padre y no se muestra la hija.
870 if(arrayObjetos[i].tipos.length > 1){
871 for(var j=0; j< arrayObjetos[i].tipos.length; j++){
872
873 if (!haystack.includes(arrayObjetos[i].tipos[j].id)) {
874
875 categoriasSelect[i].children.push({id: arrayObjetos[i].tipos[j].id, text: arrayObjetos[i].tipos[j].nombre});
876
877 }
878
879 }
880 }
881 }
882
883 }
884
885 jQuery("#categoria").append(options).select2({multiple:true, data:categoriasSelect});
886
887 $("#categoria").on('change', function (e) {
888 var seleccion = $(this).val().split(",");
889 var longitud = 0;
890
891 if (e.added.children !== undefined){
892 longitud = e.added.children.length;
893
894 for (var i=0; i < longitud; i++) {
895 for (var j=0; j < seleccion.length; j++) {
896 if (e.added.children[i].id == seleccion[j]) {
897 seleccion.splice(j, 1);
898 }
899 }
900 }
901 }
902
903 $(this).select2("val",seleccion);
904 });
905
906 if(parametro!=''){
907 //las categorias vienen separadas por comas
908 var parametroSplit = parametro.split(',');
909 //seteamos las categorias
910 $("#categoria").select2("val", parametroSplit );
911
912 }
913 if(parametroPadre!=''){
914 $("#categoria").select2("val", ['padre_' + parametroPadre + '']);
915
916 }
917 var my_options = $("#categoria");
918 }
919 var fechaInicioJSUrl = "";
920 var fechaFinJSUrl = "";
921 jQuery("#filtroMapaRecursosReserva").submit(function(e){
922 e.preventDefault();
923
924 // Se muestra el bloque de resultados
925 jQuery('#resultado').removeClass('hidden');
926 jQuery("#result-listado").removeClass("hidden");
927 jQuery("#result-header").html("");
928 fechaInicio = jQuery('#fechaInicio').val();
929 fechaFin = jQuery('#fechaFin').val();
930
931 //recogida de filtros
932 var txtBusca = jQuery("#txtBusca").val();
933 var municipio = jQuery("#municipio").select2("val");
934 var categoria = jQuery("#categoria").select2("val");
935 var ordenar= jQuery("#ordenarRecurso").val();
936
937 //metemos las categorias en un array;
938
939 var arrayCatPadre= new Array();
940 var arrayCatHijo = new Array();
941 var srcCat="";
942 //diferenciamos si tiene el prefijo padre_ o no
943 for(var i=0; i< categoria.length; i++){
944 if(categoria[i].indexOf('padre_') != -1){
945 srcCat = categoria[i].replace(/padre_/g, '');
946 arrayCatPadre.push(srcCat);
947 }else{
948 arrayCatHijo.push(categoria[i]);
949 }
950
951 }
952
953 filtro = '#RES:1';
954 if(municipio!='') filtro += '#MUN:' + municipio;
955 if(arrayCatHijo!='') filtro += '#TP:' + arrayCatHijo;
956 if(arrayCatPadre!='') filtro += '#MTG:' + arrayCatPadre;
957 if(parametro!='') filtro += '#TP:' + parametro;
958 if(parametroPadre!='') filtro += '#MTG:' + parametroPadre;
959 if(parametroCoordenadaX!='') filtro += '#X:' + parametroCoordenadaX;
960 if(parametroCoordenadaY!='') filtro += '#Y:' + parametroCoordenadaY;
961 if(fechaInicio!='') filtro += '#FECHAINIRES:' + fechaInicio;
962 if(fechaFin!='') filtro += '#FECHAFINRES:' + fechaFin;
963 if (ordenar=='cercano_ASC') {
964 var radiobusqueda = jQuery("#radioBusqueda").val()
965 filtro+= '#RAD:' + radiobusqueda ;
966 }
967 if(txtBusca!='') {
968 filtro += '#TEXT:' + jQuery.base64.encode(txtBusca);
969 }
970
971 if(filtro=='') filtro='#PROV:4';
972
973 //console.log("FILTRO: %s", filtro);
974 //El navegador es IE no se llama al metodo post
975 if(jQuery("html").hasClass("ie") ) {
976 postIE(filtro, fechaInicio, fechaFin);
977 }else{
978 jQuery.post("${urlBuscador}",{'filtro':filtro, 'locale':'${locale.toString()}', fechaInicio: fechaInicio, fechaFin: fechaFin},function(data,textStatus){
979 if(textStatus=='success'){
980 cargarListadoRecursos(data);
981 actualizarDatosNav("mapaLocBusqRec", data);
982 }
983 },"json");
984 }
985 });
986 </#if>
987
988 jQuery('#listaVistas .cambioVista').on("click",function(e){
989 e.preventDefault();
990 // Se desmarca cualquier otra vista que estuviese seleccionada
991 jQuery('#listaVistas .cambioVista').not(this).each(function() {
992 jQuery(this).removeClass('selected');
993 });
994
995 // Se marca el enlace actual como seleccionado
996 jQuery(this).addClass('selected');
997
998 // Se ocultan todas las vistas
999 jQuery('div [id^=vista-]').each(function() {
1000 jQuery(this).addClass('hidden');
1001 });
1002
1003 // Se muestra la vista referenciada por la seleccion
1004 jQuery('div [id=' + jQuery(this).attr('data-rel')+ ']').removeClass('hidden');
1005
1006 // Trampeado para que se muestre bien el mapa
1007 if (jQuery(this).attr('data-rel').indexOf('mapa') > 0){
1008 console.log("redimensionar");
1009 setDimensionsFromContainer(jQuery("#listadoRecursosMapWrapper"), '#mapaLocBusqRec');
1010 redimensionarMapa("mapaLocBusqRec");
1011 }
1012 });
1013
1014 var restablecerEsOrigenBusqueda = false;
1015 jQuery('.restablecer').bind('click',function(e){
1016 e.preventDefault();
1017 jQuery("#txtBusca").val('');
1018 jQuery("#municipio").select2("val","");
1019 jQuery("#categoria").select2("val","");
1020 restablecerEsOrigenBusqueda = true;
1021 jQuery("#filtroMapaRecursosReserva").trigger("submit");
1022 });
1023
1024
1025 //Cuando tiene el foco el campo de busqueda borra el mensaje
1026 $('#txtBusca').focusin(function(){
1027 jQuery(this).attr('placeholder','');
1028 });
1029
1030 $('#txtBusca').focusout(function(){
1031 jQuery(this).attr('placeholder','<@liferayUi["message"] key="portalweb.templates.listadoRecursos.plantillaBuscador" />');
1032 });
1033
1034 function postIE(filtro, fechaInicio, fechaFin){
1035 var xmlhttp;
1036 if (window.XMLHttpRequest)
1037 {// code for IE7+, Firefox, Chrome, Opera, Safari
1038 xmlhttp=new XMLHttpRequest();
1039 }
1040 else
1041 {// code for IE6, IE5
1042 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
1043 }
1044
1045 xmlhttp.open("POST","${urlBuscador}",true);
1046 xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
1047 xmlhttp.send("filtro=" + filtro + "&locale':'${locale.toString()}" + "&fechaInicio=" + fechaInicio + "&fechaFin=" + fechaFin);
1048
1049
1050 xmlhttp.onreadystatechange=function() {
1051 if (xmlhttp.readyState==4 && xmlhttp.status==200) {
1052 var doc1 = JSON.parse(xmlhttp.responseText);
1053 cargarListadoRecursos(doc1);
1054 actualizarDatosNav("mapaLocBusqRec", doc1);
1055 }
1056 }
1057 }
1058
1059 </script>
1060</div>