Changeset - cca88ad00317
[Not reviewed]
default
0 5 0
Ethan Zonca - 15 years ago 2010-10-27 19:37:31
ez@ethanzonca.com
Added synonym support. Still needs to be fixed in crawlers. Show professor by default. Show IE message only to IE users.
5 files changed with 9 insertions and 3 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -249,14 +249,15 @@ class Schedule
 
    }		
 

	
 
    echo "\n";
 
    echo '<div id="show-box" class="gray righttext" style="float: right; padding-right: 5pt; padding-bottom: 7pt">
 
  <form>
 
     <h3>Display</h3>
 
     <div style="text-align:left;"><input id="show-prof" name="show-prof" type="checkbox" /><label for="show-prof">Professor</label></div>
 
     <div style="text-align:left;"><input id="show-prof" name="show-prof" type="checkbox" checked="checked" /><label for="show-prof">Professor</label></div>
 
     <div style="text-align:left;"><input id="show-location" name="show-location" type="checkbox" /><label for="show-location">Room</label></div>
 
     <div style="text-align:left;"><input id="show-synonym" name="show-synonym" type="checkbox" /><label for="show-synonym">Synonym</label></div>
 
  </form>
 
  </div> <!-- id="details" -->';
 

	
 
    if($this->nPermutations > 0)
 
      {
 
	$table .= "<div id=\"tabs\">\n"
 
@@ -337,12 +338,13 @@ class Schedule
 
					. '" title="prof: ' . htmlentities($section->getProf(), ENT_QUOTES)
 
					. ', room: ' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . '">'
 
					. htmlentities($class->getName(), ENT_QUOTES) . '-'
 
					. htmlentities($section->getLetter(), ENT_QUOTES) . "\n"
 
					. '<span class="prof block">' . htmlentities($section->getProf(), ENT_QUOTES) . "</span>\n"
 
					. '<span class="location block">' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . "</span>\n"
 
					. '<span class="synonym block">' . htmlentities($section->getSynonym(), ENT_QUOTES) . "</span>\n"
 
					. "</td>\n";
 
				      $filled = TRUE;
 
				    }
 
			}
 
		    }
 

	
class.section.php
Show inline comments
 
@@ -44,12 +44,14 @@ class Section
 
  function __construct ($letter, array $section_meetings = array(), $synonym = NULL, $prof = NULL)
 
  {
 
    $this->letter = $letter;
 

	
 
    $this->meetings = $section_meetings;
 

	
 
    $this->synonym = $synonym;
 

	
 
    $this->prof = $prof;
 
  }
 

	
 
  public function getLetter()
 
  {
 
    return $this->letter;
input.php
Show inline comments
 
@@ -79,15 +79,17 @@ if (!empty($_REQUEST['selectschool'])
 
?>
 
<p>
 
  Welcome to SlatePermutate<?php $inputPage->addressStudent(', ', '',
 
  FALSE); ?>! To get started, enter in some of your
 
  class IDs, and click the autosuggestion to add available sections for each class.
 
</p>
 
<!--[if IE]>
 
<p>
 
  Note: The auto-complete function does not work in <b>Internet Explorer</b>.
 
</p>
 
<![endif]-->
 
<form method="post" action="process.php" id="scheduleForm">
 
<br />
 
<label>Schedule Name</label><br />
 
<input id="scheduleName" style="margin-bottom: 1em;" class="defText required" type="text" size="25" title="Spring 2011" name="postData[name]"
 
<?php if ($sch) echo 'value="' . htmlentities($sch->getName(), ENT_QUOTES) . '"'; /*"*/ ?>
 
/>
process.php
Show inline comments
 
@@ -118,13 +118,13 @@ if(!$DEBUG)
 
				$allClasses->addClass($class['name']);
 
		
 
				foreach($class as $section)
 
				  /* Skip the section name, which isn't a section */
 
					if(is_array($section))
 
					{
 
					  $allClasses->addSection($class['name'], $section['letter'], $section['start'], $section['end'], arrayToDays($section['days'], 'alpha'), NULL, $section['professor'], $section['location']);
 
					  $allClasses->addSection($class['name'], $section['letter'], $section['start'], $section['end'], arrayToDays($section['days'], 'alpha'), $section['synonym'], $section['professor'], $section['location']);
 
					}
 
			}
 
		}
 
		$allClasses->findPossibilities();
 
		if (!isset($_SESSION['saved']))
 
		  $_SESSION['saved'] = array();
scripts/scheduleInput.js
Show inline comments
 
@@ -80,13 +80,13 @@ function genSectionHtml(cnum)
 
/* @TODO: This should select & set items based on args, if the args != '' */
 
function genSectionHtml_n(cnum, name, synonym, stime, etime, days, prof, location)
 
{
 
		var snum = sectionsOfClass[cnum];
 

	
 
		var result = '<tr class="section class' + cnum + '"><td class="none"></td>';
 
	        result = result + '<td class="sectionIdentifier center"><input type="hidden" name="postData[' + cnum + '][' + snum + '][synonym]" value="' + synonym + '" /><input type="text" size="1" class="required" name="postData[' + cnum + '][' + snum + '][letter]" value="' + name + '" /></td>';
 
	        result = result + '<td class="sectionIdentifier center"><input type="text" name="postData[' + cnum + '][' + snum + '][synonym]" value="' + synonym + '" /><input type="text" size="1" class="required" name="postData[' + cnum + '][' + snum + '][letter]" value="' + name + '" /></td>';
 
		result = result + '<td class="professor center"><input type="text" size="10" class="" name="postData[' + cnum + ']['+ snum + '][professor]" value="' + prof + '" /></td>';
 
		result = result + '<td><select class="selectRequired" name="postData[' + cnum + '][' + snum + '][start]"><option value="none"></option>'
 
				 + genOptionHtml("0700", "7:00 am", stime) + genOptionHtml("0730", "7:30 am", stime)
 
				 + genOptionHtml("0800", "8:00 am", stime) + genOptionHtml("0830", "8:30 am", stime)
 
				 + genOptionHtml("0900", "9:00 am", stime) + genOptionHtml("0930", "9:30 am", stime)
 
				 + genOptionHtml("1000", "10:00 am", stime) + genOptionHtml("1030", "10:30 am", stime)
0 comments (0 inline, 0 general)