Rev 4 | Rev 6 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 5 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | unit BugtrackerMain; |
1 | unit BugtrackerMain; |
2 | 2 | ||
3 | (* |
3 | (* |
4 | * TODO: |
4 | * TODO: |
5 | * - fertigstellen |
- | |
6 | * ... bearbeitungsnotiz-button (rtf-farben usw) |
- | |
7 | * ... |
- | |
8 | * - abfragen ob speichern wenn fenster geschlossen wird |
5 | * - abfragen ob speichern wenn fenster geschlossen wird |
- | 6 | * - Spezielle Filter |
|
9 | * - filtern nach modul |
7 | * ... Auflisten nach Modul |
- | 8 | * ... Anzeigen der Agenda |
|
10 | * - verbinden mit ticketsystem von HS |
9 | * - verbinden mit ticketsystem von HS |
11 | * - rtf controls? |
10 | * - rtf controls? |
- | 11 | * - Neue Felder: |
|
- | 12 | * ... Erfasser |
|
- | 13 | * ... Agenda |
|
- | 14 | * ... Status = Offen, gefixt, Abgelehnt, Veröffentlicht |
|
- | 15 | * ... RTF Feld als BIGTEXT definieren |
|
- | 16 | * - Neue Aufteilung der States |
|
- | 17 | * ... Open, Fixed, Published, Wontfix/Rejected, Planned(Agenda) |
|
12 | *) |
18 | *) |
13 | 19 | ||
14 | interface |
20 | interface |
15 | 21 | ||
16 | uses |
22 | uses |
Line 73... | Line 79... | ||
73 | qryBugsversion_release: TIntegerField; |
79 | qryBugsversion_release: TIntegerField; |
74 | qryBugsmodul: TIntegerField; |
80 | qryBugsmodul: TIntegerField; |
75 | qryBugsprojekt: TIntegerField; |
81 | qryBugsprojekt: TIntegerField; |
76 | qryVersionen: TADOQuery; |
82 | qryVersionen: TADOQuery; |
77 | qryModule: TADOQuery; |
83 | qryModule: TADOQuery; |
- | 84 | LblAngemeldet: TLabel; |
|
- | 85 | Label7: TLabel; |
|
- | 86 | Label8: TLabel; |
|
78 | procedure Mitarbeiter1Click(Sender: TObject); |
87 | procedure Mitarbeiter1Click(Sender: TObject); |
79 | procedure qryBugsAfterScroll(DataSet: TDataSet); |
88 | procedure qryBugsAfterScroll(DataSet: TDataSet); |
80 | procedure Module1Click(Sender: TObject); |
89 | procedure Module1Click(Sender: TObject); |
81 | procedure Projekte1Click(Sender: TObject); |
90 | procedure Projekte1Click(Sender: TObject); |
82 | procedure Versionen1Click(Sender: TObject); |
91 | procedure Versionen1Click(Sender: TObject); |
Line 89... | Line 98... | ||
89 | procedure btnFixedToggleClick(Sender: TObject); |
98 | procedure btnFixedToggleClick(Sender: TObject); |
90 | procedure qryBugsversion_releaseValidate(Sender: TField); |
99 | procedure qryBugsversion_releaseValidate(Sender: TField); |
91 | procedure FormCreate(Sender: TObject); |
100 | procedure FormCreate(Sender: TObject); |
92 | procedure qryVersionenAfterInsert(DataSet: TDataSet); |
101 | procedure qryVersionenAfterInsert(DataSet: TDataSet); |
93 | procedure qryModuleAfterInsert(DataSet: TDataSet); |
102 | procedure qryModuleAfterInsert(DataSet: TDataSet); |
94 | private |
- | |
95 | { Private-Deklarationen } |
103 | procedure btnBearbeitungsnotizClick(Sender: TObject); |
96 | public |
104 | public |
97 | { Public-Deklarationen } |
- | |
98 | eingeloggtMitarbeiter: integer; |
105 | eingeloggtMitarbeiter: integer; |
- | 106 | eingeloggtMitarbeiterName: string; |
|
99 | aktuellesProjekt: integer; |
107 | aktuellesProjekt: integer; |
- | 108 | aktuellesProjektName: string; |
|
100 | procedure NeuFiltern; |
109 | procedure NeuFiltern; |
- | 110 | procedure NotizHinzufuegen(color: TColor; bez: string); |
|
101 | end; |
111 | end; |
102 | 112 | ||
103 | var |
113 | var |
104 | frmBugtracker: TfrmBugtracker; |
114 | frmBugtracker: TfrmBugtracker; |
105 | 115 | ||
Line 170... | Line 180... | ||
170 | procedure TfrmBugtracker.ber1Click(Sender: TObject); |
180 | procedure TfrmBugtracker.ber1Click(Sender: TObject); |
171 | begin |
181 | begin |
172 | AboutBox.ShowModal; |
182 | AboutBox.ShowModal; |
173 | end; |
183 | end; |
174 | 184 | ||
- | 185 | procedure TfrmBugtracker.btnBearbeitungsnotizClick(Sender: TObject); |
|
- | 186 | begin |
|
- | 187 | NotizHinzufuegen(clRed, 'Notiz'); |
|
- | 188 | end; |
|
- | 189 | ||
175 | procedure TfrmBugtracker.btnFixedToggleClick(Sender: TObject); |
190 | procedure TfrmBugtracker.btnFixedToggleClick(Sender: TObject); |
176 | begin |
191 | begin |
177 | if not (qryBugs.State in [dsEdit, dsInsert]) then qryBugs.Edit; |
192 | if not (qryBugs.State in [dsEdit, dsInsert]) then qryBugs.Edit; |
178 | if qryBugs.FieldByName('fixdatum').IsNull then |
193 | if qryBugs.FieldByName('fixdatum').IsNull then |
- | 194 | begin |
|
179 | qryBugs.FieldByName('fixdatum').AsDateTime := Now |
195 | qryBugs.FieldByName('fixdatum').AsDateTime := Now; |
- | 196 | NotizHinzufuegen(clGreen, 'Gefixt'); |
|
- | 197 | end |
|
180 | else |
198 | else |
- | 199 | begin |
|
181 | qryBugs.FieldByName('fixdatum').Clear; |
200 | qryBugs.FieldByName('fixdatum').Clear; |
- | 201 | NotizHinzufuegen(clBlue, 'Neu eröffnet'); |
|
- | 202 | end; |
|
182 | end; |
203 | end; |
183 | 204 | ||
184 | procedure TfrmBugtracker.ComboBox1Change(Sender: TObject); |
205 | procedure TfrmBugtracker.ComboBox1Change(Sender: TObject); |
185 | begin |
206 | begin |
186 | case ComboBox1.ItemIndex of |
207 | case ComboBox1.ItemIndex of |
Line 251... | Line 272... | ||
251 | 272 | ||
252 | qryVersionen.SQL.Text := 'SELECT * FROM versionen WHERE projekt = ' + IntToStr(aktuellesProjekt); |
273 | qryVersionen.SQL.Text := 'SELECT * FROM versionen WHERE projekt = ' + IntToStr(aktuellesProjekt); |
253 | qryVersionen.Active := true; |
274 | qryVersionen.Active := true; |
254 | end; |
275 | end; |
255 | 276 | ||
- | 277 | procedure TfrmBugtracker.NotizHinzufuegen(color: TColor; bez: string); |
|
- | 278 | var |
|
- | 279 | leerzeilen: integer; |
|
- | 280 | umbruch: string; |
|
- | 281 | prefix: string; |
|
- | 282 | begin |
|
- | 283 | if not (qryBugs.State in [dsEdit, dsInsert]) then qryBugs.Edit; |
|
- | 284 | ||
- | 285 | // Endet der Text mit zwei Zeilenabständen? Wenn nein, dann einfügen. |
|
- | 286 | leerzeilen := 0; |
|
- | 287 | if Copy(DBRichEdit1.Text, 1+Length(DBRichEdit1.Text)-2, 2) = #13#10 then Inc(leerzeilen); // letzte Zeile |
|
- | 288 | if Copy(DBRichEdit1.Text, 1+Length(DBRichEdit1.Text)-4, 2) = #13#10 then Inc(leerzeilen); // Vorletzte Zeile |
|
- | 289 | case leerzeilen of |
|
- | 290 | 0: umbruch := #13#10#13#10; |
|
- | 291 | 1: umbruch := #13#10; |
|
- | 292 | 2: umbruch := ''; |
|
- | 293 | end; |
|
- | 294 | ||
- | 295 | DBRichEdit1.SelStart := DBRichEdit1.GetTextLen; |
|
- | 296 | DBRichEdit1.SelText := umbruch; |
|
- | 297 | ||
- | 298 | DBRichEdit1.SelAttributes.Size := 13; |
|
- | 299 | DBRichEdit1.SelAttributes.Color := color; |
|
- | 300 | DBRichEdit1.SelAttributes.Style := [fsUnderline]; |
|
- | 301 | if Trim(bez) <> '' then |
|
- | 302 | prefix := Trim(bez) + ' - ' |
|
- | 303 | else |
|
- | 304 | prefix := ''; |
|
- | 305 | DBRichEdit1.SelText := prefix + eingeloggtMitarbeiterName + ' ' + FormatDateTime('dd.mm.yyyy hh:nn', Now); // DateTimeToStr(Now); |
|
- | 306 | ||
- | 307 | DBRichEdit1.SelAttributes.Size := 10; |
|
- | 308 | DBRichEdit1.SelAttributes.Color := clWindowText; |
|
- | 309 | DBRichEdit1.SelAttributes.Style := []; |
|
- | 310 | DBRichEdit1.SelText := #13#10 {+ '<Hier Text eingeben>'}; |
|
- | 311 | ||
- | 312 | // Ans Ende scrollen |
|
- | 313 | DBRichEdit1.SetFocus; |
|
- | 314 | DBRichEdit1.SelStart := DBRichEdit1.GetTextLen; |
|
- | 315 | DBRichEdit1.Perform(EM_SCROLLCARET, 0, 0); |
|
- | 316 | end; |
|
- | 317 | ||
256 | procedure TfrmBugtracker.Projekte1Click(Sender: TObject); |
318 | procedure TfrmBugtracker.Projekte1Click(Sender: TObject); |
257 | begin |
319 | begin |
258 | frmProjekte.ShowModal; |
320 | frmProjekte.ShowModal; |
259 | end; |
321 | end; |
260 | 322 |