diff --git a/inc/class.schedule.php b/inc/class.schedule.php --- a/inc/class.schedule.php +++ b/inc/class.schedule.php @@ -405,7 +405,7 @@ class Schedule if ($sort_time) sort($time); - echo '

Enter these codes into your school\'s online course registration system to register for classes:

'; + echo '
'; echo '
' . "\n" . '

@@ -442,7 +442,14 @@ class Schedule for($i = $first_permutation; $i < $last_permutation; $i++) { - $syns = array(); + /* + * Store a JSON list of courses, each with only the one + * section rendered in this permutation. This is used for + * the ``Registration Numbers'' dialog which noramlly + * shows users course synonyms. + */ + $permutation_courses = array(); + echo '

\n"; // Beginning of table @@ -518,7 +525,15 @@ class Schedule . '' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . "\n" . '' . htmlentities($section->getSynonym(), ENT_QUOTES) . "\n" . "\n"; - $syns[$section->getSynonym()] = $section->getSynonym(); + + /* for the ``Registration Codes'' dialogue: */ + if (empty($permutations_courses[$section->getSynonym()])) + { + $singleton_course = new Course($course->getName()); + $singleton_course->section_add($section); + $permutation_courses[$section->getSynonym()] = $singleton_course->to_json_array(); + } + $filled = TRUE; } } @@ -542,11 +557,11 @@ class Schedule echo " \n"; } - - + /* presort */ + ksort($permutation_courses); // End of table echo " \n" - . ' '. json_encode($syns) . "\n" + . ' '. htmlentities(json_encode($permutation_courses)) . "\n" . '
\n"; }