/**
* Get cell actions associated with this row/column combination
* Adds a link to the file if there is an uploaded file present
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LinkAction instances
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
if ($column->getId() == 'name') {
$user = $request->getUser();
$actionArgs = array_merge($row->getRequestArgs(), array('signoffId' => $row->getId()));
$signoff = $row->getData();
$actions = array();
if ($signoff->getDateCompleted()) {
import('lib.pkp.controllers.informationCenter.linkAction.SignoffNotesLinkAction');
$actions[] = new SignoffNotesLinkAction($request, $signoff, $this->getSubmissionId(), $this->getStageId());
} else {
if (time() > strtotime($signoff->getDateUnderway())) {
import('lib.pkp.controllers.api.task.SendReminderLinkAction');
$actions[] = new SendReminderLinkAction($request, 'editor.submission.proof.reminder', $actionArgs);
}
}
if (!$signoff->getDateCompleted() && $signoff->getUserId() == $user->getId()) {
// User own the unfinished signoff, let it complete the task.
import('lib.pkp.controllers.api.signoff.linkAction.AddSignoffFileLinkAction');
$addFileAction = new AddSignoffFileLinkAction($request, $this->getSubmissionId(), $this->getStageId(), $signoff->getSymbolic(), $signoff->getId(), __('submission.upload.signoff'), __('submission.upload.signoff'));
// FIXME: This is not ideal.
$addFileAction->_title = null;
$actions[] = $addFileAction;
}
}
return array_merge(parent::getCellActions($request, $row, $column, $position), $actions);
}