Function

TdmodShared.TemplateOK

Module

dShared

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public

Owner

TdmodShared

Declaration

function TemplateOK(tmpl: TTemplate; Msg: string = ''): boolean;

Calls Hierarchy


TdmodShared.TemplateOK
 ├TdmodShared.BoilerplateOK
 │ ├ErrCount
 │ ├AddErr
 │ └TdmodShared.LoadTIUObjects
 │   └GetObjectList
 └BoilerplateTemplateFieldsOK
   └ListTemplateFields
     └GetTemplateField
       ├LoadTemplateFieldByIEN
       ├LoadTemplateField
       └TTemplateField.Create
         ├TemplateFieldCode2Field
         └TemplateDateCode2DateType

Called-By Hierarchy


                        TdmodShared.TemplateOK
                      TfrmDrawers.InsertText┤ 
           TfrmDrawers.tvTemplatesDblClick┤ │ 
            TfrmDrawers.tvTemplatesKeyDown┤ │ 
                TfrmDrawers.NewRECDragDrop┤ │ 
          TfrmDrawers.SetRichEditControl┘ │ │ 
                 TfrmDCSumm.FormCreate┤   │ │ 
               TfrmConsults.FormCreate┤   │ │ 
                TfrmSurgery.FormCreate┤   │ │ 
                  TfrmNotes.FormCreate┘   │ │ 
        TfrmDrawers.mnuInsertTemplateClick┘ │ 
  TfrmDCSumm.popSummMemoInsTemplateClick┤   │ 
TfrmConsults.popNoteMemoInsTemplateClick┤   │ 
 TfrmSurgery.popNoteMemoInsTemplateClick┤   │ 
   TfrmNotes.popNoteMemoInsTemplateClick┘   │ 
         TfrmDrawers.mnuPreviewTemplateClick┤ 
        TfrmDCSumm.popSummMemoPreviewClick┤ │ 
      TfrmConsults.popNoteMemoPreviewClick┤ │ 
       TfrmSurgery.popNoteMemoPreviewClick┤ │ 
         TfrmNotes.popNoteMemoPreviewClick┘ │ 
            TfrmDrawers.mnuCopyTemplateClick┤ 
     TfrmTemplateEditor.mnuBPErrorCheckClick┘ 
          TfrmTemplateEditor.tvTreeKeyDown┤   
          TfrmTemplateEditor.mnuBPTryClick┘   
        TfrmTemplateEditor.tvTreeKeyDown┘     

Calls

Name Declaration Comments
TdmodShared.BoilerplateOK function BoilerplateOK(const Txt, CRDelim: string; ObjList: TStringList; var Err: TStringList): boolean; -
BoilerplateTemplateFieldsOK function BoilerplateTemplateFieldsOK(const AText: string; Msg: string = ''): boolean; -

Called-By

Name Declaration Comments
TfrmDrawers.InsertText procedure InsertText; -
TfrmTemplateEditor.mnuBPErrorCheckClick procedure mnuBPErrorCheckClick(Sender: TObject); -
TfrmDrawers.mnuCopyTemplateClick procedure mnuCopyTemplateClick(Sender: TObject); -
TfrmDrawers.mnuPreviewTemplateClick procedure mnuPreviewTemplateClick(Sender: TObject); -


Source

656   function TdmodShared.TemplateOK(tmpl: TTemplate; Msg: string = ''): boolean;
657   var
658     Err: TStringList;
659     btns: TMsgDlgButtons;
660   
661   begin
662     Err := nil;
663     try
664       Result := BoilerplateOK(tmpl.FullBoilerplate, #13, nil, Err);
665       if(not Result) then
666       begin
667         if(Msg = 'OK') then
668           btns := [mbOK]
669         else
670         begin
671           btns := [mbAbort, mbIgnore];
672           Err.Add('');
673           if(Msg = '') then
674             Msg := 'template insertion';
675           Err.Add('Do you want to Abort '+Msg+', or Ignore the error and continue?');
676         end;
677         Result := (MessageDlg(Err.Text, mtError, btns, 0) = mrIgnore);
678       end;
679     finally
680       if(assigned(Err)) then
681         Err.Free;
682     end;
683     if Result then
684       Result := BoilerplateTemplateFieldsOK(tmpl.FullBoilerplate, Msg);
685   end;