/**
  * 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)
 {
     $submission = $this->getSubmission();
     $query = $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);
     import('lib.pkp.controllers.grid.files.query.form.ManageQueryNoteFilesForm');
     $manageQueryNoteFilesForm = new ManageQueryNoteFilesForm($submission->getId(), $query->getId(), $request->getUserVar('noteId'), $this->getRequestArgs());
     $manageQueryNoteFilesForm->initData($args, $request);
     return new JSONMessage(true, $manageQueryNoteFilesForm->fetch($request));
 }
 /**
  * Save 'manage query files' form
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function updateQueryNoteFiles($args, $request)
 {
     $submission = $this->getSubmission();
     $query = $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);
     import('lib.pkp.controllers.grid.files.query.form.ManageQueryNoteFilesForm');
     $manageQueryNoteFilesForm = new ManageQueryNoteFilesForm($submission->getId(), $query->getId(), $request->getUserVar('noteId'));
     $manageQueryNoteFilesForm->readInputData();
     if ($manageQueryNoteFilesForm->validate()) {
         $manageQueryNoteFilesForm->execute($args, $request, $this->getGridCategoryDataElements($request, $this->getStageId()));
         // Let the calling grid reload itself
         return DAO::getDataChangedEvent();
     } else {
         return new JSONMessage(false);
     }
 }