Function

CanEditLinkType

Module

uTemplates

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

function CanEditLinkType(LinkType: TTemplateLinkTypes): boolean;

Calls Hierarchy


CanEditLinkType
 └CanEditType
   └IsUserTemplateEditor

Called-By Hierarchy


                         CanEditLinkType
          TfrmTemplateEditor.InitTrees┘ 
       TfrmTemplateEditor.FormCreate┤   
      TfrmTemplateEditor.RefreshData┘   
TfrmTemplateEditor.mnuRefreshClick┘     

Calls

Name Declaration Comments
CanEditType function CanEditType(Template: TTemplate): boolean; -

Called-By

Name Declaration Comments
TfrmTemplateEditor.InitTrees procedure InitTrees; -


Source

644   function CanEditLinkType(LinkType: TTemplateLinkTypes): boolean;
645   
646     function CanEditType(Template: TTemplate): boolean;
647     begin
648       if not assigned(Template) then
649         Result := FALSE
650       else
651       if pos(Char(ord(LinkType)+ord('0')), uCanEditLinkTypeResults) > 0 then
652         Result := (pos(Char(ord(LinkType)+ord('A')), uCanEditLinkTypeResults) > 0)
653       else
654       begin
655         Result := IsUserTemplateEditor(Template.ID, User.DUZ);
656         uCanEditLinkTypeResults := uCanEditLinkTypeResults + Char(ord(LinkType)+ord('0'));
657         if Result then
658           uCanEditLinkTypeResults := uCanEditLinkTypeResults + Char(ord(LinkType)+ord('A'));
659       end;
660     end;
661   
662   begin
663     case LinkType of
664       ttTitles:     Result := CanEditType(TitlesTemplate);
665       ttConsults:   Result := CanEditType(ConsultsTemplate);
666       ttProcedures: Result := CanEditType(ProceduresTemplate);
667       else          Result := FALSE;
668     end;
669   end;