起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 464|回复: 21

【结贴】单独显示一个业务空间时的奇怪问题**

[复制链接]
发表于 2009-5-6 12:34:38 | 显示全部楼层 |阅读模式
前两天我在做把单个业务空间拖拽出来显示的时候,修改了工作台的显示,如下图所示,就是不让红框框起来的那块显示出来,让这块是全白色的,什么都没有。前两天实现了这个需求。
今天又网页运行了一下,想测试看看,结果它又像原来那样全显示出来了。查看了一下这两天我写的代码,还是原来那样,没有动过。
实现这个需求主要是修改了配置库中的CustomDesktopFunc函数。
配置库中的部分函数如下:
static function TSystemConsts.RunFuncs: TStringArray;
begin
   Result := [CustomDesktopFunc,
    'Biz:COLLABORATIONSchedulerFunc.Func'];

end;
//上面这个函数原来就这样,我没改动过

//下面这个函数原来是这样的
static function TSystemConsts.CustomDesktopFunc: string;
begin
Result := 'Biz:COLLABORATIONCustomDesktopFunc.Func';
end;
我把它改成了
static function TSystemConsts.CustomDesktopFunc: string;
begin

Result := 'Biz:COLLABORATIONGZT.Func';
end;

这个业务URL,是我新作的一个空白窗体。就是想让这个空白窗体替代下图中红框框起来的那块儿显示的。
我算是彻底被这个问题弄晕了,本来我更换了显示的窗体,就应该显示当前的空白窗体,可是我运行起来它就显示原来的那个工作台窗体,不知道那儿出了问题?

qq2.png

58.24 KB, 下载次数: 204

回复

使用道具 举报

发表于 2009-5-6 13:15:20 | 显示全部楼层
编译一下,设置一下断点看看设置参数的函数和这个函数是否都走到了?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 14:47:11 | 显示全部楼层
跟踪了几次,static function TSystemConsts.CustomDesktopFunc: string;
begin

Result := 'Biz:\COLLABORATION\GZT.Func';
end;
这个函数确实走到了,而且一共走了大概十次呢,但是还是没找到原因,不知道CustomDesktopFunc.Func为什么会显示。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 15:51:44 | 显示全部楼层
依然还没有解决,这么多代码,总感觉也发现不了什么。。。
回复 支持 反对

使用道具 举报

发表于 2009-5-6 16:49:25 | 显示全部楼层
把配置库的完整代码贴给我看看
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:13:03 | 显示全部楼层
unit SETTINGLIB;

interface

uses
  Business.System, Business.Model, Business.Forms, Business.Model.Org;

type
  TStringArray = array of string;

  TTaskRemindKind = (trkRemindBox, trkMessenger, trkSMS, trkMail);
{ TSettingLib }

  TSETTINGLIB = class(TBizLibrary)
  public
    static function SettingFileName: string;

    static function GetDefaultConfig: TBusinessConfig;

    { 设置全局Config对象,供非主界面的功能使用,该属性在主界面中进行初始化 }
    { 不能在登陆前和主界面释放时访问 }
    static procedure SetConfig(AConfig: TBusinessConfig);
    static function GetConfig: TBusinessConfig;
    static procedure LoadConfig(AContext: TContext; AConfig: TBusinessConfig; AOrgBizUrl: TBizURL); overload;
    static procedure LoadConfig(AContext: TContext; AConfig: TBusinessConfig; IsSystem: Boolean; AOrgBizUrl: TBizURL); overload;
    static procedure SaveConfig(AContext: TContext; AConfig: TBusinessConfig; AOrgUrl: string); overload;
    static procedure SaveConfig(AContext: TContext; AConfig: TBusinessConfig; IsDefault: Boolean; AOrgUrl: string); overload;

    static procedure Init;
    static procedure Uninit;
  end;


{ TSystemConsts }

  TSystemConsts = class
   public
  //张学荣填了以下功能
   static  procedure SetBizParam(AParam:String);
    // 默认功能
    static function DefaultFuncs: TStringArray;
    // System默认功能
    static function SystemDefaultFuncs: TStringArray;
    // 默认快捷键
    static function DefaultShortcuts: TStringArray;
    // 以人的身份运行的功能
    static function PersonFuncs: TStringArray;
    // 主界面默认运行的功能
    static function RunFuncs: TStringArray;
    // System主界面默认运行的功能
    static function SystemRunFuncs: TStringArray;
    // 主界面默认的快捷功能
    static function ShortcutFuncs: TStringArray;
    // 自定义工作台的宿主功能
    static function CustomDesktopFunc: string;
    // 系统启动时自动运行的服务功能
    static function ServiceFuncs: TStringArray;
    // 系统运行后在主窗体调用自动运行的功能
    static function AutoRunFuncs: TStringArray;
    // 功能相关
    static function TaskCenterURL: string;
    static function PlanCenterURL: string;
    static function CustomerCenterURL: string;
    static function MailURL: string;
    static function DocCenterURL: string;
    static function DecisionCenterURL: string;
    static function NewsCenterURL: string;
    // 系统类别
    static function ProjectID: string;
    static function ProjectDisplayName: string;
    static function ProjectURL: string;
    static function HasProjectSystem: Boolean;
    static function CRMID: string;
    static function CRMDisplayName: string;
    static function CRMURL: string;
    static function HasCRMSystem: Boolean;
    static function DecisionID: string;
    static function DecisionDisplayName: string;
    static function DecisionURL: string;
    static function HasDecisionSystem: Boolean;
    static function DocID: string;
    static function DocDisplayName: string;
    static function DocURL: string;
    static function HasDocSystem: Boolean;
    static function OAID: string;
    static function OADisplayName: string;
    static function OAURL: string;
    static function HasOASystem: Boolean;
    static function HRMID: string;
    static function HRMDisplayName: string;
    static function HRMURL: string;
    static function HasHRMSystem: Boolean;
    static function BizDesignID: string;
    static function BizDesignDisplayName: string;
    static function BizDesignURL: string;
    static function HasBizDesignSystem: Boolean;
    static function SCMID: string;
    static function SCMDisplayName: string;
    static function SCMURL: string;
    static function HasSCMSystem: Boolean;
    static function MailBoxSize: Integer;
    static function TaskRemindKind: string;
    static function CheckRemindTaskTime: Integer;
    static function CalendarCreatorTimer: Integer;
   end;

