[#setting locale=themeDisplay.getLanguageId() /] [#setting date_format="yyyy-MM-dd" /] [#assign claim_status_style = { "claimed": "ml-3 label label-tonal-info ml-2", "unclaimed": "ml-3 label label-tonal-warning ml-2" } /] [#assign request_status_style = { "active": "label label-tonal-info ml-2", "submitted": "label label-tonal-warning ml-2", "approved": "label label-tonal-success ml-2", "expired": "label label-tonal-danger ml-2" } /] [#assign mdf_request_id = (request.getAttribute("INFO_ITEM").objectEntryId)! /] [#function days_difference_from_now date] [#return (date?long - .now?long) / (1000 * 60 * 60 * 24) /] [/#function] [#function get_event_fields activity] [#return [{ "title": "Activity Description", "value": (activity.description)!"-"}, { "title": "Venue Name", "value": (activity.venueName)!"-" }, { "title": "Liferay Branding", "value": (activity.liferayBranding)!"-" }, { "title": "Liferay Participation / Requirements", "value": (activity.liferayParticipationRequirements)!"-" }, { "title": "Source and Size of Invitee List", "value": (activity.sourceAndSizeOfInviteeList)!"-" }, { "title": "Activity Promotion", "value": (activity.activityPromotion)!"-" }] /] [/#function] [#function get_digital_marketing_fields activity] [#return [{ "title": "Overall message, content or CTA", "value": (activity.overallMessageContentCTA)!"-"}, { "title": "Specific sites to be used", "value": (activity.specificSites)!"-" }, { "title": "Keywords for PPC campaigns", "value": (activity.keywordsForPPCCampaigns)!"-" }, { "title": "Ad (any size/type)", "value": (activity.ad)!"-" }, { "title": "Do you require any assets from Liferay?", "value": (activity.assetsLiferayRequired?string("Yes", "No")!"-") }, { "title": "How will the Liferay brand be used in the campaign?", "value": (activity.howLiferayBrandUsed)!"-" }] /] [/#function] [#function get_content_marketing_fields activity] [#return [{ "title": "Will this content be gated and have a landing page?", "value": (activity.gatedLandingPage?string("Yes", "No"))!"-"}, { "title": "Primary theme or message of your content", "value": (activity.primaryThemeOrMessage)!"-" }, { "title": "Goal of Content", "value": (activity.goalOfContent)!"-" }, { "title": "Are you hiring an outside writer or agency to prepare the content?", "value": (activity.hiringOutsideWriterOrAgency?string("Yes", "No"))!"-" }] /] [/#function] [#function get_miscellaneous_marketing_fields activity] [#return [{ "title": "Marketing activity", "value": (activity.marketingActivity)!"-"}] /] [/#function] [#function get_fields_by_activity activity] [#assign fields = { "prmtact001": get_event_fields(activity), "prmtact002": get_digital_marketing_fields(activity), "prmtact003": get_content_marketing_fields(activity), "prmtact004": get_miscellaneous_marketing_fields(activity) }] [#return fields[activity.typeActivity.key] /] [/#function] [#function get_activity_fields activity] [#return [{ "title": "Activity name", "value": (activity.name)!"-" }, { "title": "Type of Activity", "value": (activity.typeActivity.name)!"-" }, { "title": "Tactic", "value": (activity.tactic.name)!"-" }] + get_fields_by_activity(activity) + [{ "title": "Start Date", "value": (activity.startDate?date?string.short)!"-" }, { "title": "End Date", "value": (activity.endDate?date?string.short)!"-" }] /] [/#function] [#macro table title items]
[#list items as item] [/#list]

${title}

${item.title}

${item.value}

[/#macro] [#macro leads_table activity] [#assign items = [{"title": "Is a lead list an outcome of this activity?", "value": activity.leadGenerated?string("Yes", "No") }, { "title": "Target # of Leads", "value": activity.targetOfLeads }, { "title": "Lead Follow Up strategy", "value": activity.leadFollowUpStrategies }, { "title": "Details on Lead Follow Up", "value": activity.detailsLeadFollowUp }] /] [@table title="Lead List" items=items /] [/#macro] [#macro campaign_table activity] [@table title="Campaign Activity" items=get_activity_fields(activity) /] [/#macro] [#macro budgets_table budgets currency_key="USD"] [#assign items = budgets?map(budget -> {"title": budget.expense.name, "value": budget.cost?number?string["ยค,##0.00;; currencyCode=${currency_key}"]}) /] [@table title="Budget Breakdown" items=items /] [/#macro] [#macro range_date end_date start_date]
${start_date?date?string("MMM dd")} - ${end_date?date?string.medium}
[/#macro] [#macro claim_status activity_claims] [#assign claim_status_content = activity_claims?filter(activity_claim -> activity_claim.r_mdfClmToMDFClmActs_c_mdfClaim.mdfClaimStatus.key != "draft")?has_content?string("claimed", "unclaimed") /]
Claim Status: ${claim_status_content?capitalize}
[/#macro] [#macro request_status activity_status end_date]

Request Status: ${activity_status.name} [#if end_date?has_content] [#assign request_date = days_difference_from_now(end_date) /] ${(request_date > 0)?then(request_date?ceiling, 0)} days left to claim [/#if]

[/#macro] [#if mdf_request_id?has_content] [#assign activities = restClient.get("/c/mdfrequests/${mdf_request_id}/mdfReqToActs?nestedFields=actToBgts,actToMDFClmActs,r_mdfClmToMDFClmActs_c_mdfClaimId&nestedFieldsDepth=3").items /] [#list activities as activity]
[@campaign_table activity=activity /] [@budgets_table budgets=activity.actToBgts currency_key=(activity.currency.key)!"USD" /] [@leads_table activity=activity /]
[/#list] [#else]

To use this fragment either place it on a Display Page Template to see which attributes are available from request.getAttribute("INFO_ITEM").

It's important to note that this will only display the attributes of a display page when you view the published display page not when you are editing it.

[/#if]