Changeset bca8f76 in iPeer


Ignore:
Timestamp:
2013-01-02T11:08:28-08:00 (6 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
c35ff0b
Parents:
2e0c194
Message:

Fix saving course failed and department not loading

Location:
app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • app/controllers/courses_controller.php

    r2e0c194 rbca8f76  
    266266        $this->_initFormEnv();
    267267
    268         $course = $this->Course->getAccessibleCourseById($courseId, User::get('id'), User::getCourseFilterPermission(), array('Instructor'));
     268        $course = $this->Course->getAccessibleCourseById($courseId, User::get('id'), User::getCourseFilterPermission(), array('Instructor', 'Department'));
    269269        if (!$course) {
    270270            $this->Session->setFlash(__('Error: Course does not exist or you do not have permission to view this course.', true));
     
    285285
    286286        $this->data = $course;
    287         $this->set('instructorSelected', Set::extract($course, '/Instructor/id'));
    288287        $this->set('breadcrumb', $this->breadcrumb->push(array('course' => $course['Course']))->push(__('Edit Course', true)));
    289288    }
  • app/views/courses/edit.ctp

    r2e0c194 rbca8f76  
    11<?php
    22echo $this->Form->create('Course');
     3echo $this->Form->input('id');
    34echo $this->Form->input('course', array('after' => ''));?>
    45<div class="help-text"><?php __('Course subjects and course numbers, e.g. APSC 201 001')?></div>
     
    67<?php echo $this->Form->input('title');?>
    78<div class="help-text"><?php __('Course title, e.g. Technical Communication')?></div>
    8 <?php echo $this->Form->input('Instructor', array('selected' => $instructorSelected));?>
     9<?php echo $this->Form->input('Instructor');?>
    910<div class="help-text"><?php __('Holding "ctrl" or "command" key to select multiple instructors.')?></div>
    1011
Note: See TracChangeset for help on using the changeset viewer.