{ TBusinessConfig }

  TConfigStoreEvent = procedure(Sender: TBusinessConfig; AIniFile: TBaseXMLIniFile) of object;

  TBusinessConfig = class
  private
    FVersion: string;

    FSaveOnExit: Boolean;
    FSaveToolWindowLayout: Boolean;

    FStyle: TViewAttributesStyle;
    FReadOnlyColor: TColor;
    FRequiredColor: TColor;

    FRunMessenger: Boolean;

    FShortcutFuncs: string;

    FDefaultFuncs: string;
    FServiceFuncs: string;
    FAutoRunFuncs: string;

    FActiveFunc: string;
    FActiveDesktopID: string;
    FOpenFuncs: string;
    FRunFuncs: string;
    FDefaultDesktopID: string;
    FSaveActiveFunc: Boolean;
    FSaveLastOpenFuncCount: Integer;

    FShowRemindBox: Boolean;
    FRemindTaskOutOfTime: Boolean;
    FTaskRemindKind: string;
    FCheckRemindTaskTime: Integer;
    FTask_ShowDeptFilter: Boolean;
    FTask_UseSuperiorDeptURLs: Boolean;
    FTask_Desktop_IncludeDeptProcess: Boolean;
    FPlan_ShowDeptFilter: Boolean;
    FProject_ShowDeptFilter: Boolean;
    FDoc_IncludeSubordinationAccess: Boolean;

    FMailBoxSize: Integer;
    FCalendarCreatorTimer: Integer;

    FRecordSystemLog: Boolean;
    FSystemLogKinds: string;

    FOnLoad: TConfigStoreEvent;
    FOnSave: TConfigStoreEvent;

    function GetSection: string;

    function DefaultStyle: TViewAttributesStyle;
    function DefaultReadOnlyColor: TColor;
    function DefaultRequiredColor: TColor;
    function DefaultTask_ShowDeptFilter: Boolean;
    function DefaultTask_UseSuperiorDeptURLs: Boolean;
    function DefaultTask_Desktop_IncludeDeptProcess: Boolean;
    function DefaultPlan_ShowDeptFilter: Boolean;
    function DefaultProject_ShowDeptFilter: Boolean;
    function DefaultDoc_IncludeSubordinationAccess: Boolean;
  public
    constructor Create(IsSystem: Boolean);
    function CheckVersion(IniFile: TCustomIniFile): Boolean;

    procedure Assign(Source: TBusinessConfig);
    procedure Save(IniFile: TBaseXMLIniFile; AURL: string);
    procedure SaveDefault(IniFile: TBaseXMLIniFile);
    procedure Load(IniFile: TBaseXMLIniFile);
    procedure Delete(IniFile: TBaseXMLIniFile);

    property Version: string read FVersion;

    { 主界面 }
    property SaveOnExit: Boolean read FSaveOnExit write FSaveOnExit;
    property SaveToolWindowLayout: Boolean read FSaveToolWindowLayout write FSaveToolWindowLayout;
    { Messenger }
    property RunMessenger: Boolean read FRunMessenger write FRunMessenger;
    { 表现风格 }
    property Style: TViewAttributesStyle read FStyle write FStyle;
    property ReadOnlyColor: TColor read FReadOnlyColor write FReadOnlyColor;
    property RequiredColor: TColor read FRequiredColor write FRequiredColor;
    { 快捷键 }
    property ShortcutFuncs: string read FShortcutFuncs write FShortcutFuncs;

   { 个人运行功能,只对system开放 }
    property DefaultFuncs: string read FDefaultFuncs write FDefaultFuncs;
   { 服务功能 }
    property ServiceFuncs: string read FServiceFuncs write FServiceFuncs;
    { 启动功能 }
    property AutoRunFuncs: string read FAutoRunFuncs write FAutoRunFuncs;


    {激活的面板}
    property ActiveDesktopID: string read FActiveDesktopID write FActiveDesktopID;

    { 工作台 }
    property ActiveFunc: string read FActiveFunc write FActiveFunc;
    property OpenFuncs: string read FOpenFuncs write FOpenFuncs;
    property RunFuncs: string read FRunFuncs write FRunFuncs;
    property DefaultDesktopID: string read FDefaultDesktopID write FDefaultDesktopID;
    property SaveActiveFunc: Boolean read FSaveActiveFunc write FSaveActiveFunc;
    property SaveLastOpenFuncCount: Integer read FSaveLastOpenFuncCount write FSaveLastOpenFuncCount;

    { 任务相关 }
    property ShowRemindBox: Boolean read FShowRemindBox write FShowRemindBox;
    property RemindTaskOutOfTime: Boolean read FRemindTaskOutOfTime write FRemindTaskOutOfTime;
    property TaskRemindKind: string read FTaskRemindKind write FTaskRemindKind;
    property CheckRemindTaskTime: Integer read FCheckRemindTaskTime write FCheckRemindTaskTime;
    // 显示本部门过滤选项
    property Task_ShowDeptFilter: Boolean read FTask_ShowDeptFilter write FTask_ShowDeptFilter;
    // 过滤本部门选项,为True使用上级部门URL,否则使用所有上级部门或上级机构的URL
    property Task_UseSuperiorDeptURLs: Boolean read FTask_UseSuperiorDeptURLs write FTask_UseSuperiorDeptURLs;
    // 任务-工作台:同时列出本部门的待办任务
    property Task_Desktop_IncludeDeptProcess: Boolean read FTask_Desktop_IncludeDeptProcess write FTask_Desktop_IncludeDeptProcess;

    { 计划相关 }
    // 显示本部门过滤选项
    property Plan_ShowDeptFilter: Boolean read FPlan_ShowDeptFilter write FPlan_ShowDeptFilter;

    { 项目相关}
    // 显示本部门过滤选项
    property Project_ShowDeptFilter: Boolean read FProject_ShowDeptFilter write FProject_ShowDeptFilter;

    { 文档相关}
    // 包含下属权限
    property Doc_IncludeSubordinationAccess: Boolean read FDoc_IncludeSubordinationAccess write FDoc_IncludeSubordinationAccess;

    { 邮箱大小 }
    property MailBoxSize: Integer read FMailBoxSize write FMailBoxSize;

    { 自动生成日程间隔 }
    property CalendarCreatorTimer: integer read FCalendarCreatorTimer write FCalendarCreatorTimer;

    { 系统日志 }
    property RecordSystemLog: Boolean read FRecordSystemLog write FRecordSystemLog;
    property SystemLogKinds: string read FSystemLogKinds write FSystemLogKinds;

    property OnLoad: TConfigStoreEvent read FOnLoad write FOnLoad;
    property OnSave: TConfigStoreEvent read FOnSave write FOnSave;
  end;

{ TConfigChangedNotifyMessage }

  TConfigChangedNotifyMessage = class(TBizMessage)
  private
    FConfig: TBusinessConfig;
  public
    constructor Create(AConfig: TBusinessConfig);
    static function GetName: string;
    property Config: TBusinessConfig read FConfig;
  end;

{TConfigChangedNotifyMessageHandler }

  TConfigChangeOnExecuteEvent = procedure(Sender: TObject; AMessage: TConfigChangedNotifyMessage;
    const AParam: THandleParam; var Handled: Boolean) of object;

  TConfigChangedNotifyMessageHandler = class(TBizMessageHandler)
  private
    FOnExecute: TConfigChangeOnExecuteEvent;
  protected
    procedure DoExecute(AMessage: TBizMessage; const AParam: THandleParam;
      var Handled: Boolean); override;
  public
    constructor Create(AOnExecute: TConfigChangeOnExecuteEvent);
  end;
//  var lBizParam :String;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:14:29 | 显示全部楼层
implementation
const
  cDefault = 'DEFAULT.USER';
  cID = 'BUSINESS.CONFIG';
  cRootURL = 'Org:\Root';
  cSystem = 'SYSTEM';

