• R/O
  • SSH
  • HTTPS

mantisbtmonitor: Commit


Commit MetaInfo

Revision32 (tree)
Time2017-09-29 01:37:40
Authorderekwildstar

Log Message

- Tela para visualização de anotações
- Outras coisas importantes

Change Summary

Incremental Difference

--- trunk/client/prj/MantisNotification.bdsproj (revision 31)
+++ trunk/client/prj/MantisNotification.bdsproj (revision 32)
@@ -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">618</VersionInfo>
153+ <VersionInfo Name="Build">798</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.618</VersionInfoKeys>
165+ <VersionInfoKeys Name="FileVersion">1.2.3.798</VersionInfoKeys>
166166 <VersionInfoKeys Name="InternalName"></VersionInfoKeys>
167167 <VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
168168 <VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
--- trunk/client/prj/MantisNotification.dpr (revision 31)
+++ trunk/client/prj/MantisNotification.dpr (revision 32)
@@ -13,7 +13,8 @@
1313 UFormIssue in '..\src\UFormIssue.pas' {FormIssue},
1414 UMNWSWrapperFunctions in '..\src\lib\UMNWSWrapperFunctions.pas',
1515 UFunctions in '..\src\lib\UFunctions.pas',
16- mnws in '..\src\lib\mnws.pas';
16+ mnws in '..\src\lib\mnws.pas',
17+ UFormViewNote in '..\src\UFormViewNote.pas' {FormViewNote};
1718
1819 {$R *.res}
1920
--- trunk/client/src/lib/UFunctions.pas (revision 31)
+++ trunk/client/src/lib/UFunctions.pas (revision 32)
@@ -2,6 +2,9 @@
22
33 interface
44
5+uses
6+ SHDocVw;
7+
58 type
69 TIssueInfo = record
710 Id: Integer;
@@ -20,6 +23,7 @@
2023 procedure OpenIssueWithMantis(AIssueNumber: Cardinal);
2124 procedure DownloadAttachment(AAttachmentId: Cardinal; AFileName: String; AOpen: Boolean = True);
2225 function UploadAttachment(AIssueNumber: Cardinal; AFileName: String): Cardinal;
26+procedure LoadWebBrowserHTML(AWebBrowser: TWebBrowser; AText: String; ADecode: Boolean = False);
2327
2428 implementation
2529
@@ -124,4 +128,41 @@
124128 ,FileContents);
125129 end;
126130
131+procedure LoadWebBrowserHTML(AWebBrowser: TWebBrowser; AText: String; ADecode: Boolean = False);
132+////////////////////////////////////////////////////////////////////////////////
133+function GetCorrectHTML(ABody: String): String;
134+const
135+ HTML = '<html>'
136+ + '<head>'
137+ + '<style type="text/css">'
138+ + 'body {margin: 5pt; font-size: 10pt; font-family: Verdana, Arial, Helvetica, sans-serif}'
139+ + '</style>'
140+ + '</head>'
141+ + '<body>%s</body>'
142+ + '</html>';
143+begin
144+ if ADeCode then
145+ ABody := StringReplace(DecodeString(ABody),#13#10,'<br>',[rfReplaceAll])
146+ else
147+ ABody := StringReplace(ABody,#13#10,'<br>',[rfReplaceAll]);
148+ Result := Format(HTML,[ABody]);
149+end;
150+////////////////////////////////////////////////////////////////////////////////
151+var
152+ Doc: Variant;
153+begin
154+ Screen.Cursor := crHourGlass;
155+ try
156+ if not Assigned(AWebBrowser.Document) then
157+ AWebBrowser.Navigate('about:blank');
158+
159+ Doc := AWebBrowser.Document;
160+ Doc.Clear;
161+ Doc.Write(GetCorrectHTML(AText));
162+ Doc.Close;
163+ finally
164+ Screen.Cursor := crDefault;
165+ end;
166+end;
167+
127168 end.
--- trunk/client/src/lib/UMNWSWrapperFunctions.pas (revision 31)
+++ trunk/client/src/lib/UMNWSWrapperFunctions.pas (revision 32)
@@ -24,7 +24,7 @@
2424 implementation
2525
2626 uses
27- mnws, Windows, SysUtils, Classes, XMLXForm, IdGlobalProtocols;
27+ mnws, Windows, SysUtils, Classes, XMLXForm, IdGlobalProtocols, Forms, Controls;
2828
2929 function Login(PUserName, PPassword: String): TUserInfo;
3030 var
@@ -90,20 +90,25 @@
9090 XML: String;
9191 XMLTransform: TXMLTransform;
9292 begin
93- Result := False;
94- AClientDataSet.Close;
93+ Screen.Cursor := crHourGlass;
94+ try
95+ Result := False;
96+ AClientDataSet.Close;
9597
96- XML := GetmnwsPortType.getAttachments(AIssueNumber);
98+ XML := GetmnwsPortType.getAttachments(AIssueNumber);
9799
98- if XML <> '' then
99- begin
100- XMLTransform := TXMLTransform.Create(nil);
101- try
102- AClientDataSet.XMLData := XMLTransform.TransformXML(XML,ExtractFilePath(ParamStr(0)) + 'xtr\AttachmentsToDp.xtr');
103- Result := True;
104- finally
105- XMLTransform.Free;
100+ if XML <> '' then
101+ begin
102+ XMLTransform := TXMLTransform.Create(nil);
103+ try
104+ AClientDataSet.XMLData := XMLTransform.TransformXML(XML,ExtractFilePath(ParamStr(0)) + 'xtr\AttachmentsToDp.xtr');
105+ Result := True;
106+ finally
107+ XMLTransform.Free;
108+ end;
106109 end;
110+ finally
111+ Screen.Cursor := crDefault;
107112 end;
108113 end;
109114
@@ -138,20 +143,25 @@
138143 XML: String;
139144 XMLTransform: TXMLTransform;
140145 begin
141- Result := False;
142- AClientDataSet.Close;
146+ Screen.Cursor := crHourGlass;
147+ try
148+ Result := False;
149+ AClientDataSet.Close;
143150
144- XML := GetmnwsPortType.getComments(AIssueNumber,AUserId);
151+ XML := GetmnwsPortType.getComments(AIssueNumber,AUserId);
145152
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;
153+ if XML <> '' then
154+ begin
155+ XMLTransform := TXMLTransform.Create(nil);
156+ try
157+ AClientDataSet.XMLData := XMLTransform.TransformXML(XML,ExtractFilePath(ParamStr(0)) + 'xtr\CommentsToDp.xtr');
158+ Result := True;
159+ finally
160+ XMLTransform.Free;
161+ end;
154162 end;
163+ finally
164+ Screen.Cursor := crDefault;
155165 end;
156166 end;
157167
--- trunk/client/src/UDamoPrincipal.pas (revision 31)
+++ trunk/client/src/UDamoPrincipal.pas (revision 32)
@@ -74,6 +74,7 @@
7474 FIssueChecking: TIssueChecking;
7575 FMyIssues: TStringList;
7676 FFirstColorIndex: Byte;
77+ procedure DoOpenWithMantis(Sender: TObject);
7778 procedure AddMyIssues;
7879 procedure ClearMyIssues;
7980 procedure GetNewIssues(ACurrentIssues, AObtainedIssues, ANewIssues: TStringList);
@@ -95,7 +96,7 @@
9596
9697 uses
9798 UFormSplash, UFormGeneralConfiguration, Forms, UConfigurations,
98- ActnMenus, Graphics, UFormIssue, ActiveX, UMNWSWrapperFunctions;
99+ ActnMenus, Graphics, UFormIssue, ActiveX, UMNWSWrapperFunctions, UFunctions;
99100
100101 const
101102 NIN_BALLOONUSERCLICK = (WM_USER + 5);
@@ -146,11 +147,13 @@
146147 Image.Width := 16;
147148 Image.Height := 16;
148149 Image.Canvas.Brush.Style := bsSolid;
150+ Image.Canvas.Pen.Color := clBlack;
149151
150152 for i := 0 to Pred(Configurations.Statuses.Count) do
151153 begin
152154 Image.Canvas.Brush.Color := Configurations.GetStatusColor(StrToInt(Configurations.Statuses.Names[i]));
153155 Image.Canvas.FillRect(Rect(0,0,16,16));
156+ Image.Canvas.Rectangle(0,0,16,16);
154157 PIML.AddMasked(Image.Picture.Bitmap,clNone);
155158 end;
156159 finally
@@ -235,11 +238,35 @@
235238
236239 procedure TDamoPrincipal.AddMyIssues;
237240 ////////////////////////////////////////////////////////////////////////////////
241+function Separator: TMenuItem;
242+begin
243+ Result := TMenuItem.Create(Self);
244+ Result.Caption := '-';
245+end;
246+
238247 procedure AddIssue(AMenuItemPai: TMenuItem; AIssueNumber: Integer);
239248 var
240249 Action: TAction;
241250 MenuItem: TMenuItem;
242251 begin
252+ // Abrir no Mantis
253+ Action := TAction.Create(Self);
254+ Action.Category := MY_ISSUES;
255+ Action.Tag := AIssueNumber;
256+ Action.ActionList := AMAN;
257+ Action.Caption := 'Abrir no Mantis...';
258+ Action.ImageIndex := 6;
259+ Action.OnExecute := DoOpenWithMantis;
260+
261+ MenuItem := TMenuItem.Create(Self);
262+ MenuItem.Tag := AIssueNumber;
263+ MenuItem.Action := Action;
264+
265+ AMenuItemPai.Insert(0,MenuItem);
266+
267+ // Separador
268+ AMenuItemPai.Insert(0,Separator);
269+
243270 // Detalhes
244271 Action := TAction.Create(Self);
245272 Action.Category := MY_ISSUES;
@@ -361,6 +388,11 @@
361388 TFormIssue.ShowMe(TComponent(Sender).Tag);
362389 end;
363390
391+procedure TDamoPrincipal.DoOpenWithMantis(Sender: TObject);
392+begin
393+ OpenIssueWithMantis(TComponent(Sender).Tag);
394+end;
395+
364396 { TIssueChecking }
365397
366398 constructor TIssueChecking.Create(ACheckInterval: Byte; AUserId: Cardinal);
--- trunk/client/src/UFormBasicDialog.pas (revision 31)
+++ trunk/client/src/UFormBasicDialog.pas (revision 32)
@@ -30,7 +30,7 @@
3030 procedure ValidateOk; virtual;
3131 public
3232 { Public declarations }
33- class function ShowMeModal: TModalResult; overload;
33+ class function ShowMeModal: TModalResult; virtual;
3434 end;
3535
3636 implementation
--- trunk/client/src/UFormIssue.pas (revision 31)
+++ trunk/client/src/UFormIssue.pas (revision 32)
@@ -8,8 +8,7 @@
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, DBCGrids, HTMLabel, dbhtmlab,
12- PictureContainer;
11+ UPngSpeedButton, Menus, ActnPopup, DBCGrids;
1312
1413 type
1514 TFormIssue = class(TFormBasicDialog)
@@ -18,7 +17,7 @@
1817 ACTNExecute: TAction;
1918 ACTNReject: TAction;
2019 ACTNImpeachment: TAction;
21- PIML: TPngImageList;
20+ PIML32: TPngImageList;
2221 LAEDProjectName: TLabeledEdit;
2322 LAEDSummary: TLabeledEdit;
2423 LAEDTargetVersion: TLabeledEdit;
@@ -72,16 +71,40 @@
7271 CLDSCommentsDate: TDateTimeField;
7372 CLDSCommentsPrivate: TSmallintField;
7473 CLDSCommentsNote: TMemoField;
75- SCBXComments: TScrollBox;
76- DBCGComments: TDBCtrlGrid;
77- DHLAComment: TDBHTMLabel;
78- PANEComments: TPanel;
79- DBTXCommentReporter: TDBText;
80- DBTXCommentId: TDBText;
81- DBTXCommentDate: TDBText;
74+ ACLI: TActionList;
75+ PIML16: TPngImageList;
76+ ACTNNoteReply: TAction;
77+ ACTNNoteFullScreen: TAction;
78+ PACONotes: TPageControl;
79+ TASHNoteIndividual: TTabSheet;
80+ TASHNoteContinuous: TTabSheet;
81+ PANE: TPanel;
82+ Label1: TLabel;
83+ LABENoteDate: TLabel;
84+ PNSBNextNote: TPngSpeedButton;
85+ PNSBPreviousNote: TPngSpeedButton;
86+ LABENoteAuthor: TLabel;
87+ WEBRNote: TWebBrowser;
88+ LABENoteNumber: TLabel;
89+ TASHHistory: TTabSheet;
90+ PANEButtons: TPanel;
91+ PNBBNoteReply: TPngBitBtn;
92+ PNBBNoteFullScreen: TPngBitBtn;
93+ WEBRNotesContinuous: TWebBrowser;
94+ PANE1: TPanel;
95+ PNSBNoteNew: TPngSpeedButton;
96+ ACTNNoteNew: TAction;
97+ procedure TASHNoteContinuousShow(Sender: TObject);
98+ procedure CLDSCommentsAfterScroll(DataSet: TDataSet);
99+ procedure PNSBNextNoteClick(Sender: TObject);
100+ procedure PNSBPreviousNoteClick(Sender: TObject);
101+ procedure FormShow(Sender: TObject);
102+ procedure ACTNNoteFullScreenExecute(Sender: TObject);
103+ procedure ACTNNoteReplyExecute(Sender: TObject);
104+ procedure TASHStepsToReproduceShow(Sender: TObject);
105+ procedure TASHAdditionalInformationShow(Sender: TObject);
82106 procedure TASHCommentsShow(Sender: TObject);
83107 procedure TASHAttachmentsAndRelationshipsShow(Sender: TObject);
84- procedure DHLACommentGetData(Sender: TObject; Tag: string; var Data: string);
85108 procedure MNUIAttachNewClick(Sender: TObject);
86109 procedure MNUIDownloadAndOpenClick(Sender: TObject);
87110 procedure MNUIDownloadAttachmentClick(Sender: TObject);
@@ -96,23 +119,29 @@
96119 FAttachmentsLoaded: Boolean;
97120 FRelationshipsLoaded: Boolean;
98121 FCommentsLoaded: Boolean;
99-
100- procedure LoadIssue;
122+ FContinuousCommentsLoaded: Boolean;
123+ FAdditionalInfoLoaded: Boolean;
124+ FStepsToReproduceLoaded: Boolean;
101125
126+ procedure LoadIssueHeader;
127+ procedure LoadAdditionalInfo;
128+ procedure LoadStepsToReproduce;
129+
102130 procedure LoadAttachments;
103131 procedure LoadRelationships;
104132 procedure LoadComments;
133+ procedure LoadContinuousComments;
105134 protected
106135 procedure CreateParams(var Params: TCreateParams); override;
107136 public
108137 { Public declarations }
109- class function ShowMe(AIssueNumber: Cardinal; AModal: Boolean = False): TModalResult; overload;
138+ class function ShowMe(AIssueNumber: Cardinal; AModal: Boolean = False): TModalResult;
110139 end;
111140
112141 implementation
113142
114143 uses
115- UConfigurations, EncdDecd;
144+ UConfigurations, UFormViewNote;
116145
117146 {$R *.dfm}
118147
@@ -125,13 +154,43 @@
125154 // Params.WndParent := 0;
126155 end;
127156
128-procedure TFormIssue.DHLACommentGetData(Sender: TObject; Tag: string; var Data: string);
157+procedure TFormIssue.FormShow(Sender: TObject);
129158 begin
130159 inherited;
131- if Tag = 'Note' then
132- Data := DecodeString(CLDSCommentsNote.AsString);
160+ Application.ProcessMessages;
133161 end;
134162
163+procedure TFormIssue.ACTNNoteFullScreenExecute(Sender: TObject);
164+begin
165+ inherited;
166+ TFormViewNote.ShowMeModal(Self,FIssueInfo.Id,TAction(Sender).ActionComponent.Tag);
167+end;
168+
169+procedure TFormIssue.ACTNNoteReplyExecute(Sender: TObject);
170+begin
171+ inherited;
172+ ShowMessage(IntToStr(TAction(Sender).ActionComponent.Tag));
173+end;
174+
175+procedure TFormIssue.CLDSCommentsAfterScroll(DataSet: TDataSet);
176+begin
177+ inherited;
178+ LABENoteAuthor.Caption := CLDSCommentsReporter.AsString;
179+ LABENoteDate.Caption := FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',CLDSCommentsDate.AsDateTime);
180+ LABENoteNumber.Caption := '(' + CLDSCommentsid.AsString + ')';
181+ LoadWebBrowserHTML(WEBRNote,CLDSCommentsNote.AsString,True);
182+ PNBBNoteReply.Tag := CLDSCommentsId.AsInteger;
183+ PNBBNoteFullScreen.Tag := CLDSCommentsId.AsInteger;
184+
185+ if CLDSCommentsPrivate.AsInteger = 1 then
186+ PANE.Color := clGray
187+ else
188+ PANE.Color := clGreen;
189+
190+ PNSBNextNote.Enabled := CLDSComments.RecNo > 1;
191+ PNSBPreviousNote.Enabled := CLDSComments.RecNo < CLDSComments.RecordCount;
192+end;
193+
135194 procedure TFormIssue.CLDSRelatedIssuesStatusGetText(Sender: TField; var Text: string; DisplayText: Boolean);
136195 begin
137196 inherited;
@@ -169,6 +228,15 @@
169228 end;
170229 end;
171230
231+procedure TFormIssue.LoadAdditionalInfo;
232+begin
233+ if not FAdditionalInfoLoaded then
234+ begin
235+ LoadWebBrowserHTML(WEBRAdditionalInformation,FIssueInfo.AdditionalInformation);
236+ FAdditionalInfoLoaded := True;
237+ end;
238+end;
239+
172240 procedure TFormIssue.LoadAttachments;
173241 begin
174242 if not FAttachmentsLoaded then
@@ -176,95 +244,18 @@
176244 end;
177245
178246 procedure TFormIssue.LoadComments;
179-////////////////////////////////////////////////////////////////////////////////
180-procedure CreateHeaderPanel(ANoteID: Integer; AReporter: String; ADate: TDateTime);
181-var
182- P: TPanel;
183247 begin
184- P := TPanel.Create(Self);
185- with P do
186- begin
187- Parent := SCBXComments;
188- Height := 16;
189- Align := alTop;
190- Color := clGreen;
191- ParentBackground := False;
192- AlignWithMargins := True;
193- Margins.Right := 0;
194- Margins.Left := 0;
195- Margins.Bottom := 3;
196- Margins.Top := 0;
197- end;
198- bolar um meio de criar os paineis na ordem correta
199-
200-
201- with TLabel.Create(Self) do
202- begin
203- Parent := P;
204- AlignWithMargins := True;
205- Width := 80;
206- Margins.Top := 0;
207- Margins.Right := 0;
208- Margins.Bottom := 0;
209- Align := alLeft;
210- Font.Style := [fsBold];
211- Font.Color := clWhite;
212- Caption := '#' + IntToStr(ANoteID);
213- Color := clYellow;
214- Transparent := False;
215- end;
216-
217- with TLabel.Create(Self) do
218- begin
219- Parent := P;
220- AlignWithMargins := True;
221- Width := 130;
222- Margins.Top := 0;
223- Margins.Left := 0;
224- Margins.Bottom := 0;
225- Align := alRight;
226- Font.Style := [fsBold];
227- Font.Color := clWhite;
228- Alignment := taRightJustify;
229- Caption := FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',ADate);
230- Color := clYellow;
231- Transparent := False;
232- end;
233-end;
234-////////////////////////////////////////////////////////////////////////////////
235-begin
236-// if not FCommentsLoaded then
237-// FCommentsLoaded := GetComments(FIssueInfo.Id,Configurations.UserId,CLDSComments);
238248 if not FCommentsLoaded then
239- begin
240249 FCommentsLoaded := GetComments(FIssueInfo.Id,Configurations.UserId,CLDSComments);
241- if FCommentsLoaded then
242- while not CLDSComments.Eof do
243- begin
244- CreateHeaderPanel(CLDSCommentsId.AsInteger, CLDSCommentsReporter.AsString, CLDSCommentsDate.AsDateTime);
245- CLDSComments.Next;
246- end;
247- end;
248250 end;
249251
250-procedure TFormIssue.LoadIssue;
251-////////////////////////////////////////////////////////////////////////////////
252-function GetCorrectHTML(ABody: String): String;
253-const
254- HTML = '<html>'
255- + '<head>'
256- + '<style type="text/css">'
257- + 'body {margin: 5pt; font-size: 10pt; font-family: Verdana, Arial, Helvetica, sans-serif}'
258- + '</style>'
259- + '</head>'
260- + '<body>%s</body>'
261- + '</html>';
252+procedure TFormIssue.LoadContinuousComments;
262253 begin
263- Result := Format(HTML,[ABody]);
254+ if not FContinuousCommentsLoaded then
255+ FContinuousCommentsLoaded := True;
264256 end;
265-////////////////////////////////////////////////////////////////////////////////
266-var
267- Doc: Variant;
257+
258+procedure TFormIssue.LoadIssueHeader;
268259 begin
269260 Caption := 'Caso Mantis #' + IntToStr(FIssueInfo.Id);
270261 LAEDProjectName.Text := FIssueInfo.ProjectName;
@@ -271,34 +262,11 @@
271262 LAEDSummary.Text := FIssueInfo.Summary;
272263 LAEDTargetVersion.Text := FIssueInfo.TargetVersion;
273264
274- if not Assigned(WEBRDescription.Document) then
275- WEBRDescription.Navigate('about:blank');
276-
277- Doc := WEBRDescription.Document;
278- Doc.Clear;
279- Doc.Write(GetCorrectHTML(FIssueInfo.Description));
280- Doc.Close;
281-
282265 LAEDStatus.Text := Configurations.GetStatusName(FIssueInfo.Status);
283266 LAEDLastUpdate.Text := FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',FIssueInfo.LastUpdated);
284267 LAEDReporter.Text := FIssueInfo.Reporter;
285268
286- if not Assigned(WEBRStepsToReproduce.Document) then
287- WEBRStepsToReproduce.Navigate('about:blank');
288-
289- Doc := WEBRStepsToReproduce.Document;
290- Doc.Clear;
291- Doc.Write(GetCorrectHTML(FIssueInfo.StepsToReproduce));
292- Doc.Close;
293-
294-
295- if not Assigned(WEBRAdditionalInformation.Document) then
296- WEBRAdditionalInformation.Navigate('about:blank');
297-
298- Doc := WEBRAdditionalInformation.Document;
299- Doc.Clear;
300- Doc.Write(GetCorrectHTML(FIssueInfo.AdditionalInformation));
301- Doc.Close;
269+ LoadWebBrowserHTML(WEBRDescription,FIssueInfo.Description);
302270 end;
303271
304272 procedure TFormIssue.LoadRelationships;
@@ -307,6 +275,15 @@
307275 FRelationshipsLoaded := GetRelatedIssues(FIssueInfo.Id,CLDSRelatedIssues);
308276 end;
309277
278+procedure TFormIssue.LoadStepsToReproduce;
279+begin
280+ if not FStepsToReproduceLoaded then
281+ begin
282+ LoadWebBrowserHTML(WEBRStepsToReproduce,FIssueInfo.StepsToReproduce);
283+ FStepsToReproduceLoaded := True;
284+ end;
285+end;
286+
310287 procedure TFormIssue.MNUIAttachNewClick(Sender: TObject);
311288 begin
312289 inherited;
@@ -346,19 +323,34 @@
346323 Close;
347324 end;
348325
326+procedure TFormIssue.PNSBNextNoteClick(Sender: TObject);
327+begin
328+ inherited;
329+ CLDSComments.Prior;
330+end;
331+
332+procedure TFormIssue.PNSBPreviousNoteClick(Sender: TObject);
333+begin
334+ inherited;
335+ CLDSComments.Next;
336+end;
337+
349338 class function TFormIssue.ShowMe(AIssueNumber: Cardinal; AModal: Boolean = False): TModalResult;
350339 begin
351340 Result := mrNone;
352-
341+
353342 with Self.Create(Application) do
354343 begin
355344 FIssueInfo := DecodeIssueInfo(GetIssueInfo(AIssueNumber));
356345
357- LoadIssue;
346+ LoadIssueHeader;
358347
359348 FAttachmentsLoaded := False;
360349 FRelationshipsLoaded := False;
361350 FCommentsLoaded := False;
351+ FContinuousCommentsLoaded := False;
352+ FAdditionalInfoLoaded := False;
353+ FStepsToReproduceLoaded := False;
362354
363355 if AModal then
364356 Result := ShowModal
@@ -367,6 +359,12 @@
367359 end;
368360 end;
369361
362+procedure TFormIssue.TASHAdditionalInformationShow(Sender: TObject);
363+begin
364+ inherited;
365+ LoadAdditionalInfo;
366+end;
367+
370368 procedure TFormIssue.TASHAttachmentsAndRelationshipsShow(Sender: TObject);
371369 begin
372370 inherited;
@@ -380,4 +378,16 @@
380378 LoadComments;
381379 end;
382380
381+procedure TFormIssue.TASHNoteContinuousShow(Sender: TObject);
382+begin
383+ inherited;
384+ LoadContinuousComments;
385+end;
386+
387+procedure TFormIssue.TASHStepsToReproduceShow(Sender: TObject);
388+begin
389+ inherited;
390+ LoadStepsToReproduce;
391+end;
392+
383393 end.
--- trunk/client/src/UFormViewNote.pas (nonexistent)
+++ trunk/client/src/UFormViewNote.pas (revision 32)
@@ -0,0 +1,129 @@
1+unit UFormViewNote;
2+
3+interface
4+
5+uses
6+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7+ Dialogs, UFormBasicDialog, StdCtrls, Buttons, UPngBitBtn, ExtCtrls, PngImage,
8+ OleCtrls, SHDocVw, UPngSpeedButton, DB, DBClient;
9+
10+type
11+ TFormViewNote = class(TFormBasicDialog)
12+ PANE: TPanel;
13+ LABE2: TLabel;
14+ LABENoteDate: TLabel;
15+ WEBRNote: TWebBrowser;
16+ PNSBNextNote: TPngSpeedButton;
17+ PNSBPreviousNote: TPngSpeedButton;
18+ CLDSComments: TClientDataSet;
19+ CLDSCommentsId: TIntegerField;
20+ CLDSCommentsReporter: TStringField;
21+ CLDSCommentsDate: TDateTimeField;
22+ CLDSCommentsPrivate: TSmallintField;
23+ CLDSCommentsNote: TMemoField;
24+ LABENoteAuthor: TLabel;
25+ IMAGOpenWithMantis: TImage;
26+ PNSBLast: TPngSpeedButton;
27+ PNSBFirst: TPngSpeedButton;
28+ procedure PNSBFirstClick(Sender: TObject);
29+ procedure PNSBLastClick(Sender: TObject);
30+ procedure IMAGOpenWithMantisClick(Sender: TObject);
31+ procedure FormShow(Sender: TObject);
32+ procedure CLDSCommentsAfterScroll(DataSet: TDataSet);
33+ procedure PNSBNextNoteClick(Sender: TObject);
34+ procedure PNSBPreviousNoteClick(Sender: TObject);
35+ procedure PNBBOKClick(Sender: TObject);
36+ private
37+ { Private declarations }
38+ FCaptionTemplate: String;
39+ FIssueNumber: Cardinal;
40+ FNoteId: Cardinal;
41+ public
42+ { Public declarations }
43+ class function ShowMeModal(AOwner: TComponent; AIssueNumber, ANoteId: Cardinal): TModalResult; reintroduce;
44+ end;
45+
46+implementation
47+
48+uses
49+ UMNWSWrapperFunctions, UConfigurations, UFunctions;
50+
51+{$R *.dfm}
52+
53+{ TFormViewNote }
54+
55+procedure TFormViewNote.CLDSCommentsAfterScroll(DataSet: TDataSet);
56+begin
57+ inherited;
58+ LABENoteAuthor.Caption := CLDSCommentsReporter.AsString;
59+ LABENoteDate.Caption := FormatDateTime('dd/mm/yyyy "às" hh:nn:ss',CLDSCommentsDate.AsDateTime);
60+ LABECaption.Caption := Format(FCaptionTemplate,[CLDSCommentsid.AsInteger,CLDSComments.RecNo,CLDSComments.RecordCount]);
61+ LoadWebBrowserHTML(WEBRNote,CLDSCommentsNote.AsString,True);
62+
63+ if CLDSCommentsPrivate.AsInteger = 1 then
64+ PANE.Color := clGray
65+ else
66+ PANE.Color := clGreen;
67+
68+ PNSBLast.Enabled := CLDSComments.RecNo > 1;
69+ PNSBNextNote.Enabled := PNSBLast.Enabled;
70+
71+ PNSBFirst.Enabled := CLDSComments.RecNo < CLDSComments.RecordCount;
72+ PNSBPreviousNote.Enabled := PNSBFirst.Enabled;
73+end;
74+
75+procedure TFormViewNote.FormShow(Sender: TObject);
76+begin
77+ inherited;
78+ GetComments(FIssueNumber,Configurations.UserId,CLDSComments);
79+ CLDSComments.Locate('Id',FNoteId,[]);
80+end;
81+
82+procedure TFormViewNote.IMAGOpenWithMantisClick(Sender: TObject);
83+begin
84+ inherited;
85+ OpenIssueWithMantis(FIssueNumber);
86+end;
87+
88+procedure TFormViewNote.PNBBOKClick(Sender: TObject);
89+begin
90+// inherited;
91+ // Método para responder a anotação visível
92+end;
93+
94+procedure TFormViewNote.PNSBFirstClick(Sender: TObject);
95+begin
96+ inherited;
97+ CLDSComments.Last;
98+end;
99+
100+procedure TFormViewNote.PNSBLastClick(Sender: TObject);
101+begin
102+ inherited;
103+ CLDSComments.First;
104+end;
105+
106+procedure TFormViewNote.PNSBNextNoteClick(Sender: TObject);
107+begin
108+ inherited;
109+ CLDSComments.Prior;
110+end;
111+
112+procedure TFormViewNote.PNSBPreviousNoteClick(Sender: TObject);
113+begin
114+ inherited;
115+ CLDSComments.Next;
116+end;
117+
118+class function TFormViewNote.ShowMeModal(AOwner: TComponent; AIssueNumber: Cardinal; ANoteId: Cardinal): TModalResult;
119+begin
120+ with Self.Create(AOwner) do
121+ begin
122+ FCaptionTemplate := 'Visualizando anotação #%u (%u/%u)';
123+ FIssueNumber := AIssueNumber;
124+ FNoteId := ANoteId;
125+ Result := ShowModal;
126+ end;
127+end;
128+
129+end.
Show on old repository browser