diff --git a/application/models/rows/CourseGeneration.php b/application/models/rows/CourseGeneration.php index d748bfe94eb4ab1e1934d804429429cc6d2c5775..8e6af8334d3f4a3916ad9e3bd59564191b9b487f 100644 --- a/application/models/rows/CourseGeneration.php +++ b/application/models/rows/CourseGeneration.php @@ -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; } diff --git a/application/views/home.xhtml b/application/views/home.xhtml index b6bb72d55b4a9ff273359b54b7a10b19bf5296ce..f6165cada16c5c29c773085e985bd910b1dcb556 100755 --- a/application/views/home.xhtml +++ b/application/views/home.xhtml @@ -1,30 +1,3 @@ -<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>