var
  FConfig: TBusinessConfig;
  FDefaultConfig: TBusinessConfig;

{ TSettingLib }

static function TSETTINGLIB.SettingFileName: string;
begin
  Result := jsCommon.ModulePath + 'Business.Config.xml';
end;

static procedure TSETTINGLIB.SetConfig(AConfig: TBusinessConfig);
begin
  FConfig := AConfig;
end;

static function TSETTINGLIB.GetConfig: TBusinessConfig;
begin
  Result := FConfig;
  if FConfig = nil then
    raise Exception.Create('Config对象尚未初始化');
end;

static function TSETTINGLIB.GetDefaultConfig: TBusinessConfig;
begin
  Result := FDefaultConfig;
  if Result = nil then
    raise Exception.Create('DefaultConfig对象尚未初始化');
end;

static procedure TSETTINGLIB.LoadConfig(AContext: TContext; AConfig: TBusinessConfig; AOrgBizUrl: TBizURL);
begin
  LoadConfig(AContext, AConfig, False, AOrgBizUrl);
end;

static procedure TSETTINGLIB.LoadConfig(AContext: TContext; AConfig: TBusinessConfig; IsSystem: Boolean; AOrgBizURL: TBizURL);
var
  lValue: string;
  lStreamSelf, lStream: TMemoryStream;
  lXmlFile: TStreamXMLIniFile;
  lURL: string;
  lHasValue: Boolean;
begin
  lStream := TMemoryStream.Create;
  try
    if IsSystem then
    begin
      lValue := '';
      ExtUtils.ReadUserInfo(cSystem, cID, lValue, lStream);
    end
    else begin
      // 取部门上定义的信息
      lValue := '';
      lHasValue := False;
      lURL := SysUtils.UpperCase(AOrgBizURL.URL);
      repeat
        lURL := FileSys.FileUtils.GetDirectory(lURL);
        lHasValue := ExtUtils.ReadUserInfo(lURL, cID, lValue, lStream);
      until lHasValue or SysUtils.SameText(lURL, JSConst.cOrgFilePrefix);

      if lHasValue then
      begin
        lXmlFile := TStreamXMLIniFile.Create(lStream);
        try
          AConfig.Load(lXmlFile);
        finally
          lXmlFile.Free;
        end;
      end;

      lStreamSelf := TMemoryStream.Create;
      try
        lURL := SysUtils.UpperCase(AOrgBizURL.URL);
        if ExtUtils.ReadUserInfo(lURL, cID, lValue, lStreamSelf) then
        begin
          lXmlFile := TStreamXMLIniFile.Create(lStreamSelf);
          try
            AConfig.Load(lXmlFile);
          finally
            lXmlFile.Free;
          end;
        end;
      finally
        lStreamSelf.Free;
      end;
      end;
  finally
    lStream.Free;
  end;
end;

static procedure TSETTINGLIB.SaveConfig(AContext: TContext; AConfig: TBusinessConfig; AOrgUrl: string);
begin
  SaveConfig(AContext, AConfig, False, AOrgUrl);
end;

static procedure TSETTINGLIB.SaveConfig(AContext: TContext; AConfig: TBusinessConfig; IsDefault: Boolean; AOrgUrl: string);
var
  lStream: TMemoryStream;
  lXmlFile: TStreamXMLIniFile;
begin
  lStream := TMemoryStream.Create;
  try
    lXmlFile := TStreamXMLIniFile.Create(lStream);
    try
      if not IsDefault then
        AConfig.Save(lXmlFile, AOrgUrl)
      else
        AConfig.SaveDefault(lXmlFile);

     (* if not IsDefault then
      begin
        if ANewConfig.SaveOnExit = ADefConfig.SaveOnExit then
          lXmlFile.DeleteKey('MainForm', 'SaveSettingsOnExit');
        if ANewConfig.SaveToolWindowLayout = ADefConfig.SaveToolWindowLayout then
          lXmlFile.DeleteKey('MainForm', 'SaveToolWindowLayout');
        if ANewConfig.SaveActiveFunc = ADefConfig.SaveActiveFunc then
          lXmlFile.DeleteKey('MainForm', 'SaveActiveFunc');
        if ANewConfig.Style = ADefConfig.Style then
          lXmlFile.DeleteKey('MainForm', 'Style');
        if ANewConfig.ReadOnlyColor = ADefConfig.ReadOnlyColor then
          lXmlFile.DeleteKey('MainForm', 'ReadOnlyColor');
        if ANewConfig.RequiredColor = ADefConfig.RequiredColor then
          lXmlFile.DeleteKey('MainForm', 'RequiredColor');
        {Messenger }
        if ANewConfig.RunMessenger = ADefConfig.RunMessenger then
          lXmlFile.DeleteKey('MainForm', 'RunMessenger');
        { 快捷键 }
        if ANewConfig.ShortcutFuncs = ADefConfig.ShortcutFuncs then
          lXmlFile.DeleteKey('MainForm', 'ShortcutFuncs');
        { 工作台 }
        if ANewConfig.RunFuncs = ADefConfig.RunFuncs then
          lXmlFile.DeleteKey('MainForm', 'RunFuncs');
      end;       *)

  finally
      lXmlFile.Free;
    end;

    if IsDefault then
      ExtUtils.WriteUserInfo(SysUtils.UpperCase(cRootURL), cID, '', lStream, True)
    else
    begin
      ExtUtils.WriteUserInfo(SysUtils.UpperCase(AOrgUrl), cID, '', lStream, True);
    end;
  finally
    lStream.Free;
  end;
end;

static procedure TSETTINGLIB.Init;
var
  lValue: string;
  lStream: TMemoryStream;
  lXmlFile: TStreamXMLIniFile;
begin
  if FDefaultConfig = nil then
  begin
    FDefaultConfig := TBusinessConfig.Create(False);
    lStream := TMemoryStream.Create;
    try
      lValue := '';

      if not ExtUtils.ReadUserInfo(SysUtils.UpperCase(cRootURL), cID, lValue, lStream) then
      begin
        Exit;
          // TODO: raise Exception.Create('加载配置文件失败,请联系管理员检查系统基础数据');
      end;

      lXmlFile := TStreamXMLIniFile.Create(lStream);
      try
        FDefaultConfig.Load(lXmlFile);
      finally
        lXmlFile.Free;
      end;
    finally
      lStream.Free;
    end;
  end;
end;

static procedure TSETTINGLIB.Uninit;
begin
  FDefaultConfig := nil;
end;

{ TSystemConsts }

