You've already forked lazarus-ccr
tvplanit: Lots of cosmetic changes
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4771 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -159,6 +159,10 @@ msgctxt "vpsr.rscalendartoday"
|
|||||||
msgid "Today"
|
msgid "Today"
|
||||||
msgstr "Heute"
|
msgstr "Heute"
|
||||||
|
|
||||||
|
#: vpsr.rscalendarweekabbr
|
||||||
|
msgid "CW"
|
||||||
|
msgstr "KW"
|
||||||
|
|
||||||
#: vpsr.rscancelbtn
|
#: vpsr.rscancelbtn
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr "Abbrechen"
|
msgstr "Abbrechen"
|
||||||
|
@ -149,6 +149,10 @@ msgctxt "vpsr.rscalendartoday"
|
|||||||
msgid "Today"
|
msgid "Today"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: vpsr.rscalendarweekabbr
|
||||||
|
msgid "CW"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rscancelbtn
|
#: vpsr.rscancelbtn
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -113,10 +113,10 @@ type
|
|||||||
procedure DisplayCurrentCountry;
|
procedure DisplayCurrentCountry;
|
||||||
procedure ResizeControls;
|
procedure ResizeControls;
|
||||||
public
|
public
|
||||||
Resource : TVpResource;
|
Resource: TVpResource;
|
||||||
Contact : TVpContact;
|
Contact: TVpContact;
|
||||||
ReturnCode : TVpEditorReturnCode;
|
ReturnCode: TVpEditorReturnCode;
|
||||||
ControlLink : TVpControlLink;
|
ControlLink: TVpControlLink;
|
||||||
procedure PopulateSelf;
|
procedure PopulateSelf;
|
||||||
procedure DePopulateSelf;
|
procedure DePopulateSelf;
|
||||||
procedure ArrangeControls;
|
procedure ArrangeControls;
|
||||||
@ -124,9 +124,9 @@ type
|
|||||||
|
|
||||||
TVpContactEditDialog = class(TVpBaseDialog)
|
TVpContactEditDialog = class(TVpBaseDialog)
|
||||||
protected {private}
|
protected {private}
|
||||||
ceEditDlg : TContactEditForm;
|
ceEditDlg: TContactEditForm;
|
||||||
ceContact : TVpContact;
|
ceContact: TVpContact;
|
||||||
ceResource : TVpResource;
|
ceResource: TVpResource;
|
||||||
public
|
public
|
||||||
function Execute(Contact: TVpContact): Boolean; reintroduce;
|
function Execute(Contact: TVpContact): Boolean; reintroduce;
|
||||||
function AddNewContact: Boolean;
|
function AddNewContact: Boolean;
|
||||||
@ -150,7 +150,7 @@ uses
|
|||||||
|
|
||||||
{== Utility functions ===================================}
|
{== Utility functions ===================================}
|
||||||
|
|
||||||
function Max(const a, b : Integer) : Integer;
|
function Max(const a, b: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
if a >= b then
|
if a >= b then
|
||||||
Result := a
|
Result := a
|
||||||
@ -254,9 +254,9 @@ end;
|
|||||||
|
|
||||||
procedure TContactEditForm.PopulateSelf;
|
procedure TContactEditForm.PopulateSelf;
|
||||||
var
|
var
|
||||||
CurCountry : Integer;
|
CurCountry: Integer;
|
||||||
i : TVpPhoneType;
|
pt: TVpPhoneType;
|
||||||
j : TVpCategoryType;
|
ct: TVpCategoryType;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
NameEdit.Text := AssembleName(Contact);
|
NameEdit.Text := AssembleName(Contact);
|
||||||
@ -296,12 +296,12 @@ begin
|
|||||||
cboxState.Text := Contact.State;
|
cboxState.Text := Contact.State;
|
||||||
|
|
||||||
|
|
||||||
for i := Low (TVpPhoneType) to High (TVpPhoneType) do begin
|
for pt := Low (TVpPhoneType) to High (TVpPhoneType) do begin
|
||||||
cboxPhoneLbl1.Items.Add (PhoneLabel (i));
|
cboxPhoneLbl1.Items.Add(PhoneLabel(pt));
|
||||||
cboxPhoneLbl2.Items.Add (PhoneLabel (i));
|
cboxPhoneLbl2.Items.Add(PhoneLabel(pt));
|
||||||
cboxPhoneLbl3.Items.Add (PhoneLabel (i));
|
cboxPhoneLbl3.Items.Add(PhoneLabel(pt));
|
||||||
cboxPhoneLbl4.Items.Add (PhoneLabel (i));
|
cboxPhoneLbl4.Items.Add(PhoneLabel(pt));
|
||||||
cboxPhoneLbl5.Items.Add (PhoneLabel (i));
|
cboxPhoneLbl5.Items.Add(PhoneLabel(pt));
|
||||||
end;
|
end;
|
||||||
cboxPhoneLbl1.ItemIndex := Contact.PhoneType1;
|
cboxPhoneLbl1.ItemIndex := Contact.PhoneType1;
|
||||||
cboxPhoneLbl2.ItemIndex := Contact.PhoneType2;
|
cboxPhoneLbl2.ItemIndex := Contact.PhoneType2;
|
||||||
@ -309,8 +309,8 @@ begin
|
|||||||
cboxPhoneLbl4.ItemIndex := Contact.PhoneType4;
|
cboxPhoneLbl4.ItemIndex := Contact.PhoneType4;
|
||||||
cboxPhoneLbl5.ItemIndex := Contact.PhoneType5;
|
cboxPhoneLbl5.ItemIndex := Contact.PhoneType5;
|
||||||
|
|
||||||
for j := Low (TVpCategoryType) to High (TVpCategoryType) do
|
for ct := Low (TVpCategoryType) to High (TVpCategoryType) do
|
||||||
cboxCategory.Items.Add (CategoryLabel (j));
|
cboxCategory.Items.Add(CategoryLabel(ct));
|
||||||
cboxCategory.ItemIndex := Contact.Category;
|
cboxCategory.ItemIndex := Contact.Category;
|
||||||
|
|
||||||
DisplayCurrentCountry;
|
DisplayCurrentCountry;
|
||||||
@ -346,7 +346,7 @@ begin
|
|||||||
cboxState.Visible := False;
|
cboxState.Visible := False;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
ControlLink.Localization.CountriesToTStrings (cboxCountry.Items);
|
ControlLink.Localization.CountriesToTStrings(cboxCountry.Items);
|
||||||
CountryLbl.FocusControl := cboxCountry;
|
CountryLbl.FocusControl := cboxCountry;
|
||||||
cboxCountry.Visible := True;
|
cboxCountry.Visible := True;
|
||||||
edtCountry.Visible := False;
|
edtCountry.Visible := False;
|
||||||
@ -372,14 +372,13 @@ type
|
|||||||
TLabelArray = array[0..9] of TLabel;
|
TLabelArray = array[0..9] of TLabel;
|
||||||
|
|
||||||
var
|
var
|
||||||
Labels : TLabelArray;
|
Labels: TLabelArray;
|
||||||
LargestLabel : Integer;
|
LargestLabel: Integer;
|
||||||
WidestField : Integer;
|
WidestField: Integer;
|
||||||
i : Integer;
|
i, j: Integer;
|
||||||
j : Integer;
|
OldFont: TFont;
|
||||||
OldFont : TFont;
|
FieldTop: Integer;
|
||||||
FieldTop : Integer;
|
delta: Integer;
|
||||||
delta : Integer;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ Note: The resizing algorithm is dependent upon the labels having their
|
{ Note: The resizing algorithm is dependent upon the labels having their
|
||||||
@ -413,21 +412,22 @@ begin
|
|||||||
try
|
try
|
||||||
Canvas.Font.Assign (cboxCountry.Font);
|
Canvas.Font.Assign (cboxCountry.Font);
|
||||||
try
|
try
|
||||||
for j := 0 to cboxCountry.Items.Count - 1 do begin
|
for j := 0 to cboxCountry.Items.Count - 1 do begin
|
||||||
i := Canvas.TextWidth (cboxCountry.Items[j]);
|
i := Canvas.TextWidth(cboxCountry.Items[j]);
|
||||||
if i > WidestField then
|
if i > WidestField then
|
||||||
WidestField := i;
|
WidestField := i;
|
||||||
end;
|
end;
|
||||||
WidestField := WidestField + ComboArrowWidth;
|
WidestField := WidestField + ComboArrowWidth;
|
||||||
cboxCountry.Width := WidestField;
|
cboxCountry.Width := WidestField;
|
||||||
finally
|
finally
|
||||||
Canvas.Font.Assign (OldFont);
|
Canvas.Font.Assign(OldFont);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
OldFont.Free;
|
OldFont.Free;
|
||||||
end;
|
end;
|
||||||
if (cboxCountry.Left + cboxCountry.Width + FormRightBorder > MinFormWidth) and
|
if (cboxCountry.Left + cboxCountry.Width + FormRightBorder > MinFormWidth) and
|
||||||
(not cboxState.Visible) then
|
(not cboxState.Visible)
|
||||||
|
then
|
||||||
Width := cboxCountry.Left + cboxCountry.Width + FormRightBorder
|
Width := cboxCountry.Left + cboxCountry.Width + FormRightBorder
|
||||||
else
|
else
|
||||||
Width := MinFormWidth;
|
Width := MinFormWidth;
|
||||||
@ -438,23 +438,24 @@ begin
|
|||||||
OldFont := TFont.Create;
|
OldFont := TFont.Create;
|
||||||
try
|
try
|
||||||
OldFont.Assign(Canvas.Font);
|
OldFont.Assign(Canvas.Font);
|
||||||
Canvas.Font.Assign (cboxCountry.Font);
|
Canvas.Font.Assign(cboxCountry.Font);
|
||||||
try
|
try
|
||||||
for j := 0 to cboxState.Items.Count - 1 do begin
|
for j := 0 to cboxState.Items.Count - 1 do begin
|
||||||
i := Canvas.TextWidth (cboxState.Items[j]);
|
i := Canvas.TextWidth(cboxState.Items[j]);
|
||||||
if i > WidestField then
|
if i > WidestField then
|
||||||
WidestField := i;
|
WidestField := i;
|
||||||
end;
|
end;
|
||||||
WidestField := WidestField + ComboArrowWidth;
|
WidestField := WidestField + ComboArrowWidth;
|
||||||
cboxState.Width := WidestField;
|
cboxState.Width := WidestField;
|
||||||
finally
|
finally
|
||||||
Canvas.Font.Assign (OldFont);
|
Canvas.Font.Assign(OldFont);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
OldFont.Free;
|
OldFont.Free;
|
||||||
end;
|
end;
|
||||||
if (cboxState.Left + cboxState.Width + FormRightBorder > MinFormWidth) and
|
if (cboxState.Left + cboxState.Width + FormRightBorder > MinFormWidth) and
|
||||||
(not cboxCountry.Visible) then
|
(not cboxCountry.Visible)
|
||||||
|
then
|
||||||
Width := cboxState.Left + cboxState.Width + FormRightBorder
|
Width := cboxState.Left + cboxState.Width + FormRightBorder
|
||||||
else
|
else
|
||||||
Width := MinFormWidth;
|
Width := MinFormWidth;
|
||||||
@ -502,14 +503,13 @@ end;
|
|||||||
procedure TContactEditForm.DisplayCurrentCountry;
|
procedure TContactEditForm.DisplayCurrentCountry;
|
||||||
var
|
var
|
||||||
Idx : Integer;
|
Idx : Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if not Assigned (ControlLink) then
|
if not Assigned(ControlLink) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
Idx := ControlLink.Localization.CountryNameToIndex (cboxCountry.Text);
|
Idx := ControlLink.Localization.CountryNameToIndex(cboxCountry.Text);
|
||||||
if Idx > -1 then begin
|
if Idx > -1 then begin
|
||||||
ControlLink.Localization.StatesToTStrings (Idx, cboxState.Items);
|
ControlLink.Localization.StatesToTStrings(Idx, cboxState.Items);
|
||||||
|
|
||||||
if ControlLink.Localization.Countries.Items[Idx].Address1Visible then begin
|
if ControlLink.Localization.Countries.Items[Idx].Address1Visible then begin
|
||||||
AddrLbl.Visible := True;
|
AddrLbl.Visible := True;
|
||||||
|
@ -44,10 +44,10 @@ type
|
|||||||
TVpCustomDBDataStore = class(TVpCustomDataStore)
|
TVpCustomDBDataStore = class(TVpCustomDataStore)
|
||||||
protected {private}
|
protected {private}
|
||||||
FReadOnly : Boolean;
|
FReadOnly : Boolean;
|
||||||
FAfterPostEvents : TNotifyEvent;
|
FAfterPostEvents : TNotifyEvent;
|
||||||
FAfterPostTasks : TNotifyEvent;
|
FAfterPostTasks : TNotifyEvent;
|
||||||
FAfterPostContacts : TNotifyEvent;
|
FAfterPostContacts : TNotifyEvent;
|
||||||
FAfterPostResources : TNotifyEvent;
|
FAfterPostResources : TNotifyEvent;
|
||||||
|
|
||||||
{ property getters }
|
{ property getters }
|
||||||
function GetResourceTable : TDataset; virtual; abstract;
|
function GetResourceTable : TDataset; virtual; abstract;
|
||||||
@ -91,10 +91,10 @@ type
|
|||||||
procedure PostTasks; override;
|
procedure PostTasks; override;
|
||||||
procedure PostResources; override;
|
procedure PostResources; override;
|
||||||
{ - Added}
|
{ - Added}
|
||||||
procedure PurgeResource(Res: TVpResource); override;
|
procedure PurgeResource(Res: TVpResource); override;
|
||||||
procedure PurgeEvents(Res: TVpResource); override;
|
procedure PurgeEvents(Res: TVpResource); override;
|
||||||
procedure PurgeContacts(Res: TVpResource); override;
|
procedure PurgeContacts(Res: TVpResource); override;
|
||||||
procedure PurgeTasks(Res: TVpResource); override;
|
procedure PurgeTasks(Res: TVpResource); override;
|
||||||
{ - End}
|
{ - End}
|
||||||
procedure SetResourceByName(Value: string); override;
|
procedure SetResourceByName(Value: string); override;
|
||||||
procedure CreateFieldDefs(const TableName : string;
|
procedure CreateFieldDefs(const TableName : string;
|
||||||
@ -102,18 +102,18 @@ type
|
|||||||
procedure CreateIndexDefs(const TableName : string;
|
procedure CreateIndexDefs(const TableName : string;
|
||||||
IndexDefs : TIndexDefs); virtual;
|
IndexDefs : TIndexDefs); virtual;
|
||||||
|
|
||||||
published
|
published
|
||||||
{events}
|
{events}
|
||||||
property AfterPostEvents : TNotifyEvent
|
property AfterPostEvents : TNotifyEvent
|
||||||
read FAfterPostEvents write FAfterPostEvents;
|
read FAfterPostEvents write FAfterPostEvents;
|
||||||
property AfterPostContacts : TNotifyEvent
|
property AfterPostContacts : TNotifyEvent
|
||||||
read FAfterPostContacts write FAfterPostContacts;
|
read FAfterPostContacts write FAfterPostContacts;
|
||||||
property AfterPostTasks : TNotifyEvent
|
property AfterPostTasks : TNotifyEvent
|
||||||
read FAfterPostTasks write FAfterPostTasks;
|
read FAfterPostTasks write FAfterPostTasks;
|
||||||
property AfterPostResources : TNotifyEvent
|
property AfterPostResources : TNotifyEvent
|
||||||
read FAfterPostResources write FAfterPostResources;
|
read FAfterPostResources write FAfterPostResources;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Constants for index names }
|
{ Constants for index names }
|
||||||
const
|
const
|
||||||
VpcIndexNameResID = 'ResID_ndx';
|
VpcIndexNameResID = 'ResID_ndx';
|
||||||
@ -892,17 +892,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else if TableName = EventsTableName then begin
|
end else if TableName = EventsTableName then begin
|
||||||
with IndexDefs do begin
|
with IndexDefs do begin
|
||||||
{ added a new index on the ResourceID and StartTime fields. }
|
{ added a new index on the ResourceID and StartTime fields. }
|
||||||
{ this index is used by the FlashFiler 2 DataStore for setting ranges }
|
{ this index is used by the FlashFiler 2 DataStore for setting ranges }
|
||||||
{ instead of using filters on the Events table. }
|
{ instead of using filters on the Events table. }
|
||||||
{ tables created with unpatched 1.0 or 1.01 versions of Visual PlanIt }
|
{ tables created with unpatched 1.0 or 1.01 versions of Visual PlanIt }
|
||||||
{ will not have this new index available so they will continue to use }
|
{ will not have this new index available so they will continue to use }
|
||||||
{ filters. }
|
{ filters. }
|
||||||
with AddIndexDef do begin
|
with AddIndexDef do begin
|
||||||
Name := 'rid_st_ndx';
|
Name := 'rid_st_ndx';
|
||||||
Fields := 'ResourceID;StartTime';
|
Fields := 'ResourceID;StartTime';
|
||||||
Options := [ixCaseInsensitive];
|
Options := [ixCaseInsensitive];
|
||||||
end;
|
end;
|
||||||
with AddIndexDef do begin
|
with AddIndexDef do begin
|
||||||
Name := 'st_ndx';
|
Name := 'st_ndx';
|
||||||
Fields := 'StartTime';
|
Fields := 'StartTime';
|
||||||
@ -982,7 +982,7 @@ begin
|
|||||||
ResourceTable.First;
|
ResourceTable.First;
|
||||||
while not ResourceTable.EOF do begin
|
while not ResourceTable.EOF do begin
|
||||||
{ Load this resource into memory }
|
{ Load this resource into memory }
|
||||||
Res := Resources.AddResource(-1);
|
Res := Resources.AddResource(-1);
|
||||||
Res.Loading := true;
|
Res.Loading := true;
|
||||||
Res.ResourceID := ResourceTable.FieldByName('ResourceID').AsInteger;
|
Res.ResourceID := ResourceTable.FieldByName('ResourceID').AsInteger;
|
||||||
Res.Description := ResourceTable.FieldByName('Description').AsString;
|
Res.Description := ResourceTable.FieldByName('Description').AsString;
|
||||||
@ -1084,8 +1084,9 @@ begin
|
|||||||
if (Resource <> nil) then
|
if (Resource <> nil) then
|
||||||
with ContactsTable do begin
|
with ContactsTable do begin
|
||||||
SetFilterCriteria(ContactsTable, False,
|
SetFilterCriteria(ContactsTable, False,
|
||||||
ResourceTable.FieldByName('ResourceID').AsInteger,
|
ResourceTable.FieldByName('ResourceID').AsInteger,
|
||||||
0, 0);
|
0, 0
|
||||||
|
);
|
||||||
First;
|
First;
|
||||||
while not EOF do begin
|
while not EOF do begin
|
||||||
Contact := Resource.Contacts.AddContact(GetNextID(ContactsTableName));
|
Contact := Resource.Contacts.AddContact(GetNextID(ContactsTableName));
|
||||||
@ -1146,8 +1147,9 @@ begin
|
|||||||
if (Resource <> nil) then
|
if (Resource <> nil) then
|
||||||
with TasksTable do begin
|
with TasksTable do begin
|
||||||
SetFilterCriteria(TasksTable, False,
|
SetFilterCriteria(TasksTable, False,
|
||||||
ResourceTable.FieldByName('ResourceID').AsInteger,
|
ResourceTable.FieldByName('ResourceID').AsInteger,
|
||||||
0, 0);
|
0, 0
|
||||||
|
);
|
||||||
First;
|
First;
|
||||||
while not EOF do begin
|
while not EOF do begin
|
||||||
Task := Resource.Tasks.AddTask(GetNextID(TasksTableName));
|
Task := Resource.Tasks.AddTask(GetNextID(TasksTableName));
|
||||||
@ -1187,25 +1189,24 @@ begin
|
|||||||
if (Resource <> nil) and Resource.ContactsDirty then begin
|
if (Resource <> nil) and Resource.ContactsDirty then begin
|
||||||
{ Dump this resource's dirty contacts to the DB }
|
{ Dump this resource's dirty contacts to the DB }
|
||||||
if ResourceTable.Locate('ResourceID', Resource.ResourceID, []) then begin
|
if ResourceTable.Locate('ResourceID', Resource.ResourceID, []) then begin
|
||||||
SetFilterCriteria(ContactsTable, False, Resource.ResourceID,
|
SetFilterCriteria(ContactsTable, False, Resource.ResourceID, 0, 0);
|
||||||
0, 0);
|
|
||||||
|
|
||||||
for I := pred(Resource.Contacts.Count) downto 0 do begin
|
for I := pred(Resource.Contacts.Count) downto 0 do begin
|
||||||
Contact := Resource.Contacts.GetContact(I);
|
Contact := Resource.Contacts.GetContact(I);
|
||||||
{ if the delete flag is set then delete the record }
|
{ if the delete flag is set then delete the record }
|
||||||
{ and free the event instance }
|
{ and free the event instance }
|
||||||
if Contact.Deleted then begin
|
if Contact.Deleted then begin
|
||||||
if ContactsTable.Locate('RecordID', Contact.RecordID, [])
|
if ContactsTable.Locate('RecordID', Contact.RecordID, [])
|
||||||
then ContactsTable.Delete;
|
then ContactsTable.Delete;
|
||||||
Contact.Free;
|
Contact.Free;
|
||||||
Continue;
|
Continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Contact.Changed then begin
|
if Contact.Changed then begin
|
||||||
if ContactsTable.Locate('RecordID', Contact.RecordID, []) then
|
if ContactsTable.Locate('RecordID', Contact.RecordID, []) then
|
||||||
{ this event already exists in the database so update it }
|
{ this event already exists in the database so update it }
|
||||||
ContactsTable.Edit
|
ContactsTable.Edit
|
||||||
else begin
|
else begin
|
||||||
{ this record doesn't exist in the database, so it's a new event }
|
{ this record doesn't exist in the database, so it's a new event }
|
||||||
ContactsTable.Append;
|
ContactsTable.Append;
|
||||||
end;
|
end;
|
||||||
@ -1274,14 +1275,14 @@ begin
|
|||||||
Contact.Changed := false;
|
Contact.Changed := false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Resource.ContactsDirty := false;
|
Resource.ContactsDirty := false;
|
||||||
|
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
|
|
||||||
if Assigned(AfterPostContacts) then
|
if Assigned(AfterPostContacts) then
|
||||||
FAfterPostContacts(self);
|
FAfterPostContacts(self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
@ -1296,26 +1297,25 @@ begin
|
|||||||
{ Dump this resource's dirty events to the DB }
|
{ Dump this resource's dirty events to the DB }
|
||||||
if ResourceTable.Locate('ResourceID', Resource.ResourceID, [])
|
if ResourceTable.Locate('ResourceID', Resource.ResourceID, [])
|
||||||
then begin
|
then begin
|
||||||
SetFilterCriteria(EventsTable, False, Resource.ResourceID,
|
SetFilterCriteria(EventsTable, False, Resource.ResourceID, 0, 0);
|
||||||
0, 0);
|
|
||||||
|
|
||||||
for J := pred(Resource.Schedule.EventCount) downto 0 do begin
|
for J := pred(Resource.Schedule.EventCount) downto 0 do begin
|
||||||
Event := Resource.Schedule.GetEvent(J);
|
Event := Resource.Schedule.GetEvent(J);
|
||||||
|
|
||||||
{ if the delete flag is set then delete it from the database }
|
{ if the delete flag is set then delete it from the database }
|
||||||
{ and free the event instance }
|
{ and free the event instance }
|
||||||
if Event.Deleted then begin
|
if Event.Deleted then begin
|
||||||
if EventsTable.Locate('RecordID', Event.RecordID, []) then
|
if EventsTable.Locate('RecordID', Event.RecordID, []) then
|
||||||
EventsTable.Delete;
|
EventsTable.Delete;
|
||||||
Event.Free;
|
Event.Free;
|
||||||
Continue;
|
Continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Event.Changed then begin
|
if Event.Changed then begin
|
||||||
if EventsTable.Locate('RecordID', Event.RecordID, []) then
|
if EventsTable.Locate('RecordID', Event.RecordID, []) then
|
||||||
{ this event already exists in the database so update it }
|
{ this event already exists in the database so update it }
|
||||||
EventsTable.Edit
|
EventsTable.Edit
|
||||||
else begin
|
else begin
|
||||||
EventsTable.Append;
|
EventsTable.Append;
|
||||||
end;
|
end;
|
||||||
try
|
try
|
||||||
@ -1366,15 +1366,15 @@ begin
|
|||||||
Event.Changed := false;
|
Event.Changed := false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Resource.EventsDirty := false;
|
Resource.EventsDirty := false;
|
||||||
Resource.Schedule.Sort;
|
Resource.Schedule.Sort;
|
||||||
|
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
|
|
||||||
if Assigned(AfterPostEvents) then
|
if Assigned(AfterPostEvents) then
|
||||||
FAfterPostEvents(self);
|
FAfterPostEvents(self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
@ -1388,30 +1388,28 @@ begin
|
|||||||
{ Dump this resource's dirty contacts to the DB }
|
{ Dump this resource's dirty contacts to the DB }
|
||||||
if ResourceTable.Locate('ResourceID', Resource.ResourceID, [])
|
if ResourceTable.Locate('ResourceID', Resource.ResourceID, [])
|
||||||
then begin
|
then begin
|
||||||
SetFilterCriteria(TasksTable, False, Resource.ResourceID,
|
SetFilterCriteria(TasksTable, False, Resource.ResourceID, 0, 0);
|
||||||
0, 0);
|
|
||||||
|
|
||||||
for I := pred(Resource.Tasks.Count) downto 0 do begin
|
for I := pred(Resource.Tasks.Count) downto 0 do begin
|
||||||
Task := Resource.Tasks.GetTask(I);
|
Task := Resource.Tasks.GetTask(I);
|
||||||
|
|
||||||
{ if the delete flag is set then delete the record }
|
{ if the delete flag is set then delete the record }
|
||||||
{ and free the event instance }
|
{ and free the event instance }
|
||||||
if Task.Deleted then begin
|
if Task.Deleted then begin
|
||||||
if TasksTable.Locate('RecordID', Task.RecordID, []) then
|
if TasksTable.Locate('RecordID', Task.RecordID, []) then
|
||||||
TasksTable.Delete;
|
TasksTable.Delete;
|
||||||
Task.Free;
|
Task.Free;
|
||||||
Continue;
|
Continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Task.Changed then begin
|
if Task.Changed then begin
|
||||||
if TasksTable.Locate('RecordID', Task.RecordID, [])
|
if TasksTable.Locate('RecordID', Task.RecordID, [])
|
||||||
then
|
then
|
||||||
{ this event already exists in the database so }
|
{ this event already exists in the database so update it }
|
||||||
{ update it }
|
TasksTable.Edit
|
||||||
TasksTable.Edit
|
else
|
||||||
else
|
{ this record doesn't exist in the database, so }
|
||||||
{ this record doesn't exist in the database, so }
|
{ it's a new event }
|
||||||
{ it's a new event }
|
|
||||||
TasksTable.Append;
|
TasksTable.Append;
|
||||||
try
|
try
|
||||||
TasksTable.FieldByName('ResourceID').AsInteger := Resource.ResourceID;
|
TasksTable.FieldByName('ResourceID').AsInteger := Resource.ResourceID;
|
||||||
@ -1445,11 +1443,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
Resource.TasksDirty := false;
|
Resource.TasksDirty := false;
|
||||||
|
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
|
|
||||||
if Assigned(AfterPostTasks) then
|
if Assigned(AfterPostTasks) then
|
||||||
FAfterPostTasks(self);
|
FAfterPostTasks(self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
@ -1468,25 +1466,25 @@ begin
|
|||||||
for I := 0 to pred(Resources.Count) do begin
|
for I := 0 to pred(Resources.Count) do begin
|
||||||
Res := Resources.Items[I];
|
Res := Resources.Items[I];
|
||||||
|
|
||||||
if (Res <> nil) and Res.Deleted then begin
|
if (Res <> nil) and Res.Deleted then begin
|
||||||
PurgeEvents(Res);
|
PurgeEvents(Res);
|
||||||
PurgeContacts(Res);
|
PurgeContacts(Res);
|
||||||
PurgeTasks(Res);
|
PurgeTasks(Res);
|
||||||
if ResourceTable.Locate('ResourceID', Res.ResourceID, [])
|
if ResourceTable.Locate('ResourceID', Res.ResourceID, [])
|
||||||
then ResourceTable.Delete;
|
then ResourceTable.Delete;
|
||||||
if Resource = Res then
|
if Resource = Res then
|
||||||
ResourceID := -1;
|
ResourceID := -1;
|
||||||
Res.Free;
|
Res.Free;
|
||||||
Continue;
|
Continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Dump this resource to the DB }
|
{ Dump this resource to the DB }
|
||||||
if (Res <> nil) and Res.Changed then begin
|
if (Res <> nil) and Res.Changed then begin
|
||||||
with ResourceTable do begin
|
with ResourceTable do begin
|
||||||
if Locate('ResourceID', Res.ResourceID, []) then
|
if Locate('ResourceID', Res.ResourceID, []) then
|
||||||
{ existing record found }
|
{ existing record found }
|
||||||
Edit
|
Edit
|
||||||
else
|
else
|
||||||
{ this is a new record}
|
{ this is a new record}
|
||||||
Append;
|
Append;
|
||||||
|
|
||||||
@ -1523,11 +1521,11 @@ begin
|
|||||||
Res.Changed := false;
|
Res.Changed := false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if not Loading then
|
if not Loading then
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
|
|
||||||
if Assigned(AfterPostEvents) then
|
if Assigned(AfterPostEvents) then
|
||||||
FAfterPostEvents(self);
|
FAfterPostEvents(self);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
Loading := false;
|
Loading := false;
|
||||||
@ -1536,37 +1534,37 @@ end;
|
|||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
{ - Added}
|
{ - Added}
|
||||||
procedure TVpCustomDBDataStore.PurgeResource(Res: TVpResource);
|
procedure TVpCustomDBDataStore.PurgeResource(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
Res.Deleted := true;
|
Res.Deleted := true;
|
||||||
PostResources;
|
PostResources;
|
||||||
Load;
|
Load;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TVpCustomDBDataStore.PurgeEvents(Res: TVpResource);
|
procedure TVpCustomDBDataStore.PurgeEvents(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
{ Purging the events from the database is done by the descendant !!.01}
|
{ Purging the events from the database is done by the descendant !!.01}
|
||||||
{ classes !!.01}
|
{ classes !!.01}
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TVpCustomDBDataStore.PurgeContacts(Res: TVpResource);
|
procedure TVpCustomDBDataStore.PurgeContacts(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
{ Purging the contacts from the database is done by the descendant !!.01}
|
{ Purging the contacts from the database is done by the descendant !!.01}
|
||||||
{ classes !!.01}
|
{ classes !!.01}
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TVpCustomDBDataStore.PurgeTasks(Res: TVpResource);
|
procedure TVpCustomDBDataStore.PurgeTasks(Res: TVpResource);
|
||||||
begin
|
begin
|
||||||
{ Purging the tasks from the database is done by the descendant !!.01}
|
{ Purging the tasks from the database is done by the descendant !!.01}
|
||||||
{ classes !!.01}
|
{ classes !!.01}
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
{ - End}
|
{ - End}
|
||||||
|
|
||||||
procedure TVpCustomDBDataStore.SetResourceByName(Value: string);
|
procedure TVpCustomDBDataStore.SetResourceByName(Value: string);
|
||||||
@ -1603,8 +1601,7 @@ begin
|
|||||||
SetFilterCriteria(ContactsTable, False, Resource.ResourceID, 0, 0);
|
SetFilterCriteria(ContactsTable, False, Resource.ResourceID, 0, 0);
|
||||||
First;
|
First;
|
||||||
while not EOF do begin
|
while not EOF do begin
|
||||||
Contact := Resource.Contacts.AddContact(
|
Contact := Resource.Contacts.AddContact(FieldByName('RecordID').AsInteger);
|
||||||
FieldByName('RecordID').AsInteger);
|
|
||||||
Contact.Loading := true;
|
Contact.Loading := true;
|
||||||
// Contact.RecordID := FieldByName('RecordID').AsInteger;
|
// Contact.RecordID := FieldByName('RecordID').AsInteger;
|
||||||
Contact.FirstName := FieldByName('FirstName').AsString;
|
Contact.FirstName := FieldByName('FirstName').AsString;
|
||||||
@ -1668,17 +1665,16 @@ begin
|
|||||||
|
|
||||||
{ Load this resource's events into memory }
|
{ Load this resource's events into memory }
|
||||||
with EventsTable do begin
|
with EventsTable do begin
|
||||||
SetFilterCriteria(EventsTable, True, Resource.ResourceID,
|
SetFilterCriteria(EventsTable, True, Resource.ResourceID, TimeRange.StartTime, TimeRange.EndTime);
|
||||||
TimeRange.StartTime,
|
|
||||||
TimeRange.EndTime);
|
|
||||||
First;
|
First;
|
||||||
|
|
||||||
while not EventsTable.EOF do
|
while not EventsTable.EOF do
|
||||||
begin
|
begin
|
||||||
Event := Resource.Schedule.AddEvent(
|
Event := Resource.Schedule.AddEvent(
|
||||||
FieldByName('RecordID').AsInteger,
|
FieldByName('RecordID').AsInteger,
|
||||||
FieldByName('StartTime').AsDateTime,
|
FieldByName('StartTime').AsDateTime,
|
||||||
FieldByName('EndTime').AsDateTime);
|
FieldByName('EndTime').AsDateTime
|
||||||
|
);
|
||||||
if Event <> nil then begin
|
if Event <> nil then begin
|
||||||
Event.Loading := true; {prevents the events changed flag from being set}
|
Event.Loading := true; {prevents the events changed flag from being set}
|
||||||
// Event.RecordID := FieldByName('RecordID').AsInteger;
|
// Event.RecordID := FieldByName('RecordID').AsInteger;
|
||||||
@ -1729,8 +1725,7 @@ begin
|
|||||||
SetFilterCriteria(TasksTable, False, Resource.ResourceID, 0, 0);
|
SetFilterCriteria(TasksTable, False, Resource.ResourceID, 0, 0);
|
||||||
First;
|
First;
|
||||||
while not EOF do begin
|
while not EOF do begin
|
||||||
Task := Resource.Tasks.AddTask(
|
Task := Resource.Tasks.AddTask(FieldByName('RecordID').AsInteger);
|
||||||
FieldByName('RecordID').AsInteger);
|
|
||||||
Task.Loading := true;
|
Task.Loading := true;
|
||||||
// Task.RecordID := FieldByName('RecordID').AsInteger;
|
// Task.RecordID := FieldByName('RecordID').AsInteger;
|
||||||
Task.Complete := FieldByName('Complete').AsBoolean;
|
Task.Complete := FieldByName('Complete').AsBoolean;
|
||||||
|
@ -116,6 +116,7 @@ type
|
|||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure StartTimeExit(Sender: TObject);
|
procedure StartTimeExit(Sender: TObject);
|
||||||
procedure EndTimeExit(Sender: TObject);
|
procedure EndTimeExit(Sender: TObject);
|
||||||
|
|
||||||
private { Private declarations }
|
private { Private declarations }
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
StartTime: TTimeEdit;
|
StartTime: TTimeEdit;
|
||||||
@ -132,8 +133,10 @@ type
|
|||||||
procedure PopLists;
|
procedure PopLists;
|
||||||
procedure LoadCaptions;
|
procedure LoadCaptions;
|
||||||
procedure DoPlaySound(Sender: TObject; const AWavFile: String; AMode: TVpPlaySoundMode);
|
procedure DoPlaySound(Sender: TObject; const AWavFile: String; AMode: TVpPlaySoundMode);
|
||||||
|
|
||||||
protected
|
protected
|
||||||
property Datastore: TVpCustomDatastore read FDatastore write FDatastore;
|
property Datastore: TVpCustomDatastore read FDatastore write FDatastore;
|
||||||
|
|
||||||
public { Public declarations }
|
public { Public declarations }
|
||||||
Event: TVpEvent;
|
Event: TVpEvent;
|
||||||
CatColorMap: TVpCategoryColorMap;
|
CatColorMap: TVpCategoryColorMap;
|
||||||
@ -142,7 +145,7 @@ type
|
|||||||
Conflicts : Integer;
|
Conflicts : Integer;
|
||||||
TimeFormat: TVpTimeFormat;
|
TimeFormat: TVpTimeFormat;
|
||||||
AlarmWavPath: string;
|
AlarmWavPath: string;
|
||||||
FLastEndTime : TDateTime;
|
FLastEndTime : TDateTime;
|
||||||
|
|
||||||
procedure PopulateDialog;
|
procedure PopulateDialog;
|
||||||
procedure DePopulateDialog;
|
procedure DePopulateDialog;
|
||||||
@ -387,7 +390,7 @@ begin
|
|||||||
|
|
||||||
Category.ItemIndex := Event.Category;
|
Category.ItemIndex := Event.Category;
|
||||||
|
|
||||||
FLastEndTime := Event.EndTime;
|
FLastEndTime := Event.EndTime;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
@ -455,22 +458,21 @@ end;
|
|||||||
procedure TDlgEventEdit.EndTimeChange(Sender: TObject);
|
procedure TDlgEventEdit.EndTimeChange(Sender: TObject);
|
||||||
|
|
||||||
function IsMidnight(ATime: TDateTime) : Boolean;
|
function IsMidnight(ATime: TDateTime) : Boolean;
|
||||||
begin
|
begin
|
||||||
Result := ATime = Trunc(ATime);
|
Result := ATime = Trunc(ATime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
|
||||||
ET: TDateTime;
|
|
||||||
|
|
||||||
|
var
|
||||||
|
ET: TDateTime;
|
||||||
begin
|
begin
|
||||||
{ Verify the value is valid }
|
{ Verify the value is valid }
|
||||||
try
|
try
|
||||||
ET := StrToTime(EndTime.Text);
|
ET := StrToTime(EndTime.Text);
|
||||||
if (IsMidnight(ET)) and (not IsMidnight(FLastEndTime)) then
|
if (IsMidnight(ET)) and (not IsMidnight(FLastEndTime)) then
|
||||||
EndDate.Date := EndDate.Date + 1
|
EndDate.Date := EndDate.Date + 1
|
||||||
else if (not IsMidnight(ET)) and (IsMidnight(FLastEndTime)) then
|
else if (not IsMidnight(ET)) and (IsMidnight(FLastEndTime)) then
|
||||||
EndDate.Date := EndDate.Date - 1;
|
EndDate.Date := EndDate.Date - 1;
|
||||||
FLastEndTime := ET;
|
FLastEndTime := ET;
|
||||||
except
|
except
|
||||||
EndTime.Color := clRed;
|
EndTime.Color := clRed;
|
||||||
EndTime.SetFocus;
|
EndTime.SetFocus;
|
||||||
@ -512,7 +514,7 @@ begin
|
|||||||
Hour := (Minute div 15) div 4;
|
Hour := (Minute div 15) div 4;
|
||||||
MinStr := IntToStr(Minute mod 60);
|
MinStr := IntToStr(Minute mod 60);
|
||||||
if MinStr = '0' then MinStr := '00';
|
if MinStr = '0' then MinStr := '00';
|
||||||
if TimeFormat = tf24Hour then
|
if TimeFormat = tf24Hour then
|
||||||
StringList.Add(IntToStr(Hour) + ':' + MinStr)
|
StringList.Add(IntToStr(Hour) + ':' + MinStr)
|
||||||
else begin
|
else begin
|
||||||
if Hour > 12 then Hour := Hour - 12;
|
if Hour > 12 then Hour := Hour - 12;
|
||||||
@ -643,7 +645,6 @@ begin
|
|||||||
if Visible then
|
if Visible then
|
||||||
FCustomInterval.SetFocus;
|
FCustomInterval.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
@ -709,7 +710,7 @@ begin
|
|||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FPlacement.Position := mpCenterTop;
|
FPlacement.Position := mpCenterTop;
|
||||||
FPlacement.Height := 415;
|
FPlacement.Height := 415;
|
||||||
FPlacement.Width := 710;
|
FPlacement.Width := 710;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
@ -746,7 +747,9 @@ begin
|
|||||||
Result := false;
|
Result := false;
|
||||||
if DataStore <> nil then begin
|
if DataStore <> nil then begin
|
||||||
ceEvent := DataStore.Resource.Schedule.AddEvent(
|
ceEvent := DataStore.Resource.Schedule.AddEvent(
|
||||||
DataStore.GetNextID(EventsTableName), StartTime, EndTime);
|
DataStore.GetNextID(EventsTableName),
|
||||||
|
StartTime, EndTime
|
||||||
|
);
|
||||||
if ceEvent <> nil then begin
|
if ceEvent <> nil then begin
|
||||||
Result := Execute(ceEvent);
|
Result := Execute(ceEvent);
|
||||||
if (not Result) or (ceEvent = nil) then
|
if (not Result) or (ceEvent = nil) then
|
||||||
@ -756,18 +759,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TDlgEventEdit.StartTimeExit(Sender: TObject);
|
procedure TDlgEventEdit.StartTimeExit(Sender: TObject);
|
||||||
var
|
var
|
||||||
ST : TDateTime;
|
ST : TDateTime;
|
||||||
begin
|
begin
|
||||||
{ Verify the value is valid }
|
{ Verify the value is valid }
|
||||||
try
|
try
|
||||||
ST := StartDate.Date + StrToTime(StartTime.Text);
|
ST := StartDate.Date + StrToTime(StartTime.Text);
|
||||||
except
|
except
|
||||||
StartTime.Color := clRed;
|
StartTime.Color := clRed;
|
||||||
StartTime.SetFocus;
|
StartTime.SetFocus;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
StartTime.Color := clWindow;
|
StartTime.Color := clWindow;
|
||||||
|
|
||||||
{ If the end time is less than the start time then change the end }
|
{ If the end time is less than the start time then change the end }
|
||||||
@ -775,12 +778,12 @@ begin
|
|||||||
|
|
||||||
if ST > EndDate.Date + StrToTime (EndTime.Text) then
|
if ST > EndDate.Date + StrToTime (EndTime.Text) then
|
||||||
EndTime.Text := FormatDateTime('hh:nn', ST + 30 / MinutesInDay);
|
EndTime.Text := FormatDateTime('hh:nn', ST + 30 / MinutesInDay);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDlgEventEdit.EndTimeExit(Sender: TObject);
|
procedure TDlgEventEdit.EndTimeExit(Sender: TObject);
|
||||||
var
|
var
|
||||||
ET: TDateTime;
|
ET: TDateTime;
|
||||||
begin
|
begin
|
||||||
{ Verify the value is valid }
|
{ Verify the value is valid }
|
||||||
try
|
try
|
||||||
ET := EndDate.Date + StrToTime(EndTime.Text);
|
ET := EndDate.Date + StrToTime(EndTime.Text);
|
||||||
@ -796,7 +799,7 @@ begin
|
|||||||
|
|
||||||
if ET < StartDate.Date + StrToTime (StartTime.Text) then
|
if ET < StartDate.Date + StrToTime (StartTime.Text) then
|
||||||
StartTime.Text := FormatDateTime('hh:nn', ET - 30 / MinutesInDay);
|
StartTime.Text := FormatDateTime('hh:nn', ET - 30 / MinutesInDay);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ resourcestring
|
|||||||
RSMinutes = 'Minutes';
|
RSMinutes = 'Minutes';
|
||||||
RSHours = 'Hours';
|
RSHours = 'Hours';
|
||||||
RSDays = 'Days';
|
RSDays = 'Days';
|
||||||
|
RSCalendarWeekAbbr = 'CW'; // Abbreviation of "calendar week"
|
||||||
|
|
||||||
{WARNINGS}
|
{WARNINGS}
|
||||||
RSPermanent = 'This operation cannot be undone!';
|
RSPermanent = 'This operation cannot be undone!';
|
||||||
|
@ -90,10 +90,10 @@ type
|
|||||||
|
|
||||||
TVpTaskEditDialog = class(TVpBaseDialog)
|
TVpTaskEditDialog = class(TVpBaseDialog)
|
||||||
protected {private}
|
protected {private}
|
||||||
teEditDlg : TTaskEditForm;
|
teEditDlg: TTaskEditForm;
|
||||||
teTask : TVpTask;
|
teTask: TVpTask;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner : TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
function Execute(Task: TVpTask): Boolean; reintroduce;
|
function Execute(Task: TVpTask): Boolean; reintroduce;
|
||||||
function AddNewTask: Boolean;
|
function AddNewTask: Boolean;
|
||||||
published
|
published
|
||||||
@ -145,13 +145,11 @@ begin
|
|||||||
DetailsMemo.Text := Task.Details;
|
DetailsMemo.Text := Task.Details;
|
||||||
CompleteCB.Checked := Task.Complete;
|
CompleteCB.Checked := Task.Complete;
|
||||||
if Task.CompletedOn <> 0 then
|
if Task.CompletedOn <> 0 then
|
||||||
CompletedOnLbl.Caption := RSCompletedOn + ' ' +
|
CompletedOnLbl.Caption := RSCompletedOn + ' ' + FormatDateTime(ShortDateFormat, Task.CompletedOn)
|
||||||
FormatDateTime(ShortDateFormat, Task.CompletedOn)
|
|
||||||
else
|
else
|
||||||
CompletedOnLbl.Visible := False;
|
CompletedOnLbl.Visible := False;
|
||||||
CompletedOnLbl.Visible := CompleteCB.Checked;
|
CompletedOnLbl.Visible := CompleteCB.Checked;
|
||||||
CreatedOnLbl.Caption := RSCreatedOn + ' ' +
|
CreatedOnLbl.Caption := RSCreatedOn + ' ' + FormatDateTime(ShortDateFormat, Task.CreatedOn);
|
||||||
FormatDateTime(ShortDateFormat, Task.CreatedOn);
|
|
||||||
|
|
||||||
DueDateEdit.Left := DueDateLbl.Left + GetLabelWidth(DueDateLbl) + 8;
|
DueDateEdit.Left := DueDateLbl.Left + GetLabelWidth(DueDateLbl) + 8;
|
||||||
end;
|
end;
|
||||||
@ -188,8 +186,8 @@ end;
|
|||||||
constructor TVpTaskEditDialog.Create(AOwner : TComponent);
|
constructor TVpTaskEditDialog.Create(AOwner : TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FPlacement.Height := 340;
|
FPlacement.Height := 340;
|
||||||
FPlacement.Width := 545;
|
FPlacement.Width := 545;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TVpTaskEditDialog.Execute(Task: TVpTask): Boolean;
|
function TVpTaskEditDialog.Execute(Task: TVpTask): Boolean;
|
||||||
@ -198,8 +196,8 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
teTask := Task;
|
teTask := Task;
|
||||||
if (teTask <> nil) and (DataStore <> nil) and
|
if (teTask <> nil) and (DataStore <> nil) and (DataStore.Resource <> nil) then
|
||||||
(DataStore.Resource <> nil) then begin
|
begin
|
||||||
Application.CreateForm(TTaskEditForm, TaskEditForm);
|
Application.CreateForm(TTaskEditForm, TaskEditForm);
|
||||||
try
|
try
|
||||||
DoFormPlacement(TaskEditForm);
|
DoFormPlacement(TaskEditForm);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user