<%- include('_header'); -%>

<% if (isCreate) { %> Create a New Burial Site <% } else { %> <%= burialSite.burialSiteName %> <% } %>

<% if (!isCreate) { %> <%= burialSite.burialSiteName %> <% } %>
<% if (isCreate) { %> Cancel <% } else { %> <% } %>
" />
<% const burialSiteNameSegments = configFunctions.getConfigProperty('settings.burialSites.burialSiteNameSegments') %>
<% for (let segmentIndex = 1; segmentIndex <= 5; segmentIndex += 1) { %> <% const segmentIndexString = segmentIndex.toString(); const segment = burialSiteNameSegments.segments[segmentIndexString]; %> <% if (segment?.isAvailable ?? false) { %> <% if (segmentIndex !== 1 && (burialSiteNameSegments.separator ?? '') !== '') { %>

<%= burialSiteNameSegments.separator %>

<% } %> <% if ((segment.prefix ?? '') !== '') { %>

<%= segment.prefix %>

<% } %>
<%= segmentIndex === 1 ? ' accesskey="f"' : '' %> <%= (isCreate && segmentIndex === 1 ? " autofocus" : "") %> />
<% if ((segment.suffix ?? '') !== '') { %>

<%= segment.suffix %>

<% } %> <% } %> <% } %>
<% if (isCreate) { %>

Select the burial site type to load the available fields.

<% } else if (burialSite.burialSiteFields.length === 0) { %>

The current burial site type has no additional fields.

<% } else { %> <% let burialSiteTypeFieldIds = ""; %> <% for (const burialSiteField of burialSite.burialSiteFields) { %> <% burialSiteTypeFieldIds += "," + burialSiteField.burialSiteTypeFieldId; %>
<% if (burialSiteField.fieldType === 'select' || (burialSiteField.fieldValues ?? '') !== "") { %> <% const fieldValues = burialSiteField.fieldValues.split("\n"); let valueFound = false; %>
<% } else { %> pattern="<%= burialSiteField.pattern %>" <% } %> minlength="<%= burialSiteField.minLength %>" maxlength="<%= burialSiteField.maxLength %>" <%= burialSiteField.isRequired ? " required" : "" %> /> <% } %>
<% } %> <% } %>

Geographic Location

Image

<% if (isCreate) { %>

Additional options will be available after the record has been created.

<% } else { %>

Comments

<% let activeCount = 0 let pastCount = 0 for (const contract of burialSite.contracts) { if (contract.contractEndDate && contract.contractEndDate < dateTimeFunctions.dateToInteger(new Date())) { pastCount++ } else { activeCount++ } } %>

Contracts

<% if (activeCount > 0) { %>
<%= activeCount %> Active
<% } %> <% if (pastCount > 0) { %>
<%= pastCount %> Past
<% } %>
<% if (burialSite.contracts.length > 0) { %>
<% } %>
<% if (burialSite.contracts.length === 0) { %>

There are no contracts associated with this burial site.

<% } else { %> <% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %> <% for (const contract of burialSite.contracts) { %> <% const isActive = !(contract.contractEndDate && contract.contractEndDate < currentDate); %> "> <% } %>
  Contract Type Contract Date End Date Interments
<% if (isActive) { %> <% } else { %> <% } %> <%= contract.contractType %>
#<%= contract.contractId %>
<%= contract.contractStartDateString %> <% if (contract.contractEndDate) { %> <%= contract.contractEndDateString %> <% } else { %> (No End Date) <% } %> <% if (contract.contractInterments.length === 0) { %> (No Interments) <% } else { %> <% for (const interment of contract.contractInterments) { %> <%= interment.deceasedName %> <% } %> <% } %>
<% } %>
<% } %> <%- include('_footerA'); -%> <% if (!isCreate) { %> <% } %> <%- include('_footerB'); -%>