Commit 1a14d7e4 by Mac Stephens

Version that works ready to be used with Mike.

parent de1aebb1
object ApiDatabaseModule: TApiDatabaseModule object ApiDatabaseModule: TApiDatabaseModule
OnCreate = DataModuleCreate
Height = 491 Height = 491
Width = 640 Width = 640
object ucEnvoy: TUniConnection object ucEnvoy: TUniConnection
......
...@@ -121,7 +121,6 @@ type ...@@ -121,7 +121,6 @@ type
uqComplaintDetailsDATERESPONDED: TDateTimeField; uqComplaintDetailsDATERESPONDED: TDateTimeField;
uqComplaintDetailsDATEARRIVED: TDateTimeField; uqComplaintDetailsDATEARRIVED: TDateTimeField;
uqComplaintDetailsDATECLEARED: TDateTimeField; uqComplaintDetailsDATECLEARED: TDateTimeField;
procedure DataModuleCreate(Sender: TObject);
procedure uqComplaintListCalcFields(DataSet: TDataSet); procedure uqComplaintListCalcFields(DataSet: TDataSet);
procedure uqMapComplaintsCalcFields(DataSet: TDataSet); procedure uqMapComplaintsCalcFields(DataSet: TDataSet);
private private
...@@ -142,52 +141,6 @@ implementation ...@@ -142,52 +141,6 @@ implementation
{$R *.dfm} {$R *.dfm}
procedure TApiDatabaseModule.DataModuleCreate(Sender: TObject);
var
iniFile: TIniFile;
begin
iniFile := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
try
ucEnvoy.Server := iniFile.ReadString('Database', 'Server', '');
ucEnvoy.Database := iniFile.ReadString('Database', 'Database', '');
ucEnvoy.Username := iniFile.ReadString('Database', 'Username', '');
ucEnvoy.Password := iniFile.ReadString('Database', 'Password', '');
try
Logger.Log(2, '');
Logger.Log(2, 'Connecting to envoyCalls Database (ApiDatabaseModule)...');
Logger.Log(2, Format('--ucEnvoy.Server: %s ucEnvoy.Username: %s', [ucEnvoy.Server, ucEnvoy.Username]));
if not ucEnvoy.Connected then
ucEnvoy.Connect;
Logger.Log(2, '--ucEnvoy connected!');
except
on E: Exception do
begin
Logger.Log(2, Format('Failed to connect to envoyCalls database: %s', [E.Message]));
end;
end;
Logger.Log(1, '');
Logger.Log(1, 'Loading Twilio settings...');
var twilioSID := iniFile.ReadString('Twilio', 'AccountSID', '');
if twilioSID.IsEmpty then
Logger.Log(1, 'Twilio->AccountSID: Entry not found')
else
Logger.Log(1, 'Twilio->AccountSID: ' + twilioSID);
var twilioAuth := iniFile.ReadString('Twilio', 'AuthHeader', '');
if twilioAuth.IsEmpty then
Logger.Log(1, 'Twilio->AuthHeader: Entry not found')
else
Logger.Log(1, 'Twilio->AuthHeader: ' + twilioAuth);
finally
iniFile.Free;
end;
end;
class procedure TApiDatabaseModule.ExecSQL(const SQL: string); class procedure TApiDatabaseModule.ExecSQL(const SQL: string);
var var
DB: TApiDatabaseModule; DB: TApiDatabaseModule;
......
[Settings] [Settings]
LogFileNum=493 LogFileNum=502
webClientVersion=0.1.0 webClientVersion=0.1.0
TwilioUpdateTime=0 TwilioUpdateTime=0
......
...@@ -57,26 +57,26 @@ begin ...@@ -57,26 +57,26 @@ begin
GetUnits; GetUnits;
tmrRefresh.Enabled := True; tmrRefresh.Enabled := True;
{$IFNDEF WIN32} // {$IFNDEF WIN32}
asm // asm
var root = pas.TFViewUnits(Self).dblUnitsList.ElementHandle; // var root = pas.TFViewUnits(Self).dblUnitsList.ElementHandle;
if (root && !root.__emiDelegated) { // if (root && !root.__emiDelegated) {
root.__emiDelegated = true; // root.__emiDelegated = true;
//
root.addEventListener('click', function (e) { // root.addEventListener('click', function (e) {
// Look for a click on, or inside, the details button // // Look for a click on, or inside, the details button
var btn = e.target && e.target.closest('.btn-unit-details'); // var btn = e.target && e.target.closest('.btn-unit-details');
if (!btn || !root.contains(btn)) return; // if (!btn || !root.contains(btn)) return;
//
e.preventDefault(); // e.preventDefault();
e.stopPropagation(); // e.stopPropagation();
//
var unitId = btn.getAttribute('data-unitid') || ''; // var unitId = btn.getAttribute('data-unitid') || '';
pas.TFViewUnits(Self).OpenUnitDetails(unitId); // pas.TFViewUnits(Self).OpenUnitDetails(unitId);
}, { passive: true }); // }, { passive: true });
} // }
end; // end;
{$ENDIF} // {$ENDIF}
end; end;
procedure TFViewUnits.btnRefreshClick(Sender: TObject); procedure TFViewUnits.btnRefreshClick(Sender: TObject);
......
...@@ -94,10 +94,10 @@ ...@@ -94,10 +94,10 @@
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<VerInfo_MinorVer>9</VerInfo_MinorVer> <VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_MajorVer>0</VerInfo_MajorVer> <VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_Release>3</VerInfo_Release>
<TMSWebBrowser>1</TMSWebBrowser>
<TMSWebSingleInstance>1</TMSWebSingleInstance> <TMSWebSingleInstance>1</TMSWebSingleInstance>
<TMSUseJSDebugger>2</TMSUseJSDebugger> <TMSUseJSDebugger>2</TMSUseJSDebugger>
<VerInfo_Release>3</VerInfo_Release>
<TMSWebBrowser>3</TMSWebBrowser>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''"> <PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
......
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