You've already forked lazarus-ccr
tvplanit: read/write Event.ResourceID to/from file
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8170 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -323,6 +323,7 @@ begin
|
||||
try
|
||||
L.AddDateTimeField('StartTime', AEvent.StartTime, 'c'); // short date + long time
|
||||
L.AddDateTimeField('EndTime', AEvent.EndTime, 'c'); // 1
|
||||
L.AddField('ResourceID', IntToStr(AEvent.ResourceID));
|
||||
L.AddField('Description', AEvent.Description);
|
||||
L.AddField('Location', AEvent.Location);
|
||||
L.AddField('Notes', EncodeLineEndings(AEvent.Notes));
|
||||
@ -1201,6 +1202,7 @@ begin
|
||||
StrToEventTimes(s, tStart, tEnd);
|
||||
event := res.Schedule.AddEvent(id, tStart, tEnd);
|
||||
StrToEvent(s, event);
|
||||
event.ResourceID := event.Owner.Owner.ResourceID;
|
||||
end;
|
||||
|
||||
key := Format('Tasks of resource %d', [resID]);
|
||||
|
@ -188,6 +188,7 @@ function TVpJSONDatastore.EventToJSON(AEvent: TVpEvent): TJSONObject;
|
||||
begin
|
||||
Result := TJSONObject.Create;
|
||||
Result.Add('RecordID', AEvent.RecordID);
|
||||
Result.Add('ResourceID', AEvent.ResourceID);
|
||||
Result.Add('Description', AEvent.Description);
|
||||
Result.Add('Notes', AEvent.Notes);
|
||||
Result.Add('Location', AEvent.Location);
|
||||
@ -333,6 +334,7 @@ begin
|
||||
endDate := StrToDateTime(s, FFormatSettings) else
|
||||
endDate := 0;
|
||||
Result := AResource.Schedule.AddEvent(evID, startDate, endDate);
|
||||
Result.ResourceID := AResource.ResourceID;
|
||||
Result.Description := AObj.Get('Description', '');
|
||||
Result.Notes := AObj.Get('Notes', '');
|
||||
Result.Location := AObj.Get('Location', '');
|
||||
|
@ -731,6 +731,7 @@ begin
|
||||
t2 := GetDateTimeAttrValue(ANode, 'EndTime', FXmlSettings);
|
||||
|
||||
ev := ASchedule.AddEvent(id, t1, t2);
|
||||
ev.ResourceID := ASchedule.Owner.ResourceID;
|
||||
ev.AlarmAdvance := GetIntAttrValue(ANode, 'AlarmAdvance');
|
||||
ev.AlarmSet := GetBoolAttrValue(ANode, 'AlarmSet');
|
||||
ev.AlertDisplayed := GetBoolAttrValue(ANode, 'AlertDisplayed');
|
||||
@ -1317,6 +1318,7 @@ var
|
||||
begin
|
||||
with TDOMElement(AEventNode) do begin
|
||||
SetAttribute('RecordID', IntToStr(AEvent.RecordID));
|
||||
SetAttribute('ResourceID', IntToStr(AEvent.ResourceID));
|
||||
SetAttribute('Category', IntToStr(AEvent.Category));
|
||||
if AEvent.StartTime <> 0 then
|
||||
SetAttribute('StartTime', DateTimeToStr(AEvent.StartTime, FXmlSettings));
|
||||
|
Reference in New Issue
Block a user