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

Make each request show up as its own section under detailed history in public view.

parent f8e73a7e
No related branches found
No related tags found
No related merge requests found
...@@ -41,93 +41,56 @@ ...@@ -41,93 +41,56 @@
<div class="clear"></div> <div class="clear"></div>
<div id="requestDetailsContainer">
<?php foreach ($this->previousRequests as $request) { ?>
<div id="requestDetailsContainer" class="titled_box"> <div class="requestDetail" id="requestDetail<?php echo $request->getId();?>">
<div class="titled_box">
<div class="box_shadow_2"> <div class="box_shadow_2">
<div class="tr"></div> <div class="tr"></div>
<div class="tl"> <div class="tl">
<h2> <h2>
Details Details for: <?php echo $request->getTypeDescription(); ?>
<img src="<?php echo $this->baseUrl(); ?>/images/index/arrow1.png" alt="arrow 1" class="toggle_arrow" />
</h2>
<h3><em></em></h3>
</div>
<div class="bl"></div>
</div>
<div class="content">
<?php foreach ($this->previousRequests as $request) { ?>
<div class="requestDetail" id="requestDetail<?php echo $request->getId();?>">
<div class="requestDetailDateType">
<?php if ($request->getLastApprovalTime()) { ?>
<?php echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); ?>
<br />
<?php } ?>
<?php echo $request->getTypeDescription(); ?>
</div>
<?php echo $this->partial('view/course-info.phtml', array('request' => $request,
'course' => $this->requestFinalCourses[$request->getId()],
'parentCourse' => $this->requestParentCourses[$request->getId()])); ?>
</div>
<?php } ?>
</div>
</div>
<?php if (Zend_Auth::getInstance()->getIdentity()) { ?>
<div id="requestCommentsContainer" class="titled_box">
<div class="box_shadow_2">
<div class="tr"></div>
<div class="tl">
<h2>
Comments
<img src="<?php echo $this->baseUrl(); ?>/images/index/arrow1.png" alt="arrow 1" class="toggle_arrow" /> <img src="<?php echo $this->baseUrl(); ?>/images/index/arrow1.png" alt="arrow 1" class="toggle_arrow" />
</h2> </h2>
<h3><em></em></h3> <h3><em><?php echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); ?></em></h3>
</div> </div>
<div class="bl"></div> <div class="bl"></div>
</div> </div>
<div class="content"> <div class="content">
<?php echo $this->partial('view/course-info.phtml', array('request' => $request,
<?php foreach ($this->previousRequests as $request) { ?> 'course' => $this->requestFinalCourses[$request->getId()],
<div class="requestComments" id="requestComments<?php echo $request->getId();?>"> 'parentCourse' => $this->requestParentCourses[$request->getId()])); ?>
<div class="requestDetailDateType">
<?php if ($request->getLastApprovalTime()) { ?>
<?php echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); ?>
<br />
<?php } ?>
<?php echo $request->getTypeDescription(); ?>
</div>
<?php
if (count($this->requestComments[$request->getId()]) > 0) {
echo $this->collectionTable(
$this->requestComments[$request->getId()],
array('visibility' => 'Type', 'user' => 'Who', 'time' => 'Date', 'text' => 'Comment'),
null, null,
array(
'time' => array('type' => 'Zend_Date', 'format' => 'MMM d, yyyy')
)
);
} else { ?>
<div>No comments for this request</div>
<?php } ?>
<div class="clear"></div>
</div> <h2>Comments</h2>
<?php if (Zend_Auth::getInstance()->getIdentity()) { ?>
<?php
if (count($this->requestComments[$request->getId()]) > 0) {
echo $this->collectionTable(
$this->requestComments[$request->getId()],
array('visibility' => 'Type', 'user' => 'Who', 'time' => 'Date', 'text' => 'Comment'),
null, null,
array(
'time' => array('type' => 'Zend_Date', 'format' => 'MMM d, yyyy')
)
);
} else { ?>
<div>No comments for this request</div>
<?php } } else { ?>
<div>Log in is required to view comments associated with this request. <a href="<?php echo $this->baseUrl(); ?>/auth/index/login">Log In</a></div>
<?php } ?> <?php } ?>
</div> </div>
</div> </div>
</div>
<?php } ?> <?php } ?>
</div>
......
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
#viewAllDetailsButton {float: right;} #viewAllDetailsButton {float: right;}
#returnToHistoryButton {float: right; display: none;} #returnToHistoryButton {float: right; display: none;}
#requestDetailsContainer, #requestCommentsContainer {display: none;} #requestDetailsContainer {display: none;}
.requestDetail, .requestComments {display: none; margin: 2em 3px; border-left: 5px solid #c00;} .requestDetail {display: none;}
.requestDetail .content {margin: 2em 3px;}
.requestDetailDateType {float: left; width: 100px; padding-left: 5px;}
.courseInfo {overflow: hidden;} .courseInfo {overflow: hidden;}
.requestComments table {width: 100%;}
.requestComments table th {background-color: #aaa;} .requestComments table th {background-color: #aaa;}
.requestComments table .even {background-color: #ccc;} .requestComments table .even {background-color: #ccc;}
......
...@@ -37,10 +37,6 @@ function handleViewDetailsLinkClick() ...@@ -37,10 +37,6 @@ function handleViewDetailsLinkClick()
document.getElementById('returnToHistoryButton').style.display = 'inline'; document.getElementById('returnToHistoryButton').style.display = 'inline';
document.getElementById('requestDetailsContainer').style.display = 'block'; document.getElementById('requestDetailsContainer').style.display = 'block';
document.getElementById('requestDetail' + requestId).style.display = 'block'; document.getElementById('requestDetail' + requestId).style.display = 'block';
if (document.getElementById('requestCommentsContainer')) {
document.getElementById('requestCommentsContainer').style.display = 'block';
document.getElementById('requestComments' + requestId).style.display = 'block';
}
return false; return false;
} }
...@@ -55,13 +51,6 @@ function handleViewAllDetailsClick() ...@@ -55,13 +51,6 @@ function handleViewAllDetailsClick()
for (var i = requestDetails.length - 1; i >= 0; i--) { for (var i = requestDetails.length - 1; i >= 0; i--) {
requestDetails[i].style.display = 'block'; requestDetails[i].style.display = 'block';
} }
if (document.getElementById('requestCommentsContainer')) {
document.getElementById('requestCommentsContainer').style.display = 'block';
var requestComments = getElementsByClassName('requestComments');
for (var i = requestComments.length - 1; i >= 0; i--) {
requestComments[i].style.display = 'block';
}
}
return false; return false;
} }
...@@ -73,13 +62,6 @@ function handleReturnToHistoryClick() ...@@ -73,13 +62,6 @@ function handleReturnToHistoryClick()
for (var i = requestDetails.length - 1; i >= 0; i--) { for (var i = requestDetails.length - 1; i >= 0; i--) {
requestDetails[i].style.display = ''; requestDetails[i].style.display = '';
} }
if (document.getElementById('requestCommentsContainer')) {
document.getElementById('requestCommentsContainer').style.display = '';
var requestComments = getElementsByClassName('requestComments');
for (var i = requestComments.length - 1; i >= 0; i--) {
requestComments[i].style.display = '';
}
}
document.getElementById('historyTable').style.display = ''; document.getElementById('historyTable').style.display = '';
document.getElementById('viewAllDetailsButton').style.display = ''; document.getElementById('viewAllDetailsButton').style.display = '';
......
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