indenting

This commit is contained in:
L_DA 2020-11-22 09:21:53 +00:00
parent 79a07df71d
commit de7af4bd57
2 changed files with 411 additions and 416 deletions

View file

@ -65,7 +65,6 @@ class lesson {
$this->subject == $substitution->subjectb &&
preg_match("/(^|~)".preg_quote($this->class,"/")."($|~)/", $substitution->classb) &&
preg_match("/(^|~)".preg_quote($this->room,"/")."($|~)/", $substitution->roomb) ) {
// Append change info
$this->teachera = $substitution->teachera;
$this->subjecta = $substitution->subjecta;
@ -108,7 +107,7 @@ class lesson {
* @param object $absence Absence
*/
public function process_absence($absence) {
// echo "Process_absence: $absence->endperiod";
// echo "Process_absence: $absence->endperiod";
if ((($absence->type == 'L' && $absence->name == $this->teacher) ||
($absence->type == 'K' && $absence->name == $this->class) ||
($absence->type == 'R' && $absence->name == $this->room)) &&

View file

@ -122,21 +122,18 @@ class timetable {
foreach ($result as $lesson) {
if (!lesson_in_lessons($lesson, $this->lessons[$lesson->day][$lesson->period]))
$this->lessons[$lesson->day][$lesson->period][] = new lesson($lesson);
// Todo: if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
}
$sql = "$this->type = '$this->name' AND lessonid=0 AND (mid(week, $this->week, 1) = '1')";
$result = $DB->get_records_select('timetable_lesson',$sql);
foreach ($result as $lesson) {
if (!lesson_in_lessons($lesson, $this->lessons_event[$lesson->day][$lesson->period]))
$this->lessons_event[$lesson->day][$lesson->period][] = new lesson($lesson);
// Todo: if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
}
$sql = "$this->type = '$this->name' and (mid(week, $this->week, 1) = 'x')";
$result = $DB->get_records_select('timetable_lesson',$sql);
foreach ($result as $lesson) {
if (!lesson_in_lessons($lesson, $this->lessons_canceled[$lesson->day][$lesson->period]))
$this->lessons_canceled[$lesson->day][$lesson->period][] = new lesson($lesson);
// Todo: if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
}
$day = new \DateTime($this->monday->format('Y-m-d\TH:i:sP'));
@ -154,7 +151,6 @@ class timetable {
$lesson->process_substitution($substitution);
}
}
// Todo: if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
$types = array('teacher'=>'L', 'class'=>'K', 'room'=>'R');
$sql = "startdate <= '".$day->format('Ymd')."' AND enddate >= '".$day->format('Ymd')."' AND type = '{$types[$this->type]}' AND name = '{$this->name}'";