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

When searching for courses that have been removed, include those that have...

When searching for courses that have been removed, include those that have changed course ids as well.
parent d51b80ad
No related branches found
No related tags found
No related merge requests found
......@@ -543,8 +543,9 @@ class Courses_CourseModel extends Unl_Model
$select->join(array('s' => 'creqSubjects'), 'd.departmentId = s.department', array());
$select->join(array('c' => 'creqCourseCodes'), 's.name = c.subject', array());
$select->join(array('x' => 'creqCourseCrosslistings'), 'c.courseCodeId = x.courseCode', array());
$select->join(array('g' => 'creqCourseGenerations'), 'x.generation = g.courseGenerationId', array('courseGenerationId'));
$select->join(array('p' => 'creqCourses'), 'g.courseGenerationId = p.currentGeneration', array());
$select->join(array('g' => 'creqCourseGenerations'), 'x.generation = g.courseGenerationId', array());
$select->join(array('p' => 'creqCourses'), 'g.course = p.courseId', array());
$select->join(array('g2' => 'creqCourseGenerations'), 'p.currentGeneration = g2.courseGenerationId', array('courseGenerationId'));
$select->join(array('e' => 'creqCourseDetails'), 'g.courseGenerationId = e.generation', array());
if (!$includeRemoved) {
$select->where('g.removed = "no"');
......@@ -586,6 +587,9 @@ class Courses_CourseModel extends Unl_Model
if ($criteria['integratedStudies']) {
$select->where('c.integratedStudies = ?', 'yes');
}
if (!$includeRemoved) {
$select->where('g.courseGenerationId = g2.courseGenerationId');
}
$records = $select->query()->fetchAll();
if (count($records) == 0) {
......
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