public function prepareData()
 {
     parent::prepareData();
     $this->messageManager = new CoreFormValidationMessageContainer();
     if (!$this->isUserPermitted()) {
         $this->messageManager->addMessage('fileDeleteErrorNoPermission');
         return;
     }
     $this->fileDAO = new FileDAO();
     CoreServices2::getDB()->transactionStart();
     $this->initFileRecord();
     if (!empty($this->fileRecord['id'])) {
         $this->initBaseRecordDAO();
         $this->initBaseRecord();
         if (!$this->hasUserPermissionsForRecord()) {
             $this->messageManager->addMessage('fileDeleteErrorNoPermission');
             return;
         }
         $this->checkDataConsistency();
         if (!$this->messageManager->isAnyErrorMessage()) {
             $this->deleteFileRecord();
         }
     } else {
         $this->messageManager->addMessage('fileDeleteErrorNoSuchFile');
     }
     CoreServices2::getDB()->transactionCommit();
 }
 protected function assignErrorValue()
 {
     $error = null;
     if (!empty($this->loginErrorMessageContainer) && $this->loginErrorMessageContainer->isAnyErrorMessage()) {
         $messages = $this->loginErrorMessageContainer->getMessages();
         if (!empty($messages['']['messages'][0]) && $messages['']['messages'][0] == 'userAccountTemporarilyBlocked') {
             $error = 'userAccountTemporarilyBlocked';
         } else {
             $error = 'defaultLoginErrorMessage';
         }
     } elseif (CoreServices2::getRequest()->getFromGet('error')) {
         $error = 'defaultLoginErrorMessage';
     }
     CoreServices2::getDisplay()->assign('error', $error);
 }
 protected function validateFields()
 {
     $this->checkBasicValidation();
     if (!$this->messageManager->isAnyErrorMessage()) {
         $this->checkDataConsistency();
     }
 }
 /**
  * Likely to be overwritten if initAdditions() is not empty.
  */
 public function assignDisplayVariables()
 {
     parent::assignDisplayVariables();
     $display = CoreServices::get('display');
     $display->assign('mainForm', $this->form);
     $display->assign('recordOldValues', $this->recordOldValues);
     $display->assign('pagePath', $this->pagePath);
     if ($this->record['id']) {
         $display->assign('recordId', $this->record['id']);
     }
     if (!is_null($this->errorMessageContainer) && $this->errorMessageContainer->isAnyErrorMessage()) {
         $display->assign('formErrorMessages', $this->errorMessageContainer);
     }
 }