# HG changeset patch # User ethanzonca # Date 2010-09-30 20:03:52 # Node ID 00282418d2eff56d4182c0b2dbf800c48b039ecc # Parent bbc0c3b4c101208dc99ae7146b33d7a731742018 # Parent ccafeb41b1389bee2e77631d2d19287c92f34202 Merge diff --git a/class.schedule.php b/class.schedule.php --- a/class.schedule.php +++ b/class.schedule.php @@ -35,8 +35,10 @@ class Schedule */ function __construct($name) { + $this->classStorage = array(); $this->nclasses = 0; $this->scheduleName = $name; + $this->storage = array(); $this->title = "SlatePermutate - Scheduler"; $this->section_format = 'numerous'; } @@ -93,7 +95,16 @@ class Schedule //-------------------------------------------------- function findPossibilities() { - $this->possiblePermutations = 1; + $this->possiblePermutations = 1; + /* special case: there is nothing entered into the schedule and thus there is one, NULL permutation */ + if (!$this->nclasses) + { + /* have an empty schedule */ + $this->classStorage[0] = array(); + $this->nPermutations = 1; + return; + } + $position = 0; $counter = 0;