Commit d17bf35c by Mac Stephens

update complaint list colors and headers, add new markers for dispatch categories, database update

parent f67b3596
......@@ -305,14 +305,27 @@ begin
while not Eof do
begin
var status: string;
if not FieldByName('DATECLEARED').IsNull then
status := 'Cleared'
else if not FieldByName('DATEARRIVED').IsNull then
status := 'AtScene'
var statusColor: string;
var statusTextColor: string;
if not FieldByName('DATEARRIVED').IsNull then
begin
status := 'On Scene';
statusColor := '#22C55E';
statusTextColor := '#000000';
end
else if not FieldByName('DATEDISPATCHED').IsNull then
status := 'Dispatched'
begin
status := 'Attached';
statusColor := '#FFFF00';
statusTextColor := '#000000';
end
else
status := 'Pending';
begin
status := 'Not Attached';
statusColor := '#FF8080';
statusTextColor := '#000000';
end;
var item := TJSONObject.Create;
......@@ -324,16 +337,11 @@ begin
item.AddPair('DistrictHeader', curAgency);
lastDistrict := curAgency;
item.AddPair('DistrictSector', 'Agency: ' + curAgency);
item.AddPair('AgencyLine', 'Agency: ' + curAgency);
var colorVal := ApiDB.uqComplaintListPRIORITY_COLOR.AsInteger;
item.AddPair('PriorityColor', '#' + IntToHex(colorVal and $FFFFFF, 6));
if (colorVal and $FFFFFF) = $0000FF then
item.AddPair('PriorityTextColor', '#FFFFFF')
else
item.AddPair('PriorityTextColor', '#000000');
item.AddPair('ComplaintId', ApiDB.uqComplaintListCOMPLAINTID.AsString);
item.AddPair('Complaint', ApiDB.uqComplaintListcomplaintNumber.AsString);
item.AddPair('Agency', ApiDB.uqComplaintListAGENCY.AsString);
......@@ -343,6 +351,8 @@ begin
item.AddPair('Business', ApiDB.uqComplaintListBUSINESS.AsString);
item.AddPair('CFSId', ApiDB.uqComplaintListCFSID.AsString);
item.AddPair('Status', status);
item.AddPair('StatusColor', statusColor);
item.AddPair('StatusTextColor', statusTextColor);
item.AddPair('DispatchDistrict', ApiDB.uqComplaintListDISPATCHDISTRICT.AsString);
item.AddPair('DateReported', ApiDB.uqComplaintListDATEREPORTED.AsString);
......
[Settings]
LogFileNum=719
LogFileNum=722
webClientVersion=0.1.0
[Database]
......
......@@ -44,20 +44,20 @@ object FViewComplaints: TFViewComplaints
ItemTemplate =
'<div class="list-section-header small fw-semibold bg-secondary t' +
'ext-white rounded-1 px-2 mb-1">(%DistrictHeader%)</div><div clas' +
's="card border shadow-sm" style="--bs-card-bg:(%PriorityColor%);' +
'--bs-card-color:(%PriorityTextColor%);"><div class="card-body py' +
'-2 px-3 d-flex gap-2"><div class="flex-grow-1"><div class="fw-bo' +
'ld text-uppercase small">(%Priority%): (%DispatchCodeDesc%)</div' +
'><div class="small">(%Address%)</div><div class="small d-none co' +
'mplaint-business" data-business="(%Business%)">(%Business%)</div' +
'><div class="small text-opacity-75">(%Complaint%): (%Status%)&nb' +
'sp;&nbsp;(%DistrictSector%)</div><div class="small text-opacity-' +
'75">(%DateReported%)</div></div><div class="d-flex flex-column j' +
'ustify-content-center gap-1"><button type="button" class="btn bt' +
'n-primary btn-sm complaint-details-btn" data-id="(%ComplaintId%)' +
'">Details</button><button type="button" class="btn btn-primary b' +
'tn-sm btn-complaint-map" data-id="(%ComplaintId%)">Map</button><' +
'/div></div></div>'
's="card border shadow-sm" style="--bs-card-bg:(%StatusColor%);--' +
'bs-card-color:(%StatusTextColor%);"><div class="card-body py-2 p' +
'x-3 d-flex gap-2"><div class="flex-grow-1"><div class="fw-bold t' +
'ext-uppercase small">(%Priority%): (%DispatchCodeDesc%)</div><di' +
'v class="small">(%Address%)</div><div class="small d-none compla' +
'int-business" data-business="(%Business%)">(%Business%)</div><di' +
'v class="small text-opacity-75">(%Complaint%): (%Status%)&nbsp;&' +
'nbsp;(%AgencyLine%)</div><div class="small text-opacity-75">(%Da' +
'teReported%)</div></div><div class="d-flex flex-column justify-c' +
'ontent-center gap-1"><button type="button" class="btn btn-primar' +
'y btn-sm complaint-details-btn" data-id="(%ComplaintId%)">Detail' +
's</button><button type="button" class="btn btn-primary btn-sm bt' +
'n-complaint-map" data-id="(%ComplaintId%)">Map</button></div></d' +
'iv></div>'
ListSource = wdsComplaints
end
object xdwcComplaints: TXDataWebClient
......@@ -111,8 +111,13 @@ object FViewComplaints: TFViewComplaints
object xdwdsComplaintsPriorityTextColor: TStringField
FieldName = 'PriorityTextColor'
end
object xdwdsComplaintsDistrictSector: TStringField
FieldName = 'DistrictSector'
object xdwdsComplaintsStatusTextColor: TStringField
FieldName = 'StatusTextColor'
Size = 80
end
object xdwdsComplaintsAgencyLine: TStringField
FieldName = 'AgencyLine'
Size = 80
end
end
object wdsComplaints: TWebDataSource
......
......@@ -30,8 +30,9 @@ type
xdwdsComplaintsStatusColor: TStringField;
xdwdsComplaintsPriorityColor: TStringField;
xdwdsComplaintsPriorityTextColor: TStringField;
xdwdsComplaintsDistrictSector: TStringField;
xdwdsComplaintsBusiness: TStringField;
xdwdsComplaintsStatusTextColor: TStringField;
xdwdsComplaintsAgencyLine: TStringField;
procedure WebFormCreate(Sender: TObject);
procedure WebFormDestroy(Sender: TObject);
private
......
webEMIMobile/assets/markers/car_ems.png

