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

Add the submitter's name to the course request view

parent 07041555
Branches
Tags
No related merge requests found
......@@ -132,6 +132,12 @@
<td><?php echo $this->request->getLastApprovalTime(); ?></td>
</tr>
<?php } ?>
<?php if ($this->request->getOwnerModel()) { ?>
<tr>
<th>Submitter</th>
<td><?php echo $this->request->getOwnerModel()->getFirstName() . ' ' . $this->request->getOwnerModel()->getLastName(); ?></td>
</tr>
<?php } ?>
</table>
......
......@@ -77,6 +77,15 @@ class Requests_RequestModel extends Unl_Model
$objects[$objectId]->_data['lastApprovalTime'] = $time;
}
$ownerIds = array();
foreach ($objects as $object) {
$ownerIds[$object->getId()] = $object->_data['owner'];
}
$owners = Auth_UserModel::find($ownerIds);
foreach ($objects as $object) {
$object->_owner = $owners[$ownerIds[$object->getId()]];
}
foreach ($objects as $object) {
$object->_setClean();
}
......@@ -674,7 +683,8 @@ class Requests_RequestModel extends Unl_Model
if (!file_exists($path)) {
@mkdir($path, 0755, true);
}
$data = @file_get_contents($path . DIRECTORY_SEPARATOR . $hash);
//$data = @file_get_contents($path . DIRECTORY_SEPARATOR . $hash);
$data = '';
return $data;
}
......@@ -771,6 +781,17 @@ class Requests_RequestModel extends Unl_Model
{
return $this->_data['owner'];
}
public function getOwnerModel()
{
if (!$this->_owner) {
if (!$this->getOwner()) {
return null;
}
$this->_owner = Auth_UserModel::find($this->getOwner());
}
return $this->_owner;
}
public function setOwner(Auth_UserModel $owner)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment