• R/O
  • SSH
  • HTTPS

mantisbtmonitor: Commit


Commit MetaInfo

Revision30 (tree)
Time2017-09-21 06:33:05
Authorderekwildstar

Log Message

- Obtenção de comentários
- Otimização de abertura de tela

Change Summary

Incremental Difference

--- trunk/client/prj/MantisNotification.bdsproj (revision 29)
+++ trunk/client/prj/MantisNotification.bdsproj (revision 30)
@@ -150,7 +150,7 @@
150150 <VersionInfo Name="MajorVer">1</VersionInfo>
151151 <VersionInfo Name="MinorVer">2</VersionInfo>
152152 <VersionInfo Name="Release">3</VersionInfo>
153- <VersionInfo Name="Build">570</VersionInfo>
153+ <VersionInfo Name="Build">595</VersionInfo>
154154 <VersionInfo Name="Debug">False</VersionInfo>
155155 <VersionInfo Name="PreRelease">False</VersionInfo>
156156 <VersionInfo Name="Special">False</VersionInfo>
@@ -162,7 +162,7 @@
162162 <VersionInfoKeys>
163163 <VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
164164 <VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
165- <VersionInfoKeys Name="FileVersion">1.2.3.570</VersionInfoKeys>
165+ <VersionInfoKeys Name="FileVersion">1.2.3.595</VersionInfoKeys>
166166 <VersionInfoKeys Name="InternalName"></VersionInfoKeys>
167167 <VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
168168 <VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
--- trunk/client/res/Comments.xml (nonexistent)
+++ trunk/client/res/Comments.xml (revision 30)
@@ -0,0 +1 @@
1+<DATAPACKET Version="2.0"><METADATA><FIELDS><FIELD attrname="Id" fieldtype="i4"/><FIELD attrname="Reporter" fieldtype="string" WIDTH="64"/><FIELD attrname="Date" fieldtype="dateTime"/><FIELD attrname="Private" fieldtype="i2"/><FIELD attrname="Note" fieldtype="bin.hex" SUBTYPE="Text"/></FIELDS><PARAMS/></METADATA><ROWDATA/></DATAPACKET>
--- trunk/client/src/lib/UMNWSWrapperFunctions.pas (revision 29)
+++ trunk/client/src/lib/UMNWSWrapperFunctions.pas (revision 30)
@@ -19,6 +19,7 @@
1919 function GetAttachments(AIssueNumber: Cardinal; AClientDataSet: TClientDataSet): Boolean;
2020 function GetAttachmentData(AAttachmentId: Cardinal): String;
2121 function AddAttachment(AUserName: String; APassword: String; AIssueId: Cardinal; AFileName: String; AMimeType: String; ABase64Contents: String): Cardinal;
22+function GetComments(AIssueNumber: Cardinal; AUserId: Integer; AClientDataSet: TClientDataSet): Boolean;
2223
2324 implementation
2425
@@ -72,6 +73,7 @@
7273 XMLTransform := TXMLTransform.Create(nil);
7374 try
7475 AClientDataSet.XMLData := XMLTransform.TransformXML(XML,ExtractFilePath(ParamStr(0)) + 'xtr\RelatedIssuesToDp.xtr');
76+ Result := True;
7577 finally
7678 XMLTransform.Free;
7779 end;
@@ -98,6 +100,7 @@
98100 XMLTransform := TXMLTransform.Create(nil);
99101 try
100102 AClientDataSet.XMLData := XMLTransform.TransformXML(XML,ExtractFilePath(ParamStr(0)) + 'xtr\AttachmentsToDp.xtr');
103+ Result := True;
101104 finally
102105 XMLTransform.Free;
103106 end;
@@ -130,6 +133,28 @@
130133 end;
131134 end;
132135
136+function GetComments(AIssueNumber: Cardinal; AUserId: Integer; AClientDataSet: TClientDataSet): Boolean;
137+var
138+ XML: String;
139+ XMLTransform: TXMLTransform;
140+begin
141+ Result := False;
142+ AClientDataSet.Close;
143+
144+ XML := GetmnwsPortType.getComments(AIssueNumber,AUserId);
145+
146+ if XML <> '' then
147+ begin
148+ XMLTransform := TXMLTransform.Create(nil);
149+ try
150+ AClientDataSet.XMLData := XMLTransform.TransformXML(XML,ExtractFilePath(ParamStr(0)) + 'xtr\CommentsToDp.xtr');
151+ Result := True;
152+ finally
153+ XMLTransform.Free;
154+ end;
155+ end;
156+end;
157+
133158 initialization
134159
135160 end.
--- trunk/client/src/lib/mnws.pas (revision 29)
+++ trunk/client/src/lib/mnws.pas (revision 30)
@@ -4,7 +4,7 @@
44 // WSDL : http://192.168.251.88/mnws/index.php?wsdl
55 // Encoding : UTF-8
66 // Version : 1.0
7-// (06/09/2017 15:56:04 - 1.33.2.5)
7+// (20/09/2017 16:39:15 - 1.33.2.5)
88 // ************************************************************************ //
99
1010 unit mnws;
@@ -46,6 +46,7 @@
4646 function getAttachments(const aIssueId: integer): WideString; stdcall;
4747 function getAttachmentData(const aAttachmentId: integer): WideString; stdcall;
4848 function addAttachment(const aUserName: WideString; const aPassword: WideString; const aIssueId: integer; const aFileName: WideString; const aMimeType: WideString; const aBase64Contents: WideString): WideString; stdcall;
49+ function getComments(const aIssueId: integer; const aViewingUserId: integer): WideString; stdcall;
4950 end;
5051
5152 function GetmnwsPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): mnwsPortType;
--- trunk/client/src/UFormIssue.pas (revision 29)
+++ trunk/client/src/UFormIssue.pas (revision 30)
@@ -8,7 +8,8 @@
88 ToolWin, ActnMan, ActnCtrls, XPStyleActnCtrls, ActnList, ImgList,
99 UPngImageList, UMNWSWrapperFunctions, OleCtrls, SHDocVw, ComCtrls, DB,
1010 DBClient, Grids, DBGrids, KRK.Components.DataControls.DBGrid, DBCtrls, UFunctions,
11- UPngSpeedButton, Menus, ActnPopup;
11+ UPngSpeedButton, Menus, ActnPopup, DBCGrids, HTMLabel, dbhtmlab,
12+ PictureContainer;
1213
1314 type
1415 TFormIssue = class(TFormBasicDialog)
@@ -65,12 +66,26 @@
6566 CLDSAttachmentsFilename: TStringField;
6667 CLDSAttachmentsDate: TDateTimeField;
6768 CLDSAttachmentsFileSize: TIntegerField;
69+ DBCGComments: TDBCtrlGrid;
70+ CLDSComments: TClientDataSet;
71+ CLDSCommentsId: TIntegerField;
72+ CLDSCommentsReporter: TStringField;
73+ CLDSCommentsDate: TDateTimeField;
74+ CLDSCommentsPrivate: TSmallintField;
75+ CLDSCommentsNote: TMemoField;
76+ DASOComments: TDataSource;
77+ DHLAComment: TDBHTMLabel;
78+ PANEComments: TPanel;
79+ DBTXCommentReporter: TDBText;
80+ DBTXCommentId: TDBText;
81+ DBTXCommentDate: TDBText;
82+ procedure TASHCommentsShow(Sender: TObject);
83+ procedure TASHAttachmentsAndRelationshipsShow(Sender: TObject);
84+ procedure DHLACommentGetData(Sender: TObject; Tag: string; var Data: string);
6885 procedure MNUIAttachNewClick(Sender: TObject);
6986 procedure MNUIDownloadAndOpenClick(Sender: TObject);
7087 procedure MNUIDownloadAttachmentClick(Sender: TObject);
71- procedure KRDGRelatedIssuesDrawColumnCell(Sender: TObject;
72- const Rect: TRect; DataCol: Integer; Column: TColumn;
73- State: TGridDrawState);
88+ procedure KRDGRelatedIssuesDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
7489 procedure PNBBCloseClick(Sender: TObject);
7590 procedure IMAGOpenWithMantisClick(Sender: TObject);
7691 procedure KRDGRelatedIssuesDblClick(Sender: TObject);
@@ -78,9 +93,15 @@
7893 private
7994 { Private declarations }
8095 FIssueInfo: TIssueInfo;
96+ FAttachmentsLoaded: Boolean;
97+ FRelationshipsLoaded: Boolean;
98+ FCommentsLoaded: Boolean;
99+
81100 procedure LoadIssue;
101+
102+ procedure LoadAttachments;
82103 procedure LoadRelationships;
83- procedure LoadAttachments;
104+ procedure LoadComments;
84105 protected
85106 procedure CreateParams(var Params: TCreateParams); override;
86107 public
@@ -91,7 +112,7 @@
91112 implementation
92113
93114 uses
94- UConfigurations;
115+ UConfigurations, EncdDecd;
95116
96117 {$R *.dfm}
97118
@@ -104,6 +125,13 @@
104125 // Params.WndParent := 0;
105126 end;
106127
128+procedure TFormIssue.DHLACommentGetData(Sender: TObject; Tag: string; var Data: string);
129+begin
130+ inherited;
131+ if Tag = 'Note' then
132+ Data := DecodeString(CLDSCommentsNote.AsString);
133+end;
134+
107135 procedure TFormIssue.CLDSRelatedIssuesStatusGetText(Sender: TField; var Text: string; DisplayText: Boolean);
108136 begin
109137 inherited;
@@ -143,9 +171,16 @@
143171
144172 procedure TFormIssue.LoadAttachments;
145173 begin
146- GetAttachments(FIssueInfo.Id,CLDSAttachments);
174+ if not FAttachmentsLoaded then
175+ FAttachmentsLoaded := GetAttachments(FIssueInfo.Id,CLDSAttachments);
147176 end;
148177
178+procedure TFormIssue.LoadComments;
179+begin
180+ if not FCommentsLoaded then
181+ FCommentsLoaded := GetComments(FIssueInfo.Id,Configurations.UserId,CLDSComments);
182+end;
183+
149184 procedure TFormIssue.LoadIssue;
150185 ////////////////////////////////////////////////////////////////////////////////
151186 function GetCorrectHTML(ABody: String): String;
@@ -202,7 +237,8 @@
202237
203238 procedure TFormIssue.LoadRelationships;
204239 begin
205- GetRelatedIssues(FIssueInfo.Id,CLDSRelatedIssues);
240+ if not FRelationshipsLoaded then
241+ FRelationshipsLoaded := GetRelatedIssues(FIssueInfo.Id,CLDSRelatedIssues);
206242 end;
207243
208244 procedure TFormIssue.MNUIAttachNewClick(Sender: TObject);
@@ -253,10 +289,11 @@
253289 FIssueInfo := DecodeIssueInfo(GetIssueInfo(AIssueNumber));
254290
255291 LoadIssue;
256- LoadRelationships;
257- LoadAttachments;
258-// LoadComments;
259292
293+ FAttachmentsLoaded := False;
294+ FRelationshipsLoaded := False;
295+ FCommentsLoaded := False;
296+
260297 if AModal then
261298 Result := ShowModal
262299 else
@@ -264,4 +301,17 @@
264301 end;
265302 end;
266303
304+procedure TFormIssue.TASHAttachmentsAndRelationshipsShow(Sender: TObject);
305+begin
306+ inherited;
307+ LoadAttachments;
308+ LoadRelationships;
309+end;
310+
311+procedure TFormIssue.TASHCommentsShow(Sender: TObject);
312+begin
313+ inherited;
314+ LoadComments;
315+end;
316+
267317 end.
Show on old repository browser