Changeset - 493ff1f08af8
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2011-03-21 22:22:19
ohnobinki@ohnopublishing.net
Don't consider empty sections when generating a schedule.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
inc/class.schedule.php
Show inline comments
 
@@ -110,14 +110,15 @@ class Schedule
 

	
 
  //--------------------------------------------------
 
  // Adds a section to the desired class.
 
  //--------------------------------------------------
 
  function addSection($course_name, $letter, $time_start, $time_end, $days, $synonym = NULL, $faculty = NULL, $location = NULL, $type = 'lecture')
 
  {
 
    $found = false;
 
    $counter = 0;
 
    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')))
 
      return;
 

	
 
    foreach ($this->courses as $course)
 
      if (!strcmp($course_name, $course->getName()))
 
	{
 
	  $section = $course->section_get($letter);
 
	  if (!$section)
 
@@ -127,12 +128,13 @@ class Schedule
 
	    }
 
	  $section->meeting_add(new SectionMeeting($days, $time_start, $time_end, $location, $type));
 

	
 
	  return;
 
	}
 

	
 
    error_log('Could not find class when parsing schedule from postData: ' . $course_name);
 
    echo 'Could not find class: ' . $course_name . "<br />\n";
 
  }
 

	
 
  //--------------------------------------------------
 
  // Finds all of the possible permutations and stores
 
  // the results in the storage array.
0 comments (0 inline, 0 general)