Skip to content

Commit

Permalink
Mostrati i dettagli dei bandi figli nella visualizzazione del bando p…
Browse files Browse the repository at this point in the history
…adre
  • Loading branch information
mspasiano committed Feb 17, 2025
1 parent 77cd313 commit 52acab5
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ public Map<String, Object> addToModel(Map<String, String[]> paramz, HttpServletR
criteria.add(Restrictions.inFolder(folder.getId()));
ItemIterable<QueryResult> attachments = criteria.executeQuery(currentCMISSession, false, currentCMISSession.getDefaultContext()).getPage(Integer.MAX_VALUE);
final boolean macroCall = callService.isMacroCall(folder);
List<String> childs = Collections.emptyList();
List<CmisObject> childs = Collections.emptyList();
if (macroCall) {
childs = StreamSupport.stream(folder.getChildren().spliterator(), false)
.filter(cmisObject -> cmisObject.getType().equals(folder.getType()))
.map(cmisObject -> cmisObject.<String>getPropertyValue(JCONONPropertyIds.CALL_CODICE.value()))
.sorted()
.sorted((t1, t2) ->
t1.<String>getPropertyValue(JCONONPropertyIds.CALL_CODICE.value()).compareTo(
t2.<String>getPropertyValue(JCONONPropertyIds.CALL_CODICE.value())
))
.collect(Collectors.toList());
}
return Stream.of(
Expand All @@ -111,6 +113,7 @@ public Map<String, Object> addToModel(Map<String, String[]> paramz, HttpServletR
new AbstractMap.SimpleEntry<>("isMacroCall", macroCall),
new AbstractMap.SimpleEntry<>("childs", childs),
new AbstractMap.SimpleEntry<>("isActive", callService.isBandoInCorso(folder)),
new AbstractMap.SimpleEntry<>("isFuture", callService.isBandoFuturo(folder)),
new AbstractMap.SimpleEntry<>("attachments",
StreamSupport.stream(attachments.spliterator(), false)
.map(queryResult -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,14 @@ public boolean isBandoInCorso(Folder call) {
return isBandoInCorso;
}

public boolean isBandoFuturo(Folder call) {
return Optional.ofNullable(call.getPropertyValue(JCONONPropertyIds.CALL_DATA_INIZIO_INVIO_DOMANDE.value()))
.filter(Calendar.class::isInstance)
.map(Calendar.class::cast)
.map(calendar -> calendar.after(new GregorianCalendar()))
.orElse(Boolean.FALSE);
}

public void isBandoInCorso(Folder call, CMISUser loginUser) {
if (!isBandoInCorso(call) && !loginUser.isAdmin())
throw new ClientMessageException("message.error.bando.scaduto");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ label.attivi=Active
label.scaduti=Expired
label.call.active=Active
label.call.expired=Expired
label.call.future=Future
label.tutti=All
label.filter=Filter
label.h3.call=Available calls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ actions.disabilita_commissario=Disabilita
title.call.active=Bandi Attivi
label.call.active=Aperto
label.call.expired=Scaduto

label.call.future=Non ancora attivo
label.pec.email=Inserire indirizzo PEC di trasmissione
label.pec.email.hint=Inserire un indirizzo PEC valido di uso corrente della propria Struttura o Istituto CNR es. acronimoIst/[email protected]
label.pec.password=Password della PEC di trasmissione
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
<#if isActive>
<h3 class="alert alert-success">${message('label.call.active')}</h3>
<#else>
<h3 class="alert alert-danger">${message('label.call.expired')}</h3>
<#if isFuture>
<h3 class="alert alert-warning">${message('label.call.future')}</h3>
<#else>
<h3 class="alert alert-danger">${message('label.call.expired')}</h3>
</#if>
</#if>
<div class="well">
<h4 class="text-info">${message('label.jconon_call_descrizione')}</h4>
Expand Down Expand Up @@ -63,7 +67,25 @@
<hr>
<ol>
<#list childs as child>
<li><a href="${contextURL}/call-detail?callCode=${child}">${child}</a></li>
<#assign codice = child.getPropertyValue("jconon_call:codice")>
<li>
<p>
<span>${message('label.jconon_call_codice')}:</span>
<a href="${contextURL}/call-detail?callCode=${codice}">${codice}</a>
</p>
<#if child.getPropertyValue("jconon_call:sede")??>
<p>
<span>${message('label.jconon_call_sede')}:</span>
<b><#if locale_suffix != 'it' && child['jconon_call:sede_en']??>${child['jconon_call:sede_en']}<#else>${child['jconon_call:sede']}</#if></b>
</p>
</#if>
<#if child.getPropertyValue("jconon_call_aspect_ad_smr:descrizione_ad_smr")??>
<p>
<span>${message('label.th.jconon_bando_descrizione_ad_smr')}:</span>
<b>${child.getPropertyValue("jconon_call_aspect_ad_smr:descrizione_ad_smr")}</b>
</p>
</#if>
</li>
</#list>
</ol>
</div>
Expand Down

0 comments on commit 52acab5

Please sign in to comment.