حصل خطأ عند معالجة القالب.
The following has evaluated to null or missing: ==> spec [in template "20099#20135#321193" at line 218, column 62] ---- Tip: If the failing expression is known to be 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: #if (aDateTime?date lte eventDate_Dat... [in template "20099#20135#321193" at line 218, column 11] ----
1<script type="application/javascript">
2 function validateForm() {
3 var startDate = document.getElementById("fromDate").value;
4 var endDate = document.getElementById("toDate").value;
5 var title = document.getElementById("title").value;
6 var type = document.getElementById("kind").value;
7
8 if(isNaN(type) && startDate ==="" && endDate ==="" && title ===""){
9 alert("Please enter at least one value");
10 return false;
11 }
12
13 // Check if both fields are filled
14 if (((startDate !== "") && (endDate === "")) || ((startDate === "") && (endDate !== ""))) {
15 alert("Please enter both start date and end date.");
16 return false;
17 }
18
19 // Convert the input values to Date objects
20 var startDateObj = new Date(startDate);
21 var endDateObj = new Date(endDate);
22
23 // Check if the start date is before the end date
24 if (startDateObj >= endDateObj) {
25 alert("End date must be greater than start date.");
26 return false;
27 }
28
29 // Validation passed
30 return true;
31 }
32</script>
33<script type="application/javascript">
34 document.addEventListener("DOMContentLoaded", function () {
35 const myForm = document.getElementById("searchForm");
36 const cancelButton = document.getElementById("cancelButton");
37
38 // Add an event listener to the cancel button
39 cancelButton.addEventListener("click", function () {
40 // Clear all the input fields when the cancel button is clicked
41 const currentURL = window.location.href;
42 const newUrl = '/activities';
43 myForm.reset();
44 if(currentURL.includes('fromDate')){
45 window.location.href = newUrl;
46 }else{
47 history.pushState(null, '', newUrl);
48 }
49
50 });
51 });
52</script>
53<script>
54 const dynamicSelect = document.getElementById('kind');
55 const currentURL = window.location.href;
56 if(currentURL.includes('fromDate')){
57 const urlParams = new URLSearchParams(window.location.search);
58 const type = urlParams.get('kind');
59 console.log('ahmedddd'+type);
60 window.onload = (event) =>{
61 document.getElementById("kind").value = type;
62 };
63 }
64</script>
65<style>
66 time.icon
67 {
68 font-size: 1em; /* change icon size */
69 display: block;
70 position: relative;
71 width: 112px;
72 height: 112px;
73 background-color: #fff;
74 border-radius: 0.6em;
75 box-shadow: 0 1px 0 #bdbdbd, 0 2px 0 #fff, 0 3px 0 #bdbdbd, 0 4px 0 #fff, 0 5px 0 #bdbdbd, 0 0 0 1px #bdbdbd;
76 overflow: hidden;
77 }
78 table.dataTable thead th{
79 text-align: inherit;
80 }
81 table.dataTable thead th:last-child input{
82 display:none;
83 }
84 table.dataTable thead th:last-child:before,
85 table.dataTable thead th:last-child:after{
86 display:none !important;
87 }
88 table.dataTable thead tr:first-child{
89 display:none;
90 }
91 time.icon *
92 {
93 display: block;
94 width: 100%;
95 font-size: 1em;
96 font-weight: bold;
97 font-style: normal;
98 text-align: center;
99 }
100 time.icon strong
101 {
102 position: absolute;
103 top: 0;
104 padding: 0.4em 0;
105 color: #fff;
106 background-color: #f68c30;
107 border-bottom: 1px dashed #d27220;
108 box-shadow: 0 2px 0 #f68c30;
109 }
110 time.icon em
111 {
112 position: absolute;
113 bottom: 0.3em;
114 color: #1f5e97;
115 }
116 time.icon span
117 {
118 font-size: 2.8em;
119 letter-spacing: -0.05em;
120 padding-top: 0.8em;
121 color: #2f2f2f;
122 }
123 .upcommingActivityInfo small{
124 margin-bottom:6px;
125 display:inline-block;
126 }
127 .upcommingActivity{
128 border: 1px solid #cccccc;
129 box-sizing: border-box;
130 display: inline-block;
131 width: 100%;
132 border-radius: 10px;
133 padding: 15px;
134 }
135 .upcommingActivity .upcommingActivityInfo{
136 width:calc(100% - 128px);
137 }
138 .owl-carousel-upcomming .owl-item:after{
139 display:none;
140 }
141 .owl-carousel-upcomming .owl-item{
142 padding:1px;
143 }
144 <#if locale="ar_SA">
145 .owl-carousel-upcomming{
146 direction:ltr;
147 }
148 .upcommingActivityInfo{
149 text-align:right;
150 }
151 .upcommingActivity time{
152 float:right;
153 margin-left:16px;
154 }
155 .upcommingActivity .upcommingActivityInfo{
156 float:left;
157 }
158 .owl-carousel-upcomming .owl-dots{
159 direction:rtl;
160 }
161 .owl-stage-outer .owl-stage .owl-item{
162 text-align:left:
163 }
164 </#if>
165 <#if locale="en_US">
166 .upcommingActivity time{
167 float:left;
168 margin-right:15px;
169 }
170 .upcommingActivity .upcommingActivityInfo{
171 float:right;
172 }
173 .owl-stage-outer .owl-stage .owl-item{
174 text-align:right:
175 }
176 .upcommingActivityInfo{
177 text-align:left;
178 }
179 </#if>
180 .owl-stage-outer{
181 text-align:center;
182 }
183 .owl-stage-outer .owl-stage{
184 margin:0 auto !important;
185 }
186 @media only screen and (max-width: 768px) {
187 table th:nth-child(3),
188 table th:nth-child(4){
189 display:none;
190 }
191 .hideOnMobile{
192 display:none;
193 }
194 }
195</style>
196<div class="container">
197 <span class="title title-large title-bold sds mr-5-dir mt-4">
198 <#if locale="ar_SA">
199 الأنشطة القادمة
200 </#if>
201 <#if locale="en_US">
202 Upcoming Activities
203 </#if>
204 </span>
205 <div class="owl-carousel-upcomming owl-carousel owl-theme">
206 <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
207 <#list entries as curEntry>
208 <#assign article = curEntry.getAssetRenderer().getArticle() /> <#if (curEntry.getAssetRenderer().getArticle())??>
209 <#assign structKey = curEntry.getAssetRenderer().getArticle().getDDMStructureKey()/>
210 <#assign docXml = saxReaderUtil.read(curEntry.getAssetRenderer().getArticle().getContent()) />
211 <#assign eventDate = docXml.valueOf("//dynamic-element[@name='date']/dynamic-content/text()")/>
212 <#assign speciality = docXml.valueOf("//dynamic-element[@name='speciality']/dynamic-content/text()")/>
213 <#if request.getParameter("spec")??>
214 <#assign spec = request.getParameter("spec") />
215 </#if>
216 <#assign eventDate_Data = getterUtil.getString(eventDate)> <#if validator.isNotNull(eventDate_Data)>
217 <#assign eventDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", eventDate_Data, locale)> </#if> <#assign aDateTime = .now?date>
218 <#if (aDateTime?date lte eventDate_DateObj?date && spec == speciality) >
219 ${journalArticleLocalService.getArticleContent(article,"326760", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)}
220 </#if>
221 <#else> There's No upcoming Activities </#if>
222 </#list>
223 </div>
224</div>
225<#if locale="ar_SA">
226<div class="container mb-5">
227 <span class="title title-large title-bold sds mr-5-dir mt-4"> جميع الانشطة </span>
228 <form id="searchForm" onsubmit="return validateForm()" method="get">
229 <#if themeDisplay.getURLCurrent()?contains("fromDate")> <#if request.getParameter("fromDate")??>
230 <#assign startDate = request.getParameter("fromDate") /> </#if> <#if request.getParameter("toDate")??>
231 <#assign endDate = request.getParameter("toDate") /> </#if> <#if request.getParameter("title")??>
232 <#assign title = request.getParameter("title") /> </#if> <#if request.getParameter("kind")??>
233 <#assign kind = request.getParameter("kind") /> </#if> </#if>
234 <div class="row mt-5">
235 <div class="col-md-2">
236 <#if request.getParameter("title")??>
237 <div class="form-group">
238 <label>عنوان النشاط</label> <input id="title" name="title" class="form-control" value=${title}>
239 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
240 </div>
241 <#else>
242 <div class="form-group">
243 <label>عنوان النشاط</label> <input id="title" name="title" class="form-control">
244 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
245 </div>
246 </#if>
247 </div>
248 <div class="col-md-2">
249 <#if request.getParameter("fromDate")??>
250 <div class="form-group">
251 <label>انعقاد النشاط من</label>
252 <input id="fromDate" name="fromDate" class="form-control gj-textbox-md-rev newdatepicker01" value=${startDate}>
253 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
254 </div>
255 <#else>
256 <div class="form-group">
257 <label>انعقاد النشاط من</label>
258 <input id="fromDate" name="fromDate" class="form-control gj-textbox-md-rev newdatepicker01">
259 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
260 </div>
261 </#if>
262 </div>
263 <div class="col-md-2">
264 <#if request.getParameter("toDate")??>
265 <div class="form-group">
266 <label>انعقاد النشاط الي</label>
267 <input id="toDate" name="toDate" class="form-control gj-textbox-md-rev newdatepicker02" value=${endDate}>
268 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
269 </div>
270 <#else>
271 <div class="form-group">
272 <label>انعقاد النشاط الي</label>
273 <input id="toDate" name="toDate" class="form-control gj-textbox-md-rev newdatepicker02">
274 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
275 </div>
276 </#if>
277 </div>
278 <div class="col-md-2">
279 <#if request.getParameter("kind")??>
280 <div class="form-group">
281 <label>نوع النشاط</label>
282 <select name="kind" id="kind" class="form-control">
283 <option>اختر..</option>
284 <option value="2">Training Course</option>
285 <option value="1">workshop training</option>
286 <option value="3">Online webex</option>
287 </select>
288 </div>
289 <#else>
290 <div class="form-group">
291 <label>نوع النشاط</label>
292 <select name="kind" id="kind" class="form-control">
293 <option>اختر..</option>
294 <option value="2">Training Course</option>
295 <option value="1">workshop training</option>
296 <option value="3">Online webex</option>
297 </select>
298 </div>
299 </#if>
300 </div>
301 <div class="col-md-2">
302 <label class="helper"></label>
303 <button type="submit" class="btn btn-blue w100" >بحث</button>
304 </div>
305 <div class="col-md-2">
306 <label class="helper"></label>
307 <button type="button" class="btn btn-white w100" id="cancelButton">اعادة البحث</button>
308 </div>
309 </div>
310 </form>
311 <div class="row mt-5">
312 <div class="col-md-12 table-responsive">
313 <table id="datatable01" class="display" style="width:100%">
314 <thead>
315 <tr>
316 <th>عنوان النشاط</th>
317 <th>نوع النشاط</th>
318 <th>تاريخ بداية أنعقاد النشاط </th>
319 <th>تاريخ نهاية أنعقاد النشاط </th>
320 <th>المحافظة</th>
321 <th>عرض</th>
322 </tr>
323 </thead>
324 <tbody> <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
325 <#list entries as curEntry> <#assign article = curEntry.getAssetRenderer().getArticle() />
326 <#if (curEntry.getAssetRenderer().getArticle())??> <#assign structKey = curEntry.getAssetRenderer().getArticle().getDDMStructureKey()/>
327 <#assign docXml = saxReaderUtil.read(curEntry.getAssetRenderer().getArticle().getContent()) />
328 <#assign eventDate = docXml.valueOf("//dynamic-element[@name='date']/dynamic-content/text()")/>
329 <#assign eventTitle = docXml.valueOf("//dynamic-element[@name='title']/dynamic-content/text()")/>
330 <#assign eventType = docXml.valueOf("//dynamic-element[@name='kind']/dynamic-content/text()")/>
331 <#assign eventTypeDropdown = docXml.valueOf("//dynamic-element[@name='eventType1']/dynamic-content/text()")/>
332 <#assign eventDate_Data = getterUtil.getString(eventDate)> <#if validator.isNotNull(eventDate_Data)>
333 <#assign eventDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", eventDate_Data, locale)> </#if>
334 <#assign speciality = docXml.valueOf("//dynamic-element[@name='speciality']/dynamic-content/text()")/>
335 <#if request.getParameter("spec")??>
336 <#assign spec = request.getParameter("spec") />
337 <#if spec == speciality>
338 <#if !themeDisplay.getURLCurrent()?contains("fromDate")>
339 ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)}
340 </#if>
341 <#if title?has_content && eventTitle?contains(title)>
342 ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)}
343 </#if>
344 <#if ((startDate?has_content) && eventDate_DateObj?date gte startDate?date("MM/dd/yyyy")) && (eventDate_DateObj?date lte endDate?date("MM/dd/yyyy"))>
345 ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)}
346 </#if>
347 <#if (kind?has_content) && (eventTypeDropdown == kind)>
348 ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)}
349 </#if>
350 </#if>
351 </#if>
352 </#if> </#list> </tbody>
353 </table>
354 </div>
355 </div>
356</div>
357</#if> <#if locale="en_US">
358<div class="container mb-5">
359 <span class="title title-large title-bold sds mr-5-dir mt-4">All Activities </span>
360 <form id="searchForm" onsubmit="return validateForm()" method="get">
361 <#if themeDisplay.getURLCurrent()?contains("fromDate")> <#if request.getParameter("fromDate")??><#assign startDate = request.getParameter("fromDate") /> </#if> <#if request.getParameter("toDate")??> <#assign endDate = request.getParameter("toDate") /> </#if> <#if request.getParameter("title")??> <#assign title = request.getParameter("title") /> </#if> <#if request.getParameter("kind")??> <#assign kind = request.getParameter("kind") /> </#if> </#if>
362 <div class="row mt-5">
363 <div class="col-md-2">
364 <#if request.getParameter("title")??>
365 <div class="form-group">
366 <label>Activity Title</label> <input id="title" name="title" class="form-control" value=${title}>
367 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
368 </div>
369 <#else>
370 <div class="form-group">
371 <label>Activity Title</label> <input id="title" name="title" class="form-control" placeholder="">
372 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
373 </div>
374 </#if>
375 </div>
376 <div class="col-md-2">
377 <#if request.getParameter("fromDate")??>
378 <div class="form-group">
379 <label>Activity From</label>
380 <input id="fromDate" name="fromDate" class="form-control gj-textbox-md-rev newdatepicker01" value=${startDate}>
381 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
382 </div>
383 <#else>
384 <div class="form-group">
385 <label>Activity From</label>
386 <input id="fromDate" name="fromDate" class="form-control gj-textbox-md-rev newdatepicker01" placeholder="">
387 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
388 </div>
389 </#if>
390 </div>
391 <div class="col-md-2">
392 <#if request.getParameter("toDate")??>
393 <div class="form-group">
394 <label>Activity To</label>
395 <input id="toDate" name="toDate" class="form-control gj-textbox-md-rev newdatepicker02" value=${endDate}>
396 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
397 </div>
398 <#else>
399 <div class="form-group">
400 <label>Activity To</label>
401 <input id="toDate" name="toDate" class="form-control gj-textbox-md-rev newdatepicker02" placeholder="">
402 <!--<small id="emailHelp" class="form-text text-muted"></small>-->
403 </div>
404 </#if>
405 </div>
406 <div class="col-md-2">
407 <div class="form-group">
408 <label>Activity Type</label>
409 <select name="kind" id="kind" class="form-control">
410 <option>Select..</option>
411 <option value="2">Training Course</option>
412 <option value="1">workshop training</option>
413 <option value="3">Online webex</option>
414 </select>
415 </div>
416 </div>
417 <div class="col-md-2">
418 <label class="helper"></label>
419 <button type="submit" class="btn btn-blue w100" >Search</button>
420 </div>
421 <div class="col-md-2">
422 <label class="helper"></label>
423 <button type="button" class="btn btn-white w100" id="cancelButton">Clear</button>
424 </div>
425 </div>
426 </form>
427 <div class="row mt-5">
428 <div class="col-md-12 table-responsive">
429 <table id="datatable01" class="display" style="width:100%">
430 <thead>
431 <tr>
432 <th>Activity Title</th>
433 <th>Activity Type</th>
434 <th>From Activity Date</th>
435 <th class="hideOnMobile">To Activity Date</th>
436 <th class="hideOnMobile">Governorate</th>
437 <th>Show</th>
438 </tr>
439 </thead>
440 <#if themeDisplay.getURLCurrent()?contains("fromDate")>
441 <#if request.getParameter("fromDate")??><#assign startDate = request.getParameter("fromDate") /> </#if> <#if request.getParameter("toDate")??>
442 <#assign endDate = request.getParameter("toDate") /> </#if> <#if request.getParameter("title")??> <#assign title = request.getParameter("title") /> </#if> <#if request.getParameter("kind")??> <#assign kind = request.getParameter("kind") /> </#if> </#if>
443 <tbody> <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
444 <#list entries as curEntry> <#assign article = curEntry.getAssetRenderer().getArticle() /> <#if (curEntry.getAssetRenderer().getArticle())??>
445 <#assign structKey = curEntry.getAssetRenderer().getArticle().getDDMStructureKey()/> <#assign docXml = saxReaderUtil.read(curEntry.getAssetRenderer().getArticle().getContent()) /> <#assign eventDate = docXml.valueOf("//dynamic-element[@name='date']/dynamic-content/text()")/> <#assign eventTitle = docXml.valueOf("//dynamic-element[@name='title']/dynamic-content/text()")/> <#assign eventType = docXml.valueOf("//dynamic-element[@name='kind']/dynamic-content/text()")/> <#assign eventTypeDropdown = docXml.valueOf("//dynamic-element[@name='eventType1']/dynamic-content/text()")/> <#assign eventDate_Data = getterUtil.getString(eventDate)>
446 <#if validator.isNotNull(eventDate_Data)> <#assign eventDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", eventDate_Data, locale)> </#if>
447
448 <#assign speciality = docXml.valueOf("//dynamic-element[@name='speciality']/dynamic-content/text()")/>
449 <#if request.getParameter("spec")??>
450 <#assign spec = request.getParameter("spec") />
451 <#if spec == speciality>
452
453 <#if !themeDisplay.getURLCurrent()?contains("fromDate")> ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)} </#if> <#if title?has_content && eventTitle?contains(title)> ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)} </#if> <#if ((startDate?has_content) && eventDate_DateObj?date gte startDate?date("MM/dd/yyyy")) && (eventDate_DateObj?date lte endDate?date("MM/dd/yyyy"))> ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)} </#if>
454 <#if (kind?has_content) && (eventTypeDropdown == kind)> ${journalArticleLocalService.getArticleContent(article,"321238", "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)}
455 </#if>
456 </#if>
457 </#if>
458 </#if> </#list> </tbody>
459 </table>
460 </div>
461 </div>
462</div>
463</#if>