static function TSystemConsts.DefaultFuncs: TStringArray;
begin
   Result := ['Biz:\COLLABORATION\DesktopFunc.Func',
    CustomDesktopFunc,
    'Biz:\COLLABORATION\SchedulerFunc.Func',
    'Biz:\COLLABORATION\TaskCenterFunc.Func',
    'Biz:\COLLABORATION\PlanCenterFunc.Func',
    'Biz:\COLLABORATION\JustepMail.Func',

    'Biz:\COLLABORATION\MyTaskFunc.Func',
    'Biz:\COLLABORATION\TaskRelationViewFunc.Func',
    'Biz:\COLLABORATION\PlanBrowseFunc.Func',

    'Biz:\COLLABORATION\WorkRecordFunc.Func',
    'Biz:\COLLABORATION\WORKTASKFUNC.Func',
//    'Biz:\COLLABORATION\WorkRemindFunc.Func',
    'Biz:\COLLABORATION\WorkLogFunc.Func',
    'Biz:\COLLABORATION\WorkAdviceFunc.Func',
    'Biz:\COLLABORATION\WorkWeekPlanFunc.Func',
    'Biz:\COLLABORATION\CalendarFunc.Func',
    'Biz:\COLLABORATION\CalendarTempletMngFunc.Func',

    'Biz:\COLLABORATION\WorkCalendarFunc.Func',
    'Biz:\COLLABORATION\UserPanelSettingFunc.Func',
    'Biz:\COLLABORATION\WEBVIEWFUNC.Func',

    'Biz:\COLLABORATION\WorkAdviceDealFunc.Func',
    'Biz:\COLLABORATION\WorkLogDealFunc.Func',
    'Biz:\COLLABORATION\WorkRecordDealFunc.Func',
//    'Biz:\COLLABORATION\WorkRemindDealFunc.Func',
    'Biz:\COLLABORATION\WorkTaskDealFunc.Func',
    'Biz:\COLLABORATION\WorkWeekPlanDealFunc.Func',
    'Biz:\COLLABORATION\ShowDetails.Func',
    'Biz:\COLLABORATION\PanelDefineFunc.Func',
    'Biz:\COLLABORATION\CalendarDealFunc.Func',

    'Biz:\COLLABORATION\AddressListFunc.Func',
    'Biz:\COLLABORATION\JUSTEPMEMO.Func',
    'Biz:\COLLABORATION\JUSTEPNOTEBOOK.Func',

    'Biz:\OPERATION\CRMSPACE\UserMngFunc.Func',
    'Biz:\OPERATION\CRMSPACE\CstmCommRecordFunc.Func',
    'Biz:\OPERATION\CRMSPACE\CSTMTRACKTFUNC.Func',
    'Biz:\OPERATION\CRMSPACE\PresaleWorkTaskFunc.Func',
    'Biz:\OPERATION\CRMSPACE\CustomerMngFunc.Func',
    'Biz:\OPERATION\CRMSPACE\UserCommRecordFunc.Func',
    'Biz:\OPERATION\CRMSPACE\UserTrackRecordFunc.Func',
    'Biz:\OPERATION\CRMSPACE\CHIEFMEETINGRECFUNC.Func',
    'Biz:\OPERATION\CRMSPACE\WORKWEEKREPORTFunc.Func',
    'Biz:\OPERATION\CRMSPACE\ProductDemandFUNC.Func',
    'Biz:\OPERATION\CRMSPACE\ProductQuestionFunc.Func',
    'Biz:\OPERATION\CRMSPACE\ProductQuestionFunc.Func',
    'Biz:\OPERATION\CRMSPACE\DATEAPPLICATIONFunc.Func',

    'Biz:\OPERATION\CRMSPACE\CstmCommRecordDealFunc.Func',
    'Biz:\OPERATION\CRMSPACE\CSTMTRACKDEALFUNC.Func',
    'Biz:\OPERATION\CRMSPACE\PresaleWorkTaskDealFunc.Func',
    'Biz:\OPERATION\CRMSPACE\UserCommRecordDealFunc.Func',
    'Biz:\OPERATION\CRMSPACE\UserTrackRecordDealFunc.Func',
    'Biz:\OPERATION\CRMSPACE\CHIEFMEETINGRECDEALFUNC.Func',
    'Biz:\OPERATION\CRMSPACE\WORKWEEKREPORTDEALfunc.Func',
    'Biz:\OPERATION\CRMSPACE\ProductDemandDealFunc.Func',
    'Biz:\OPERATION\CRMSPACE\ProductQuestionDealFunc.Func',
    'Biz:\OPERATION\CRMSPACE\DATEAPPLICATIONDEALFUNC.Func'
    ];

  if TSystemConsts.HasProjectSystem then
  begin
    SetLength(Result, High(Result) - Low(Result) + 1 + 1);
    Result[High(Result)] := 'Biz:\OPERATION\PROJECTSPACE\ProjectRelationBrowseFunc.Func';
  end;

  if TSystemConsts.HasDocSystem then
  begin
    SetLength(Result, High(Result) - Low(Result) + 1 + 1);
    Result[High(Result)] := TSystemConsts.DocCenterURL;
  end;

  if TSystemConsts.HasDecisionSystem then
  begin
    SetLength(Result, High(Result) - Low(Result) + 1  + 1);
    Result[High(Result)] := TSystemConsts.DecisionCenterURL;
  end;

  if TSystemConsts.HasOASystem then
  begin
    SetLength(Result, High(Result) - Low(Result) + 1  + 5);
    Result[High(Result) - 4] := TSystemConsts.NewsCenterURL;
    Result[High(Result) - 3] := 'Biz:\OPERATION\OASPACE\LetterVisitDealFunc.Func';
    Result[High(Result) - 2] := 'Biz:\OPERATION\OASPACE\LetterDisposalDealFunc.Func';
    Result[High(Result) - 1] := 'Biz:\OPERATION\OASPACE\DailyChargeBxDealFunc.Func';
    Result[High(Result)] := 'Biz:\OPERATION\OASPACE\EvectionChargeBxDealFunc.Func';
  end;
end;

static function TSystemConsts.SystemDefaultFuncs: TStringArray;
begin
  //组织机构设计器
  Result := ['Biz:\SYSTEM\OrgSetting.Func'];

  SetLength(Result, Length(Result) + 8);
  //系统默认参数设置
  Result[Length(Result) - 8] := 'Biz:\COLLABORATION\SYSCONFIGSETTIN.Func';
  //面板风格管理
//  Result[Length(Result) - 8] := 'Biz:\COLLABORATION\PanelDefineFunc.Func';
  //DOCTOR
  Result[Length(Result) - 7] := 'Biz:\SYSTEM\DOCTOR.Func';
  //系统面板配置
  Result[Length(Result) - 6] := 'Biz:\COLLABORATION\SysPanelSettingFunc.Func';
  //业务系统管理
  Result[Length(Result) - 5] := 'Biz:\COLLABORATION\BIZSYSTEMMNG.Func';
  //业务功能树配置
  Result[Length(Result) - 4] := 'Biz:\COLLABORATION\FuncTreeMngFunc.Func';
  //决策中心初始化
  //任务关联配置—任务管理管理
  Result[Length(Result) - 3] := 'Biz:\COLLABORATION\TaskRelevancyMngFunc.Func';
  //业务关联配置—业务关联管理
  Result[Length(Result) - 2] := 'Biz:\COLLABORATION\BusinessRelevancyMngFunc.Func';
  //文档关联配置-文档关联定义
  Result[Length(Result) - 1] := 'Biz:\COLLABORATION\DOCRELEVANCYDEFFUNC.FUNC';

  if BizSys.BizSystem.URLExists('Biz:\OPERATION\TemplateSpace') then
  begin
    SetLength(Result, Length(Result) + 1);
    Result[Length(Result) - 1] := 'Biz:\OPERATION\TEMPLATESPACE\DocAccessSettingFunc.Func';
  end;

  if BizSys.BizSystem.URLExists('Biz:\OPERATION\DocSpace') then
  begin
    SetLength(Result, Length(Result) + 1);
    Result[Length(Result) - 1] := 'Biz:\OPERATION\DOCSPACE\DocAccessSettingFunc.Func';
  end;

  if BizSys.BizSystem.URLExists('Biz:\OPERATION\DecisionSpace') then
  begin
    SetLength(Result, Length(Result) + 1);
    Result[Length(Result) - 1] := 'Biz:\OPERATION\DECISIONSPACE\DecisionAccessSettingFunc.FUNC';
  end;

