• R/O
  • SSH
  • HTTPS

mantisbtmonitor: コミット


コミットメタ情報

リビジョン44 (tree)
日時2019-07-31 06:38:46
作者derekwildstar

ログメッセージ

- Adição de comentários concluída

変更サマリ

差分

--- trunk/client/prj/MantisNotification.dproj (nonexistent)
+++ trunk/client/prj/MantisNotification.dproj (revision 44)
@@ -0,0 +1,173 @@
1+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+ <PropertyGroup>
3+ <ProjectGuid>{6D3063A5-0ED6-4592-A54E-E314632D66E2}</ProjectGuid>
4+ <MainSource>MantisNotification.dpr</MainSource>
5+ <Base>True</Base>
6+ <Config Condition="'$(Config)'==''">Debug</Config>
7+ <TargetedPlatforms>1</TargetedPlatforms>
8+ <AppType>Application</AppType>
9+ <FrameworkType>VCL</FrameworkType>
10+ <ProjectVersion>18.4</ProjectVersion>
11+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
12+ </PropertyGroup>
13+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
14+ <Base>true</Base>
15+ </PropertyGroup>
16+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
17+ <Base_Win32>true</Base_Win32>
18+ <CfgParent>Base</CfgParent>
19+ <Base>true</Base>
20+ </PropertyGroup>
21+ <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
22+ <Base_Win64>true</Base_Win64>
23+ <CfgParent>Base</CfgParent>
24+ <Base>true</Base>
25+ </PropertyGroup>
26+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
27+ <Cfg_1>true</Cfg_1>
28+ <CfgParent>Base</CfgParent>
29+ <Base>true</Base>
30+ </PropertyGroup>
31+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
32+ <Cfg_1_Win32>true</Cfg_1_Win32>
33+ <CfgParent>Cfg_1</CfgParent>
34+ <Cfg_1>true</Cfg_1>
35+ <Base>true</Base>
36+ </PropertyGroup>
37+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
38+ <Cfg_2>true</Cfg_2>
39+ <CfgParent>Base</CfgParent>
40+ <Base>true</Base>
41+ </PropertyGroup>
42+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
43+ <Cfg_2_Win32>true</Cfg_2_Win32>
44+ <CfgParent>Cfg_2</CfgParent>
45+ <Cfg_2>true</Cfg_2>
46+ <Base>true</Base>
47+ </PropertyGroup>
48+ <PropertyGroup Condition="'$(Base)'!=''">
49+ <DCC_DebugInformation>1</DCC_DebugInformation>
50+ <DCC_E>false</DCC_E>
51+ <DCC_F>false</DCC_F>
52+ <DCC_K>false</DCC_K>
53+ <DCC_N>true</DCC_N>
54+ <DCC_S>false</DCC_S>
55+ <DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
56+ <DCC_ImageBase>00400000</DCC_ImageBase>
57+ <DCC_ExeOutput>..\bin</DCC_ExeOutput>
58+ <DCC_DcuOutput>..\bin\dcu</DCC_DcuOutput>
59+ <DCC_UnitSearchPath>..\src\lib;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
60+ <DebugSourcePath>D:\COMPONENTESDELPHI\trunk\03-Implementacao\01-Src\DELPHI 10 (2006)\SRC\PNGComponentsDXCE\src\;$(DebugSourcePath)</DebugSourcePath>
61+ <SanitizedProjectName>MantisNotification</SanitizedProjectName>
62+ <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
63+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
64+ <VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
65+ <VerInfo_MinorVer>2</VerInfo_MinorVer>
66+ <VerInfo_Release>3</VerInfo_Release>
67+ <VerInfo_Build>922</VerInfo_Build>
68+ <VerInfo_Locale>1046</VerInfo_Locale>
69+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.2.3.922;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
70+ </PropertyGroup>
71+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
72+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
73+ <BT_BuildType>Debug</BT_BuildType>
74+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
75+ <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
76+ <VerInfo_Locale>1033</VerInfo_Locale>
77+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
78+ <Icon_MainIcon>MantisNotification_Icon.ico</Icon_MainIcon>
79+ <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
80+ <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
81+ <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
82+ </PropertyGroup>
83+ <PropertyGroup Condition="'$(Base_Win64)'!=''">
84+ <Icon_MainIcon>MantisNotification_Icon.ico</Icon_MainIcon>
85+ <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
86+ <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
87+ </PropertyGroup>
88+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
89+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
90+ <DCC_DebugInformation>0</DCC_DebugInformation>
91+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
92+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
93+ </PropertyGroup>
94+ <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
95+ <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
96+ <AppEnableHighDPI>true</AppEnableHighDPI>
97+ </PropertyGroup>
98+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
99+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
100+ <DCC_Optimize>false</DCC_Optimize>
101+ <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
102+ </PropertyGroup>
103+ <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
104+ <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
105+ <AppEnableHighDPI>true</AppEnableHighDPI>
106+ </PropertyGroup>
107+ <ItemGroup>
108+ <DelphiCompile Include="$(MainSource)">
109+ <MainSource>MainSource</MainSource>
110+ </DelphiCompile>
111+ <DCCReference Include="..\src\UFormSplash.pas">
112+ <Form>FormSplash</Form>
113+ </DCCReference>
114+ <DCCReference Include="..\src\UFormBasicDialog.pas">
115+ <Form>FormBasicDialog</Form>
116+ </DCCReference>
117+ <DCCReference Include="..\src\UFormGeneralConfiguration.pas">
118+ <Form>FormGeneralConfiguration</Form>
119+ </DCCReference>
120+ <DCCReference Include="..\src\UConfigurations.pas"/>
121+ <DCCReference Include="..\src\UFormLogin.pas">
122+ <Form>FormLogin</Form>
123+ </DCCReference>
124+ <DCCReference Include="..\src\UFormNoLogin.pas">
125+ <Form>FormNoLogin</Form>
126+ </DCCReference>
127+ <DCCReference Include="..\src\UDamoPrincipal.pas">
128+ <Form>DamoPrincipal</Form>
129+ <DesignClass>TDataModule</DesignClass>
130+ </DCCReference>
131+ <DCCReference Include="..\src\UFormIssue.pas">
132+ <Form>FormIssue</Form>
133+ </DCCReference>
134+ <DCCReference Include="..\src\lib\UMNWSWrapperFunctions.pas"/>
135+ <DCCReference Include="..\src\lib\UFunctions.pas"/>
136+ <DCCReference Include="..\src\lib\mnws.pas"/>
137+ <DCCReference Include="..\src\UFormViewNote.pas">
138+ <Form>FormViewNote</Form>
139+ </DCCReference>
140+ <DCCReference Include="..\src\UFormManageNote.pas">
141+ <Form>FormManageNote</Form>
142+ </DCCReference>
143+ <BuildConfiguration Include="Debug">
144+ <Key>Cfg_2</Key>
145+ <CfgParent>Base</CfgParent>
146+ </BuildConfiguration>
147+ <BuildConfiguration Include="Base">
148+ <Key>Base</Key>
149+ </BuildConfiguration>
150+ <BuildConfiguration Include="Release">
151+ <Key>Cfg_1</Key>
152+ <CfgParent>Base</CfgParent>
153+ </BuildConfiguration>
154+ </ItemGroup>
155+ <ProjectExtensions>
156+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
157+ <Borland.ProjectType/>
158+ <BorlandProject>
159+ <Delphi.Personality>
160+ <Source>
161+ <Source Name="MainSource">MantisNotification.dpr</Source>
162+ </Source>
163+ </Delphi.Personality>
164+ <Platforms>
165+ <Platform value="Win32">True</Platform>
166+ <Platform value="Win64">False</Platform>
167+ </Platforms>
168+ </BorlandProject>
169+ <ProjectFileVersion>12</ProjectFileVersion>
170+ </ProjectExtensions>
171+ <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
172+ <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
173+</Project>
--- trunk/testes/Unit9.pas (revision 43)
+++ trunk/testes/Unit9.pas (revision 44)
@@ -25,8 +25,15 @@
2525 AssignedProjects: TAssignedProjects;
2626 end;
2727
28+ TStatus = record
29+ Id: Word;
30+ Description: String;
31+ end;
32+
33+ TPossibleStatusChanges = array of TStatus;
34+
2835 TTask = record
29- Id: String;
36+ Id: Cardinal;
3037 Status: String;
3138 StatusColor: TColor;
3239 Priority: String;
@@ -36,6 +43,7 @@
3643 LastUpdate: TDateTime;
3744 AddCommentToken: String;
3845 MaxFileSize: Cardinal;
46+ PossibleStatusChanges: TPossibleStatusChanges;
3947 end;
4048
4149 TAssignedTasks = array of TTask;
@@ -57,6 +65,7 @@
5765 Button5: TButton;
5866 Memo2: TMemo;
5967 OpenDialog1: TOpenDialog;
68+ Button6: TButton;
6069 procedure FormShow(Sender: TObject);
6170 procedure Button1Click(Sender: TObject);
6271 procedure Button2Click(Sender: TObject);
@@ -141,6 +150,60 @@
141150 //
142151 //end;
143152
153+function FixEncoding(AText: OleVariant): String;
154+var
155+ RBS: RawByteString;
156+begin
157+ // RBS é um RawByteString, que é uma string que não tenta interpretar os bytes
158+ // da string original. Atualmente existem codificações que usam de 1 a 4 bytes
159+ // para representar um único caractere. Ao usar RawByteString dois bytes que
160+ // representam um único caractere, por exemplo, são exibidos como caracteres
161+ // separados. Usar RawByteString aqui garante que a String contida em AText
162+ // seja trabalhada como uma simples sequência de bytes, pois não estamos nos
163+ // interessando em interpretar seus caracteres mas sim trabalhar com seus
164+ // bytes separadamente. Isso também garante que ela seja portada sem perder
165+ // sua codificação. Para facilitar, pense em RawByteString como sendo um
166+ // arquivo não compactado, portanto, original. Strings codificadas (UTF-8,
167+ // UTF-16, etc) são como arquivos compactados, onde eventualmente mais de um
168+ // byte é usado para representar um único caractere.
169+ // Atenção: O resultado obtido com o cast RawByteString depende da string
170+ // original. Como AText é algo que vem da página que estamos lendo e ela é
171+ // UTF-8, RawByteString vai conter Byte a Byte a string UTF-8. Se AText fosse
172+ // UTF-16, a representação seria Byte a Byte um UTF-16, por exemplo, ao usar
173+ // RawByteString com "à" em UTF-8, obtemos uma string de 2 bytes 0xC3 0xA0.
174+ // Caso originalmente a string fosse UTF-16 (unicode), haveria apenas um byte
175+ // de valor 0xE0. É por este motivo que não é possível comparar duas strings
176+ // com codificações diferentes e esperar que o resultado seja true. É
177+ // necessário comparar sempre strings com a mesma codificação, convertendo-as
178+ // se necessário
179+ RBS := RawByteString(AText);
180+ // Não sei ao certo, mas eventualmente o Byte 0xAD sozinho é convertido em sua
181+ // entidade html correspondente (&shy;) que representa um "soft hyphen", no
182+ // entanto, este Byte forma com um Byte anterior um caractere na codificação
183+ // UTF-8. O caractere "í" em UTF-8 é 0xC3AD. Este bug converte o Byte 0xAD em
184+ // &shy; o que resulta em uma string contendo #$C3 + '&shy;'. Isso quebra a
185+ // codificação fazendo aparecer um caractere correspondente ao 0xC3. O
186+ // caractere correspondente ao &shy; não aparece, pois é esta a função do soft
187+ // hyphen: aparecer apenas quando houver uma quebra de palavra. Existem muitos
188+ // artigos falando a respeito do &shy; e de seus problemas correlatos
189+ RBS := RawByteString(StringReplace(String(RBS),'&shy;',#$AD,[rfReplaceAll]));
190+ // Considerando que estamos lendo sempre algo em UTF-8, não é possível existir
191+ // um Byte 0xC3 sozinho, pois ele sempre é acompanhado de algum outro Byte
192+ // para completar a representação de um caractere UTF-8. A linha abaixo
193+ // corrige o bug que transforma o Byte 0xA0 (&nbsp;) em um espaço normal
194+ // (0x20) desconsiderando o UTF-8. Toda vez que houver 0xC320 (que não existe
195+ // no UTF-8) ele deve ser convertido em 0xC3A0
196+ RBS := RawByteString(StringReplace(String(RBS),#$C3#$20,#$C3#$A0,[rfReplaceAll]));
197+ // Converte a sequência de Bytes contida de forma pura em RBS, de volta em uma
198+ // string UTF-16, onde há a codificação de bytes
199+ Result := UTF8ToString(RBS);
200+end;
201+
202+function ExtractProjectName(AString: OleVariant): String;
203+begin
204+ RegExReplaceAll(AString,'\[(.*)\]','\1',Result);
205+end;
206+
144207 {$WARN IMPLICIT_STRING_CAST_LOSS OFF}
145208 function UserInfo(AHandle: Cardinal; out AUserInfo: TUserInfo): Boolean;
146209 var
@@ -191,11 +254,11 @@
191254
192255 if Result then
193256 begin
194- AUserInfo.EMail := ELE.Value;
195- AUserInfo.RealName := UTF8ToString(HTD.getElementById('realname').Value);
196- AUserInfo.UserName := HTD.getElementsByTagName('td').item(1).innerText;
197- AUserInfo.AccessLevel := HTD.getElementsByTagName('td').item(13).innerText;
198- AUserInfo.ProjectAccessLevel := HTD.getElementsByTagName('td').item(15).innerText;
257+ AUserInfo.EMail := FixEncoding(ELE.Value);
258+ AUserInfo.RealName := FixEncoding(HTD.getElementById('realname').Value);
259+ AUserInfo.UserName := FixEncoding(HTD.getElementsByTagName('td').item(1).innerText);
260+ AUserInfo.AccessLevel := FixEncoding(HTD.getElementsByTagName('td').item(13).innerText);
261+ AUserInfo.ProjectAccessLevel := FixEncoding(HTD.getElementsByTagName('td').item(15).innerText);
199262
200263 for i := 0 to HTD.body.all.length - 1 do
201264 begin
@@ -215,10 +278,10 @@
215278
216279 for i := 1 to ELE.length - 1 do // O elemento zero é um TH
217280 begin
218- AUserInfo.AssignedProjects[i-1].Name := UTF8ToString(ELE.item(i).all.item(0).innerText);
219- AUserInfo.AssignedProjects[i-1].AccessLevel := ELE.item(i).all.item(1).innerText;
220- AUserInfo.AssignedProjects[i-1].Visibility := ELE.item(i).all.item(2).innerText;
221- AUserInfo.AssignedProjects[i-1].Description := UTF8ToString(ELE.item(i).all.item(3).innerText);
281+ AUserInfo.AssignedProjects[i-1].Name := FixEncoding(ELE.item(i).all.item(0).innerText);
282+ AUserInfo.AssignedProjects[i-1].AccessLevel := FixEncoding(ELE.item(i).all.item(1).innerText);
283+ AUserInfo.AssignedProjects[i-1].Visibility := FixEncoding(ELE.item(i).all.item(2).innerText);
284+ AUserInfo.AssignedProjects[i-1].Description := FixEncoding(ELE.item(i).all.item(3).innerText);
222285 end;
223286 end;
224287
@@ -327,16 +390,6 @@
327390 end;
328391 end;
329392
330-function FixEncoding(AText: OleVariant): String;
331-begin
332- Result := UTF8ToString(RawByteString(AText));
333-end;
334-
335-function ExtractProjectName(AString: OleVariant): String;
336-begin
337- RegExReplaceAll(AString,'\[(.*)\]','\1',Result);
338-end;
339-
340393 function ExtractDateTime(AString: OleVariant): TDateTime;
341394 var
342395 DateTime: String;
@@ -468,7 +521,7 @@
468521 Request(Req,Res);
469522
470523 Result := RegExMatch(TStringStream(Res.Content).DataString
471- ,'<a href="\/mantis\/account_page\.php">\s*([a-z]*)\s*\(\s*(.*)\s*\)\s*<\/a>'
524+ ,'<a href="\/mantis\/account_page\.php">\s*([a-z]+)\s*\(\s*([^ ][\w\W ]+[^ ])\s*\)\s*<\/a>'
472525 ,0
473526 ,0
474527 ,False
@@ -506,7 +559,7 @@
506559
507560 Req.InternetOpenParams.Agent := 'Mantis Monitor';
508561 Req.InternetOpenParams.AccessType := INTERNET_OPEN_TYPE_PRECONFIG;
509- Req.InternetConnectParams.ServerName := PChar(BASE_URL + '/mantis/view.php?id=' + ATask.Id);
562+ Req.InternetConnectParams.ServerName := PChar(BASE_URL + '/mantis/view.php?id=' + IntToStr(ATask.Id));
510563 Req.InternetConnectParams.Service := INTERNET_SERVICE_HTTP;
511564 Req.InternetConnectParams.Context := AHandle;
512565
@@ -562,8 +615,6 @@
562615 end;
563616 end;
564617
565-
566-
567618 procedure WriteStream(AStream: TStream; AValue: RawByteString);
568619 var
569620 i: Cardinal;
@@ -629,8 +680,7 @@
629680 end;
630681 end;
631682
632-//uma propriedade para receber cada arquivo e cada um de seus mimes
633-function AddComment(AHandle: Cardinal; AAddCommentToken: UTF8String; AMaxFileSize: Cardinal; ATaskId: Cardinal; AComment: UTF8String; AAttachments: array of String; out AError: String): Boolean;
683+function AddComment(AHandle: Cardinal; AAddCommentToken: UTF8String; AMaxFileSize: Cardinal; ATaskId: Cardinal; AComment: UTF8String; AAttachments: array of String; out ACommentId: Cardinal; out AError: String): Boolean;
634684 var
635685 Req: TRequestOptions;
636686 Res: TResponse;
@@ -637,9 +687,13 @@
637687 Boundary: UTF8String;
638688 i: Word;
639689 HTMLDocument: OleVariant;
640- Divs: OleVariant;
690+ Aux: OleVariant;
691+ CommentingUser: String;
692+ LastCommentId: Cardinal;
693+ CurrentCommentId: Cardinal;
641694 begin
642695 AError := '';
696+ ACommentId := 0;
643697 ZeroMemory(@Req,SizeOf(Req));
644698 ZeroMemory(@Res,SizeOf(Res));
645699
@@ -696,13 +750,13 @@
696750 HTMLDocument.Write(TStringStream(Res.Content).DataString);
697751 HTMLDocument.Close;
698752
699- Divs := HTMLDocument.GetElementsByTagName('div');
753+ Aux := HTMLDocument.GetElementsByTagName('div');
700754
701- for i := 0 to Divs.Length - 1 do
755+ for i := 0 to Aux.Length - 1 do
702756 begin
703- if Divs.Item(i).ClassName = 'alert alert-danger' then
757+ if Aux.Item(i).ClassName = 'alert alert-danger' then
704758 begin
705- AError := UTF8ToString(RawByteString(Divs.Item(i).ChildNodes[0].InnerText + '|' + Divs.Item(i).ChildNodes[1].InnerText));
759+ AError := FixEncoding(RawByteString(Aux.Item(i).ChildNodes[0].InnerText + '|' + Aux.Item(i).ChildNodes[1].InnerText));
706760 Break;
707761 end;
708762 end;
@@ -709,25 +763,35 @@
709763
710764 // Caso tenha saído do loop anterior prematuramente, significa que
711765 // houve um erro
712- Result := i = Divs.Length;
766+ Result := i = Aux.Length;
713767
768+ if Result then
769+ begin
770+ RegExMatch(TStringStream(Res.Content).DataString
771+ ,'<a href="\/mantis\/account_page\.php">\s*([a-z]+)\s*\(\s*([^ ][\w\W ]+[^ ])\s*\)\s*<\/a>'
772+ ,2
773+ ,0
774+ ,False
775+ ,[]
776+ ,CommentingUser);
714777
778+ Aux := HTMLDocument.GetElementsByTagName('tr');
715779
780+ LastCommentId := 0;
716781
782+ for i := 0 to Aux.Length - 1 do
783+ begin
784+ if (Aux.Item(i).ClassName = 'bugnote') and (FixEncoding(Aux.Item(i).ChildNodes[0].ChildNodes[1].ChildNodes[0].ChildNodes[1].InnerText) = CommentingUser) then
785+ begin
786+ CurrentCommentId := StrToInt(StringReplace(Aux.Item(i).Id,'c','',[]));
717787
788+ if CurrentCommentId > LastCommentId then
789+ LastCommentId := CurrentCommentId;
790+ end;
791+ end;
718792
719-// Res.Content.Position := 0;
720-// FORM9.Memo1.Lines.LoadFromStream(Res.Content);
721-
722-// Result := RegExMatch(TStringStream(Res.Content).DataString
723-// ,'<a href="\/mantis\/account_page\.php">\s*([a-z]*)\s*\(\s*(.*)\s*\)\s*<\/a>'
724-// ,0
725-// ,0
726-// ,False
727-// ,[]
728-// ,Aux);
729-// if Result then
730-// Result := UserInfo(AHandle,AUserInfo);
793+ ACommentId := LastCommentId;
794+ end;
731795 finally
732796 Res.Content.Free;
733797 end;
@@ -1066,9 +1130,10 @@
10661130
10671131 if AssignedTasks(Self.Handle, FStatusColors, AT) then
10681132 begin
1133+ ShowMessage('retornar tambem os possiveis status para os quais a tarefa pode mudar');
10691134 for T in AT do
10701135 begin
1071- Memo1.Lines.Add(T.Id + ' - ' + T.Status + ' - ' + ColorToString(T.StatusColor) + ' - ' + T.Project + ' - ' +T.Description + ' - ' + T.Category + ' - ' + DateTimeToStr(T.LastUpdate));
1136+ Memo1.Lines.Add(T.Id.ToString + ' - ' + T.Status + ' - ' + ColorToString(T.StatusColor) + ' - ' + T.Project + ' - ' +T.Description + ' - ' + T.Category + ' - ' + DateTimeToStr(T.LastUpdate));
10721137 end;
10731138
10741139 // Memo1.Lines.Add('UserName = ' + UserName);
@@ -1090,8 +1155,9 @@
10901155 i: Word;
10911156 f: Array of String;
10921157 E: String;
1158+ C: Cardinal;
10931159 begin
1094- T.Id := '0083766';
1160+ T.Id := 0083766;
10951161 TaskDetails(Self.Handle,T);
10961162
10971163 if OpenDialog1.Execute then
@@ -1103,8 +1169,10 @@
11031169
11041170 end;
11051171
1106- if not AddComment(Self.Handle,T.AddCommentToken,T.MaxFileSize,83766,Memo2.Text,f,E) then
1107- Memo1.Text := E;
1172+ if not AddComment(Self.Handle,T.AddCommentToken,T.MaxFileSize,83766,Trim(Memo2.Text),f,C,E) then
1173+ Memo1.Text := E
1174+ else
1175+ Memo1.Text := 'Comentário nº ' + C.ToString + ' inserido com sucesso';
11081176 end;
11091177
11101178 procedure TForm9.ColorListBox1GetColors(Sender: TCustomColorListBox; Items: TStrings);
旧リポジトリブラウザで表示