/**
  * @copydoc Form::execute()
  */
 function execute($args, $request)
 {
     //
     // FIXME: Should caption, credit, or any other fields be
     // localized?
     // FIXME: How to upload a permissions file?
     // FIXME: How to select a contact author from the submission
     // author list?
     //
     // Update the sumbission file by reference.
     $submissionFile = $this->getSubmissionFile();
     $submissionFile->setCaption($this->getData('artworkCaption'));
     $submissionFile->setCredit($this->getData('artworkCredit'));
     $submissionFile->setCopyrightOwner($this->getData('artworkCopyrightOwner'));
     $submissionFile->setCopyrightOwnerContactDetails($this->getData('artworkCopyrightOwnerContact'));
     $submissionFile->setPermissionTerms($this->getData('artworkPermissionTerms'));
     // Persist the submission file.
     parent::execute($args, $request);
 }
 /**
  * @copydoc Form::execute()
  */
 function execute($args, $request)
 {
     // Update the submission file from form data.
     $submissionFile = $this->getSubmissionFile();
     $submissionFile->setSubject($this->getData('subject'), null);
     // Localized
     $submissionFile->setCreator($this->getData('creator'), null);
     // Localized
     $submissionFile->setDescription($this->getData('description'), null);
     // Localized
     $submissionFile->setPublisher($this->getData('publisher'), null);
     // Localized
     $submissionFile->setSponsor($this->getData('sponsor'), null);
     // Localized
     $submissionFile->setSource($this->getData('source'), null);
     // Localized
     $submissionFile->setLanguage($this->getData('language'));
     $submissionFile->setDateCreated($this->getData('dateCreated'));
     // Persist the submission file.
     parent::execute($args, $request);
 }
 /**
  * Save the metadata of a submission file
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function saveMetadata($args, &$request)
 {
     $fileId = $request->getUserVar('fileId');
     $submissionFileDao =& DAORegistry::getDAO('SubmissionFileDAO');
     /* @var $submissionFileDao SubmissionFileDAO */
     $monographFile =& $submissionFileDao->getLatestRevision($fileId);
     $genreDao =& DAORegistry::getDAO('GenreDAO');
     $genre = $genreDao->getById($monographFile->getGenreId());
     $monographId = $monographFile->getMonographId();
     switch ($genre->getCategory()) {
         // FIXME: Need a way to determine artwork file type from user-specified artwork file types
         case GENRE_CATEGORY_ARTWORK:
             import('controllers.grid.files.form.SubmissionFilesArtworkMetadataForm');
             $metadataForm = new SubmissionFilesArtworkMetadataForm($monographFile, WORKFLOW_STAGE_ID_EDITING);
             break;
         default:
             import('controllers.grid.files.form.SubmissionFilesMetadataForm');
             $metadataForm = new SubmissionFilesMetadataForm($monographFile, WORKFLOW_STAGE_ID_EDITING);
             break;
     }
     $metadataForm->readInputData();
     if ($metadataForm->validate()) {
         $metadataForm->execute($args, $request);
         $router =& $request->getRouter();
         $additionalAttributes = array('isEditing' => true, 'finishingUpUrl' => $router->url($request, null, null, 'finishFileSubmission', null, array('gridId' => $this->getId(), 'fileId' => $fileId, 'monographId' => $monographId)));
         $json = new JSON(true, '', false, $fileId, $additionalAttributes);
     } else {
         $json = new JSON(false, Locale::translate('submission.submit.fileNameRequired'));
     }
     return $json->getString();
 }