end;

static function TSystemConsts.DefaultShortcuts: TStringArray;
begin
  // 废弃
  Result := [];
end;

static function TSystemConsts.PersonFuncs: TStringArray;
begin

  Result := ['Biz:\COLLABORATION\DesktopFunc.Func',
  //张学荣在这儿做了修改,注释了那句话,换成了变量这这句
    CustomDesktopFunc,
   // 'Biz:\COLLABORATION\CUSTOMDESKTOPFUNC.FUNC',
    'Biz:\COLLABORATION\SchedulerFunc.Func',
    'Biz:\COLLABORATION\TaskCenterFunc.Func',
    'Biz:\COLLABORATION\MyTaskFunc.Func',
    'Biz:\COLLABORATION\TaskRelationViewFunc.Func',
    'Biz:\COLLABORATION\PlanCenterFunc.Func',
    'Biz:\COLLABORATION\PlanBrowseFunc.Func',
    'Biz:\COLLABORATION\TaskRemindFunc.Func',
{ TODO:   DocCenterURL,
    DecisionCenterURL,
    NewsCenterURL,}
    'Biz:\SYSTEM\DeptFuncManage.Func',
    'Biz:\SYSTEM\DeptManageAuthority.Func',
    'Biz:\SYSTEM\DeptOrganDesignForm.Func',
    'Biz:\SYSTEM\DeptPersonDesignForm.Func',
    'Biz:\SYSTEM\DEPTORGSETTING.FUNC',
    'Biz:\JUSTEP\JUSTEPMAIL.Func',
    'Biz:\OPERATION\DOCSPACE\DOCCENTERFUNC.FUNC',
    'Biz:\OPERATION\PROJECTSPACE\PROJECTCENTERFUNC.Func',
    'Biz:\OPERATION\DECISIONSPACE\DECISIONCENTERFUNC.FUNC'
    ];
end;

static function TSystemConsts.RunFuncs: TStringArray;
begin
   Result := [CustomDesktopFunc,
    'Biz:\COLLABORATION\SchedulerFunc.Func'];

end;


static function TSystemConsts.ServiceFuncs: TStringArray;
begin
  Result := ['Biz:\COLLABORATION\TaskServiceFunc.Func',
    'Biz:\COLLABORATION\MailServiceFunc.Func',
    'Biz:\COLLABORATION\DocContentServiceFunc.Func',
    'Biz:\COLLABORATION\DocServiceFunc.Func',
    { 默认不加载,用于组织机构地址簿同步
    'Biz:\COLLABORATION\AddressListMessageReceiveFunc.Func',}
    'Biz:\OPERATION\CodeServiceFunc.Func'];
end;

static function TSystemConsts.AutoRunFuncs: TStringArray;
begin
  Result := ['Biz:\COLLABORATION\TaskRemindFunc.Func',
    'Biz:\COLLABORATION\CalendarCreatorFunc.Func'];
end;

static function TSystemConsts.SystemRunFuncs: TStringArray;
begin
  Result := ['Biz:\COLLABORATION\SystemDesktopFunc.Func'];
end;

static function TSystemConsts.ShortcutFuncs: TStringArray;
begin
  Result := ['Biz:\COLLABORATION\TaskCenterFunc.Func',
    'Biz:\COLLABORATION\PlanCenterFunc.Func',
    'Biz:\COLLABORATION\JustepMail.Func'
    ];
end;
//下面的函数张学荣添加
static  procedure TSystemConsts.SetBizParam(AParam:String);
begin
//  lBizParam:=AParam;
end;

static function TSystemConsts.CustomDesktopFunc: string;
begin
result:='Biz:\COLLABORATION\GZTnew.Func';
//dialogs.ShowMessage('lBizParam'+lBizParam);
{if GetParamValue('Biz:\SYSTEM\DICT\YWCSZ1.ParamGroup\YWKJID.Param')<>'' then
     Result := 'Biz:\COLLABORATION\CustomDesktopFunc.Func'
    else
    Result := 'Biz:\COLLABORATION\GZT.Func';}
  //if  lBizParam='' then
   //Result := 'Biz:\COLLABORATION\CustomDesktopFunc.Func'
    //else
//   Result := 'Biz:\COLLABORATION\GZT.Func';
    //张学荣做了修改,这个函数的原版就是下面的那句话,我用上面这些语句替代了这句话
// Result := 'Biz:\COLLABORATION\CustomDesktopFunc.Func';
end;

static function TSystemConsts.TaskCenterURL: string;
begin
  Result := 'Biz:\COLLABORATION\TaskCenterFunc.Func';
end;

static function TSystemConsts.PlanCenterURL: string;
begin
  Result := 'Biz:\COLLABORATION\PlanCenterFunc.Func';
end;

static function TSystemConsts.DecisionCenterURL: string;
begin
  Result := 'Biz:\OPERATION\DECISIONSPACE\DecisionCenterFunc.Func';
end;

static function TSystemConsts.NewsCenterURL: string;
begin
  Result := 'Biz:\OPERATION\OASPACE\TASKCENTERNEWSFUNC.Func';
end;

static function TSystemConsts.CustomerCenterURL: string;
begin
  Result := 'Biz:\OPERATION\CRMSPACE\CustomerMngFunc.Func';
end;

static function TSystemConsts.MailURL: string;
begin
  Result := 'Biz:\COLLABORATION\JustepMail.Func';
end;

static function TSystemConsts.DocCenterURL: string;
begin
  Result := 'Biz:\OPERATION\DOCSPACE\DOCCENTERFUNC.FUNC';
end;

static function TSystemConsts.ProjectID: string;
begin
  Result := 'PROJECT';
end;

static function TSystemConsts.ProjectDisplayName: string;
begin
  Result := '项目中心';
end;

static function TSystemConsts.ProjectURL: string;
begin
  Result := 'Biz:\OPERATION\ProjectSpace';
end;

static function TSystemConsts.HasProjectSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.ProjectURL);
end;

static function TSystemConsts.CRMID: string;
begin
  Result := 'CRM';
end;

static function TSystemConsts.CRMDisplayName: string;
begin
  Result := '客户关系';
end;

static function TSystemConsts.CRMURL: string;
begin
  Result := 'Biz:\OPERATION\CRMSpace';
end;

static function TSystemConsts.HasCRMSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.CRMURL);
end;

