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

Fix editting of existing learning outcomes.

parent ae514858
Branches
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ class LearningOutcomes_NewController extends Creq_Controller_Action
$request->setOwner($user);
$request->setJustification('--None Required--');
$learningOutcome = LearningOutcomes_LearningOutcomeModel::findByMajor($in['major']);
$learningOutcome = LearningOutcomes_LearningOutcomeModel::findByMajorId($in['major']);
if (!$learningOutcome) {
$learningOutcome = LearningOutcomes_LearningOutcomeModel::fetchNew();
$learningOutcome->setMajorId($in['major']);
......
......@@ -266,15 +266,14 @@ class LearningOutcomes_LearningOutcomeModel extends Unl_Model
return self::find($generationIds);
}
static public function findByMajor($major)
static public function findByMajorId($majorId)
{
$db = Zend_Registry::get('db');
$select = new Zend_Db_Select($db);
$select->from(array('g' => 'creqLearningOutcomeGenerations'), array('learningOutcomeGenerationId'));
$select->join(array('m' => 'creqMajors'), 'g.majorId = m.majorId', array('major' => 'name'));
$select->join(array('f' => 'creqLearningOutcomes'), 'g.learningOutcomeGenerationId = f.currentGeneration', array());
$select->where('m.name = ?', $major);
$select->where('g.majorId = ?', $majorId);
$records = $select->query()->fetchAll();
if (count($records) == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment