Procedure

EditTemplates

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

procedure EditTemplates(Form: TForm; NewTemplate: boolean = FALSE; CopiedText: string = ''; Shared: boolean = FALSE);

Calls Hierarchy


EditTemplates
 ├UserTemplateAccessLevel
 │ ├GetTemplateRoots
 │ └GetTemplateAccess
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 ├TdmodShared.ExpandTree
 │ └TdmodShared.ExpandNode
 │   ├ExpandTemplate
 │   │ ├TTemplate.GetChildren
 │   │ ├GetTemplateChildren
 │   │ ├AddTemplate
 │   │ │ ├TTemplate.Create
 │   │ │ │ └TTemplate.ReminderDialogIEN
 │   │ │ └TTemplate.AddChild
 │   │ │   └TTemplate.GetItems
 │   │ │     └ExpandTemplate...
 │   │ └TTemplate.ItemIENs
 │   │   └TTemplate.GetItems...
 │   ├TTemplate.GetItems...
 │   ├TdmodShared.AddTemplateNode
 │   │ ├AddChildObject
 │   │ │ └TTemplate.AddNode
 │   │ └TTemplate.GetChildren
 │   └TTemplate.GetChildren
 ├TfrmTemplateEditor.btnNewClick
 │ ├TfrmTemplateEditor.CanClone
 │ │ ├GetFirstPersonalNode
 │ │ │ └..(rec)..
 │ │ └TTemplate.CanModify
 │ │   ├TTemplate.ValidID
 │ │   └LockTemplate
 │ ├TfrmTemplateEditor.Clone
 │ │ ├TfrmTemplateEditor.CanClone...
 │ │ ├..(rec)..
 │ │ ├TTemplate.CanModify...
 │ │ ├TTemplate.Clone
 │ │ │ ├TTemplate.TrueClone
 │ │ │ │ ├TTemplate.GetChildren
 │ │ │ │ ├TTemplate.Create...
 │ │ │ │ ├TTemplate.SetBoilerplate
 │ │ │ │ │ ├TTemplate.CanModify...
 │ │ │ │ │ └TTemplate.ValidID
 │ │ │ │ ├TTemplate.GetBoilerplate
 │ │ │ │ │ └GetTemplateBoilerplate
 │ │ │ │ ├TTemplate.SetDescription
 │ │ │ │ │ ├TTemplate.CanModify...
 │ │ │ │ │ └TTemplate.ValidID
 │ │ │ │ └TTemplate.GetDescription
 │ │ │ │   └LoadTemplateDescription
 │ │ │ ├TTemplate.GetItems...
 │ │ │ └TTemplate.BackupItems
 │ │ │   └TTemplate.ItemIENs...
 │ │ ├TTemplate.RemoveNode
 │ │ ├MarkDeleted
 │ │ │ ├TTemplate.ValidID
 │ │ │ ├TTemplate.SetFileLink
 │ │ │ │ └TTemplate.AssignFileLink
 │ │ │ │   ├TTemplate.CanModify...
 │ │ │ │   ├TTemplate.ValidID
 │ │ │ │   ├TTemplate.LinkType
 │ │ │ │   ├TTemplate.SetReminderDialog
 │ │ │ │   │ ├TTemplate.CanModify...
 │ │ │ │   │ ├TTemplate.ValidID
 │ │ │ │   │ ├TTemplate.ReminderDialogIEN
 │ │ │ │   │ ├TTemplate.LinkType
 │ │ │ │   │ └TTemplate.SetFileLink...
 │ │ │ │   ├TTemplate.GetItems...
 │ │ │ │   └..(rec)..
 │ │ │ ├TTemplate.GetItems...
 │ │ │ └..(rec)..
 │ │ ├TTemplate.AddNode
 │ │ ├TTemplate.GetItems...
 │ │ └TfrmTemplateEditor.ShowTemplateType
 │ ├TTemplate.CanModify...
 │ ├TTemplate.GetItems...
 │ ├TTemplate.CreateFromXML
 │ │ ├TTemplate.Create...
 │ │ ├TTemplate.SetBoilerplate...
 │ │ ├TTemplate.SetDescription...
 │ │ ├TTemplate.GetItems...
 │ │ ├..(rec)..
 │ │ └TTemplate.BackupItems...
 │ ├TTemplate.Create...
 │ ├TTemplate.BackupItems...
 │ └TfrmTemplateEditor.Resync
 │   ├TdmodShared.Resync
 │   │ ├InSyncNode
 │   │ ├GetID
 │   │ │ └..(rec)..
 │   │ ├TTemplate.RemoveNode
 │   │ ├BuildNodes
 │   │ │ ├TTemplate.AddNode
 │   │ │ ├TTemplate.GetItems...
 │   │ │ ├..(rec)..
 │   │ │ └TTemplate.GetChildren
 │   │ └GetNode
 │   │   └GetID...
 │   ├TfrmTemplateEditor.EnableNavControls
 │   │ └TfrmTemplateEditor.AllowMove
 │   │   ├TfrmTemplateEditor.IsTemplateLocked
 │   │   │ ├TTemplate.AutoLock
 │   │   │ │ └TTemplate.LinkType
 │   │   │ ├TTemplate.IsLocked
 │   │   │ │ └TTemplate.AutoLock...
 │   │   │ └..(rec)..
 │   │   └TTemplate.GetItems...
 │   └TfrmTemplateEditor.tvTreeChange
 │     ├TfrmTemplateEditor.ChangeTree
 │     ├TfrmTemplateEditor.IsTemplateLocked...
 │     ├TfrmTemplateEditor.EnableControls
 │     │ ├TfrmTemplateEditor.UpdateInsertsDialogs
 │     │ │ ├TfrmTemplateObjects.UpdateStatus
 │     │ │ └TfrmTemplateFields.UpdateStatus
 │     │ │   └TfrmTemplateFields.ValidInsert
 │     │ └TfrmTemplateEditor.EnableNavControls...
 │     └TfrmTemplateEditor.ShowInfo
 │       ├TfrmTemplateEditor.ShowTemplateType
 │       ├TfrmTemplateEditor.GetLinkType
 │       ├LoadServiceListWithSynonyms
 │       ├TTemplate.LinkName
 │       │ ├GetLinkName
 │       │ │ └ExternalName
 │       │ ├TTemplate.LinkIEN
 │       │ └TTemplate.LinkType
 │       ├TTemplate.LinkIEN
 │       ├TTemplate.GetDescription...
 │       ├TTemplate.IsLocked...
 │       ├TTemplate.AutoLock...
 │       ├TfrmTemplateEditor.IsTemplateLocked...
 │       ├TTemplate.GetChildren
 │       ├TTemplate.ReminderDialogIEN
 │       ├TdmodShared.InDialog
 │       │ └TTemplate.IsDialog
 │       ├TTemplate.GetBoilerplate...
 │       ├TfrmTemplateEditor.DisplayBoilerplate
 │       │ ├TfrmTemplateEditor.pnlBoilerplateResize
 │       │ ├TTemplate.GetBoilerplate...
 │       │ ├TTemplate.FullBoilerplate
 │       │ │ ├TTemplate.GetBoilerplate...
 │       │ │ ├TTemplate.ItemBoilerplate
 │       │ │ │ ├TTemplate.GetItems...
 │       │ │ │ ├TTemplate.GetTemplateType
 │       │ │ │ ├DlgText
 │       │ │ │ └TTemplate.DialogProperties
 │       │ │ │   ├TTemplate.GetBoilerplate...
 │       │ │ │   └TTemplate.DlgID
 │       │ │ ├DlgText
 │       │ │ └TTemplate.DialogProperties...
 │       │ ├TfrmTemplateEditor.UpdateInsertsDialogs...
 │       │ ├TfrmTemplateEditor.ShowBoilerPlate
 │       │ └TfrmTemplateEditor.ShowGroupBoilerplate
 │       ├TfrmTemplateEditor.ShowGroupBoilerplate
 │       └TfrmTemplateEditor.pnlBoilerplateResize
 ├TTemplate.SetBoilerplate...
 └TfrmTemplateEditor.ShowInfo...

Called-By Hierarchy


                             EditTemplates
     TfrmDCSumm.popSummMemoTemplateClick┤ 
          TfrmDCSumm.mnuNewTemplateClick┤ 
        TfrmDCSumm.mnuEditTemplatesClick┤ 
  TfrmDCSumm.mnuEditSharedTemplatesClick┤ 
    TfrmDCSumm.mnuNewSharedTemplateClick┤ 
   TfrmConsults.popNoteMemoTemplateClick┤ 
      TfrmConsults.mnuEditTemplatesClick┤ 
        TfrmConsults.mnuNewTemplateClick┤ 
TfrmConsults.mnuEditSharedTemplatesClick┤ 
  TfrmConsults.mnuNewSharedTemplateClick┤ 
       TfrmDrawers.mnuEditTemplatesClick┤ 
         TfrmDrawers.mnuNewTemplateClick┤ 
    TfrmSurgery.popNoteMemoTemplateClick┤ 
       TfrmSurgery.mnuEditTemplatesClick┤ 
         TfrmSurgery.mnuNewTemplateClick┤ 
 TfrmSurgery.mnuEditSharedTemplatesClick┤ 
   TfrmSurgery.mnuNewSharedTemplateClick┤ 
      TfrmNotes.popNoteMemoTemplateClick┤ 
         TfrmNotes.mnuEditTemplatesClick┤ 
           TfrmNotes.mnuNewTemplateClick┤ 
   TfrmNotes.mnuEditSharedTemplatesClick┤ 
     TfrmNotes.mnuNewSharedTemplateClick┘ 

Calls

Name Declaration Comments
TfrmTemplateEditor.btnNewClick procedure btnNewClick(Sender: TObject); -
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
TdmodShared.ExpandTree procedure ExpandTree(Tree: TORTreeView; ExpandString: string; var EmptyCount: integer; AllowInactive: boolean = FALSE); -
TTemplate.SetBoilerplate procedure SetBoilerplate(Value: string); -
TfrmTemplateEditor.ShowInfo procedure ShowInfo(Node: TTreeNode); -
UserTemplateAccessLevel function UserTemplateAccessLevel: TTemplateAccess; -

Called-By

Name Declaration Comments
TfrmDCSumm.mnuEditSharedTemplatesClick procedure mnuEditSharedTemplatesClick(Sender: TObject); -
TfrmConsults.mnuEditSharedTemplatesClick procedure mnuEditSharedTemplatesClick(Sender: TObject); -
TfrmSurgery.mnuEditSharedTemplatesClick procedure mnuEditSharedTemplatesClick(Sender: TObject); -
TfrmNotes.mnuEditSharedTemplatesClick procedure mnuEditSharedTemplatesClick(Sender: TObject); -
TfrmDCSumm.mnuEditTemplatesClick procedure mnuEditTemplatesClick(Sender: TObject); -
TfrmConsults.mnuEditTemplatesClick procedure mnuEditTemplatesClick(Sender: TObject); -
TfrmDrawers.mnuEditTemplatesClick procedure mnuEditTemplatesClick(Sender: TObject); -
TfrmSurgery.mnuEditTemplatesClick procedure mnuEditTemplatesClick(Sender: TObject); -
TfrmNotes.mnuEditTemplatesClick procedure mnuEditTemplatesClick(Sender: TObject); -
TfrmDCSumm.mnuNewSharedTemplateClick procedure mnuNewSharedTemplateClick(Sender: TObject); -
TfrmConsults.mnuNewSharedTemplateClick procedure mnuNewSharedTemplateClick(Sender: TObject); -
TfrmSurgery.mnuNewSharedTemplateClick procedure mnuNewSharedTemplateClick(Sender: TObject); -
TfrmNotes.mnuNewSharedTemplateClick procedure mnuNewSharedTemplateClick(Sender: TObject); -
TfrmDCSumm.mnuNewTemplateClick procedure mnuNewTemplateClick(Sender: TObject); -
TfrmConsults.mnuNewTemplateClick procedure mnuNewTemplateClick(Sender: TObject); -
TfrmDrawers.mnuNewTemplateClick procedure mnuNewTemplateClick(Sender: TObject); -
TfrmSurgery.mnuNewTemplateClick procedure mnuNewTemplateClick(Sender: TObject); -
TfrmNotes.mnuNewTemplateClick procedure mnuNewTemplateClick(Sender: TObject); -
TfrmConsults.popNoteMemoTemplateClick procedure popNoteMemoTemplateClick(Sender: TObject); -
TfrmSurgery.popNoteMemoTemplateClick procedure popNoteMemoTemplateClick(Sender: TObject); -
TfrmNotes.popNoteMemoTemplateClick procedure popNoteMemoTemplateClick(Sender: TObject); -
TfrmDCSumm.popSummMemoTemplateClick procedure popSummMemoTemplateClick(Sender: TObject); -