static function TSystemConsts.DecisionID: string;
begin
  Result := 'Decision';
end;

static function TSystemConsts.DecisionDisplayName: string;
begin
  Result := '决策中心';
end;

static function TSystemConsts.DecisionURL: string;
begin
  Result := 'Biz:\OPERATION\DecisionSpace';
end;

static function TSystemConsts.HasDecisionSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.DecisionURL);
end;

static function TSystemConsts.DocID: string;
begin
  Result := 'Doc';
end;

static function TSystemConsts.DocDisplayName: string;
begin
  Result := '知识中心';
end;

static function TSystemConsts.DocURL: string;
begin
  Result := 'Biz:\OPERATION\DocSpace';
end;

static function TSystemConsts.HasDocSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.DocURL);
end;

static function TSystemConsts.OAID: string;
begin
  Result := 'OA';
end;

static function TSystemConsts.OADisplayName: string;
begin
  Result := '办公自动化';
end;

static function TSystemConsts.OAURL: string;
begin
  Result := 'Biz:\OPERATION\OASpace';
end;

static function TSystemConsts.HasOASystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.OAURL);
end;

static function TSystemConsts.HRMID: string;
begin
  Result := 'HRM';
end;

static function TSystemConsts.HRMDisplayName: string;
begin
  Result := '人力资源';
end;

static function TSystemConsts.HRMURL: string;
begin
  Result := 'Biz:\OPERATION\HRMSpace';
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:17:42 | 显示全部楼层
static function TSystemConsts.HasHRMSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.HRMURL);
end;

static function TSystemConsts.BizDesignID: string;
begin
  Result := 'BizDsn';
end;

static function TSystemConsts.BizDesignDisplayName: string;
begin
  Result := '业务设计';
end;

static function TSystemConsts.BizDesignURL: string;
begin
  Result := 'Biz:\LRDESIGNSPACE';
end;

static function TSystemConsts.HasBizDesignSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.BizDesignURL);
end;

static function TSystemConsts.SCMID: string;
begin
  Result := 'SCM';
end;

static function TSystemConsts.SCMDisplayName: string;
begin
  Result := '供应链';
end;

static function TSystemConsts.SCMURL: string;
begin
  Result := 'Biz:\JEWIMPHARMA';
end;

static function TSystemConsts.HasSCMSystem: Boolean;
begin
  Result := BizSys.BizSystem.URLExists(TSystemConsts.SCMURL);
end;

static function TSystemConsts.MailBoxSize: Integer;
begin
  Result := 100 *1024*1024;
end;

static function TSystemConsts.TaskRemindKind: string;
begin
  Result := 'RemindBox';
end;

static function TSystemConsts.CheckRemindTaskTime: Integer;
begin
  Result := 30;
end;

static function TSystemConsts.CalendarCreatorTimer: Integer;
begin
  Result := 60;
end;

{ TBusinessConfig }

const
  cVersion = 'Version';
  cSaveOnExit = 'SaveSettingsOnExit';
  cSaveToolWindowLayout = 'SaveToolWindowLayout';
  cSaveActiveFunc = 'SaveActiveFunc';
  cSaveLastOpenFuncCount = 'SaveLastOpenFuncCount';
  cActiveFunc = 'ActiveFunc';
  cDefaultDesktopID = 'DefaultDesktopID';
  cRunMessenger = 'RunMessenger';
  cStyle = 'Style';
  cReadOnlyColor = 'ReadOnlyColor';
  cRequiredColor = 'RequiredColor';

// 字符数组转换为“;”分隔的字符串
function StrArrayToStr(const AArray: TStringArray): string;
var
  I: Integer;
begin
  Result := '';
  for I := Low(AArray) to High(AArray) do
  begin
    if Result <> '' then
      Result := Result + ';';
    Result := Result + AArray[I];
  end;
end;

procedure TBusinessConfig.Assign(Source: TBusinessConfig);
begin
  SaveOnExit := Source.SaveOnExit;
  SaveToolWindowLayout := Source.SaveToolWindowLayout;
  SaveActiveFunc := Source.SaveActiveFunc;
  SaveLastOpenFuncCount := Source.SaveLastOpenFuncCount;

  ActiveFunc := Source.ActiveFunc;
  OpenFuncs := Source.OpenFuncs;
  RunFuncs := Source.RunFuncs;
  DefaultDesktopID := Source.DefaultDesktopID;

  RunMessenger := Source.RunMessenger;

  Style := Source.Style;
  ReadOnlyColor := Source.ReadOnlyColor;
  RequiredColor := Source.RequiredColor;
  ShowRemindBox := Source.ShowRemindBox;
  RemindTaskOutOfTime := Source.RemindTaskOutOfTime;
  FTask_ShowDeptFilter := Source.Task_ShowDeptFilter;
  FTask_UseSuperiorDeptURLs := Source.Task_UseSuperiorDeptURLs;
  FTask_Desktop_IncludeDeptProcess := Source.Task_Desktop_IncludeDeptProcess;
  FPlan_ShowDeptFilter := Source.Plan_ShowDeptFilter;
  FProject_ShowDeptFilter := Source.Project_ShowDeptFilter;
  FDoc_IncludeSubordinationAccess := Source.Doc_IncludeSubordinationAccess;
  RecordSystemLog := Source.RecordSystemLog;
  SystemLogKinds := Source.SystemLogKinds;
end;

constructor TBusinessConfig.Create(IsSystem: Boolean);
begin
  inherited Create;
  FVersion := '1.0.0.3';

  SaveOnExit := False;
  SaveToolWindowLayout := True;
  //SaveActiveFunc := True;
  //SaveLastOpenFuncCount := 10;
  Style := DefaultStyle;
  ReadOnlyColor := DefaultReadOnlyColor;
  RequiredColor := DefaultRequiredColor;

  RunMessenger := True;

  if IsSystem then
  begin
    ShortcutFuncs := StrArrayToStr(TSystemConsts.SystemDefaultFuncs);
    RunFuncs := StrArrayToStr(TSystemConsts.SystemRunFuncs);
    RecordSystemLog := True;
  end
  else begin
    ShortcutFuncs := StrArrayToStr(TSystemConsts.ShortcutFuncs);
    RunFuncs := StrArrayToStr(TSystemConsts.RunFuncs);
    RecordSystemLog := False;
  end;

  DefaultFuncs := StrArrayToStr(TSystemConsts.DefaultFuncs);
  ServiceFuncs := StrArrayToStr(TSystemConsts.ServiceFuncs);
  AutoRunFuncs := StrArrayToStr(TSystemConsts.AutoRunFuncs);
  TaskRemindKind := 'RemindBox';
  CheckRemindTaskTime := 30;
  MailBoxSize := 100;
  CalendarCreatorTimer := 60;
  ShowRemindBox := True;
  RemindTaskOutOfTime := False;
  FTask_ShowDeptFilter := DefaultTask_ShowDeptFilter;
  FTask_UseSuperiorDeptURLs := DefaultTask_UseSuperiorDeptURLs;
  FTask_Desktop_IncludeDeptProcess := DefaultTask_Desktop_IncludeDeptProcess;
  FPlan_ShowDeptFilter := DefaultPlan_ShowDeptFilter;
  FProject_ShowDeptFilter := DefaultProject_ShowDeptFilter;
  FDoc_IncludeSubordinationAccess := DefaultDoc_IncludeSubordinationAccess;
  SystemLogKinds := 'SYSTEM;ORGSETTING';
