Changeset - 4a879ea2e1b6
[Not reviewed]
default
0 4 0
Ethan Zonca - 15 years ago 2010-11-16 00:07:35
ez@ethanzonca.com
XHTML fixes, CU-specific instruction changes, removed IE-specific warning as autocompletion now works in IE
4 files changed with 14 insertions and 14 deletions:
0 comments (0 inline, 0 general)
index.php
Show inline comments
 
@@ -2,29 +2,29 @@
 
/*
 
 * Copyright 2010 Nathan Gelderloos, Ethan Zonca, Nathan Phillip Brink
 
 *
 
 * This file is part of SlatePermutate.
 
 *
 
 * SlatePermutate is free software: you can redistribute it and/or modify
 
 * it under the terms of the GNU Affero General Public License as published by
 
 * the Free Software Foundation, either version 3 of the License, or
 
 * (at your option) any later version.
 
 *
 
 * SlatePermutate is distributed in the hope that it will be useful,
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 * GNU Affero General Public License for more details.
 
 *
 
 * You should have received a copy of the GNU Affero General Public License
 
 * along with SlatePermutate.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
  include_once 'inc/class.page.php'; 
 
  $welcomepage = new page('Welcome');
 
?>
 

	
 
<h3>Find the schedule that works for you!</h3>
 
<p>View <a href="schedulecreator.php">demo output</a> or <a href="input.php">get started on your own</a>. This program was created by <a href="http://www.calvin.edu" target="_blank">Calvin College</a> and <a href="http://cedarville.edu/" target="_blank">Cedarville University</a> students. SlatePermutate works with any college or university.</p>
 
<p>View <a href="schedulecreator.php">demo output</a> or <a href="input.php">get started on your own</a>. This program was created by <a href="http://www.calvin.edu" rel="external">Calvin College</a> and <a href="http://cedarville.edu/" rel="external">Cedarville University</a> students. SlatePermutate works with any college or university.</p>
 
<p class="righttext"><a href="input.php"><img class="noborder" src="images/get-started.png" alt="Get Started" /></a></p>
 

	
 
<?php
 
$welcomepage->foot();
input.php
Show inline comments
 
@@ -79,92 +79,92 @@ if (!empty($_REQUEST['selectschool'])
 
    $next_page = 'input.php';
 
    if (isset($_GET['s']))
 
      $next_page .= '?s=' . (int)$_GET['s'];
 
?>
 
<h2>School Selection</h2>
 
<p>
 
  Choose the school you attend from the list below. <strong>If you cannot
 
  find your school</strong>, you may proceed using
 
  the <a href="<?php echo $next_page . (strpos($next_page, '?') === FALSE ? '?' : '&amp;'); ?>school=default">generic
 
  settings</a>.
 
</p>
 
<?php
 
    $inputPage->showSchools($next_page);
 
    $inputPage->foot();
 
    exit;
 
  }
 

	
 
$inputPage->showSavedScheds($_SESSION);
 
?>
 
<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 <strong>Internet Explorer</strong>.
 
</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) . '"'; /*"*/ ?>
 
/>
 

	
 
<table id="container">
 
  <tr><td>
 
    <table id="jsrows">
 
	<!-- Header -->
 
	<tr>
 
		<td>Class ID</td>
 
		<td class="center" id="letterNumber">Section</td>
 
		<td class="center">Prof</td>
 
		<td class="center">Start Time</td>
 
		<td class="center">End Time</td>
 
		<td class="center">M</td>
 
		<td class="center">Tu</td>
 
		<td class="center">W</td>
 
		<td class="center">Th</td>
 
		<td class="center">F</td>
 
		<td class="center"></td>
 
		<td class="center"></td>
 
	</tr>
 
    </table>
 
  </td>
 
  </tr>
 
  
 
  <tr><td> <span class="gray" style="padding: 0 3.5em 0 3.5em;" id="addclass">Add Class</span></td></tr>
 
  <tr>
 
    <td><span class="gray" style="padding: 0 3.5em 0 3.5em;" id="addclass">Add Class</span></td>
 
  </tr>
 
</table>
 

	
 
<div class="paddingtop"><input class="green" style="margin:0;padding:0;" type="submit" value="Find a schedule" /></div>
 

	
 
</form>
 

	
 
<p>&nbsp;<br /><br /><br /></p>
 
<?php /* RE-enable if advanced options added: <p><span id="showadvanced" style="margin-left: 1em;"><a href="#">Advanced</a></span></p> */ ?>
 
<?php
 
<?php 
 

	
 
/* Show/hide Advanced Options: <p><span id="showadvanced" style="margin-left: 1em;"><a href="#">Advanced</a></span></p> */ 
 

	
 
$inputPage->showSchoolInstructions();
 
$inputPage->foot();
 

	
 
function input_class_js(Classes $class, $whitespace = '  ')
 
