コード例 #1
0
 /**
  * Show the form to allow the user to select files from previous stages
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function selectFiles($args, $request)
 {
     import('lib.pkp.controllers.grid.files.final.form.ManageFinalDraftFilesForm');
     $manageFinalDraftFilesForm = new ManageFinalDraftFilesForm($this->getSubmission()->getId());
     $manageFinalDraftFilesForm->initData($args, $request);
     return new JSONMessage(true, $manageFinalDraftFilesForm->fetch($request));
 }
 /**
  * Save 'manage final draft files' form
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function updateFinalDraftFiles($args, $request)
 {
     $submission = $this->getSubmission();
     import('lib.pkp.controllers.grid.files.final.form.ManageFinalDraftFilesForm');
     $manageFinalDraftFilesForm = new ManageFinalDraftFilesForm($submission->getId());
     $manageFinalDraftFilesForm->readInputData();
     if ($manageFinalDraftFilesForm->validate()) {
         $manageFinalDraftFilesForm->execute($args, $request, $this->getGridCategoryDataElements($request, $this->getStageId()));
         // Let the calling grid reload itself
         return DAO::getDataChangedEvent();
     } else {
         return new JSONMessage(false);
     }
 }
コード例 #3
0
 /**
  * Save 'manage final draft files' form
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function updateFinalDraftFiles($args, &$request)
 {
     // Instantiate the files form.
     import('controllers.grid.files.finalDraftFiles.form.ManageFinalDraftFilesForm');
     $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
     /* @var $monograph Monograph */
     $manageFinalDraftFilesForm = new ManageFinalDraftFilesForm($monograph);
     // Initialize form and read in data.
     $manageFinalDraftFilesForm->initData($args, $request);
     $manageFinalDraftFilesForm->readInputData();
     // Validate and execute form.
     if ($manageFinalDraftFilesForm->validate()) {
         $selectedFiles =& $manageFinalDraftFilesForm->execute($args, $request);
         // Re-render the grid with the updated files.
         $this->setData($selectedFiles);
         $this->initialize($request);
         // FIXME: Calls to private methods of superclasses are not allowed!
         $gridBodyParts = $this->_renderGridBodyPartsInternally($request);
         if (count($gridBodyParts) == 0) {
             // The following should usually be returned from a
             // template also so we remain view agnostic. But as this
             // is easy to migrate and we want to avoid the additional
             // processing overhead, let's just return plain HTML.
             $renderedGridRows = '<tbody> </tbody>';
         } else {
             assert(count($gridBodyParts) == 1);
             $renderedGridRows = $gridBodyParts[0];
         }
         $json = new JSON('true', $renderedGridRows);
     } else {
         $json = new JSON('false');
     }
     // Serialize JSON.
     return $json->getString();
 }
コード例 #4
0
 /**
  * Save 'manage final draft files' form
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function updateFinalDraftFiles($args, &$request)
 {
     // Instantiate the files form.
     import('controllers.grid.files.final.form.ManageFinalDraftFilesForm');
     $monograph =& $this->getMonograph();
     /* @var $monograph Monograph */
     $manageFinalDraftFilesForm = new ManageFinalDraftFilesForm($monograph);
     // Initialize form and read in data.
     $manageFinalDraftFilesForm->initData($args, $request);
     $manageFinalDraftFilesForm->readInputData();
     // Validate and execute form.
     if ($manageFinalDraftFilesForm->validate()) {
         $manageFinalDraftFilesForm->execute($args, $request);
         // Let the calling grid reload itself
         return DAO::getDataChangedEvent();
     } else {
         $json = new JSON(false);
         return $json->getString();
     }
 }