|
@@ -127,7 +127,7 @@ type
|
|
|
implementation
|
|
|
|
|
|
uses ProjectData, Forms, PHPWebDm, CslJson, ConstUnit, UtilMethods,
|
|
|
- StdConvs;
|
|
|
+ StdConvs, superobject;
|
|
|
|
|
|
{ TUpFile }
|
|
|
|
|
@@ -262,54 +262,46 @@ begin
|
|
|
end;
|
|
|
|
|
|
procedure TUpFiles.LoadDatas;
|
|
|
-var vArrFile: TOVArr;
|
|
|
- i, iBillID: Integer;
|
|
|
- vFile: TUpFile;
|
|
|
+
|
|
|
+ procedure LoadData(AFile: ISuperObject);
|
|
|
+ var
|
|
|
+ vFile: TUpFile;
|
|
|
+ begin
|
|
|
+ vFile := Add(AFile.I['itemid']);
|
|
|
+ vFile.DownURL := AFile.S['downurl'];
|
|
|
+ vFile.DisplayName := AFile.S['filename'];
|
|
|
+ vFile.LocalFile := FPath + vFile.DisplayName;
|
|
|
+ vFile.UperName := AFile.S['ownerName'];
|
|
|
+ vFile.Category := AFile.S['Category'];
|
|
|
+ vFile.Memo := AFile.S['Memo'];
|
|
|
+ vFile.UperID := AFile.I['owmerid'];
|
|
|
+ vFile.UpTime := AFile.S['uptime'];
|
|
|
+ vFile.ID := AFile.I['fileid'];
|
|
|
+ vFile.Phase := AFile.I['phase'];
|
|
|
+ vFile.WebID := TProjectData(FProjectData).WebID;
|
|
|
+ vFile.Status := ufsNormal;
|
|
|
+ end;
|
|
|
+
|
|
|
+var
|
|
|
+ i, iCount: Integer;
|
|
|
+ sUrl, sInfo: string;
|
|
|
+ vJ: ISuperObject;
|
|
|
begin
|
|
|
- if G_IsCloud then
|
|
|
+ if not G_IsCloud then Exit;
|
|
|
+
|
|
|
+ sUrl := Format('%stender/attachment/%d/list', [PHPWeb.MeasureURL, TProjectData(FProjectData).WebID]);
|
|
|
+ if PHPWeb.UrlGet(sUrl, nil, sInfo) = 1 then
|
|
|
begin
|
|
|
- if PHPWeb.GetAttachmentList(TProjectData(FProjectData).WebID, vArrFile) then
|
|
|
- begin
|
|
|
- for i := Low(vArrFile) to High(vArrFile) do
|
|
|
- begin
|
|
|
- iBillID := StrToInt(vArrFile[i, 4]);
|
|
|
- vFile := Add(iBillID); // AAAAA
|
|
|
- vFile.DownURL := vArrFile[i, 0];
|
|
|
- vFile.DisplayName := vArrFile[i, 1];
|
|
|
- vFile.LocalFile := FPath + vArrFile[i, 1];
|
|
|
- vFile.UperName := vArrFile[i, 3];
|
|
|
- vFile.Category := vArrFile[i, 5];
|
|
|
- vFile.Memo := vArrFile[i, 6];
|
|
|
- vFile.UperID := StrToInt(vArrFile[i, 7]);
|
|
|
- vFile.UpTime := vArrFile[i, 8];
|
|
|
- vFile.ID := StrToInt(vArrFile[i, 9]);
|
|
|
- vFile.Phase := StrToInt(vArrFile[i, 10]); // vArrFile[i, 2] ÎļþÀ©Õ¹Ãû
|
|
|
- vFile.WebID := TProjectData(FProjectData).WebID;
|
|
|
- vFile.Status := ufsNormal;
|
|
|
- end;
|
|
|
+ vJ := SO(sInfo);
|
|
|
+ try
|
|
|
+ if not Assigned(vJ.AsArray) then Exit;
|
|
|
+ iCount := vJ.AsArray.Length;
|
|
|
+ for i := 0 to iCount - 1 do
|
|
|
+ LoadData(vJ.AsArray.O[i]);
|
|
|
+ finally
|
|
|
+ vJ := nil;
|
|
|
end;
|
|
|
end;
|
|
|
-// else
|
|
|
-// begin
|
|
|
-// FLocalQue.Close;
|
|
|
-// FLocalQue.SQL.Text := 'Select * from AttachmentFile order by ID';
|
|
|
-// FLocalQue.Open;
|
|
|
-// FLocalQue.First;
|
|
|
-//
|
|
|
-// while not FLocalQue.Eof do
|
|
|
-// begin
|
|
|
-// iBillID := FLocalQue.FieldByName('BillID').AsInteger;
|
|
|
-// iPhase := FLocalQue.FieldByName('Phase').AsInteger;
|
|
|
-// vFile := Add(iBillID, iPhase);
|
|
|
-// vFile.ID := FLocalQue.FieldByName('ID').AsInteger;
|
|
|
-// vFile.LocalFile := FPath + FLocalQue.FieldByName('FileName').AsString;
|
|
|
-// vFile.DisplayName := FLocalQue.FieldByName('FileName').AsString;
|
|
|
-//
|
|
|
-// FLocalQue.Next;
|
|
|
-// end;
|
|
|
-//
|
|
|
-// FLocalCon.Close;
|
|
|
-// end;
|
|
|
end;
|
|
|
|
|
|
procedure TUpFile.SetID(const Value: Integer);
|