Changeset 53


Ignore:
Timestamp:
Apr 3, 2012, 8:31:39 AM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Aktualizace seznamu modulů do databáze a použití příznaku modulů "Instalován" pro zjištění, zda vytvářet znova strukturu.
Location:
trunk/Client
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Client/Application/UChronisModule.pas

    r52 r53  
    4545  List := TListProxy.Create;
    4646  List.Client := TChronisBase(System).Client;
    47   List.SchemaName := TChronisBase(System).Client.Schema;
     47  List.Path := TChronisBase(System).Client.Schema;
    4848  List.ObjectName := SystemModuleObject;
    4949  List.Condition := '(SysName="' + SysName + '") AND (Installed=1)';
     
    6060  List := TListProxy.Create;
    6161  List.Client := TChronisBase(System).Client;
    62   List.SchemaName := TChronisBase(System).Client.Schema;
     62  List.Path := TChronisBase(System).Client.Schema;
    6363  List.ObjectName := SystemModuleObject;
    6464  List.Condition := 'SysName="' + SysName + '"';
     
    6868    NewObject.Id := StrToInt(TObjectProxy(List.Objects[0]).Properties.Values['Id']);
    6969    NewObject.Client := TChronisBase(System).Client;
    70     NewObject.SchemaName := TChronisBase(System).Client.Schema;
     70    NewObject.Path := TChronisBase(System).Client.Schema;
    7171    NewObject.ObjectName := SystemModuleObject;
    7272    NewObject.Properties.Add('Installed', '1');
     
    8484  List := TListProxy.Create;
    8585  List.Client := TChronisBase(System).Client;
    86   List.SchemaName := TChronisBase(System).Client.Schema;
     86  List.Path := TChronisBase(System).Client.Schema;
    8787  List.ObjectName := SystemModuleObject;
    8888  List.Condition := 'SysName="' + SysName + '"';
     
    9292    NewObject.Id := StrToInt(TObjectProxy(List.Objects[0]).Properties.Values['Id']);
    9393    NewObject.Client := TChronisBase(System).Client;
    94     NewObject.SchemaName := TChronisBase(System).Client.Schema;
     94    NewObject.Path := TChronisBase(System).Client.Schema;
    9595    NewObject.ObjectName := SystemModuleObject;
    9696    NewObject.Properties.Add('Installed', '0');
  • trunk/Client/Forms/UFormItemAdd.pas

    r52 r53  
    6464    NewProxy.Client := Client;
    6565    NewProxy.ObjectName := SelectedObject.Table;
    66     NewProxy.SchemaName := SelectedObject.Schema;
     66    NewProxy.Path := SelectedObject.Schema;
    6767    for I := 0 to Report.Columns.Count - 1 do
    6868    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
  • trunk/Client/Forms/UFormItemEdit.pas

    r52 r53  
    128128    Proxy.Client := Client;
    129129    Proxy.ObjectName := SelectedObject.Table;
    130     Proxy.SchemaName := SelectedObject.Schema;
     130    Proxy.Path := SelectedObject.Schema;
    131131    Proxy.Id := SelectedItemId;
    132132    for I := 0 to Report.Columns.Count - 1 do
  • trunk/Client/Forms/UFormMenu.pas

    r52 r53  
    142142      Groups.Client := Core.System.Client;
    143143      Groups.ObjectName := ObjectGroupTable;
    144       Groups.SchemaName := Core.System.Client.Schema;
     144      Groups.Path := Core.System.Client.Schema;
    145145      Groups.Load;
    146146      for I := 0 to Groups.Objects.Count - 1 do begin
     
    154154          Objects.Client := Core.System.Client;
    155155          Objects.ObjectName := ObjectTable;
    156           Objects.SchemaName := Core.System.Client.Schema;
     156          Objects.Path := Core.System.Client.Schema;
    157157          Objects.Condition := '`Group`="' + Obj.Properties.Values['Id'] + '"';
    158158          Objects.Load;
  • trunk/Client/Module/UModuleSystem.pas

    r52 r53  
    312312begin
    313313  inherited Create;
     314  SysName := 'System';
    314315  Name := 'System';
     316  Version := '1.0';
    315317end;
    316318
  • trunk/Client/Module/UModuleUser.pas

    r52 r53  
    3737constructor TModuleUser.Create;
    3838begin
     39  SysName := 'User';
    3940  Name := 'User';
     41  Version := '1.0';
    4042  inherited Create;
    4143end;
  • trunk/Client/UCore.pas

    r52 r53  
    77uses
    88  Classes, SysUtils, FileUtil, UCoolTranslator, UDebugLog, USystem, Registry,
    9   USqlDatabase, UFormLoginProfile, URegistry, UPDClient, UModuleSystem;
     9  USqlDatabase, UFormLoginProfile, URegistry, UPDClient;
    1010
    1111type
     
    3838  Core: TCore;
    3939
     40
    4041implementation
    4142
     43uses
     44  UModuleSystem, UModuleUser, UApplicationInfo;
     45
    4246{$R *.lfm}
    43 
    44 uses
    45   UApplicationInfo;
    4647
    4748{ TCore }
     
    5859  System.RegisterModule(TModuleSystem);
    5960  System.ModuleSystem := TModuleSystem(System.Modules.Last);
     61  System.RegisterModule(TModuleUser);
    6062
    6163  {$IFDEF DEBUG}
  • trunk/Client/USystem.pas

    r52 r53  
    194194      Properties.Client := Base.Client;
    195195      Properties.ObjectName := PropertyTable;
    196       Properties.SchemaName := Base.Client.Schema;
     196      Properties.Path := Base.Client.Schema;
    197197      Properties.Condition := 'Object="' + IntToStr(Obj.Id) + '"';
    198198      Properties.Load;
     
    219219      Values.ColummsFilterUse := True;
    220220      Values.ObjectName := Obj.Table;
    221       Values.SchemaName := Obj.Schema;
     221      Values.Path := Obj.Schema;
    222222      Values.Condition := Filter;
    223223      Values.Load;
     
    249249    Client.Connect;
    250250    if Client.Connected then begin
     251      if not Modules.IsInstalled then begin
     252        Modules.Install;
     253        Modules.UpdateList;
     254      end;
     255      Modules.UpdateList;
    251256      if not ModuleSystem.IsInstalled then ModuleSystem.Install;
    252257      LoadTypes;
     
    273278    Proxy.Client := Client;
    274279    Proxy.ObjectName := PropertyTypeTable;
     280    Proxy.Id := Integer(TypeIndex);
    275281    Proxy.Properties.Add('Name', Name);
    276282    Proxy.Properties.Add('DbType', DataType);
    277     Proxy.Properties.Add('Id', IntToStr(Integer(TypeIndex)));
    278283    Proxy.Save;
    279284    Result := Proxy.Id;
     
    655660    Proxy := TListProxy.Create;
    656661    Proxy.Client := Client;
    657     Proxy.SchemaName := 'information_schema';
     662    Proxy.Path := 'information_schema';
    658663    Proxy.ObjectName := 'tables';
    659664    Proxy.Condition := 'table_name = "SystemModule" AND table_schema = "' +
     
    719724    List.Client := Core.System.Client;
    720725    List.ObjectName := ObjectTable;
    721     List.SchemaName := Core.System.Client.Schema;
     726    List.Path := Core.System.Client.Schema;
    722727    List.Condition := 'Id=' + IntToStr(ObjectId);
    723728    List.Load;
     
    758763  List := TListProxy.Create;
    759764  List.Client := Base.Client;
    760   List.SchemaName := Base.Client.Schema;
    761   NewObject := TObjectProxy.Create;
    762   NewObject.Client := Base.Client;
     765  List.Path := Base.Client.Schema;
     766  List.ObjectName := SystemModuleObject;
    763767  for I := 0 to Count - 1 do
    764768  with TChronisModule(Items[I]) do begin
    765769    List.Condition := 'SysName="' + SysName + '"';
    766770    List.Load;
     771    NewObject := TObjectProxy.Create;
     772    NewObject.Client := Base.Client;
    767773    if List.Objects.Count > 0 then
    768774      NewObject.Id := StrToInt(TObjectProxy(List.Objects[0]).Properties.Values['Id'])
    769775      else NewObject.Id := 0;
    770     NewObject.SchemaName := Base.Client.Schema;
     776    NewObject.Path := Base.Client.Schema;
    771777    NewObject.ObjectName := SystemModuleObject;
    772     NewObject.Properties.Add('SysName', SysName);
    773     NewObject.Properties.Add('Name', Name);
    774     NewObject.Properties.Add('Version', Version);
    775     NewObject.Properties.Add('License', License);
    776     NewObject.Properties.Add('Creator', Creator);
    777     NewObject.Properties.Add('HomePage', HomePage);
     778    with NewObject.Properties do begin
     779      Add('SysName', SysName);
     780      Add('Name', Name);
     781      Add('Version', Version);
     782      Add('License', License);
     783      Add('Creator', Creator);
     784      Add('HomePage', HomePage);
     785    end;
    778786    NewObject.Save;
    779   end;
    780   NewObject.Free;
     787    NewObject.Free;
     788  end;
    781789  List.Free;
    782790end;
Note: See TracChangeset for help on using the changeset viewer.