{
 
  $js = $whitespace . 'class_last = add_class_n(\'' . htmlentities($class->getName(), ENT_QUOTES) . "');\n";
 

	
 
  $nsections  = $class->getnsections();
 
  for ($section_key = $nsections - 1; $section_key >= 0; $section_key --)
 
    {
 
      $section = $class->getSection($section_key);
 
      $meetings = $section->getMeetings();
 
      foreach ($meetings as $meeting)
 
	{
 
	  $js .= $whitespace . 'add_section_n(class_last, \'' . htmlentities($section->getLetter(), ENT_QUOTES) . '\', \''
 
	    . htmlentities($section->getSynonym(), ENT_QUOTES) . '\', \''
 
	    . $meeting->getStartTime() . '\', \''
 
	    . $meeting->getEndTime() . '\', '
 
	    . json_encode(array('m' => $meeting->getDay(0), 't' => $meeting->getDay(1), 'w' => $meeting->getDay(2), 'h' => $meeting->getDay(3), 'f' => $meeting->getDay(4))) . ', \''
 
	    . htmlentities($section->getProf(), ENT_QUOTES) . '\', \''
 
	    . htmlentities($meeting->getLocation(), ENT_QUOTES) . "');\n";
 
	}
 
    }
 

	
school.d/calvin.inc
Show inline comments
 
@@ -23,44 +23,44 @@ function calvin_info()
 
  return array('name' => 'Calvin College',
 
	       'url' => 'http://calvin.edu/',
 
	       /*
 
		* rDNS postfixes which indicate a student is
 
		* connecting from that college campus
 
		*/
 
	       'domains' => array(
 
				  'calvin.edu',
 
				  ),
 
	       'student_address' => 'Knight',
 
	       );
 
}
 

	
 
function calvin_instructions_html()
 
{
 
  return <<<EOF
 
<h2>Instructions</h2>
 
<!--<p>
 
  SlatePermutate can be a useful tool for scheduling your next semester at <a href="http://calvin.edu/">Calvin College</a>.
 
</p>-->
 
<h3>
 
	Using the Auto-Complete function
 
</h3>
 
<p>
 
	Note: For best results, use <b>Firefox</b> or <b>Google Chrome</b> or <b>Safari</b>.
 
	Note: For best results, use <strong>Firefox</strong>, <strong>Google Chrome</strong>, or <strong>Safari</strong>.
 
</p>
 
<ol>
 
  <li>Determine the classes you wish to take next semester.</li>
 
	<li>Enter in the class numbers (e.g. MATH 101, CS 104) in the Class ID box.</li>
 
	<li>Select a valid class number from the drop down menu.</li>
 
	<li>Click anywhere outside of the box to automatically fill in the available section data for that class.</li>
 
	<li>Repeat this process for each class.</li>
 
	<li>Click "Find a Schedule" to view all possible schedules for next semester.</li>
 
</ol>
 
<!--<ol>
 
  <li>Get in touch with your advisor during advising/reading recess.</li>
 
  <li>Look up each class your advisor specified in Calvin's registration page of <a href="http://kv.calvin.edu/">KnightVision</a> (soon to be <a href="http://moodle.calvin.edu">moo</a>).</li>
 
  <li>Enter each class into a <tt>slate_permutate</tt> schedule and add each section that is listed that you are willing to take.</li>
 
  <li>Submit your schedule and view all of the different permutations of your schedule which would work with the sections you specified.</li>
 
  <li>Print out your preferred schedule by choosing "print" and selecting a schedule.</li>
 
  <li>Wait until it's your turn to register and grab your preferred sections before they fill up!</li>
 
</ol>-->
 
EOF;
 
}
school.d/cedarville.inc
Show inline comments
 
@@ -11,58 +11,58 @@
 
 *
 
 * SlatePermutate is distributed in the hope that it will be useful,
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 * GNU Affero General Public License for more details.
 
 *
 
 * You should have received a copy of the GNU Affero General Public License
 
 * along with SlatePermutate.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
function cedarville_info()
 
{
 
  return array('name' => 'Cedarville University',
 
	       'url' => 'http://cedarville.edu/',
 
	       'domains' => array(
 
				  'cedarville.edu',
 
				  ),
 
	       'student_address' => 'Cedarville Student',
 
	       );
 
}
 

	
 
function cedarville_instructions_html()
 
{
 
  return <<<EOF
 
<h2>Cedarville-specific Instructions</h2>
 
<h2>Instructions</h2>
 
<p>
 
  SlatePermutate can be a useful tool for scheduling your next semester at <a href="http://cedarville.edu/" target="_blank">Cedarville University</a>.
 
  SlatePermutate can be a useful tool for scheduling your next semester at <a href="http://cedarville.edu/" rel="external">Cedarville University</a>.
 
</p>
 
<ol>
 
  <li> <strong>Talk to your advisor</strong> and figure out which courses you need to take. Use the <a href="http://www.cedarville.edu/courses/schedule/">course list</a> to see what's available.</li>
 
  <li>Enter the course ID, such as PHYS-1020, in the Class ID blank. You will see a list of auto-suggestions.</li>
 
  <li><strong>You must click on the auto-suggested item</strong> to automatically add all sections of the class.</li>
 
  <li>Submit your schedule and view all of the different permutations of your schedule.</li>
 
  <li>Wait until it's your turn to register and grab your preferred sections before they fill up!</li>
 
  <li><strong>Schedule a meeting with your advisor to review your schedule.</strong></li>
 
  <li>When it's time to register, check the "Show Synonyms" box on your schedule and enter your course synonyms into the registration interface.</li>
 
</ol> <!--'-->
 
EOF;
 
}
 

	
 
/**
 
 * \brief
 
 *   Get a list of default classes (with sections (with meeting
 
 *   times)) for Cedarville students.
 
 *
 
 * \return
 
 *   An array of Classes objects.
 
 */
 
function cedarville_default_classes()
 
{
 
  $chapel = new Classes('Chapel');
 
  $chapel->section_add(new Section('_', array(new SectionMeeting('mtwhf', '1000', '1045', '', 'chapel')),
 
				   '', '_'));
 

	
 
  return array($chapel);
 
}
 

	
 
/**
 
 * \brief
 
 *   Parse given html into an array, first row is row headers
0 comments (0 inline, 0 general)