Changeset - 39cd0cde34a4
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 15 years ago 2011-03-29 22:42:06
ohnobinki@ohnopublishing.net
Fix instructors not being carried through from the input form to the output.
2 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
inc/class.schedule.php
Show inline comments
 
@@ -113,14 +113,17 @@ class Schedule
 
   * \brief
 
   *   Adds a section to this semester after finding the class.
 
   *
 
   * \param $instructor
 
   *   The instructor of this section/section_meeting.
 
   *
 
   * \return
 
   *   NULL on success, a string on error which is a message for the
 
   *   user and a valid XHTML fragment.
 
   */
 
  function addSection($course_name, $letter, $time_start, $time_end, $days, $synonym = NULL, $faculty = NULL, $location = NULL, $type = 'lecture')
 
  function addSection($course_name, $letter, $time_start, $time_end, $days, $synonym = NULL, $instructor = NULL, $location = NULL, $type = 'lecture')
 
  {
 
    if (empty($letter) && (empty($time_start) || !strcmp($time_start, 'none')) && (empty($time_end) || !strcmp($time_end, 'none')) && empty($days)
 
	&& empty($synonym) && empty($faculty) && empty($location) && (empty($type) || !strcmp($type, 'lecture')))
 
	&& empty($synonym) && empty($instructor) && empty($location) && (empty($type) || !strcmp($type, 'lecture')))
 
      return;
 

	
 
    /* reject invalid times */
 
@@ -137,10 +140,10 @@ class Schedule
 
	  $section = $course->section_get($letter);
 
	  if (!$section)
 
	    {
 
	      $section = new Section($letter, array(), $synonym, $faculty);
 
	      $section = new Section($letter, array(), $synonym);
 
	      $course->section_add($section);
 
	    }
 
	  $section->meeting_add(new SectionMeeting($days, $time_start, $time_end, $location, $type));
 
	  $section->meeting_add(new SectionMeeting($days, $time_start, $time_end, $location, $type, $instructor));
 

	
 
	  return;
 
	}
inc/class.section.php
Show inline comments
 
@@ -286,7 +286,7 @@ class Section
 
      /* Move the instructor (old $this->prof) property to our SectionMeeting children */
 
      foreach ($this->meetings as $meeting)
 
      {
 
	$meeting->instructor_set();
 
	$meeting->instructor_set($this->prof);
 
	unset($this->prof);
 
      }
 
  }
0 comments (0 inline, 0 general)