Commit 1fc480c1 by Cam Hayes

Bug cannot connect $model:model

parent 07bb644d
......@@ -19,7 +19,7 @@ type
FUnauthorizedAccessProc: TUnauthorizedAccessProc;
public
const clientVersion = '0.9.13.6';
const clientVersion = '0.9.13.7';
procedure InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc);
procedure SetClientConfig(Callback: TVersionCheckCallback);
......
......@@ -47,6 +47,7 @@ type
function GetUserInfo: string;
procedure setActive(page: string);
procedure ConfirmLogout;
procedure ShowQBInfoForm();
public
{ Public declarations }
class procedure Display(LogoutProc: TLogoutProc);
......@@ -182,16 +183,35 @@ var
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 + '&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;
ShowQBInfoForm();
end;
procedure TFViewMain.ShowQBInfoForm();
//var
// newform: TFQBInfo;
begin
// newform := TFQBInfo.CreateNew;
//
// newform.Caption := 'Quickbooks information';
//
// // used to manage Back button handling to close subform
// window.location.hash := 'subform';
//
// newform.ShowModal(
// procedure(AValue: TModalResult)
// begin
//// if newform.confirm then
//// begin
//// if newform.cbCorrugatedPlate.Checked then
//// orderType := 'corrugated'
//// else if newform.cbWebPlate.Checked then
//// orderType := 'web'
//// else
//// orderType := 'cutting';
//// orderEntry('', newForm.DBID, 'ADD', orderType);
//// end;
// end
// );
end;
procedure TFViewMain.setActive(page: string);
......
object FQBInfo: TFQBInfo
Width = 640
Height = 208
object WebLabel1: TWebLabel
Left = 16
Top = 24
Width = 268
Height = 32
Caption = 'Quickbooks is not linked.'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Segoe UI'
Font.Style = []
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object lblCompanyName: TWebLabel
Left = 16
Top = 68
Width = 120
Height = 21
Caption = 'Company Name: '
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object lblCompanyID: TWebLabel
Left = 16
Top = 98
Width = 93
Height = 21
Caption = 'Company ID: '
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebButton1: TWebButton
Left = 16
Top = 125
Width = 96
Height = 25
Caption = 'Link to QB'
ChildOrder = 3
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = WebButton1Click
end
end
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>TMS Web Project</title>
<style>
</style>
</head>
<body>
</body>
</html>
\ No newline at end of file
unit View.QBInfo;
interface
uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls;
type
TFQBInfo = class(TWebForm)
WebLabel1: TWebLabel;
lblCompanyName: TWebLabel;
lblCompanyID: TWebLabel;
WebButton1: TWebButton;
procedure WebButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FQBInfo: TFQBInfo;
implementation
{$R *.dfm}
procedure TFQBInfo.WebButton1Click(Sender: TObject);
var
qblink, redirectUri: string;
qbWindow: TJSWindow;
begin
// qblink := 'https://appcenter.intuit.com/connect/oauth2';
// //qblink := qblink + '?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P';
// qblink := qblink + '?client_id=ABXLUuBrwvodIZMtaPcBg9acYBPafUxP80qk5aQ9HOAw1i2W3s';
// qblink := qblink + '&response_type=code';
// qblink := qblink + '&scope=com.intuit.quickbooks.accounting';
// qblink := qblink + '&state=7';
// //redirectUri := DMConnection.AuthConnection.URL + 'AuthService/QBAuthorize';
// qblink := qblink + '&redirect_uri=' + RedirectUri;
// console.log(redirectUri);
// qbWindow := window.open('', '_blank');
// if Assigned(qbWindow) then
// qbWindow.location.href := qbLink;
end;
end.
{
"AuthUrl" : "http://localhost:2004/kgOrders/auth/",
"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"
}
......@@ -288,6 +288,12 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="css\spinner.css" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="css\spinner.css" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
......
......@@ -135,7 +135,7 @@ begin
iniFile := TIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
try
qbEnabled := iniFile.ReadBool('Quickbooks', 'Enabled', false);
qbEnabled := iniFile.ReadBool('Quickbooks', 'Enabled', true);
finally
iniFile.Free;
end;
......@@ -193,12 +193,12 @@ function TAuthService.QBAuthorize(code, realmId, state: string): string;
var
iniFile: TIniFile;
begin
Logger.Log(3, 'TAuthService.Authorize - begin');
Logger.Log(3, 'TAuthService.QBAuthorize - begin');
iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini');
iniFile.WriteString('Quickbooks', 'CompanyID', realmId);
iniFile.Free;
result := ExchangeQBAuthCode(code);
Logger.Log(3, 'TAuthService.Authorize - end - result: ' + result);
Logger.Log(3, 'TAuthService.QBAuthorize - end - result: ' + result);
end;
function TAuthService.ExchangeQBAuthCode(code: string): string;
......@@ -211,7 +211,7 @@ var
Client, Secret, authString, AccessToken, RefreshToken, RedirectUri: string;
jsonObj: TJSONObject;
begin
logger.Log(3, 'AuthService.ExchangeAuthCode - start');
logger.Log(3, 'AuthService.ExchangeQBAuthCode - start');
iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini');
restClient := TRESTClient.Create(nil);
......@@ -282,7 +282,7 @@ begin
on E: Exception do
begin
result := 'The server has ran into an error please try again later...';
logger.Log(1, 'ExchangeAuthCode Error: ' + E.Message);
logger.Log(1, 'ExchangeQBAuthCode Error: ' + E.Message);
end;
end;
finally
......@@ -290,7 +290,7 @@ begin
restRequest.Free;
restResponse.Free;
iniFile.Free;
logger.Log(3, 'AuthService.ExchangeAuthCode - end');
logger.Log(3, 'AuthService.ExchangeQBAuthCode - end');
end;
end;
......
......@@ -183,7 +183,7 @@ begin
Logger.Log(1, '---Quickbooks---');
iniStr := IniFile.ReadString( 'Quickbooks', 'Enabled', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Quickbooks->Enabled: Entry not found - default: false' )
Logger.Log( 1, '--Quickbooks->Enabled: Entry not found - default: true' )
else
Logger.Log( 1, '--Quickbooks->Enabled: ' + iniStr );
......
......@@ -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.6;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.7;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>6</VerInfo_Build>
<VerInfo_Build>7</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