/** * @copydoc GridCellProvider::getCellActions() */ function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT) { $submissionFile = $row->getData(); assert(is_a($submissionFile, 'SubmissionFile')); switch ($column->getId()) { case 'name': import('lib.pkp.controllers.grid.files.FileNameGridColumn'); $fileNameColumn = new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION, true); // Set the row data as expected in FileNameGridColumn object. $rowData = array('submissionFile' => $submissionFile); $row->setData($rowData); $actions = $fileNameColumn->getCellActions($request, $row); // Back the row data as expected by the signoff grid. $row->setData($submissionFile); return $actions; case 'approved': return array($this->_getApprovedCellAction($request, $submissionFile, $this->getCellState($row, $column))); } return parent::getCellActions($request, $row, $column, $position); }
/** * @see GridCellProvider::getCellActions() */ function getCellActions($request, $row, $column) { $data = $row->getData(); $router = $request->getRouter(); if (is_a($data, 'Representation')) { switch ($column->getId()) { case 'name': // if it is a remotely hosted content, don't provide // file upload and select link actions $remoteURL = $data->getRemoteURL(); if ($remoteURL) { return array(); } import('lib.pkp.controllers.api.file.linkAction.AddFileLinkAction'); import('lib.pkp.controllers.grid.files.fileList.linkAction.SelectFilesLinkAction'); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR); return array(new AddFileLinkAction($request, $data->getSubmissionId(), WORKFLOW_STAGE_ID_PRODUCTION, array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT), null, SUBMISSION_FILE_PROOF, ASSOC_TYPE_REPRESENTATION, $data->getId()), new SelectFilesLinkAction($request, array('submissionId' => $data->getSubmissionId(), 'assocType' => ASSOC_TYPE_REPRESENTATION, 'assocId' => $data->getId(), 'representationId' => $data->getId(), 'stageId' => WORKFLOW_STAGE_ID_PRODUCTION, 'fileStage' => SUBMISSION_FILE_PROOF), __('editor.submission.selectFiles'))); case 'isComplete': return array(new LinkAction('approveRepresentation', new RemoteActionConfirmationModal(__($data->getIsApproved() ? 'grid.catalogEntry.approvedRepresentation.removeMessage' : 'grid.catalogEntry.approvedRepresentation.message'), __('grid.catalogEntry.approvedRepresentation.title'), $router->url($request, null, null, 'setApproved', null, array('representationId' => $data->getId(), 'newApprovedState' => $data->getIsApproved() ? 0 : 1, 'submissionId' => $data->getSubmissionId())), 'modal_approve'), $data->getIsApproved() ? __('submission.complete') : __('submission.incomplete'), $data->getIsApproved() ? 'complete' : 'incomplete', __('grid.action.setApproval'))); } } else { assert(is_array($data) && isset($data['submissionFile'])); $submissionFile = $data['submissionFile']; switch ($column->getId()) { case 'name': import('lib.pkp.controllers.grid.files.FileNameGridColumn'); $fileNameColumn = new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION, true); return $fileNameColumn->getCellActions($request, $row); case 'isComplete': AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR); import('lib.pkp.classes.linkAction.request.AjaxAction'); return array(new LinkAction($submissionFile->getViewable() ? 'approved' : 'not_approved', new RemoteActionConfirmationModal(__($submissionFile->getViewable() ? 'editor.submission.proofreading.confirmRemoveCompletion' : 'editor.submission.proofreading.confirmCompletion'), __($submissionFile->getViewable() ? 'editor.submission.proofreading.revokeProofApproval' : 'editor.submission.proofreading.approveProof'), $router->url($request, null, null, 'setProofFileCompletion', null, array('submissionId' => $submissionFile->getSubmissionId(), 'fileId' => $submissionFile->getFileId(), 'revision' => $submissionFile->getRevision(), 'approval' => !$submissionFile->getViewable())), 'modal_approve'), $submissionFile->getViewable() ? __('grid.catalogEntry.availableRepresentation.approved') : __('grid.catalogEntry.availableRepresentation.notApproved'))); } } return parent::getCellActions($request, $row, $column); }