Skip to content
Snippets Groups Projects
Commit 7b121c90 authored by Tim Steiner's avatar Tim Steiner
Browse files

Update course request view decision list to support View-Vote mode.

parent bcff339b
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,24 @@ class Courses_ViewController extends App_Controller_Action
if (count($editAllowedRoles) > 0) {
$canEdit = true;
}
if ($action) {
$selectedDecision = '_null';
$defaultDecision = '--Decision--';
$votes = Requests_ApproverVoteModel::findUsersVotesForRequests($user, $request);
$vote = $votes[$request->getId()];
if ($vote) {
if ($vote->getApprovalAction() == $action->getId() && $request->getLastApprovalTime()->isEarlier($vote->getTime())) {
$selectedDecision = $vote->getVote();
} else {
$defaultDecision = 'PREVOTE: ' . $vote->getVote();
}
}
$this->view->selectedDecision = $selectedDecision;
$this->view->defaultDecision = $defaultDecision;
}
}
$this->view->request = $request;
......
......@@ -164,7 +164,7 @@ $this->layout()->breadcrumbs = array($breadcrumb . ': ' . $this->course->getCour
<?php if ($this->action) { ?>
<form id="decisionForm" action="<?php echo $this->baseUrl(); ?>/requests/index/decide.post">
<?php echo $this->formHidden('returnUrl', '/courses/view/index/id/' . $this->request->getId()); ?>
<?php echo $this->formSelect('decisions[' . $this->request->getId() . ']', null, null, array('_null' => '--Decision--') + $this->action->getResultStatusStrings($this->user)); ?>
<?php echo $this->formSelect('decisions[' . $this->request->getId() . ']', $this->selectedDecision, null, array('_null' => $this->defaultDecision) + $this->action->getResultStatusStrings($this->user)); ?>
<?php echo $this->formSubmit('submit', 'Submit Decision'); ?>
</form>
<?php } ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment