remove in context reports
parent
a43e5e8401
commit
3a0b8a2ca1
|
|
@ -21,6 +21,19 @@ const lotOccupancyIdAlias = occupancyCamelCase + 'Id';
|
||||||
const occupancyTypeAlias = occupancyCamelCase + 'Type';
|
const occupancyTypeAlias = occupancyCamelCase + 'Type';
|
||||||
const occupancyStartDateAlias = occupancyCamelCase + 'StartDate';
|
const occupancyStartDateAlias = occupancyCamelCase + 'StartDate';
|
||||||
const occupancyEndDateAlias = occupancyCamelCase + 'EndDate';
|
const occupancyEndDateAlias = occupancyCamelCase + 'EndDate';
|
||||||
|
const occupantCamelCase = camelCase(configFunctions.getProperty('aliases.occupant'));
|
||||||
|
const lotOccupantIndexAlias = occupantCamelCase + 'Index';
|
||||||
|
const lotOccupantTypeAlias = occupantCamelCase + 'Type';
|
||||||
|
const occupantNameAlias = occupantCamelCase + 'Name';
|
||||||
|
const occupantAddress1Alias = occupantCamelCase + 'Address1';
|
||||||
|
const occupantAddress2Alias = occupantCamelCase + 'Address2';
|
||||||
|
const occupantCityAlias = occupantCamelCase + 'City';
|
||||||
|
const occupantProvinceAlias = occupantCamelCase + 'Province';
|
||||||
|
const occupantPostalCodeAlias = occupantCamelCase + 'PostalCode';
|
||||||
|
const occupantPhoneNumberAlias = occupantCamelCase + 'PhoneNumber';
|
||||||
|
const occupantEmailAddressAlias = occupantCamelCase + 'EmailAddress';
|
||||||
|
const occupantCommentTitleAlias = occupantCamelCase + 'CommentTitle';
|
||||||
|
const occupantCommentAlias = occupantCamelCase + 'Comment';
|
||||||
export async function getReportData(reportName, reportParameters = {}) {
|
export async function getReportData(reportName, reportParameters = {}) {
|
||||||
let sql;
|
let sql;
|
||||||
const sqlParameters = [];
|
const sqlParameters = [];
|
||||||
|
|
@ -137,6 +150,26 @@ export async function getReportData(reportName, reportParameters = {}) {
|
||||||
sql = 'select * from LotOccupancyOccupants';
|
sql = 'select * from LotOccupancyOccupants';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'lotOccupancyOccupants-byLotOccupancyId': {
|
||||||
|
sql = `select o.lotOccupantIndex as ${lotOccupantIndexAlias},
|
||||||
|
t.lotOccupantType as ${lotOccupantTypeAlias},
|
||||||
|
o.occupantName as ${occupantNameAlias},
|
||||||
|
o.occupantAddress1 as ${occupantAddress1Alias},
|
||||||
|
o.occupantAddress2 as ${occupantAddress2Alias},
|
||||||
|
o.occupantCity as ${occupantCityAlias},
|
||||||
|
o.occupantProvince as ${occupantProvinceAlias},
|
||||||
|
o.occupantPostalCode as ${occupantPostalCodeAlias},
|
||||||
|
o.occupantPhoneNumber as ${occupantPhoneNumberAlias},
|
||||||
|
o.occupantEmailAddress as ${occupantEmailAddressAlias},
|
||||||
|
t.occupantCommentTitle as ${occupantCommentTitleAlias},
|
||||||
|
o.occupantComment as ${occupantCommentAlias}
|
||||||
|
from LotOccupancyOccupants o
|
||||||
|
left join LotOccupantTypes t on o.lotOccupantTypeId = t.lotOccupantTypeId
|
||||||
|
where o.recordDelete_timeMillis is null
|
||||||
|
and o.lotOccupancyId = ?`;
|
||||||
|
sqlParameters.push(reportParameters.lotOccupancyId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'lotOccupancyTransactions-all': {
|
case 'lotOccupancyTransactions-all': {
|
||||||
sql = 'select * from LotOccupancyTransactions';
|
sql = 'select * from LotOccupancyTransactions';
|
||||||
break;
|
break;
|
||||||
|
|
@ -187,6 +220,20 @@ export async function getReportData(reportName, reportParameters = {}) {
|
||||||
sql = 'select * from WorkOrderMilestones';
|
sql = 'select * from WorkOrderMilestones';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'workOrderMilestones-byWorkOrderId': {
|
||||||
|
sql = `select t.workOrderMilestoneType,
|
||||||
|
m.workOrderMilestoneDate,
|
||||||
|
m.workOrderMilestoneTime,
|
||||||
|
m.workOrderMilestoneDescription,
|
||||||
|
m.workOrderMilestoneCompletionDate,
|
||||||
|
m.workOrderMilestoneCompletionTime
|
||||||
|
from WorkOrderMilestones m
|
||||||
|
left join WorkOrderMilestoneTypes t on m.workOrderMilestoneTypeId = t.workOrderMilestoneTypeId
|
||||||
|
where m.recordDelete_timeMillis is null
|
||||||
|
and m.workOrderId = ?`;
|
||||||
|
sqlParameters.push(reportParameters.workOrderId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'fees-all': {
|
case 'fees-all': {
|
||||||
sql = 'select * from Fees';
|
sql = 'select * from Fees';
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,22 @@ const occupancyTypeAlias = occupancyCamelCase + 'Type'
|
||||||
const occupancyStartDateAlias = occupancyCamelCase + 'StartDate'
|
const occupancyStartDateAlias = occupancyCamelCase + 'StartDate'
|
||||||
const occupancyEndDateAlias = occupancyCamelCase + 'EndDate'
|
const occupancyEndDateAlias = occupancyCamelCase + 'EndDate'
|
||||||
|
|
||||||
|
const occupantCamelCase = camelCase(
|
||||||
|
configFunctions.getProperty('aliases.occupant')
|
||||||
|
)
|
||||||
|
const lotOccupantIndexAlias = occupantCamelCase + 'Index'
|
||||||
|
const lotOccupantTypeAlias = occupantCamelCase + 'Type'
|
||||||
|
const occupantNameAlias = occupantCamelCase + 'Name'
|
||||||
|
const occupantAddress1Alias = occupantCamelCase + 'Address1'
|
||||||
|
const occupantAddress2Alias = occupantCamelCase + 'Address2'
|
||||||
|
const occupantCityAlias = occupantCamelCase + 'City'
|
||||||
|
const occupantProvinceAlias = occupantCamelCase + 'Province'
|
||||||
|
const occupantPostalCodeAlias = occupantCamelCase + 'PostalCode'
|
||||||
|
const occupantPhoneNumberAlias = occupantCamelCase + 'PhoneNumber'
|
||||||
|
const occupantEmailAddressAlias = occupantCamelCase + 'EmailAddress'
|
||||||
|
const occupantCommentTitleAlias = occupantCamelCase + 'CommentTitle'
|
||||||
|
const occupantCommentAlias = occupantCamelCase + 'Comment'
|
||||||
|
|
||||||
export async function getReportData(
|
export async function getReportData(
|
||||||
reportName: string,
|
reportName: string,
|
||||||
reportParameters: ReportParameters = {}
|
reportParameters: ReportParameters = {}
|
||||||
|
|
@ -179,6 +195,27 @@ export async function getReportData(
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'lotOccupancyOccupants-byLotOccupancyId': {
|
||||||
|
sql = `select o.lotOccupantIndex as ${lotOccupantIndexAlias},
|
||||||
|
t.lotOccupantType as ${lotOccupantTypeAlias},
|
||||||
|
o.occupantName as ${occupantNameAlias},
|
||||||
|
o.occupantAddress1 as ${occupantAddress1Alias},
|
||||||
|
o.occupantAddress2 as ${occupantAddress2Alias},
|
||||||
|
o.occupantCity as ${occupantCityAlias},
|
||||||
|
o.occupantProvince as ${occupantProvinceAlias},
|
||||||
|
o.occupantPostalCode as ${occupantPostalCodeAlias},
|
||||||
|
o.occupantPhoneNumber as ${occupantPhoneNumberAlias},
|
||||||
|
o.occupantEmailAddress as ${occupantEmailAddressAlias},
|
||||||
|
t.occupantCommentTitle as ${occupantCommentTitleAlias},
|
||||||
|
o.occupantComment as ${occupantCommentAlias}
|
||||||
|
from LotOccupancyOccupants o
|
||||||
|
left join LotOccupantTypes t on o.lotOccupantTypeId = t.lotOccupantTypeId
|
||||||
|
where o.recordDelete_timeMillis is null
|
||||||
|
and o.lotOccupancyId = ?`
|
||||||
|
sqlParameters.push(reportParameters.lotOccupancyId)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
case 'lotOccupancyTransactions-all': {
|
case 'lotOccupancyTransactions-all': {
|
||||||
sql = 'select * from LotOccupancyTransactions'
|
sql = 'select * from LotOccupancyTransactions'
|
||||||
break
|
break
|
||||||
|
|
@ -241,6 +278,21 @@ export async function getReportData(
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'workOrderMilestones-byWorkOrderId': {
|
||||||
|
sql = `select t.workOrderMilestoneType,
|
||||||
|
m.workOrderMilestoneDate,
|
||||||
|
m.workOrderMilestoneTime,
|
||||||
|
m.workOrderMilestoneDescription,
|
||||||
|
m.workOrderMilestoneCompletionDate,
|
||||||
|
m.workOrderMilestoneCompletionTime
|
||||||
|
from WorkOrderMilestones m
|
||||||
|
left join WorkOrderMilestoneTypes t on m.workOrderMilestoneTypeId = t.workOrderMilestoneTypeId
|
||||||
|
where m.recordDelete_timeMillis is null
|
||||||
|
and m.workOrderId = ?`
|
||||||
|
sqlParameters.push(reportParameters.workOrderId)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
case 'fees-all': {
|
case 'fees-all': {
|
||||||
sql = 'select * from Fees'
|
sql = 'select * from Fees'
|
||||||
break
|
break
|
||||||
|
|
|
||||||
|
|
@ -411,26 +411,32 @@
|
||||||
|
|
||||||
<% if (!isCreate) { %>
|
<% if (!isCreate) { %>
|
||||||
<div class="panel mt-5">
|
<div class="panel mt-5">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div class="level is-mobile">
|
<div class="level is-mobile">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="title is-4">
|
<h2 class="title is-4">
|
||||||
<%= configFunctions.getProperty("aliases.occupants") %>
|
<%= configFunctions.getProperty("aliases.occupants") %>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="level-right">
|
|
||||||
<div class="level-item">
|
|
||||||
<button class="button is-small is-success is-hidden-print" id="button--addOccupant" type="button">
|
|
||||||
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
|
||||||
<span>Add <%= configFunctions.getProperty("aliases.occupant") %></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<div class="level-item">
|
||||||
|
<button class="button is-small is-success is-hidden-print" id="button--addOccupant" type="button">
|
||||||
|
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
||||||
|
<span>Add <%= configFunctions.getProperty("aliases.occupant") %></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="level-item">
|
||||||
|
<a class="button is-link is-small is-hidden-print has-text-weight-normal" href="<%= urlPrefix %>/reports/lotOccupancyOccupants-byLotOccupancyId/?lotOccupancyId=<%= lotOccupancy.lotOccupancyId %>" target="_blank" download>
|
||||||
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
||||||
|
<span>Export</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-block is-block" id="container--lotOccupancyOccupants"></div>
|
</div>
|
||||||
|
<div class="panel-block is-block" id="container--lotOccupancyOccupants"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
|
|
|
||||||
|
|
@ -144,67 +144,81 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<h2 class="panel-heading">
|
<div class="panel-heading">
|
||||||
<%= configFunctions.getProperty("aliases.occupants") %>
|
<div class="level is-mobile">
|
||||||
</h2>
|
<div class="level-left">
|
||||||
<div class="panel-block is-block">
|
<div class="level-item">
|
||||||
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
|
<h2 class="title is-4"><%= configFunctions.getProperty("aliases.occupants") %></h2>
|
||||||
<div class="message is-warning">
|
|
||||||
<p class="message-body">
|
|
||||||
There are no <%= configFunctions.getProperty("aliases.occupants").toLowerCase() %>
|
|
||||||
associated with this record.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<% } else { %>
|
</div>
|
||||||
<table class="table is-fullwidth is-striped is-hoverable">
|
<div class="level-right">
|
||||||
<thead>
|
<div class="level-item">
|
||||||
<tr>
|
<a class="button is-link is-small is-hidden-print has-text-weight-normal" href="<%= urlPrefix %>/reports/lotOccupancyOccupants-byLotOccupancyId/?lotOccupancyId=<%= lotOccupancy.lotOccupancyId %>" target="_blank" download>
|
||||||
<th><%= configFunctions.getProperty("aliases.occupant") %></th>
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
||||||
<th>Address</th>
|
<span>Export</span>
|
||||||
<th>Other Contact</th>
|
</a>
|
||||||
<th>Comment</th>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%= lotOccupancyOccupant.occupantName %><br />
|
|
||||||
<span class="tag">
|
|
||||||
<i class="fas fa-fw fa-<%= lotOccupancyOccupant.fontAwesomeIconClass %>" aria-hidden="true"></i>
|
|
||||||
<span class="ml-1"><%= lotOccupancyOccupant.lotOccupantType %></span>
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<% if (lotOccupancyOccupant.occupantAddress1) { %>
|
|
||||||
<%= lotOccupancyOccupant.occupantAddress1 %><br />
|
|
||||||
<% } %>
|
|
||||||
<% if (lotOccupancyOccupant.occupantAddress2) { %>
|
|
||||||
<%= lotOccupancyOccupant.occupantAddress2 %><br />
|
|
||||||
<% } %>
|
|
||||||
<% if (lotOccupancyOccupant.occupantCity) { %>
|
|
||||||
<%= lotOccupancyOccupant.occupantCity %>,
|
|
||||||
<% } %>
|
|
||||||
<%= lotOccupancyOccupant.occupantProvince %><br />
|
|
||||||
<%= lotOccupancyOccupant.occupantPostalCode %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<% if (lotOccupancyOccupant.occupantPhoneNumber) { %>
|
|
||||||
<%= lotOccupancyOccupant.occupantPhoneNumber %><br />
|
|
||||||
<% } %>
|
|
||||||
<%= lotOccupancyOccupant.occupantEmailAddress %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span data-tooltip="<%= (lotOccupancyOccupant.occupantCommentTitle ?? '') === '' ? 'Comment' : lotOccupancyOccupant.occupantCommentTitle %>">
|
|
||||||
<%= lotOccupancyOccupant.occupantComment %>
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% } %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel-block is-block">
|
||||||
|
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
|
||||||
|
<div class="message is-warning">
|
||||||
|
<p class="message-body">
|
||||||
|
There are no <%= configFunctions.getProperty("aliases.occupants").toLowerCase() %>
|
||||||
|
associated with this record.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<% } else { %>
|
||||||
|
<table class="table is-fullwidth is-striped is-hoverable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><%= configFunctions.getProperty("aliases.occupant") %></th>
|
||||||
|
<th>Address</th>
|
||||||
|
<th>Other Contact</th>
|
||||||
|
<th>Comment</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= lotOccupancyOccupant.occupantName %><br />
|
||||||
|
<span class="tag">
|
||||||
|
<i class="fas fa-fw fa-<%= lotOccupancyOccupant.fontAwesomeIconClass %>" aria-hidden="true"></i>
|
||||||
|
<span class="ml-1"><%= lotOccupancyOccupant.lotOccupantType %></span>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<% if (lotOccupancyOccupant.occupantAddress1) { %>
|
||||||
|
<%= lotOccupancyOccupant.occupantAddress1 %><br />
|
||||||
|
<% } %>
|
||||||
|
<% if (lotOccupancyOccupant.occupantAddress2) { %>
|
||||||
|
<%= lotOccupancyOccupant.occupantAddress2 %><br />
|
||||||
|
<% } %>
|
||||||
|
<% if (lotOccupancyOccupant.occupantCity) { %>
|
||||||
|
<%= lotOccupancyOccupant.occupantCity %>,
|
||||||
|
<% } %>
|
||||||
|
<%= lotOccupancyOccupant.occupantProvince %><br />
|
||||||
|
<%= lotOccupancyOccupant.occupantPostalCode %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<% if (lotOccupancyOccupant.occupantPhoneNumber) { %>
|
||||||
|
<%= lotOccupancyOccupant.occupantPhoneNumber %><br />
|
||||||
|
<% } %>
|
||||||
|
<%= lotOccupancyOccupant.occupantEmailAddress %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span data-tooltip="<%= (lotOccupancyOccupant.occupantCommentTitle ?? '') === '' ? 'Comment' : lotOccupancyOccupant.occupantCommentTitle %>">
|
||||||
|
<%= lotOccupancyOccupant.occupantComment %>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% } %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if (lotOccupancy.lotOccupancyComments.length > 0) { %>
|
<% if (lotOccupancy.lotOccupancyComments.length > 0) { %>
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,60 @@
|
||||||
<%- include('_header'); -%>
|
<%- include('_header'); -%>
|
||||||
|
|
||||||
<nav class="breadcrumb">
|
<nav class="breadcrumb">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
|
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
|
||||||
<li class="is-active"><a href="#" aria-current="page">
|
<li class="is-active">
|
||||||
<span class="icon is-small"><i class="far fa-map" aria-hidden="true"></i></span>
|
<a href="#" aria-current="page">
|
||||||
<span><%= configFunctions.getProperty("aliases.maps") %></span>
|
<span class="icon is-small"><i class="far fa-map" aria-hidden="true"></i></span>
|
||||||
</a></li>
|
<span><%= configFunctions.getProperty("aliases.maps") %></span>
|
||||||
</ul>
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<h1 class="title is-1">
|
<div class="level is-mobile">
|
||||||
Find a <%= configFunctions.getProperty("aliases.map") %>
|
<div class="level-left">
|
||||||
</h1>
|
<div class="level-item">
|
||||||
|
<h1 class="title is-1">
|
||||||
|
Find a <%= configFunctions.getProperty("aliases.map") %>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<div class="level-item">
|
||||||
|
<a class="button" href="<%= urlPrefix %>/reports/maps-formatted" target="_blank" download>
|
||||||
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
||||||
|
<span>Export</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% if (user.userProperties.canUpdate) { %>
|
<% if (user.userProperties.canUpdate) { %>
|
||||||
<div class="fixed-container is-fixed-bottom-right mx-4 my-4 has-text-right is-hidden-print">
|
<div class="fixed-container is-fixed-bottom-right mx-4 my-4 has-text-right is-hidden-print">
|
||||||
<a class="button is-circle is-primary has-tooltip-left"
|
<a class="button is-circle is-primary has-tooltip-left"
|
||||||
data-tooltip="Create a New <%= configFunctions.getProperty("aliases.map") %>"
|
data-tooltip="Create a New <%= configFunctions.getProperty("aliases.map") %>"
|
||||||
href="<%= urlPrefix %>/maps/new"
|
href="<%= urlPrefix %>/maps/new"
|
||||||
accesskey="n">
|
accesskey="n">
|
||||||
<i class="fas fa-plus" aria-hidden="true"></i>
|
<i class="fas fa-plus" aria-hidden="true"></i>
|
||||||
<span class="sr-only">Create a New <%= configFunctions.getProperty("aliases.map") %></span>
|
<span class="sr-only">Create a New <%= configFunctions.getProperty("aliases.map") %></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<form id="form--searchFilters">
|
<form id="form--searchFilters">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control has-icons-left">
|
<div class="control has-icons-left">
|
||||||
<input class="input" id="searchFilter--map" type="text"
|
<input class="input" id="searchFilter--map" type="text"
|
||||||
placeholder="Search <%= configFunctions.getProperty("aliases.map").toLowerCase() %> name, description, and address"
|
placeholder="Search <%= configFunctions.getProperty("aliases.map").toLowerCase() %> name, description, and address"
|
||||||
accesskey="f" />
|
accesskey="f" />
|
||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<i class="fas fa-search" aria-hidden="true"></i>
|
<i class="fas fa-search" aria-hidden="true"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="container--searchResults"></div>
|
<div id="container--searchResults"></div>
|
||||||
|
|
@ -46,7 +62,7 @@
|
||||||
<%- include('_footerA'); -%>
|
<%- include('_footerA'); -%>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
exports.maps = <%- JSON.stringify(maps) %>;
|
exports.maps = <%- JSON.stringify(maps) %>;
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= urlPrefix %>/javascripts/mapSearch.min.js"></script>
|
<script src="<%= urlPrefix %>/javascripts/mapSearch.min.js"></script>
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -124,93 +124,93 @@
|
||||||
|
|
||||||
<div class="columns is-desktop">
|
<div class="columns is-desktop">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<form id="form--workOrderEdit">
|
<form id="form--workOrderEdit">
|
||||||
<input id="workOrderEdit--workOrderId" name="workOrderId" type="hidden" value="<%= workOrder.workOrderId %>" />
|
<input id="workOrderEdit--workOrderId" name="workOrderId" type="hidden" value="<%= workOrder.workOrderId %>" />
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="panel-block is-block">
|
<div class="panel-block is-block">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<label class="label" for="workOrderEdit--workOrderNumber">Work Order Number</label>
|
<label class="label" for="workOrderEdit--workOrderNumber">Work Order Number</label>
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
<input class="input <%= (isCreate ? "" : " is-readonly") %>" id="workOrderEdit--workOrderNumber" name="workOrderNumber" type="text" value="<%= workOrder.workOrderNumber %>" maxlength="50" readonly accesskey="f" <%= (isCreate ? "" : " required") %> />
|
<input class="input <%= (isCreate ? "" : " is-readonly") %>" id="workOrderEdit--workOrderNumber" name="workOrderNumber" type="text" value="<%= workOrder.workOrderNumber %>" maxlength="50" readonly accesskey="f" <%= (isCreate ? "" : " required") %> />
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock Field">
|
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock Field">
|
||||||
<i class="fas fa-unlock" aria-hidden="true"></i>
|
<i class="fas fa-unlock" aria-hidden="true"></i>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% if (isCreate) { %>
|
|
||||||
<p class="help">Leave work order number blank to autopopulate.</p>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<div class="field">
|
|
||||||
<label class="label" for="workOrderEdit--workOrderTypeId">Work Order Type</label>
|
|
||||||
<div class="control">
|
|
||||||
<div class="select is-fullwidth">
|
|
||||||
<select id="workOrderEdit--workOrderTypeId" name="workOrderTypeId" required <%= (isCreate ? " autofocus" : "") %>>
|
|
||||||
<% if (isCreate && workOrderTypes.length > 1) { %>
|
|
||||||
<option value="">(Select Type)</option>
|
|
||||||
<% } %>
|
|
||||||
<% for (const workOrderType of workOrderTypes) { %>
|
|
||||||
<option value="<%= workOrderType.workOrderTypeId %>" <%= (workOrder.workOrderTypeId === workOrderType.workOrderTypeId ? " selected" : "") %>>
|
|
||||||
<%= workOrderType.workOrderType %>
|
|
||||||
</option>
|
|
||||||
<% } %>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label class="label" for="workOrderEdit--workOrderDescription">Description</label>
|
|
||||||
<div class="control">
|
|
||||||
<textarea class="textarea" id="workOrderEdit--workOrderDescription" name="workOrderDescription"><%= workOrder.workOrderDescription %></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column">
|
|
||||||
<div class="field">
|
|
||||||
<label class="label" for="workOrderEdit--workOrderOpenDateString"><%= configFunctions.getProperty("aliases.workOrderOpenDate") %></label>
|
|
||||||
<div class="control has-icons-left">
|
|
||||||
<%
|
|
||||||
const currentDateString = dateTimeFunctions.dateToString(new Date());
|
|
||||||
%>
|
|
||||||
<input class="input" id="workOrderEdit--workOrderOpenDateString" name="workOrderOpenDateString" type="date"
|
|
||||||
value="<%= workOrder.workOrderOpenDateString %>"
|
|
||||||
max="<%= workOrder.workOrderOpenDateString > currentDateString ? workOrder.workOrderOpenDateString : currentDateString %>"
|
|
||||||
required />
|
|
||||||
<span class="icon is-left">
|
|
||||||
<i class="fas fa-calendar" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<label class="label" for="workOrderEdit--workOrderCloseDateString"><%= configFunctions.getProperty("aliases.workOrderCloseDate") %></label>
|
|
||||||
<div class="field has-addons">
|
|
||||||
<div class="control is-expanded">
|
|
||||||
<input class="input" id="workOrderEdit--workOrderCloseDateString" name="workOrderCloseDateString" type="date" value="<%= workOrder.workOrderCloseDateString %>" disabled readonly />
|
|
||||||
</div>
|
|
||||||
<div class="control">
|
|
||||||
<button class="button is-light is-success is-outlined" id="button--closeWorkOrder" type="button">
|
|
||||||
<span class="icon is-small"><i class="fas fa-stop-circle" aria-hidden="true"></i></span>
|
|
||||||
<span>
|
|
||||||
Close
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% if (isCreate) { %>
|
||||||
</div>
|
<p class="help">Leave work order number blank to autopopulate.</p>
|
||||||
</div>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
<% if (!isCreate) { %>
|
<label class="label" for="workOrderEdit--workOrderTypeId">Work Order Type</label>
|
||||||
|
<div class="control">
|
||||||
|
<div class="select is-fullwidth">
|
||||||
|
<select id="workOrderEdit--workOrderTypeId" name="workOrderTypeId" required <%= (isCreate ? " autofocus" : "") %>>
|
||||||
|
<% if (isCreate && workOrderTypes.length > 1) { %>
|
||||||
|
<option value="">(Select Type)</option>
|
||||||
|
<% } %>
|
||||||
|
<% for (const workOrderType of workOrderTypes) { %>
|
||||||
|
<option value="<%= workOrderType.workOrderTypeId %>" <%= (workOrder.workOrderTypeId === workOrderType.workOrderTypeId ? " selected" : "") %>>
|
||||||
|
<%= workOrderType.workOrderType %>
|
||||||
|
</option>
|
||||||
|
<% } %>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="workOrderEdit--workOrderDescription">Description</label>
|
||||||
|
<div class="control">
|
||||||
|
<textarea class="textarea" id="workOrderEdit--workOrderDescription" name="workOrderDescription"><%= workOrder.workOrderDescription %></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="workOrderEdit--workOrderOpenDateString"><%= configFunctions.getProperty("aliases.workOrderOpenDate") %></label>
|
||||||
|
<div class="control has-icons-left">
|
||||||
|
<%
|
||||||
|
const currentDateString = dateTimeFunctions.dateToString(new Date());
|
||||||
|
%>
|
||||||
|
<input class="input" id="workOrderEdit--workOrderOpenDateString" name="workOrderOpenDateString" type="date"
|
||||||
|
value="<%= workOrder.workOrderOpenDateString %>"
|
||||||
|
max="<%= workOrder.workOrderOpenDateString > currentDateString ? workOrder.workOrderOpenDateString : currentDateString %>"
|
||||||
|
required />
|
||||||
|
<span class="icon is-left">
|
||||||
|
<i class="fas fa-calendar" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<label class="label" for="workOrderEdit--workOrderCloseDateString"><%= configFunctions.getProperty("aliases.workOrderCloseDate") %></label>
|
||||||
|
<div class="field has-addons">
|
||||||
|
<div class="control is-expanded">
|
||||||
|
<input class="input" id="workOrderEdit--workOrderCloseDateString" name="workOrderCloseDateString" type="date" value="<%= workOrder.workOrderCloseDateString %>" disabled readonly />
|
||||||
|
</div>
|
||||||
|
<div class="control">
|
||||||
|
<button class="button is-light is-success is-outlined" id="button--closeWorkOrder" type="button">
|
||||||
|
<span class="icon is-small"><i class="fas fa-stop-circle" aria-hidden="true"></i></span>
|
||||||
|
<span>
|
||||||
|
Close
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<% if (!isCreate) { %>
|
||||||
<div class="panel mt-4">
|
<div class="panel mt-4">
|
||||||
<h2 class="panel-heading">Related <%= configFunctions.getProperty("aliases.lots") %></h2>
|
<h2 class="panel-heading">Related <%= configFunctions.getProperty("aliases.lots") %></h2>
|
||||||
<div class="panel-block is-block">
|
<div class="panel-block is-block">
|
||||||
|
|
@ -255,72 +255,76 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (!isCreate) { %>
|
<% if (!isCreate) { %>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div class="level is-mobile">
|
<div class="level is-mobile">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="has-text-weight-bold is-size-5">
|
<h2 class="has-text-weight-bold is-size-5">
|
||||||
Comments
|
Comments
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right">
|
</div>
|
||||||
<div class="level-item">
|
<div class="level-right">
|
||||||
<button class="button is-small is-success" id="workOrderComments--add" type="button">
|
<div class="level-item">
|
||||||
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
<button class="button is-small is-success" id="workOrderComments--add" type="button">
|
||||||
<span>Add a Comment</span>
|
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
||||||
</button>
|
<span>Add a Comment</span>
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-block is-block" id="container--workOrderComments"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<div class="panel-block is-block" id="container--workOrderComments"></div>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% if (!isCreate) { %>
|
<% if (!isCreate) { %>
|
||||||
<div class="column is-4-desktop">
|
<div class="column is-4-desktop">
|
||||||
<div class="panel" id="panel--milestones">
|
<div class="panel" id="panel--milestones">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div class="level is-mobile">
|
<div class="level is-mobile">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="title has-text-weight-bold is-5">Milestones</h2>
|
<h2 class="title has-text-weight-bold is-5">Milestones</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right">
|
<div class="level-right">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<button class="button is-small is-success" id="button--addMilestone" type="button">
|
<button class="button is-small is-success" id="button--addMilestone" type="button">
|
||||||
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
|
||||||
<span>Add Milestone</span>
|
<span>Add Milestone</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<div class="dropdown is-right has-text-weight-normal">
|
<div class="dropdown is-right has-text-weight-normal">
|
||||||
<div class="dropdown-trigger">
|
<div class="dropdown-trigger">
|
||||||
<button class="button is-small has-tooltip-left" data-tooltip="Milestone Options" type="button" aria-label="Options">
|
<button class="button is-small has-tooltip-left" data-tooltip="Milestone Options" type="button" aria-label="Options">
|
||||||
<i class="fas fa-ellipsis-v" aria-hidden="true"></i>
|
<i class="fas fa-ellipsis-v" aria-hidden="true"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content">
|
||||||
<a class="dropdown-item" href="<%= urlPrefix %>/api/<%= user.userProperties.apiKey %>/milestoneICS/?workOrderId=<%= workOrder.workOrderId %>">
|
<a class="dropdown-item" href="<%= urlPrefix %>/api/<%= user.userProperties.apiKey %>/milestoneICS/?workOrderId=<%= workOrder.workOrderId %>">
|
||||||
<span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
<span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||||
<span>Download iCalendar</span>
|
<span>Download iCalendar</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<a class="dropdown-item" href="<%= urlPrefix %>/reports/workOrderMilestones-byWorkOrderId/?workOrderId=<%= workOrder.workOrderId %>" target="_blank" download>
|
||||||
</div>
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
||||||
|
<span>Export as CSV</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,267 +85,271 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="columns is-desktop">
|
<div class="columns is-desktop">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="panel-block is-block">
|
<div class="panel-block is-block">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<p class="mb-2">
|
<p class="mb-2">
|
||||||
<strong>Work Order Type</strong><br />
|
<strong>Work Order Type</strong><br />
|
||||||
<%= workOrder.workOrderType %>
|
<%= workOrder.workOrderType %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Description</strong><br />
|
<strong>Description</strong><br />
|
||||||
<% if (workOrder.workOrderDescription) { %>
|
<% if (workOrder.workOrderDescription) { %>
|
||||||
<%= workOrder.workOrderDescription %>
|
<%= workOrder.workOrderDescription %>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<span class="has-text-grey">(No Description)</span>
|
<span class="has-text-grey">(No Description)</span>
|
||||||
<% } %>
|
<% } %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<p class="mb-2">
|
<p class="mb-2">
|
||||||
<strong><%= configFunctions.getProperty("aliases.workOrderOpenDate") %></strong><br />
|
<strong><%= configFunctions.getProperty("aliases.workOrderOpenDate") %></strong><br />
|
||||||
<%= workOrder.workOrderOpenDateString %>
|
<%= workOrder.workOrderOpenDateString %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong><%= configFunctions.getProperty("aliases.workOrderCloseDate") %></strong><br />
|
<strong><%= configFunctions.getProperty("aliases.workOrderCloseDate") %></strong><br />
|
||||||
<% if (workOrder.workOrderCloseDate) { %>
|
<% if (workOrder.workOrderCloseDate) { %>
|
||||||
<%= workOrder.workOrderCloseDateString %>
|
<%= workOrder.workOrderCloseDateString %>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.workOrderCloseDate") %>)</span>
|
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.workOrderCloseDate") %>)</span>
|
||||||
<% } %>
|
<% } %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel">
|
|
||||||
<h2 class="panel-heading">Related <%= configFunctions.getProperty("aliases.lots") %></h2>
|
|
||||||
<div class="panel-block is-block">
|
|
||||||
<%
|
|
||||||
const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots");
|
|
||||||
%>
|
|
||||||
<div class="tabs is-boxed">
|
|
||||||
<ul>
|
|
||||||
<li class="<%= (tabToSelect === "lotOccupancies" ? "is-active" : "") %>">
|
|
||||||
<a href="#relatedTab--lotOccupancies">
|
|
||||||
<span><%= configFunctions.getProperty("aliases.occupancies") %></span>
|
|
||||||
<span class="ml-2 tag"><%= workOrder.workOrderLotOccupancies.length %></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="<%= (tabToSelect === "lots" ? "is-active" : "") %>">
|
|
||||||
<a href="#relatedTab--lots">
|
|
||||||
<span><%= configFunctions.getProperty("aliases.lots") %></span>
|
|
||||||
<span class="ml-2 tag"><%= workOrder.workOrderLots.length %></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="tab-container">
|
|
||||||
<div class="<%= (tabToSelect === "lotOccupancies" ? "" : "is-hidden") %>" id="relatedTab--lotOccupancies">
|
|
||||||
<% if (workOrder.workOrderLotOccupancies.length === 0) { %>
|
|
||||||
<div class="message is-info">
|
|
||||||
<p class="message-body">
|
|
||||||
There are no
|
|
||||||
<%= configFunctions.getProperty("aliases.lot").toLowerCase() %>
|
|
||||||
<%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %>
|
|
||||||
records associated with this work order.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<% } else { %>
|
|
||||||
<% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %>
|
|
||||||
<table class="table is-fullwidth is-striped is-hoverable">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="has-width-1"></th>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.occupancy") %> Type</th>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.lot") %></th>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.occupancyStartDate") %></th>
|
|
||||||
<th>End Date</th>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.occupants") %></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %>
|
|
||||||
<% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %>
|
|
||||||
<tr>
|
|
||||||
<td class="has-text-centered">
|
|
||||||
<% if (isActive) { %>
|
|
||||||
<i class="fas fa-play" title="Current <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
|
||||||
<% } else { %>
|
|
||||||
<i class="fas fa-stop" title="Previous <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
|
||||||
<% } %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a class="has-text-weight-bold"
|
|
||||||
href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
|
|
||||||
<%= lotOccupancy.occupancyType %>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<% if (lotOccupancy.lotId) { %>
|
|
||||||
<%= lotOccupancy.lotName %>
|
|
||||||
<% } else { %>
|
|
||||||
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.lot") %>)</span>
|
|
||||||
<% } %>
|
|
||||||
</td>
|
|
||||||
<td><%= lotOccupancy.occupancyStartDateString %></td>
|
|
||||||
<td>
|
|
||||||
<% if (lotOccupancy.occupancyEndDate) { %>
|
|
||||||
<%= lotOccupancy.occupancyEndDateString %>
|
|
||||||
<% } else { %>
|
|
||||||
<span class="has-text-grey">(No End Date)</span>
|
|
||||||
<% } %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
|
|
||||||
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span>
|
|
||||||
<% } else { %>
|
|
||||||
<% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %>
|
|
||||||
<span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>">
|
|
||||||
<i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i>
|
|
||||||
<%= occupant.occupantName %>
|
|
||||||
</span><br />
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% } %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
|
||||||
<div class="<%= (tabToSelect === "lots" ? "" : "is-hidden") %>" id="relatedTab--lots">
|
|
||||||
<% if (workOrder.workOrderLots.length === 0) { %>
|
|
||||||
<div class="message is-info">
|
|
||||||
<p class="message-body">
|
|
||||||
There are no
|
|
||||||
<%= configFunctions.getProperty("aliases.lots").toLowerCase() %>
|
|
||||||
records associated with this work order.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<% } else { %>
|
|
||||||
<table class="table is-fullwidth is-striped is-hoverable">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.lot") %></th>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.map") %></th>
|
|
||||||
<th><%= configFunctions.getProperty("aliases.lot") %> Type</th>
|
|
||||||
<th>Status</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% for (const lot of workOrder.workOrderLots) { %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a class="has-text-weight-bold" href="<%= urlPrefix %>/lots/<%= lot.lotId %>"><%= lot.lotName %></a>
|
|
||||||
</td>
|
|
||||||
<td><%= lot.mapName %></td>
|
|
||||||
<td><%= lot.lotType %></td>
|
|
||||||
<td><%= lot.lotStatus %></td>
|
|
||||||
</tr>
|
|
||||||
<% } %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if (workOrder.workOrderComments.length > 0) { %>
|
|
||||||
<div class="panel">
|
|
||||||
<h2 class="panel-heading">Work Order Comments</h2>
|
|
||||||
<div class="panel-block is-block">
|
|
||||||
<table class="table is-fullwidth is-striped is-hoverable">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Commentor</th>
|
|
||||||
<th>Comment Date</th>
|
|
||||||
<th>Comment</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% for (const workOrderComment of workOrder.workOrderComments) { %>
|
|
||||||
<tr>
|
|
||||||
<td><%= workOrderComment.recordCreate_userName %></td>
|
|
||||||
<td>
|
|
||||||
<%= workOrderComment.workOrderCommentDateString %>
|
|
||||||
<%= (workOrderComment.workOrderCommentTime === 0 ? "" : workOrderComment.workOrderCommentTimeString) %>
|
|
||||||
</td>
|
|
||||||
<td><%= workOrderComment.workOrderComment %></td>
|
|
||||||
</tr>
|
|
||||||
<% } %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
<% if (workOrder.workOrderMilestones.length > 0) { %>
|
|
||||||
<div class="column is-4-desktop">
|
<div class="panel">
|
||||||
<div class="panel">
|
<h2 class="panel-heading">Related <%= configFunctions.getProperty("aliases.lots") %></h2>
|
||||||
<div class="panel-heading">
|
<div class="panel-block is-block">
|
||||||
<div class="level is-mobile">
|
<%
|
||||||
<div class="level-left">
|
const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots");
|
||||||
<div class="level-item">
|
%>
|
||||||
<h2 class="title is-5 has-text-weight-bold">Milestones</h2>
|
<div class="tabs is-boxed">
|
||||||
|
<ul>
|
||||||
|
<li class="<%= (tabToSelect === "lotOccupancies" ? "is-active" : "") %>">
|
||||||
|
<a href="#relatedTab--lotOccupancies">
|
||||||
|
<span><%= configFunctions.getProperty("aliases.occupancies") %></span>
|
||||||
|
<span class="ml-2 tag"><%= workOrder.workOrderLotOccupancies.length %></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="<%= (tabToSelect === "lots" ? "is-active" : "") %>">
|
||||||
|
<a href="#relatedTab--lots">
|
||||||
|
<span><%= configFunctions.getProperty("aliases.lots") %></span>
|
||||||
|
<span class="ml-2 tag"><%= workOrder.workOrderLots.length %></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-container">
|
||||||
|
<div class="<%= (tabToSelect === "lotOccupancies" ? "" : "is-hidden") %>" id="relatedTab--lotOccupancies">
|
||||||
|
<% if (workOrder.workOrderLotOccupancies.length === 0) { %>
|
||||||
|
<div class="message is-info">
|
||||||
|
<p class="message-body">
|
||||||
|
There are no
|
||||||
|
<%= configFunctions.getProperty("aliases.lot").toLowerCase() %>
|
||||||
|
<%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %>
|
||||||
|
records associated with this work order.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% } else { %>
|
||||||
<div class="level-right">
|
<% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %>
|
||||||
<div class="level-item">
|
<table class="table is-fullwidth is-striped is-hoverable">
|
||||||
<div class="dropdown is-right has-text-weight-normal">
|
<thead>
|
||||||
<div class="dropdown-trigger">
|
<tr>
|
||||||
<button class="button is-small has-tooltip-left" type="button" data-tooltip="Milestone Options" aria-label="Options">
|
<th class="has-width-1"></th>
|
||||||
<i class="fas fa-ellipsis-v" aria-hidden="true"></i>
|
<th><%= configFunctions.getProperty("aliases.occupancy") %> Type</th>
|
||||||
</button>
|
<th><%= configFunctions.getProperty("aliases.lot") %></th>
|
||||||
</div>
|
<th><%= configFunctions.getProperty("aliases.occupancyStartDate") %></th>
|
||||||
<div class="dropdown-menu">
|
<th>End Date</th>
|
||||||
<div class="dropdown-content">
|
<th><%= configFunctions.getProperty("aliases.occupants") %></th>
|
||||||
<a class="dropdown-item" href="<%= urlPrefix %>/api/<%= user.userProperties.apiKey %>/milestoneICS/?workOrderId=<%= workOrder.workOrderId %>">
|
</tr>
|
||||||
<span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
</thead>
|
||||||
<span>Download iCalendar</span>
|
<tbody>
|
||||||
</a>
|
<% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %>
|
||||||
</div>
|
<% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<td class="has-text-centered">
|
||||||
</div>
|
<% if (isActive) { %>
|
||||||
</div>
|
<i class="fas fa-play" title="Current <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
||||||
</div>
|
<% } else { %>
|
||||||
|
<i class="fas fa-stop" title="Previous <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
|
||||||
|
<% } %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="has-text-weight-bold"
|
||||||
|
href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
|
||||||
|
<%= lotOccupancy.occupancyType %>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<% if (lotOccupancy.lotId) { %>
|
||||||
|
<%= lotOccupancy.lotName %>
|
||||||
|
<% } else { %>
|
||||||
|
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.lot") %>)</span>
|
||||||
|
<% } %>
|
||||||
|
</td>
|
||||||
|
<td><%= lotOccupancy.occupancyStartDateString %></td>
|
||||||
|
<td>
|
||||||
|
<% if (lotOccupancy.occupancyEndDate) { %>
|
||||||
|
<%= lotOccupancy.occupancyEndDateString %>
|
||||||
|
<% } else { %>
|
||||||
|
<span class="has-text-grey">(No End Date)</span>
|
||||||
|
<% } %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
|
||||||
|
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span>
|
||||||
|
<% } else { %>
|
||||||
|
<% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %>
|
||||||
|
<span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>">
|
||||||
|
<i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i>
|
||||||
|
<%= occupant.occupantName %>
|
||||||
|
</span><br />
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% } %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% for (const milestone of workOrder.workOrderMilestones) { %>
|
<div class="<%= (tabToSelect === "lots" ? "" : "is-hidden") %>" id="relatedTab--lots">
|
||||||
<div class="panel-block is-block">
|
<% if (workOrder.workOrderLots.length === 0) { %>
|
||||||
<div class="columns is-mobile">
|
<div class="message is-info">
|
||||||
<div class="column is-narrow">
|
<p class="message-body">
|
||||||
<% if (milestone.workOrderMilestoneCompletionDate) { %>
|
There are no
|
||||||
<span class="icon is-small" data-tooltip="Completed <%= milestone.workOrderMilestoneCompletionDateString %>">
|
<%= configFunctions.getProperty("aliases.lots").toLowerCase() %>
|
||||||
<i class="fas fa-check" aria-label="Completed <%= milestone.workOrderMilestoneCompletionDateString %>"></i>
|
records associated with this work order.
|
||||||
</span>
|
</p>
|
||||||
<% } else { %>
|
|
||||||
<span class="icon is-small">
|
|
||||||
<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>
|
|
||||||
</span>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<% if (milestone.workOrderMilestoneTypeId) { %>
|
|
||||||
<strong><%= milestone.workOrderMilestoneType %></strong><br />
|
|
||||||
<% } %>
|
|
||||||
<%= milestone.workOrderMilestoneDateString %>
|
|
||||||
<% if (milestone.workOrderMilestoneTime !== 0) { %>
|
|
||||||
<%= milestone.workOrderMilestoneTimeString %>
|
|
||||||
<% } %>
|
|
||||||
<br />
|
|
||||||
<span class="is-size-7"><%= milestone.workOrderMilestoneDescription %></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% } else { %>
|
||||||
<% } %>
|
<table class="table is-fullwidth is-striped is-hoverable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><%= configFunctions.getProperty("aliases.lot") %></th>
|
||||||
|
<th><%= configFunctions.getProperty("aliases.map") %></th>
|
||||||
|
<th><%= configFunctions.getProperty("aliases.lot") %> Type</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% for (const lot of workOrder.workOrderLots) { %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a class="has-text-weight-bold" href="<%= urlPrefix %>/lots/<%= lot.lotId %>"><%= lot.lotName %></a>
|
||||||
|
</td>
|
||||||
|
<td><%= lot.mapName %></td>
|
||||||
|
<td><%= lot.lotType %></td>
|
||||||
|
<td><%= lot.lotStatus %></td>
|
||||||
|
</tr>
|
||||||
|
<% } %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% if (workOrder.workOrderComments.length > 0) { %>
|
||||||
|
<div class="panel">
|
||||||
|
<h2 class="panel-heading">Work Order Comments</h2>
|
||||||
|
<div class="panel-block is-block">
|
||||||
|
<table class="table is-fullwidth is-striped is-hoverable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Commentor</th>
|
||||||
|
<th>Comment Date</th>
|
||||||
|
<th>Comment</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% for (const workOrderComment of workOrder.workOrderComments) { %>
|
||||||
|
<tr>
|
||||||
|
<td><%= workOrderComment.recordCreate_userName %></td>
|
||||||
|
<td>
|
||||||
|
<%= workOrderComment.workOrderCommentDateString %>
|
||||||
|
<%= (workOrderComment.workOrderCommentTime === 0 ? "" : workOrderComment.workOrderCommentTimeString) %>
|
||||||
|
</td>
|
||||||
|
<td><%= workOrderComment.workOrderComment %></td>
|
||||||
|
</tr>
|
||||||
|
<% } %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<% if (workOrder.workOrderMilestones.length > 0) { %>
|
||||||
|
<div class="column is-4-desktop">
|
||||||
|
<div class="panel">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="level is-mobile">
|
||||||
|
<div class="level-left">
|
||||||
|
<div class="level-item">
|
||||||
|
<h2 class="title is-5 has-text-weight-bold">Milestones</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<div class="level-item">
|
||||||
|
<div class="dropdown is-right has-text-weight-normal">
|
||||||
|
<div class="dropdown-trigger">
|
||||||
|
<button class="button is-small has-tooltip-left" type="button" data-tooltip="Milestone Options" aria-label="Options">
|
||||||
|
<i class="fas fa-ellipsis-v" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<div class="dropdown-content">
|
||||||
|
<a class="dropdown-item" href="<%= urlPrefix %>/api/<%= user.userProperties.apiKey %>/milestoneICS/?workOrderId=<%= workOrder.workOrderId %>">
|
||||||
|
<span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||||
|
<span>Download iCalendar</span>
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="<%= urlPrefix %>/reports/workOrderMilestones-byWorkOrderId/?workOrderId=<%= workOrder.workOrderId %>" target="_blank" download>
|
||||||
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
||||||
|
<span>Export as CSV</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% for (const milestone of workOrder.workOrderMilestones) { %>
|
||||||
|
<div class="panel-block is-block">
|
||||||
|
<div class="columns is-mobile">
|
||||||
|
<div class="column is-narrow">
|
||||||
|
<% if (milestone.workOrderMilestoneCompletionDate) { %>
|
||||||
|
<span class="icon is-small" data-tooltip="Completed <%= milestone.workOrderMilestoneCompletionDateString %>">
|
||||||
|
<i class="fas fa-check" aria-label="Completed <%= milestone.workOrderMilestoneCompletionDateString %>"></i>
|
||||||
|
</span>
|
||||||
|
<% } else { %>
|
||||||
|
<span class="icon is-small">
|
||||||
|
<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>
|
||||||
|
</span>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<% if (milestone.workOrderMilestoneTypeId) { %>
|
||||||
|
<strong><%= milestone.workOrderMilestoneType %></strong><br />
|
||||||
|
<% } %>
|
||||||
|
<%= milestone.workOrderMilestoneDateString %>
|
||||||
|
<% if (milestone.workOrderMilestoneTime !== 0) { %>
|
||||||
|
<%= milestone.workOrderMilestoneTimeString %>
|
||||||
|
<% } %>
|
||||||
|
<br />
|
||||||
|
<span class="is-size-7"><%= milestone.workOrderMilestoneDescription %></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%- include('_footerA'); -%>
|
<%- include('_footerA'); -%>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue