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

Display original course id for requests on home page.

parent f7bae675
No related branches found
Tags
No related merge requests found
......@@ -139,13 +139,16 @@ class CourseGeneration extends Asset
return $this->assetId;
}
public function getParentGeneration()
public function getParentGeneration($official = false)
{
if(!$this->parent) {
return null;
}
$parentGeneration = CourseGenerations::getInstance()->findOne($this->parent);
while($offical && $parentGeneration && $parentGeneration->type != 'official') {
$parentGeneration = CourseGenerations::getInstance()->findOne($parentGeneration->parent);
}
return $parentGeneration;
}
......
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<div id="announcements" class="titled_box">
<div class="box_shadow_2">
<div class="tr"></div>
......@@ -38,7 +11,8 @@ function MM_swapImage() { //v3.0
<div class="bl"></div>
</div>
<div class="content">
Welcome to Curriculum Action Request. Items in your activity basket indicate..... </div>
Welcome to Curriculum Action Request. Items in your activity basket indicate.....
</div>
</div>
<?php if(count($this->savedRequests) > 0) { ?>
......@@ -67,12 +41,16 @@ function MM_swapImage() { //v3.0
$row = 0;
foreach($this->savedRequests as $savedId => $request) {
$course = $this->savedCourses[$savedId];
$originalCourse = $course->getParentGeneration(true);
if (!$originalCourse) {
$originalCourse = $course;
}
?>
<tr <?php echo (++$row % 2 ? 'class="odd"' : ''); ?>>
<td><input type="checkbox" /></td>
<td><?php echo $course->subject . ' '
. $course->courseNumber
. $course->courseLetter; ?></td>
<td><?php echo $originalCourse->subject . ' '
. $originalCourse->courseNumber
. $originalCourse->courseLetter; ?></td>
<td>NONC</td>
<td><?php echo $request->type->name; ?></td>
<td>
......@@ -117,12 +95,16 @@ function MM_swapImage() { //v3.0
$row = 0;
foreach($this->myRequests as $request) {
$course = $request->getCourseGeneration();
$originalCourse = $course->getParentGeneration(true);
if (!$originalCourse) {
$originalCourse = $course;
}
?>
<tr <?php echo (++$row % 2 ? 'class="odd"' : ''); ?>>
<td><input type="checkbox" /></td>
<td><?php echo $request->getCourseGeneration()->subject . ' '
. $request->getCourseGeneration()->courseNumber
. $request->getCourseGeneration()->courseLetter; ?></td>
<td><?php echo $originalCourse->subject . ' '
. $originalCourse->courseNumber
. $originalCourse->courseLetter; ?></td>
<td><?php echo get_class($course->subject); ?></td>
<td><?php echo $request->type->name; ?></td>
<td><?php echo $request->getCurrentApprovalBody()->name; ?></td>
......@@ -189,12 +171,16 @@ function MM_swapImage() { //v3.0
$row = 0;
foreach($role->getRequests() as $request) {
$course = $request->getCourseGeneration();
$originalCourse = $course->getParentGeneration(true);
if (!$originalCourse) {
$originalCourse = $course;
}
?>
<tr <?php echo (++$row % 2 ? 'class="odd"' : ''); ?>>
<td><input type="checkbox" /></td>
<td><?php echo $request->getCourseGeneration()->subject . ' '
. $request->getCourseGeneration()->courseNumber
. $request->getCourseGeneration()->courseLetter; ?></td>
<td><?php echo $originalCourse->subject . ' '
. $originalCourse->courseNumber
. $originalCourse->courseLetter; ?></td>
<td>NONC</td>
<td><?php echo $request->type->name; ?></td>
<td><?php echo $request->getCurrentAction()->name; ?></td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment