Function

UserTemplateAccessLevel

Module

uTemplates

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

function UserTemplateAccessLevel: TTemplateAccess;

Calls Hierarchy


UserTemplateAccessLevel
 ├GetTemplateRoots
 └GetTemplateAccess

Called-By Hierarchy


                     UserTemplateAccessLevel
             TfrmDrawers.popTemplatesPopup┤ 
               TfrmDrawers.ReloadTemplates┤ 
            TfrmDrawers.sbTemplatesClick┤ │ 
     TfrmDrawers.ExternalReloadTemplates┘ │ 
                    TdmodShared.Reload┘   │ 
      TfrmTemplateEditor.FormDestroy┘     │ 
              TfrmDrawers.CanEditTemplates┤ 
             TfrmDCSumm.popSummMemoPopup┤ │ 
              TfrmDCSumm.mnuOptionsClick┤ │ 
           TfrmConsults.popNoteMemoPopup┤ │ 
            TfrmConsults.mnuOptionsClick┤ │ 
            TfrmSurgery.popNoteMemoPopup┤ │ 
             TfrmSurgery.mnuOptionsClick┤ │ 
              TfrmNotes.popNoteMemoPopup┤ │ 
               TfrmNotes.mnuOptionsClick┘ │ 
                 TfrmDrawers.CanEditShared┤ 
              TfrmDCSumm.mnuOptionsClick┤ │ 
            TfrmConsults.mnuOptionsClick┤ │ 
             TfrmSurgery.mnuOptionsClick┤ │ 
               TfrmNotes.mnuOptionsClick┘ │ 
       TfrmDrawers.UpdatePersonalTemplates┤ 
    TdmodShared.EncounterLocationChanged┘ │ 
             TdmodShared.AddDrawerTree┘   │ 
              TfrmDrawers.FormCreate┘     │ 
         TfrmTemplateAutoGen.rgSourceClick┤ 
                             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┘ │ 
             TfrmTemplateEditor.FormCreate┤ 
 TfrmTemplateEditor.mnuBPInsertObjectClick┤ 
        TfrmTemplateEditor.tvTreeKeyDown┘ │ 
              TfrmTemplateEditor.InitTrees┘ 
           TfrmTemplateEditor.FormCreate┤   
          TfrmTemplateEditor.RefreshData┘   
    TfrmTemplateEditor.mnuRefreshClick┘     

Calls

Name Declaration Comments
GetTemplateAccess function GetTemplateAccess(ID: string): integer; -
GetTemplateRoots procedure GetTemplateRoots; -

Called-By

Name Declaration Comments
TfrmDrawers.CanEditShared function CanEditShared: boolean; -
TfrmDrawers.CanEditTemplates function CanEditTemplates: boolean; -
EditTemplates procedure EditTemplates(Form: TForm; NewTemplate: boolean = FALSE; CopiedText: string = ''; Shared: boolean = FALSE); -
TfrmTemplateEditor.FormCreate procedure FormCreate(Sender: TObject); -
TfrmTemplateEditor.InitTrees procedure InitTrees; -
TfrmTemplateEditor.mnuBPInsertObjectClick procedure mnuBPInsertObjectClick(Sender: TObject); -
TfrmDrawers.popTemplatesPopup procedure popTemplatesPopup(Sender: TObject); -
TfrmDrawers.ReloadTemplates procedure ReloadTemplates; -
TfrmTemplateAutoGen.rgSourceClick procedure rgSourceClick(Sender: TObject); -
TfrmDrawers.UpdatePersonalTemplates procedure UpdatePersonalTemplates; -


Source

456   function UserTemplateAccessLevel: TTemplateAccess;
457   var
458     i: integer;
459   
460   begin
461     if(TemplateAccessLevelChecked and
462       (LastTemplateLocation = Encounter.Location)) then
463       Result := TemplateAccessLevelValue
464     else
465     begin
466       TemplateAccessLevelChecked := FALSE;
467       LastTemplateLocation := 0;
468       if(not assigned(RootTemplate)) then
469       begin
470         Result := taAll;
471         GetTemplateRoots;
472         for i := 0 to RPCBrokerV.Results.Count-1 do
473         begin
474           if(Piece(RPCBrokerV.Results[i],U,2)=TemplateTypeCodes[ttRoot]) then
475           begin
476             Result := TTemplateAccess(GetTemplateAccess(Piece(RPCBrokerV.Results[i],U,1)));
477             LastTemplateLocation := Encounter.Location;
478             TemplateAccessLevelChecked := TRUE;
479             TemplateAccessLevelValue := Result;
480             Break;
481           end;
482         end;
483       end
484       else
485       begin
486         Result := TTemplateAccess(GetTemplateAccess(RootTemplate.ID));
487         LastTemplateLocation := Encounter.Location;
488         TemplateAccessLevelChecked := TRUE;
489         TemplateAccessLevelValue := Result;
490       end;
491     end;
492   end;