<#-- Get the demand_type from a given id demand type --> <#function getDemandType demand_types_list id_demand_type> <#if demand_types_list?? && demand_types_list?has_content> <#list demand_types_list as demand_type> <#if demand_type.idDemandType?string = id_demand_type> <#return demand_type> <#function getBgColor label > <#assign color = 'F2F6FF'/> <#if label?contains("TERM") || label?contains("ACQUI") > <#assign color = 'F2F6FF'/> <#elseif label?contains("COMPL") || label?contains("RÉGL") || label?contains("REGL") > <#assign color = 'FFFAE6'/> <#elseif label?contains("COUR")> <#assign color = 'F2F6FF'/> <#elseif label?contains("ANNUL")> <#assign color = 'F2F6FF'/> <#return 'background-color:#'+ color +' !important;'/> <#function getColorStatus label > <#assign color = '071F32'/> <#if label?contains("TERM") || label?contains("ACQUI") > <#assign color = '3AE932'/> <#elseif label?contains("COMPL") || label?contains("RÉGL") || label?contains("REGL") > <#assign color = 'E22C3F'/> <#elseif label?contains("COUR")> <#assign color = 'E4AB73'/> <#elseif label?contains("ANNUL")> <#assign color = '828E98'/> <#return 'color:#'+ color +' !important;'/> <#macro tabDemands listDemandDashboard class> <@cTable themed=false caption='Liste des demandes'> <@cThead> <@cTr> <@cTh>Demandes <@cTh class='status'>#i18n{crm.crm.columnStatus} <@cTh>Date de mise à jour <@cTh> <@cTbody> <#list listDemandDashboard as demandDashboard> <#assign demand = demandDashboard.demand> <#if getDemandType( demand_types_list, demand.typeId )?has_content><#assign demand_type = getDemandType( demand_types_list, demand.typeId)> <#if demand_type??> <@cTr id="${class}-${(demand.UID)!}" class="${class} bg-content" params='data-id="${(demand.UID)!}" data-type-id="${(demand.typeId)!}" style="${getBgColor(demandDashboard.status?upper_case)}"'> <@cTd params='data-label="Type : "' nospan=true> ${(demand_type.label)!} <#if demandDashboard.listNotification??> <#list demandDashboard.listNotification?sort_by('date') as notification>

${(notification.date?number_to_date?string["dd.MM.yyyy"])!} - ${(notification.myDashboardNotification.subject)!} <#else>

Aucune notification !

<@cTd params='data-label="Statut : " style="${getColorStatus(demandDashboard.status?upper_case)}"' class='status' nospan=true> ${(demandDashboard.status)!} <@cTd class='pe-5' params='data-label="Date :"' nospan=true> <@cSection type='div' class='d-flex flex-column justify-content-center'> ${(demand.modifyDate?number_to_date?string["dd.MM.yyyy"])!} initié le ${(demand.modifyDate?number_to_date?string["dd.MM.yyyy"])!} <@cTd class='pe-5' params='data-label="Date :"' nospan=true> <#if demand_type.url?has_content><@cLink href='${demand_type.url!}' label='Accéder
au service' class='show-target fs-sm url-sn' target='_blank' showTarget=true /> <#if demandDashboard.listNotification??> <#list demandDashboard.listNotification?sort_by('date') as notification> <@cTr class="sub msg-${notification.demand.UID!} notification-content" id="content-${(notification.demand.UID)!}" params='style="display:none"'> <@cTd colspan="4" params='style="border-inline: 1px solid gray;"'> <@div class="d-flex align-items-start mb-2" params='style="gap:1.5rem"'> <@div class="media-body text-left">

${(notification.date?number_to_date?string["dd.MM.yyyy"])!} - ${(notification.myDashboardNotification.subject)!}

${(notification.myDashboardNotification.message)!}