Changeset - 76ece8b74a2e
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2011-03-29 21:56:11
ohnobinki@ohnopublishing.net
Fix double-display of earlier times, problem caused by 933c98416373.
1 file changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
inc/class.schedule.php
Show inline comments
 
@@ -254,25 +254,32 @@ class Schedule
 
  /**
 
   * \brief
 
   *   Prints out the possible permutations in tables.
 
   *
 
   * \param $schedule_store
 
   *   The schedule_store handle with which this schedule was loaded,
 
   *   used to query the parent schedule.
 
   */
 
  //--------------------------------------------------
 
  function writeoutTables(array $schedule_store = NULL)
 
  {
 
    $filled = false;
 
    $time = array(700,730,800,830,900,930,1000,1030,1100,1130,1200,1230,1300,1330,1400,1430,1500,1530,1600,1630,1700,1730,1800,1830,1900,1930,2000,2030,2100,2130, 2200);
 
    $time = array(700 => 700, 730 => 730, 800 => 800, 830 => 830,
 
		  900 => 900, 930 => 930,1000 =>1000,1030 =>1030,
 
		  1100 => 1100, 1130 => 1130, 1200 => 1200, 1230 => 1230,
 
		  1300 => 1300, 1330 => 1330, 1400 => 1400, 1430 => 1430,
 
		  1500 => 1500, 1530 => 1530, 1600 => 1600, 1630 => 1630,
 
		  1700 => 1700, 1730 => 1730, 1800 => 1800, 1830 => 1830,
 
		  1900 => 1900, 1930 => 1930, 2000 => 2000, 2030 => 2030,
 
		  2100 => 2100, 2130 => 2130, 2200 => 2200);
 

	
 
    define('SP_PERMUTATIONS_PER_PAGE', 64); /** @TODO: Define this in config.inc */
 

	
 
    $npages = ceil($this->nPermutations / SP_PERMUTATIONS_PER_PAGE);
 
    $page = 0;
 
    if (isset($_REQUEST['page']))
 
      $page = $_REQUEST['page'];
 
    /*
 
     * only display the ``this page doesn't exist'' 404 if there is at
 
     * least one permutation. Otherwise, we give an irrelevant 404 for
 
     * users with no permutations.
 
     */
 
@@ -385,32 +392,32 @@ class Schedule
 
		  if ($meeting->getDay(5))
 
		    {
 
		      $max_day_plusone = 6;
 
		      $have_saturday = TRUE;
 
		    }
 

	
 
		  /* very late / very early classes */
 
		  while ($meeting->getEndTime() > $max_time)
 
		    {
 
		      $max_time = sprintf("%04d", $max_time + 30);
 
		      while (substr($max_time, -2) >= 60)
 
			$max_time = sprintf("%02d%02d", substr($max_time, 0, 2) + 1, substr($max_time, -2) - 60);
 
		      $time[] = $max_time;
 
		      $time[(int)$max_time] = $max_time;
 
		    }
 
		  while ($meeting->getStartTime() < $min_time)
 
		    {
 
		      if (substr($min_time, -2) < 30)
 
			$min_time = sprintf("%02d%02d", substr($min_time, 0, 2) - 1, substr($min_time, -2) + 60);
 
		      $min_time = sprintf("%04d", $min_time - 30);
 
		      $time[] = $min_time;
 
		      $time[(int)$min_time] = (int)$min_time;
 
		      $sort_time = TRUE;
 
		    }
 
		}
 
	  }
 
	/* ensure that early times are actually first ;-) */
 
	if ($sort_time)
 
	  sort($time);
 

	
 
        echo '    <div id="regDialog" title="Registration Codes">' . PHP_EOL
 
	  . '      <div id="regDialog-content"></div>' . PHP_EOL
 
	  . '      <p id="regDialog-disclaimer" class="graytext"><em>Note: The registration information above corresponds to the sections displayed on the currently selected tab.</em></p>'
 
	  . '    </div>';
0 comments (0 inline, 0 general)