Commit 07bb644d by Cam Hayes

v9.13.6 ready for deployment

parent ef41aacf
......@@ -45,6 +45,7 @@ procedure LoadConfig(LoadProc: TConfigLoadedProc);
if JS.toString(Obj['ApiUrl']) <> '' then
Config.ApiUrl := JS.toString(Obj['ApiUrl']);
end;
finally
LoadProc(Config);
......
......@@ -19,7 +19,7 @@ type
FUnauthorizedAccessProc: TUnauthorizedAccessProc;
public
const clientVersion = '0.9.13.3';
const clientVersion = '0.9.13.6';
procedure InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc);
procedure SetClientConfig(Callback: TVersionCheckCallback);
......
......@@ -6,7 +6,7 @@ uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, WEBLib.ExtCtrls, Vcl.Controls, Vcl.StdCtrls,
WEBLib.StdCtrls, Data.DB, XData.Web.JsonDataset, XData.Web.Dataset,
App.Types, ConnectionModule, XData.Web.Client, WEBLib.Menus, Utils;
App.Types, ConnectionModule, XData.Web.Client, WEBLib.Menus, Utils, System.IOUtils;
type
TFViewMain = class(TWebForm)
......@@ -81,7 +81,8 @@ uses
View.OrderEntryCorrugated,
View.OrderEntryCuttingDie,
View.OrderEntryWeb,
View.Customers, View.Customer.Add;
View.Customers,
View.Customer.Add;
{$R *.dfm}
......@@ -176,17 +177,18 @@ begin
ShowToast('Please Save or Cancel your changes', 'danger');
end;
procedure TFViewMain.lblLinkToQBClick(Sender: TObject);
var
qblink: string;
qblink, redirectUri: string;
qbWindow: TJSWindow;
begin
qblink := 'https://appcenter.intuit.com/connect/oauth2';
qblink := qblink + '?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P';
qblink := qblink + '&response_type=code';
qblink := qblink + '&scope=com.intuit.quickbooks.accounting';
qblink := qblink + '&redirect_uri=http://localhost:2004/kgOrders/auth/AuthService/Authorize&state=7';
qblink := qblink + '&state=7';
redirectUri := DMConnection.AuthConnection.URL + 'AuthService/QBAuthorize';
qblink := qblink + '&redirect_uri=' + RedirectUri;
qbWindow := window.open('', '_blank');
if Assigned(qbWindow) then
qbWindow.location.href := qbLink;
......
{
"AuthUrl" : "http://localhost:2004/kgOrders/auth/",
"ApiUrl" : "http://localhost:2004/kgOrders/api/"
"ApiUrl" : "http://localhost:2004/kgOrders/api/",
"RedirectUri2" : "https://webapps.em-sys.net/kgOrdersTest/auth/AuthService/Authorize",
"RedirectUri1" : "https://webapps.em-sys.net/kgOrders/auth/AuthService/Authorize",
"RedirectUri" : "http://localhost:2004/kgOrders/auth/AuthService/Authorize"
}
......@@ -41,7 +41,7 @@ uses
System.JSON,
Common.Config,
Common.Logging,
uLibrary;
uLibrary, XData.Sys.Exceptions;
{%CLASSGROUP 'Vcl.Controls.TControl'}
......@@ -57,6 +57,7 @@ begin
on E: Exception do
begin
Logger.Log( 1, '--TAuthDatabase.DataModuleCreate -Error connecting to database: ' + E.Message );
raise EXDataHttpException.Create(500, 'Error Connecting to database! Please try again later or contact a system admin!');
end;
end;
end;
......
......@@ -20,7 +20,7 @@ type
['{9CFD59B2-A832-4F82-82BB-9A25FC93F305}']
function Login(const user, password: string): string;
function VerifyVersion(clientVersion: string): TJSONObject;
[HttpGet] function Authorize(code, realmId, state: string): string;
[HttpGet] function QBAuthorize(code, realmId, state: string): string;
end;
implementation
......
......@@ -23,8 +23,8 @@ type
public
function Login(const user, password: string): string;
function VerifyVersion(ClientVersion: string): TJSONObject;
function Authorize(code, realmId, state: string): string;
function ExchangeAuthCode(code: string): string;
function QBAuthorize(code, realmId, state: string): string;
function ExchangeQBAuthCode(code: string): string;
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
end;
......@@ -189,7 +189,7 @@ begin
end;
end;
function TAuthService.Authorize(code, realmId, state: string): string;
function TAuthService.QBAuthorize(code, realmId, state: string): string;
var
iniFile: TIniFile;
begin
......@@ -197,11 +197,11 @@ begin
iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini');
iniFile.WriteString('Quickbooks', 'CompanyID', realmId);
iniFile.Free;
result := ExchangeAuthCode(code);
result := ExchangeQBAuthCode(code);
Logger.Log(3, 'TAuthService.Authorize - end - result: ' + result);
end;
function TAuthService.ExchangeAuthCode(code: string): string;
function TAuthService.ExchangeQBAuthCode(code: string): string;
var
iniFile: TIniFile;
restClient: TRESTClient;
......
......@@ -114,11 +114,11 @@
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_ExeOutput>.\bin</DCC_ExeOutput>
<DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.6;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_Release>13</VerInfo_Release>
<VerInfo_Build>3</VerInfo_Build>
<VerInfo_Build>6</VerInfo_Build>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
......
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