protected function setRecordValuesFromForm() { parent::setRecordValuesFromForm(); $templateFileRecord = $this->fileDAO->getRecordTemplate(); foreach (array_keys($this->standardAttachmentTypes) as $listName) { $this->fileList[$listName] = $this->form->getRecordsFromVLF($listName, $templateFileRecord, $this->fileListOldValues[$listName]); } }
protected function saveFileRecord() { $this->fileRecord = $this->fileDAO->getRecordTemplate(); $this->form->setRecordValuesFromFields($this->fileRecord); $this->fileRecord['id'] = null; $recordId = $this->form->getField('id')->getValue(); $this->fileRecord['recordId'] = !empty($recordId) ? $recordId : $this->form->getField('_tmpId')->getValue(); $this->fileRecord['recordType'] = !empty($recordId) ? $this->form->getField('recordType')->getValue() : '_tmpRecord'; $this->fileRecord['fileUpdateTime'] = CoreUtils::getDateTime(); $maxOrder = $this->fileDAO->getMaxOrderByRecord($this->fileRecord['recordType'], $this->fileRecord['recordId'], $this->fileRecord['fileCategory'], $this->fileRecord['filePosition']); // numerowanie od 0! $this->fileRecord['fileOrder'] = $maxOrder + 1; $uploadStruct = $this->form->getField('_fileUpload')->getValue(); $this->fileDAO->save($this->fileRecord, $uploadStruct); }