1.49 KB | W: | H:

webEMIMobile/assets/markers/car_ems.png

763 Bytes | W: | H:

webEMIMobile/assets/markers/car_ems.png
webEMIMobile/assets/markers/car_ems.png
webEMIMobile/assets/markers/car_ems.png
webEMIMobile/assets/markers/car_ems.png
  • 2-up
  • Swipe
  • Onion skin
webEMIMobile/assets/markers/car_police.png

832 Bytes | W: | H:

webEMIMobile/assets/markers/car_police.png

837 Bytes | W: | H:

webEMIMobile/assets/markers/car_police.png
webEMIMobile/assets/markers/car_police.png
webEMIMobile/assets/markers/car_police.png
webEMIMobile/assets/markers/car_police.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -52,18 +52,18 @@ begin
function getUnitBadgeColor(iconUrl) {
if (iconUrl && iconUrl.indexOf("car_fire") >= 0) {
return "#DC2626";
return "#B05454";
}
if (iconUrl && iconUrl.indexOf("car_ems") >= 0) {
return "#16A34A";
return "#5D9270";
}
if (iconUrl && iconUrl.indexOf("car_police") >= 0) {
return "#2563EB";
return "#637AAE";
}
return "#2563EB";
return "#637AAE";
}
function getComplaintBadgeColors(complaintStatus) {
......@@ -135,7 +135,7 @@ begin
var html =
'<div class="' + wrapClass + '">' +
'<img src="' + iconUrl + '" class="emi-marker-img">';
'<img src="' + iconUrl + '" class="emi-marker-img" onerror="this.onerror=null;this.src=\'' + getFallbackIconUrl(meta) + '\';">';
if (isUnit && meta.unitBadgeText) {
html +=
......@@ -290,6 +290,26 @@ begin
return html;
}
function getFallbackIconUrl(meta) {
if (meta.markerType === 'complaint') {
if (meta.complaintStatus === 'attached') {
return 'assets/markers/default_attached.png';
}
if (meta.complaintStatus === 'onscene') {
return 'assets/markers/default_onscene.png';
}
return 'assets/markers/default_notattached.png';
}
if (meta.markerType === 'unit') {
return 'assets/markers/car_default.png';
}
return 'assets/markers/default_notattached.png';
}
function openMarkerPicker(map, marker, nearby) {
window.emiNearbyMarkerPick = nearby;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment