diff --git a/application/controllers/CourseadminController.php b/application/controllers/CourseadminController.php index e21bd4f76df87e1d85a389cf0376f2b775e3140d..9988caed266d6d13273ff1208959304e29ccf32a 100644 --- a/application/controllers/CourseadminController.php +++ b/application/controllers/CourseadminController.php @@ -62,22 +62,22 @@ class CourseAdminController extends Nmc_Controller_Action $out->assign('prevCourseLink', $prevCourseLink); $out->assign('nextCourseLink', $nextCourseLink); - $creditsSingleValues = array(); - foreach($course->credits as $credit) { - if($credit->type == 1) { - $creditsSingleValues[] = $credit->hours; - } else if($credit->type == 2) { - $out->creditsRangeMin = $credit->hours; - } else if($credit->type == 3) { - $out->creditsRangeMax = $credit->hours; - } else if($credit->type == 4) { - $out->creditsMaxPerSemester = $credit->hours; - } else if($credit->type == 5) { - $out->creditsMaxPerDegree = $credit->hours; - } + } + $creditsSingleValues = array(); + foreach($course->credits as $credit) { + if($credit->type == 1) { + $creditsSingleValues[] = $credit->hours; + } else if($credit->type == 2) { + $out->creditsRangeMin = $credit->hours; + } else if($credit->type == 3) { + $out->creditsRangeMax = $credit->hours; + } else if($credit->type == 4) { + $out->creditsMaxPerSemester = $credit->hours; + } else if($credit->type == 5) { + $out->creditsMaxPerDegree = $credit->hours; } - $out->creditsSingleValues = implode(' ', $creditsSingleValues); } + $out->creditsSingleValues = implode(' ', $creditsSingleValues); $out->assign('page', 'edit_course'); $out->assign('course', $course); diff --git a/application/models/tables/CourseGenerations.php b/application/models/tables/CourseGenerations.php index 76fc2555c1d850e236e44f82070e4b8852e4cccb..0be838410041458ff776b7f76c028d2ce51f90b8 100644 --- a/application/models/tables/CourseGenerations.php +++ b/application/models/tables/CourseGenerations.php @@ -113,19 +113,19 @@ class CourseGenerations extends Nmc_Db_Table $newHomeCrosslist = CourseCrosslistings::getInstance()->fetchNew(); $newHomeCrosslist->type = 'home listing'; - $newCredit = CourseCredits::getInstance()->fetchNew(); - $newCredit->type = 1; - $newCredit->hours = 3; + $newFixedCredit = CourseCredits::getInstance()->fetchNew(); + $newFixedCredit->type = 1; + $newFixedCredit->hours = 3; - $newActivity = CourseActivities::getInstance()->fetchNew(); - $newActivity->type = 'lec'; - $newActivity->hours = 3; + $newMaxCredit = CourseCredits::getInstance()->fetchNew(); + $newMaxCredit->type = 5; + $newMaxCredit->hours = 3; $newRecord = parent::fetchNew(); $newRecord->termsOffered = array('Fall', 'Spring', 'Summer'); $newRecord->gradingType = 'unrestricted'; - $newRecord->activities[] = $newActivity; - $newRecord->credits[] = $newCredit; + $newRecord->credits[] = $newFixedCredit; + $newRecord->credits[] = $newMaxCredit; $newRecord->deliveryMethods = array('Classroom'); $newRecord->campuses = array('UNL');