S'ha produït un error mentre es processava la plantilla.
Java method "com.educaixa.common.impl.EduCaixaCommonImpl.getRelatedItinerancia(String, com.liferay.portal.kernel.theme.ThemeDisplay)" threw an exception when invoked on com.educaixa.common.impl.EduCaixaCommonImpl object "com.educaixa.common.impl.EduCaixaCommonImpl@1a105509"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign itinerances = UtilsService.ge...  [in template "10154#10192#FICHA_ACTIVIDADES_TPL" at line 65, column 1]
----
1<#-- get services --> 
2<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
3<#assign UtilsService = serviceLocator.findService("com.educaixa.common.service.EduCaixaCommonService")/> 
4<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
5<#assign dLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") /> 
6<#assign valoracionesDisplay = serviceLocator.findService("com.educaixa.services.service.RatingStatsLocalService")/> 
7<#assign LiteralsToolsServiceUtil = serviceLocator.findService("com.aqua.literals.util.LiteralsToolsService")/> 
8<#assign language = themeDisplay.getLocale()/> 
9<#assign groupId = themeDisplay.getScopeGroupId()/> 
10<#assign restultsLiteral = LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.common.link.resultados") /> 
11<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
12<#assign httpServletRequest = serviceContext.getRequest() /> 
13<#assign UserBookmarkLocalService = serviceLocator.findService("com.educaixa.services.service.UserBookmarkLocalService") /> 
14 
15<#assign article = journalArticleLocalService.getArticle(getterUtil.getLong(scopeGroupId), .vars['reserved-article-id'].data) /> 
16<#assign asset = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", article.resourcePrimKey) /> 
17 
18<#-- get the results URL and valoration value--> 
19<#assign results_url = "https://${request.serverName}/${locale.getLanguage()}${restultsLiteral}?q=" /> 
20<#assign valoracionesDisplayAverage = 0/> 
21<#if valoracionesDisplay.fetchByResourcePK(scopeGroupId,themeDisplay.getCompanyId(),article.getResourcePrimKey()) ??> 
22	<#assign valoracionesDisplayValue = valoracionesDisplay.findByResourcePK(scopeGroupId,themeDisplay.getCompanyId(),article.getResourcePrimKey()) /> 
23	<#assign valoracionesDisplayAverage = valoracionesDisplayValue.getAverageGlobalScore() /> 
24</#if> 
25 
26<#assign journalArticleId = .vars['reserved-article-id'].data/> 
27<#assign userId =themeDisplay.getUserId()/> 
28<#assign isUserBookmark = UserBookmarkLocalService.isUserBookmark(themeDisplay.getCompanyId(),userId,journalArticleId,groupId)/> 
29 
30<#-- Escape title text --> 
31<#assign titleEscaped = "" /> 
32<#if title.getData()??> 
33	<#assign titleEscaped = title.getData()?replace('<p>','','r')/> 
34		<#assign titleEscaped = titleEscaped?replace('</p>','','r')/> 
35	<#assign titleEscaped = titleEscaped?replace('<div>','','r')/> 
36		<#assign titleEscaped = titleEscaped?replace('</div>','','r')/> 
37	<#assign titleEscaped = titleEscaped?replace('<h1>','','r')/> 
38		<#assign titleEscaped = titleEscaped?replace('</h1>','','r')/> 
39</#if> 
40<#assign titleEscapedGTM = titleEscaped?replace('"','','')/> 
41 
42<#assign subtituloEscaped = "" /> 
43<#if subtitle.getData()??> 
44	<#assign subtituloEscaped = subtitle.getData() /> 
45	<#assign subtituloEscaped = subtituloEscaped?replace('<p>','','r')/> 
46	<#assign subtituloEscaped = subtituloEscaped?replace('</p>','','r')/> 
47</#if> 
48 
49<#-- get image alt --> 
50<#-- En PCC no viene ningun alt informado --> 
51<#assign altImage = titleEscaped /> 
52 
53<#-- get image banner --> 
54<#if bannerImage?? && bannerImage.getData()?? && bannerImage.getData() != ""> 
55	<#assign imageSrc = bannerImage.getData() /> 
56	<#else> 
57	<#assign imageSrc = "/o/educaixa-theme/images/blured-lights-actividades.png" /> 
58</#if> 
59 
60<#assign thesaurusCategories = UtilsService.getThesaurusCategories(asset) /> 
61<#assign tagsCategories = UtilsService.getTagsCategories(asset) /> 
62<#assign categories = thesaurusCategories + tagsCategories /> 
63 
64<#assign itinerancesActive = UtilsService.getDateRelatedItinerancia(journalArticleId,themeDisplay) /> 
65<#assign itinerances = UtilsService.getRelatedItinerancia(journalArticleId,themeDisplay) /> 
66 
67<#-- Login --> 
68<#assign is_signed_in = themeDisplay.isSignedIn()/> 
69<#assign plid = portalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), "EducaixaMyeducaixaLogin") /> 
70<#assign loginURL = portletURLFactory.create(httpServletRequest, "EducaixaMyeducaixaLogin", plid, "RENDER_PHASE") /> 
71${loginURL.setParameter("mvcPath", "/login_modal.jsp")} 
72${loginURL.setWindowState("POP_UP")} 
73 
74<#-- Centers --> 
75<#assign plidCenter = portalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), "com_educaixa_planner_portlet_plannerbuilder_PlannerBuilderActivityListPortlet") /> 
76<#assign centersURL = portletURLFactory.create(httpServletRequest, "com_educaixa_planner_portlet_plannerbuilder_PlannerBuilderActivityListPortlet", plidCenter, "RENDER_PHASE") /> 
77${centersURL.setParameter("mvcRenderCommandName", "choose_center")} 
78${centersURL.setWindowState("POP_UP")} 
79${centersURL.setParameter("articleId", journalArticleId)} 
80 
81<#assign language = themeDisplay.getLocale()/> 
82<#assign nivel_educativo = []> 
83<#assign area_conocimiento = []> 
84<#assign competencias = []> 
85<#assign objectius = []> 
86<#assign idiomas = []> 
87 
88<#list asset.getCategories() as cur_category> 
89	<#if cur_category.vocabularyId == 10515> 
90		<#assign nivel_educativo = nivel_educativo + [cur_category.getTitle(language)]> 
91		<#elseif cur_category.vocabularyId == 6> 
92		<#assign area_conocimiento = area_conocimiento + [cur_category.getTitle(language)]> 
93		<#elseif cur_category.vocabularyId == 401> 
94		<#assign competencias = competencias + [cur_category.getTitle(language)]> 
95		<#elseif cur_category.vocabularyId == 43203> 
96		<#assign objectius = objectius + [cur_category.getTitle(language)]> 
97		<#elseif cur_category.vocabularyId == 13> 
98		<#assign idiomas = idiomas + [cur_category.getTitle(language)]> 
99	</#if> 
100</#list> 
101 
102<#-- Identificador symphony itinerante --> 
103<#assign symphonyActivityId = 'AE-1977' /> 
104<#assign symphonyLocationId = '18170' /> 
105 
106<#-- button plan --> 
107<#assign CentersService = serviceLocator.findService("com.educaixa.planner.core.activitylist.service.CenterService")/> 
108<#assign hasCentersToPlan = CentersService.hasCentersToPlan(journalArticleId, themeDisplay)/> 
109<#--  --> 
110 
111<#if FBLCID.getData()??> 
112	<#assign currentActivityId = FBLCID.getData()?replace(' ', '') /> 
113</#if> 
114 
115<div class="container vertical image-view"> 
116	<div class="row"> 
117		<img src="${imageSrc}" alt="${altImage}" width="900px" height="458px" class="video-player"> 
118		<div class="box-img col-lg square"> 
119			<label id="added_label" class="card-course__tag hide">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.TAG.ADDED")}</label> 
120			<p class="box-img-pre-rec" style="color: #4176DB;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad")}</p> 
121			<#if title?has_content> 
122				<h1 class="box-img-title-rec">${titleEscaped}</h1> 
123			</#if> 
124			<#if subtitle?has_content> 
125				<p class="box-img-sub-title-rec">${subtituloEscaped}</p> 
126			</#if> 
127			<p class="box-img-categ-rec"> 
128				<#if categories?has_content> 
129					<#list categories as category> 
130						<#-- redirige la pagina de resultados por tag--> 
131						<a onClick="updateTagsCicks('${category.getTitle(locale)}');" href="${results_url}${category.getTitle(locale)}" >${category.getTitle(locale)}</a> 
132					</#list> 
133				</#if> 
134			</p> 
135			<p class="box-img-price"><br> 
136				<#if activityDuration?? && activityDuration.getData() != ""> 
137					${activityDuration.getData()} <br> 
138				</#if> 
139				<#if itinerancesActive> 
140					<p id="centro-preferente"></p> 
141					<a href="#reservar" style="color: black;"> 
142						<p class="box-img-more">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.mas.fechas")}</p> 
143					</a> 
144				</#if> 
145			</p> 
146			<div class="panel__footer"> 
147				<#if itinerancesActive> 
148					<#if symphonyActivityId != currentActivityId> 
149						<!--<button onClick="window.location='#reservar'" class="button__secundary-outline button--small button--light">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.reservar actividad")}</button>--> 
150						<#if hasCentersToPlan> 
151							<button id="book_button" class="planner-add-disabled button__secundary-outline button--small button--light btn-default">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.BOOK.BUTTON")}</button> 
152							<button id="plan_button" class="planner-add-disabled button__secundary-outline button--small button--light btn-primary btn-default">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.BUTTON")}</button> 
153						</#if> 
154					<#else> 
155						<#assign hasItineraryCentersToPlan = CentersService.hasItineraryCentersToPlan(journalArticleId, themeDisplay)/> 
156						<#if hasItineraryCentersToPlan> 
157							<button id="book_button" class="planner-add-disabled button__secundary-outline button--small button--light btn-default">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.BOOK.BUTTON")}</button> 
158							<button id="plan_button" class="planner-add-disabled button__secundary-outline button--small button--light btn-primary btn-default">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.BUTTON")}</button> 
159						</#if> 
160					</#if>   
161					 
162				</#if> 
163				 
164				<div class="card-actions flex"> 
165					<div class="statistics"> 
166						<svg viewBox="0 0 36 36" class="circular-chart orange"><line x1="18" y1="-5" x2="18" y2="5" stroke="black" stroke-width="2"></line> 
167							<path class="circle-bg" d="M18 2.0845 
168												a 15.9155 15.9155 0 0 1 0 31.831 
169												a 15.9155 15.9155 0 0 1 0 -31.831"></path> 
170							<path class="circle" stroke-dasharray="${valoracionesDisplayAverage*20}, 100" d="M18 2.0845 
171												a 15.9155 15.9155 0 0 1 0 31.831 
172												a 15.9155 15.9155 0 0 1 0 -31.831"></path> 
173							<text x="18" y="22" class="percentage">${valoracionesDisplayAverage}</text> 
174						</svg> 
175					</div> 
176					<div class="share"> 
177						<button id="share" class="no-min-width"></button> 
178						<div class="addthis_inline_share_toolbox tooltip"></div> 
179					</div> 
180					<div class="bookmark"> 
181						<#if is_signed_in> 
182							<#if isUserBookmark> 
183								<button id="bookmark" onClick="updateUserBookmark(${journalArticleId},false);" data-articleid="${journalArticleId}" class="bookmark bookmarked no-min-width"></button> 
184							<#else> 
185								<button id="bookmark" onClick="updateUserBookmark(${journalArticleId},true);" data-articleid="${journalArticleId}" class="bookmark no-min-width"></button> 
186							</#if> 
187						<#else> 
188							<button id="bookmark" class="no-min-width" onClick="event.stopPropagation();openPopup('${loginURL}','','500', '650')"></button> 
189						</#if> 
190					</div> 
191				</div> 
192			</div> 
193			<div id="msg_add_center" class="hide mt-2"> 
194				<i class="fa fa-info-circle pr-2"></i> 
195				<small>${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.SELECTED.ACTIVITY")}</small> 
196			</div> 
197			 
198		</div> 
199	</div> 
200</div> 
201 
202<#-- Categories section--> 
203<div class="container vertical info-view" style="margin-top:25px;"> 
204	<div class="row"> 
205		<#if nivel_educativo?size != 0 > 
206			<div class="col-lg col-xs-6 col-sm"> 
207				<h2 class="purple-title" style="color: #4176DB;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.nivel.educativo")}</h2> 
208				<#assign levels = educationLevel.getData()?replace("<p>", "<li class=\"marked\">") /> 
209				<#assign levels = levels?replace("</p>", "</li>") /> 
210				<ul> 
211					${levels} 
212				</ul> 
213			</div> 
214		</#if> 
215		<#if area_conocimiento?size != 0 > 
216			<div class="col-lg col-xs-6 col-sm"> 
217				<h2 class="purple-title" style="color: #4176DB;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.area.conocimiento")}</h2> 
218				<ul> 
219					<#list area_conocimiento as item> 
220					<li class="marked">${item}</li> 
221				</#list> 
222				</ul> 
223			</div> 
224		</#if> 
225		<#if area_conocimiento?size != 0 > 
226			<div class="col-lg col-xs-6 col-sm"> 
227				<h2 class="purple-title" style="color: #4176DB;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.competencias")}</h2> 
228				<ul> 
229					<#list competencias as item> 
230					<li class="marked">${item}</li> 
231				</#list> 
232				</ul> 
233			</div> 
234		</#if> 
235		<#if activityDuration?? && activityDuration.getData() != "" > 
236			<div class="col-lg col-xs-6 col-sm"> 
237				<h2 class="purple-title" style="color: #4176DB;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.duracion")}</h2> 
238				<ul> 
239					<li class="marked">${activityDuration.getData()}</li> 
240				</ul> 
241			</div> 
242		</#if> 
243		<#if idiomas?size != 0 > 
244			<div class="col-lg col-xs-6 col-sm"> 
245				<h2 class="purple-title" style="color: #4176DB;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.idioma")}</h2> 
246				<ul> 
247					<#list idiomas as item> 
248					<li class="marked">${item}</li> 
249				</#list> 
250				</ul> 
251			</div> 
252		</#if> 
253	</div> 
254	<hr class="line-12" style="border: 1px solid #4176DB;"> 
255</div> 
256 
257<#-- Content section--> 
258<div class="container vertical info-text"> 
259	<div class="row"> 
260		<div class="col-lg-7 col-xs-12"> 
261			<#if description.getData() ?? && description.getData() != ""> 
262				<p>${description.getData()}</p> 
263			</#if> 
264			<#if objective.getData() ?? && objective.getData() != ""> 
265				<h3 style="margin-top:45px;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.objetivos")}</h3> 
266				<div class="row" style="margin-top: 4%;"> 
267					<div class="col-lg-12"> 
268						<p>${objective.getData()}</p> 
269					</div> 
270				</div> 
271			</#if> 
272			<#-- material de descarga--> 
273			<#if document?? || documentsNoSync?? && (document.foo)?? || (documentsNoSync.foo)??> 
274				<div class="container vertical"> 
275					<div class="row"> 
276						<div class="center-title"> 
277							<h3 style="margin-top:45px;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.MATERIALS.AND.DOWNLOADS")}</h3> 
278						</div> 
279						<div>	 
280							<ul> 
281								<#if document??> 
282									<#list document.getSiblings() as cur_doc> 
283										<#if cur_doc.getData()?? && cur_doc.getData() != ""> 
284											<#assign file = dLFileEntryLocalService.getFileEntryByUuidAndGroupId(cur_doc.getData()?keep_after_last("/")?keep_before("?"),groupId) /> 
285											<li> 
286												<a href="${cur_doc.getData()}"> 
287													<span class="mat-and-down-before"></span> 
288													<span class="mat-and-down-text">${file.getFileName()?keep_before(".")} 
289														<span>  
290															(${file.getMimeType()?keep_after_last("/")?upper_case}  
291															${file.getSize()}kb) 
292														</span> 
293													</span> 
294													<span class="mat-and-down-after"></span> 
295												</a>  
296											</li> 
297										</#if> 
298									</#list> 
299								</#if> 
300								<#if documentsNoSync??> 
301									<#list documentsNoSync.getSiblings() as cur_docNoSync> 
302										<#if cur_docNoSync.getData()?? && cur_docNoSync.getData() != ""> 
303											<#assign file = dLFileEntryLocalService.getFileEntryByUuidAndGroupId(cur_docNoSync.getData()?keep_after_last("/")?keep_before("?"),groupId) /> 
304											<li> 
305												<a href="${cur_docNoSync.getData()}">  
306													<span class="mat-and-down-before"></span> 
307													<span class="mat-and-down-text">${file.getFileName()?keep_before(".")} 
308														<span>  
309															(${file.getMimeType()?keep_after_last("/")?upper_case}  
310															${file.getSize()}kb) 
311														</span> 
312													</span> 
313													<span class="mat-and-down-after"></span> 
314												</a>  
315											</li> 
316										</#if> 
317									</#list> 
318								</#if> 
319							</ul> 
320						</div> 
321					</div> 
322				</div> 
323			</#if>	 
324		 
325			<#if activityMoreInfo.getData() ?? && activityMoreInfo.getData() != ""> 
326				<h3 class="info-title" style="margin-top:45px;;color: #4176db;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.info.adicional")}</h3> 
327				<p>${activityMoreInfo.getData()}</p> 
328			</#if> 
329			<#if itinerancesActive> 
330				<div class="container vertical"> 
331					<div class="row"> 
332						<div class="center-title" style="margin-top: 3%;"> 
333							<p id="reservar">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.otra.info")}</p> 
334							</a> 
335						</div> 
336						<div class="row"> 
337							<#list 0 ..< itinerances.length() as i> 
338								<#if itinerances.get(i)?? && itinerances.get(i) != ""> 
339									<#if itinerances.get(i).active> 
340									 
341										<div class="col-lg-8"> 
342											<#assign centerName = "" /> 
343											<#if itinerances.get(i).centro?? && itinerances.get(i).centro != ""> 
344												<#assign centerName = itinerances.get(i).centro?upper_case /> 
345												<#assign centerName = centerName?replace("-", " ") /> 
346											</#if> 
347											<#if itinerances.get(i).centro?? && itinerances.get(i).centro != ""> 
348												<a href="/-/${itinerances.get(i).centro}"> 
349													<#assign centerName = itinerances.get(i).centro?upper_case /> 
350													<#assign centerName = centerName?replace("-", " ") /> 
351													<p class="activity-info center-name">${centerName}</p> 
352												</a> 
353											</#if> 
354											<#if itinerances.get(i).dateText?? && itinerances.get(i).dateText != ""> 
355												<div class="activity-info">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.fecha")} 
356													${itinerances.get(i).dateText} 
357												</div> 
358											</#if> 
359											<#if itinerances.get(i).timeText?? && itinerances.get(i).timeText != ""> 
360												<div class="activity-info activity-time">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.horario")} 
361													${itinerances.get(i).timeText} 
362												</div> 
363											</#if> 
364											<#if itinerances.get(i).duration?? && itinerances.get(i).duration != ""> 
365												<div class="activity-info">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.duracion")} 
366													${itinerances.get(i).duration} 
367												</div> 
368											</#if> 
369										</div> 
370 
371										<#if symphonyActivityId == currentActivityId> 
372										 
373										<div class="col-lg-4"> 
374											<#if itinerances.get(i).url?? && itinerances.get(i).url != ""> 
375												<#if is_signed_in> 
376													<div class="center-link"> 
377														<a onClick="addGTMEvent('reserva_online', 'boton_ficha', '${titleEscapedGTM}')" href="${itinerances.get(i).url}" class="color-caixa-blue"> 
378															${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.reservar")} ${centerName} 
379														</a> 
380													</div> 
381												<#else> 
382													<div class="center-link"> 
383														<a href="javascript:void(0);" onClick="event.stopPropagation();openPopup('${loginURL}','','500', '650')" class="color-caixa-blue"> 
384															${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.actividad.reservar")} ${centerName} 
385														</a> 
386													</div> 
387												</#if> 
388											</#if> 
389										</div> 
390										</#if>   
391										</br> 
392									</div> 
393									<div class=" center-info" style="width:100%"> 
394										<table style="width:100%"> 
395											<#if itinerances.get(i).aforo?? && itinerances.get(i).aforo != ""> 
396												<tr> 
397													<th><img class="center-info-img" src="/o/educaixa-theme/images/group-icon.PNG" width="50px" alt="grupo actividades EduCaixa"></th> 
398													<td><div class="activity-info">${itinerances.get(i).aforo}</div></td> 
399												</tr> 
400											</#if> 
401											<#if itinerances.get(i).price ?? && itinerances.get(i).price != ""> 
402												<tr> 
403													<th><img class="center-info-img" src="/o/educaixa-theme/images/money-icon.PNG" width="50px" alt="precio actividades EduCaixa"></th> 
404													<td> 
405														<div class="activity-info"> 
406															<#if itinerances.get(i).priceText?? > 
407																${itinerances.get(i).priceText} 
408															<#else> 
409																${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.ficha.gratis")} 
410															</#if> 
411															<#if itinerances.get(i).offer?? && itinerances.get(i).offer != ""> 
412																${itinerances.get(i).offer} 
413															</#if> 
414														</div> 
415													</td> 
416												</tr> 
417											</#if> 
418											<#if itinerances.get(i).description?? && itinerances.get(i).description != ""> 
419												<tr> 
420													<th><img class="center-info-img" src="/o/educaixa-theme/images/info-icon.PNG" width="50px" alt="información actividades EduCaixa"></th> 
421													<td><div class="activity-info">${itinerances.get(i).description?replace(".", ".</br>")}</div></td> 
422												</tr> 
423											</#if> 
424										</table> 
425										</br> 
426										</br> 
427									 
428									</#if> 
429								</#if> 
430							</#list> 
431						</div> 
432					</div> 
433				</div> 
434			</#if> 
435		</div> 
436		 
437		<div class="col-lg-5 col-xs-12"> 
438		<!-- Next sessions --> 
439		<@liferay_portlet["runtime"] portletName="com_educaixa_planner_portlet_plannerbuilder_PlannerNextSessionsPortlet"  
440									queryString="fblcActivityId=" + currentActivityId + "&journalArticleId=" + journalArticleId/> 
441		<!-- End Next sessions --> 
442		 
443		 
444		 
445		<#-- Register content --> 
446		<#if journalArticleLocalService.fetchArticle(groupId, "CAPTACION_ACTIVIDAD") ?? && !is_signed_in> 
447			<#assign register = journalArticleLocalService.getArticle(groupId, "CAPTACION_ACTIVIDAD")/> 
448			<#if register?? && register != ""> 
449				<#assign registerContent = journalArticleLocalService.getArticleContent(register, register.DDMTemplateKey, "VIEW", themeDisplay.getLocale(), themeDisplay) /> 
450			</#if> 
451			<#assign registerContent = journalArticleLocalService.getArticleContent(register, register.DDMTemplateKey, "VIEW", themeDisplay.getLocale(), themeDisplay) /> 
452			<div class= "captacion-ficha"> 
453				${registerContent} 
454			</div> 
455		</#if> 
456		</div> 
457	</div> 
458</div> 
459 
460<style> 
461	.center-name{ 
462		text-decoration: underline; 
463		color: #4176db; 
464
465	.center-link{ 
466		border-radius: 15px; 
467		border: 1px solid #009DDF; 
468		width: auto; 
469		line-height: 22px; 
470		text-align: center; 
471
472	.center-info th { 
473		width: 15%; 
474
475	.center-title{ 
476		width: 100%; 
477
478	.activity-info{ 
479		width: 100%; 
480
481	.activity-time p{ 
482		display: inline; 
483
484	.panel__footer button.no-min-width{ 
485		min-width: 0; 
486
487</style> 
488 
489<script> 
490$( document ).ready(function() { 
491	initAddThis(); 
492	var fblcActivityId = '${FBLCID.getData()}'.replaceAll(' ', ''); 
493	ActivityList.existsActivity(fblcActivityId, showLabelActivity, hideLabelActivity.bind(fblcActivityId)); 
494 
495	preferredCenter(); 
496	 
497	// Open popup 
498	$('#centro-preferente').on('click', 'a', function(e){ 
499		e.preventDefault(); 
500		Center.selectCenter('${centersURL}'); 
501		return false;  
502		}  
503	); 
504    
505	$(document).bind("DOMNodeRemoved", function(e) 
506
507		var currentTarget = e.target; 
508		if (currentTarget){ 
509			var idName = currentTarget.id; 
510			if (idName == 'dialog'){ 
511				ActivityList.existsActivity(fblcActivityId, showLabelActivity, hideLabelActivity.bind(fblcActivityId)); 
512				PlannerIcons.refreshIcons(); 
513
514
515            
516	}); 
517	 
518		 
519    // Hidden tag and event on click for add activity 
520	 
521   }); 
522    
523   function hideLabelActivity(fblcActivityId){ 
524		 
525		var plan_button_next_sessions = document.getElementById("plan_button_next_sessions"); 
526		var plan_button = document.getElementById("plan_button"); 
527    
528		[ plan_button_next_sessions, plan_button ].forEach(function(element) { 
529	 
530			plan_button.onclick = function(event) { 
531				event.stopPropagation(); 
532				 
533				if( $('#plan_button').hasClass('planner-add-disabled')){ 
534					$('#msg_add_center').removeClass('hide'); 
535					$('#msg_add_center').addClass('d-inline-flex '); 
536				}else{ 
537					var fblcLocationId = $('#centro-preferente span').attr('data-fblcLocationId'); 
538					if(fblcLocationId != ""){ 
539						var centro = $('#centro-preferente span').text().replace(/^ /, ''); 
540						addGTMAddActivityToPlani("${titleEscaped}",'${currentActivityId}',centro,'${area_conocimiento?join(", ")}','${competencias?join(", ")}'); 
541						ActivityList.addActivity('${journalArticleId}', fblcActivityId, fblcLocationId); 
542						showLabelActivity(); 
543
544
545
546		}); 
547	    
548		$('#added_label').addClass('hide'); 
549		 
550		var book_button = document.getElementById("book_button"); 
551    
552		$('.panel__footer>#book_button').on('click', function(event) { 
553			event.stopPropagation(); 
554			if(${is_signed_in?c}){ 
555				if( $('#book_button').hasClass('planner-add-disabled')){ 
556					$('#msg_add_center').removeClass('hide'); 
557					$('#msg_add_center').addClass('d-inline-flex '); 
558				}else{ 
559					var fblcLocationId = $('#centro-preferente span').attr('data-fblcLocationId'); 
560					if(!fblcLocationId) fblcLocationId = $('#centerNextSessions').attr('data-fblcLocationId'); 
561					if(fblcLocationId != ""){ 
562						var centro = $('#centro-preferente span').text().replace(/^ /, ''); 
563						if(!centro) centro = $('#centerNextSessions').text().replace(/^ /, ''); 
564						if(Plan.addPlan('${journalArticleId}', fblcActivityId, fblcLocationId)){ 
565							var redirect = '${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.planner.assigngroupdate.url")}'; 
566							Liferay.Service( 
567								'/planner.locationmapper/get-category-id-by-fblc-location-id', 
568
569								fblcLocationId: fblcLocationId, 
570								}, 
571								function(categoryId) { 
572									redirect = redirect.concat("?p_r_p_categoryId=",categoryId); 
573									window.location.href = redirect; 
574
575							);  
576
577
578
579			} else { 
580				openPopup('${loginURL}','','500', '650'); 
581
582		}); 
583
584		 
585	function showLabelActivity(){ 
586		$('#added_label').removeClass('hide'); 
587		$('#centro-preferente', parent.document).addClass('hide'); 
588		$('#plan_button', parent.document).removeClass('hide'); 
589		$('#plan_button', parent.document).prop('disabled', false); 
590		$('#plan_button', parent.document).removeClass('planner-add-disabled'); 
591		$('#plan_button', parent.document).addClass('card-button-dark'); 
592		$('#plan_button', parent.document).text('${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.GO.PLANIFICADOR")}'); 
593		 
594		$('#plan_button_next_sessions', parent.document).removeClass('planner-add-disabled'); 
595		$('#plan_button_next_sessions', parent.document).addClass('card-button-dark'); 
596		$('#plan_button_next_sessions', parent.document).text('${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.planner.next.sessions.btn.ir.planificador")}'); 
597		 
598		var url = getPlannerUrl(); 
599		$('#plan_button', parent.document).attr('onclick','location.href=\''+url+'\''); 
600		$('#book_button', parent.document).hide(); 
601		$('#plan_button_next_sessions', parent.document).attr('onclick','location.href=\''+url+'\''); 
602		 
603
604   	 
605	function getPlannerUrl(){ 
606		if(!${is_signed_in?c}) { 
607				url = Liferay.Util.PortletURL.createPortletURL( 
608					'${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ICONS.PLANNERURL")}', 
609
610							'p_p_id': 'com_educaixa_planner_portlet_plannerbuilder_PlannerBuilderActivityListPortlet', 
611							'activities': JSON.stringify(LocalStorage.getAllByPrefix(ACTIVITY_PREFIX)) 
612
613			); 
614
615		else url = '${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ICONS.PLANNERURL")}'; 
616		return url; 
617
618   	 
619    
620   function preferredCenter(){ 
621   var tagAddHidden = $('#added_label').hasClass('hide'); 
622       
623   	if(Liferay.ThemeDisplay.isSignedIn()){ 
624   		Liferay.Service( 
625   		  '/expandovalue/get-data', 
626
627   			companyId: Liferay.ThemeDisplay.getCompanyId(), 
628   			className: 'com.liferay.portal.kernel.model.User', 
629   			tableName: 'CUSTOM_FIELDS', 
630   			columnName: 'centro-preferente', 
631   			classPK: Liferay.ThemeDisplay.getUserId() 
632   		  }, 
633   		  function(fblcLocationId) { 
634				tagAddHidden = $('#added_label').hasClass('hide'); 
635				// Usuario tiene centro preferente 
636   			  if(fblcLocationId != ""){ 
637   				Liferay.Service( 
638   				  '/planner.locationmapper/get-category-name-by-fblc-location-id', 
639
640   					fblcLocationId: fblcLocationId, 
641   					locale: Liferay.ThemeDisplay.getLanguageId() 
642   				  }, 
643   				  function(centerName) { 
644					  if(tagAddHidden){ 
645						var aux = '<span data-fblcLocationId="' + fblcLocationId + '"> ' + centerName + '</span><a id="modificar-centro" class="ml-2 small" title="${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.MODIFICAR_CENTRO")}" href="">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.MODIFICAR_CENTRO")}</a>'; 
646						$('#centro-preferente').append(aux);  
647						 
648						${itinerances}.some(function(el) { 
649							  if(el.centro == centerName){ 
650								$('#plan_button').prop('disabled', false); 
651								$('#plan_button').removeClass('planner-add-disabled'); 
652								$('#book_button').removeClass('planner-add-disabled'); 
653
654							}); 
655					  }else{ 
656						var aux = '<span data-fblcLocationId="' + fblcLocationId + '"> ' + centerName + '</span>'; 
657						$('#centro-preferente').append(aux);  
658
659
660   				);  
661   			  }else{ 
662				 
663				if(tagAddHidden){ 
664					var aux = '<span></span><a id="modificar-centro" title="${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.SELECCIONAR_CENTRO")}" href="">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.SELECCIONAR_CENTRO")}'; 
665						$('#centro-preferente').append(aux); 
666					 
667
668
669
670   		); 
671   	}else { 
672   		var fblcLocationId = Center.getPreferredCenter(); 
673		tagAddHidden = $('#added_label').hasClass('hide'); 
674		if(!fblcLocationId && tagAddHidden){ 
675			var aux = '<span></span><a id="modificar-centro" title="${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.SELECCIONAR_CENTRO")}" href="">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.SELECCIONAR_CENTRO")}'; 
676						$('#centro-preferente').append(aux); 
677		}else if(fblcLocationId && tagAddHidden){ 
678			Liferay.Service( 
679   				  '/planner.locationmapper/get-category-name-by-fblc-location-id', 
680
681   					fblcLocationId: fblcLocationId, 
682   					locale: Liferay.ThemeDisplay.getLanguageId() 
683   				  }, 
684   				  function(centerName) { 
685				  var aux = '<span data-fblcLocationId="' + fblcLocationId + '"> ' + centerName + '</span><a id="modificar-centro" class="ml-2 small" title="${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.MODIFICAR_CENTRO")}" href="">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "COM.EDUCAIXA.PLANNER.ACTIVITY.PLAN.MODIFICAR_CENTRO")}</a>'; 
686   					$('#centro-preferente').append(aux);  
687					 
688					${itinerances}.some(function(el) { 
689						  if(el.centro == centerName){ 
690							$('#plan_button').prop('disabled', false); 
691							$('#plan_button').removeClass('planner-add-disabled'); 
692							$('#book_button').removeClass('planner-add-disabled'); 
693
694						}); 
695
696   				);  
697
698
699   }	 
700   //# sourceURL = fichaActividad.js 
701</script> 
0.0
Encara no hi ha cap comentari. Sigues el primer a enviar comentaris.

Valoració mitjana global sobre 5

Basada en 0 valoracions