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

Add some extra info to the view request screen

parent 483a2e76
No related branches found
No related tags found
No related merge requests found
......@@ -110,4 +110,26 @@
</dl>
</div>
<?php } ?>
<table id="otherInfo">
<caption>Other Information</caption>
<tr>
<th>DF Removal</th>
<td><?php echo $course->getDfRemoval(); ?></td>
</tr>
<tr>
<th>Grading Type</th>
<td><?php echo $course->getGradingType(); ?></td>
</tr>
<tr>
<th>Effective Term</th>
<td><?php echo $course->getEffectiveSemester(); ?></td>
</tr>
<tr>
<th>Most Recent Action</th>
<td><?php echo $this->request->getLastApprovalTime(); ?>
</tr>
</table>
</div>
\ No newline at end of file
......@@ -33,7 +33,7 @@ class Requests_RequestModel extends Unl_Model
$objects[$object->getId()] = $object;
}
$select = new Zend_Db_Select($db);
$select->from(array('r' => 'creqRequestFiles'));
$select->join(array('f' => 'creqFiles'), 'r.file = f.fileId');
......@@ -57,6 +57,24 @@ class Requests_RequestModel extends Unl_Model
}
}
}
// Most recent approval time
$select = new Zend_Db_Select($db);
$select->from(array('h' => 'creqApprovalHistories'), array('request', 'time' => 'MAX(time)'));
$select->group('request');
if (Unl_Util::isArray($id)) {
$select->where('h.request IN (?)', $id);
} else {
$select->where('h.request = ?', $id);
}
$records = $select->query()->fetchAll();
foreach ($records as $record) {
$objectId = $record['request'];
$time = $record['time'];
$objects[$objectId]->_data['lastApprovalTime'] = $time;
}
foreach ($objects as $object) {
$object->_setClean();
......@@ -893,6 +911,15 @@ class Requests_RequestModel extends Unl_Model
{
$this->_data['stackPointer'] = NULL;
}
public function getLastApprovalTime()
{
$time = $this->_data['lastApprovalTime'];
if ($time > 0) {
return new Zend_Date($time);
}
return null;
}
public function isValid()
{
......
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