end;

function TBusinessConfig.GetSection: string;
begin
  Result := 'MainForm';
end;

function TBusinessConfig.DefaultStyle: TViewAttributesStyle;
begin
  Result := TViewAttributesStyle.vsCustom;
end;

function TBusinessConfig.DefaultReadOnlyColor: TColor;
begin
  Result := Graphics.clInactiveCaptionText;
end;

function TBusinessConfig.DefaultRequiredColor: TColor;
begin
  Result := Graphics.clWindow;
end;

function TBusinessConfig.DefaultTask_ShowDeptFilter: Boolean;
begin
  Result := True;
end;

function TBusinessConfig.DefaultTask_UseSuperiorDeptURLs: Boolean;
begin
  Result := True;
end;

function TBusinessConfig.DefaultTask_Desktop_IncludeDeptProcess: Boolean;
begin
  Result := False;
end;

function TBusinessConfig.DefaultPlan_ShowDeptFilter: Boolean;
begin
  Result := True;
end;

function TBusinessConfig.DefaultProject_ShowDeptFilter: Boolean;
begin
  Result := True;
end;

function TBusinessConfig.DefaultDoc_IncludeSubordinationAccess: Boolean;
begin
  Result := True;
end;

function TBusinessConfig.CheckVersion(IniFile: TCustomIniFile): Boolean;
begin
  Result := IniFile.ReadString(GetSection, cVersion, '') = FVersion;
end;

procedure TBusinessConfig.Delete(IniFile: TBaseXMLIniFile);
begin
  IniFile.EraseSection('MainForm');
end;

procedure TBusinessConfig.Load(IniFile: TBaseXMLIniFile);
begin
  if not CheckVersion(IniFile) then
    Exit;

  { 常规 }
  SaveOnExit := IniFile.ReadBool(GetSection, cSaveOnExit, SaveOnExit);
  SaveToolWindowLayout := IniFile.ReadBool(GetSection, cSaveToolWindowLayout, SaveToolWindowLayout);
  SaveActiveFunc := IniFile.ReadBool(GetSection, cSaveActiveFunc, SaveActiveFunc);
  SaveLastOpenFuncCount := IniFile.ReadInteger(GetSection, cSaveLastOpenFuncCount, SaveLastOpenFuncCount);
  ActiveFunc := IniFile.ReadString(GetSection, cActiveFunc, ActiveFunc);
  // TODO: 废弃 OpenFuncs := IniFile.ReadString(GetSection, 'OpenFuncs', OpenFuncs);
  DefaultDesktopID := IniFile.ReadString(GetSection, cDefaultDesktopID, DefaultDesktopID);
  Style := TViewAttributesStyle(IniFile.ReadInteger(GetSection, cStyle, Integer(DefaultStyle)));
  ReadOnlyColor := TColor(IniFile.ReadInteger(GetSection, cReadOnlyColor, Integer(DefaultReadOnlyColor)));
  RequiredColor := TColor(IniFile.ReadInteger(GetSection, cRequiredColor, Integer(DefaultRequiredColor)));
  { Messenger }
  RunMessenger := IniFile.ReadBool(GetSection, cRunMessenger, RunMessenger);
  { 快捷面板 }
  ShortcutFuncs := IniFile.ReadString(GetSection, 'ShortcutFuncs', ShortcutFuncs);
  {激活的面板}
  ActiveDesktopID := IniFile.ReadString(GetSection, 'ActiveDesktopID', ActiveDesktopID);
  { 工作台 }
  RunFuncs := IniFile.ReadString(GetSection, 'RunFuncs', RunFuncs);
  { 任务相关 }
  ShowRemindBox := IniFile.ReadBool(GetSection, 'ShowRemindBox', ShowRemindBox);
  RemindTaskOutOfTime := IniFile.ReadBool(GetSection, 'RemindTaskOutOfTime', RemindTaskOutOfTime);
  { 个人运行功能,只对system开放 }
  DefaultFuncs := IniFile.ReadString(GetSection, 'DefaultFuncs', DefaultFuncs);
  { 系统启动时自动运行的服务功能 }
  ServiceFuncs := IniFile.ReadString(GetSection, 'ServiceFuncs', ServiceFuncs);
  { 系统运行后在主窗体调用自动运行的功能 }
  AutoRunFuncs := IniFile.ReadString(GetSection, 'AutoRunFuncs', AutoRunFuncs);
  { 任务提醒方式 }
  TaskRemindKind := IniFile.ReadString(GetSection, 'TaskRemindKind', TaskRemindKind);
  { 提醒刷新任务间隔时间 }
  CheckRemindTaskTime := IniFile.ReadInteger(GetSection, 'CheckRemindTaskTime', CheckRemindTaskTime);
  { 邮箱大小 }
  MailBoxSize := IniFile.ReadInteger(GetSection, 'MailBoxSize', MailBoxSize);
  { 自动生成日程间隔时间 }
  CalendarCreatorTimer := IniFile.ReadInteger(GetSection, 'CalendarCreatorTimer', CalendarCreatorTimer);

  Task_ShowDeptFilter := IniFile.ReadBool(GetSection, 'Task_ShowDeptFilter', Task_ShowDeptFilter);
  Task_UseSuperiorDeptURLs := IniFile.ReadBool(GetSection, 'Task_UseSuperiorDeptURLs', Task_UseSuperiorDeptURLs);
  Task_Desktop_IncludeDeptProcess := IniFile.ReadBool(GetSection, 'Task_Desktop_IncludeDeptProcess', Task_Desktop_IncludeDeptProcess);
  Plan_ShowDeptFilter := IniFile.ReadBool(GetSection, 'Plan_ShowDeptFilter', Plan_ShowDeptFilter);
  Project_ShowDeptFilter := IniFile.ReadBool(GetSection, 'Project_ShowDeptFilter', Project_ShowDeptFilter);
  Doc_IncludeSubordinationAccess := IniFile.ReadBool(GetSection, 'Doc_IncludeSubordinationAccess', Doc_IncludeSubordinationAccess);

  RecordSystemLog := IniFile.ReadBool(GetSection, 'RecordSystemLog', RecordSystemLog);
  SystemLogKinds := IniFile.ReadString(GetSection, 'SystemLogKinds', SystemLogKinds);

  if Assigned(FOnLoad) then
    FOnLoad(Self, IniFile);
end;

procedure TBusinessConfig.SaveDefault(IniFile: TBaseXMLIniFile);
begin
  IniFile.WriteString(GetSection, cVersion, FVersion);
   { 常规 }
  IniFile.WriteBool(GetSection, cSaveOnExit, SaveOnExit);
  IniFile.WriteBool(GetSection, cSaveToolWindowLayout, SaveToolWindowLayout);
  IniFile.WriteBool(GetSection, cSaveActiveFunc, SaveActiveFunc);
  IniFile.WriteInteger(GetSection, cSaveLastOpenFuncCount, SaveLastOpenFuncCount);
  IniFile.WriteString(GetSection, cActiveFunc, ActiveFunc);