Source

500   procedure EditTemplates(Form: TForm; NewTemplate: boolean = FALSE;
501     CopiedText: string = ''; Shared: boolean = FALSE);
502   var
503     frmTemplateEditor: TfrmTemplateEditor;
504     Drawers: TfrmDrawers;
505     ExpandStr, SelectStr: string;
506     SelNode: TTreeNode;
507     SelShared: boolean;
508   
509   begin
510     if (UserTemplateAccessLevel in [taReadOnly, taNone]) then exit;
511   
512     ExpandStr := '';
513     SelectStr := '';
514     Drawers := nil;
515     if (not NewTemplate) and (CopiedText = '') then
516     begin
517       if Form is TfrmDrawers then
518         Drawers := TfrmDrawers(Form)
519       else
520         if IsPublishedProp(Form, DrawersProperty) then
521           Drawers := TfrmDrawers(GetOrdProp(Form, DrawersProperty));
522     end;
523   
524     if assigned(Drawers) then
525     begin
526       ExpandStr := Drawers.tvTemplates.GetExpandedIDStr(1, ';');
527       SelectStr := Drawers.tvTemplates.GetNodeID(TORTreeNode(Drawers.tvTemplates.Selected), 1, ';');
528     end;
529   
530     frmTemplateEditor := TfrmTemplateEditor.Create(Application);
531     try
532       with frmTemplateEditor do
533       begin
534         Font := Form.Font;
535         reBoil.Font.Size := Form.Font.Size;
536         reGroupBP.Font.Size := Form.Font.Size;
537         reNotes.Font.Size := Form.Font.Size;
538         dmodShared.ExpandTree(tvShared, ExpandStr, FSharedEmptyNodeCount);
539         SelNode := tvShared.FindPieceNode(SelectStr, 1, ';');
540         SelShared := assigned(SelNode);
541         dmodShared.ExpandTree(tvPersonal, ExpandStr, FPersonalEmptyNodeCount);
542         if not SelShared then
543           SelNode := tvPersonal.FindPieceNode(SelectStr, 1, ';');
544   
545         if (SelShared and (not Shared)) then
546           Shared := TRUE;
547   
548         if (Shared and (UserTemplateAccessLevel = taEditor)) then
549         begin
550           cbEditShared.Checked := TRUE;
551           ActiveControl := tvShared;
552           if SelShared then
553             tvShared.Selected := SelNode
554           else
555             tvShared.Selected := tvShared.Items.GetFirstNode;
556         end
557         else
558           if (not SelShared) and (assigned(SelNode)) then
559             tvPersonal.Selected := SelNode;
560         if (NewTemplate) then
561         begin
562           btnNewClick(frmTemplateEditor);
563           if (CopiedText <> '') then
564           begin
565             TTemplate(FBtnNewNode.Data).Boilerplate := CopiedText;
566             ShowInfo(FBtnNewNode);
567           end;
568         end;
569         ShowModal;
570       end;
571     finally
572       frmTemplateEditor.Free;
573     end;
574   end;