// TODO: 废弃 IniFile.WriteString(GetSection, 'OpenFuncs', OpenFuncs);
  IniFile.WriteString(GetSection, cDefaultDesktopID, DefaultDesktopID);

  if Style <> DefaultStyle then
    IniFile.WriteInteger(GetSection, cStyle, Integer(Style))
  else
    IniFile.DeleteKey(GetSection, cStyle);
  if ReadOnlyColor <> DefaultReadOnlyColor then
    IniFile.WriteInteger(GetSection, cReadOnlyColor, Integer(ReadOnlyColor))
  else
    IniFile.DeleteKey(GetSection, cReadOnlyColor);
  if RequiredColor <> DefaultRequiredColor then
    IniFile.WriteInteger(GetSection, cRequiredColor, Integer(RequiredColor))
  else
    IniFile.DeleteKey(GetSection, cRequiredColor);

  { Messenger }
  IniFile.WriteBool(GetSection, cRunMessenger, RunMessenger);
  { 快捷面板 }
  IniFile.WriteString(GetSection, 'ShortcutFuncs', ShortcutFuncs);
  {激活的面板}
  IniFile.WriteString(GetSection, 'ActiveDesktopID', ActiveDesktopID);
  { 工作台 }
  IniFile.WriteString(GetSection, 'RunFuncs', RunFuncs);

  { 任务相关 }
  IniFile.WriteBool(GetSection, 'ShowRemindBox', ShowRemindBox);
  IniFile.WriteBool(GetSection, 'RemindTaskOutOfTime', RemindTaskOutOfTime);
  { 个人运行功能,只对system开放 }
  IniFile.WriteString(GetSection, 'DefaultFuncs', DefaultFuncs);
  { 系统启动时自动运行的服务功能 }
  IniFile.WriteString(GetSection, 'ServiceFuncs', ServiceFuncs);
  { 系统运行后在主窗体调运自动运行的功能 }
  IniFile.WriteString(GetSection, 'AutoRunFuncs', AutoRunFuncs);
  { 任务提醒方式 }
  IniFile.WriteString(GetSection, 'TaskRemindKind', TaskRemindKind);
  { 提醒刷新任务间隔时间 }
  IniFile.WriteInteger(GetSection, 'CheckRemindTaskTime', CheckRemindTaskTime);
  { 邮箱大小 }
  IniFile.WriteInteger(GetSection, 'MailBoxSize', MailBoxSize);
  { 自动生成日程间隔时间 }
  IniFile.WriteInteger(GetSection, 'CalendarCreatorTimer', CalendarCreatorTimer);

  IniFile.WriteBool(GetSection, 'Task_ShowDeptFilter', Task_ShowDeptFilter);
  IniFile.WriteBool(GetSection, 'Task_UseSuperiorDeptURLs', Task_UseSuperiorDeptURLs);
  IniFile.WriteBool(GetSection, 'Task_Desktop_IncludeDeptProcess', Task_Desktop_IncludeDeptProcess);

  IniFile.WriteBool(GetSection, 'Plan_ShowDeptFilter', Plan_ShowDeptFilter);

  IniFile.WriteBool(GetSection, 'Project_ShowDeptFilter', Project_ShowDeptFilter);

  IniFile.WriteBool(GetSection, 'Doc_IncludeSubordinationAccess', Doc_IncludeSubordinationAccess);

  IniFile.WriteBool(GetSection, 'RecordSystemLog', RecordSystemLog);
  IniFile.WriteString(GetSection, 'SystemLogKinds', SystemLogKinds);

  if Assigned(FOnSave) then
    FOnSave(Self, IniFile);
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:20:03 | 显示全部楼层
procedure TBusinessConfig.Save(IniFile: TBaseXMLIniFile; AURL: string);
var
  lConfig: TBusinessConfig;
  lHasValue: Boolean;
  lValue: string;
  lXmlFile: TStreamXMLIniFile;
  lStream: TStream;
  lURL: string;
begin
  lConfig := TBusinessConfig.Create(False);
  lValue := '';

  lHasValue := False;
  lURL := SysUtils.UpperCase(AURL);
  lStream := TMemoryStream.Create;
  try
    repeat
      lURL := FileSys.FileUtils.GetDirectory(lURL);
      lHasValue := ExtUtils.ReadUserInfo(lURL, cID, lValue, lStream);
    until lHasValue or SysUtils.SameText(lURL, JSConst.cOrgFilePrefix);

    lXmlFile := TStreamXMLIniFile.Create(lStream);
    try
      lConfig.Load(lXmlFile);
    finally
      lXmlFile.Free;
    end;
  finally
    lStream.Free;
  end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:22:44 | 显示全部楼层
IniFile.WriteString(GetSection, cVersion, FVersion);
   { 常规 }
  if (lConfig.SaveOnExit <> SaveOnExit) then
    IniFile.WriteBool(GetSection, cSaveOnExit, SaveOnExit);
  if (lConfig.SaveToolWindowLayout <> SaveToolWindowLayout ) then
    IniFile.WriteBool(GetSection, cSaveToolWindowLayout, SaveToolWindowLayout);
  if (lConfig.SaveLastOpenFuncCount <> SaveLastOpenFuncCount ) then
    IniFile.WriteBool(GetSection, cSaveActiveFunc, SaveActiveFunc);
  if (lConfig.SaveLastOpenFuncCount <> SaveLastOpenFuncCount )  then
    IniFile.WriteInteger(GetSection, cSaveLastOpenFuncCount, SaveLastOpenFuncCount);
  if (lConfig.ActiveFunc <> ActiveFunc ) then
    IniFile.WriteString(GetSection, cActiveFunc, ActiveFunc);
  // TODO: 废弃 IniFile.WriteString(GetSection, 'OpenFuncs', OpenFuncs);
  if (lConfig.DefaultDesktopID <> DefaultDesktopID ) then
    IniFile.WriteString(GetSection, cDefaultDesktopID, DefaultDesktopID);

  if (Style <> DefaultStyle ) then
    IniFile.WriteInteger(GetSection, cStyle, Integer(Style))
  else
    IniFile.DeleteKey(GetSection, cStyle);
  if (ReadOnlyColor <> DefaultReadOnlyColor ) then
    IniFile.WriteInteger(GetSection, cReadOnlyColor, Integer(ReadOnlyColor))
  else
    IniFile.DeleteKey(GetSection, cReadOnlyColor);
  if (RequiredColor <> DefaultRequiredColor ) then
    IniFile.WriteInteger(GetSection, cRequiredColor, Integer(RequiredColor))
  else
    IniFile.DeleteKey(GetSection, cRequiredColor);

  { Messenger }
  if (lConfig.RunMessenger <> RunMessenger ) then
    IniFile.WriteBool(GetSection, cRunMessenger, RunMessenger);
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-21 05:39 , Processed in 0.047791 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表