CSS and logic updates
This commit is contained in:
parent
52f3f359af
commit
c000c8f7b7
5 changed files with 297 additions and 78 deletions
|
|
@ -189,17 +189,32 @@ class timetable {
|
|||
$this->times = $DB->get_records_select('timetable_time',$sql);
|
||||
}
|
||||
|
||||
public function get_periodmax() {
|
||||
//$maxperiod = get_config('timetable', 'numperiod');
|
||||
$maxperiod = 0;
|
||||
for ($i=0; $i<$this->numdayweek; $i++) {
|
||||
foreach($this->lessons[$i+1] as $period => $lessons)
|
||||
if ($period > $maxperiod && count($lessons)) $maxperiod = $period;
|
||||
foreach($this->lessons_canceled[$i+1] as $period => $lessons)
|
||||
if ($period > $maxperiod && count($lessons)) $maxperiod = $period;
|
||||
foreach($this->lessons_event[$i+1] as $period => $lessons)
|
||||
if ($period > $maxperiod && count($lessons)) $maxperiod = $period;
|
||||
}
|
||||
return $maxperiod;
|
||||
}
|
||||
|
||||
public function prepare_output() {
|
||||
$resultdata = array();
|
||||
|
||||
$numperiod = get_config('timetable', 'numperiod');
|
||||
if ($this->periodmax > $numperiod) $numperiod = $this->periodmax;
|
||||
$numperiod = 13;
|
||||
$numperiod = max($this->get_periodmax(), get_config('timetable', 'numperiod'));
|
||||
|
||||
$numdayweek = 5 + get_config('timetable', 'saturday');
|
||||
if ($numdayweek == 6) $resultdata['saturday'] = 1; else $resultdata['saturday'] = 0;
|
||||
|
||||
$resultdata['type'] = $this->type;
|
||||
$resultdata['viewteacher'] = ($this->type == 'teacher') ? "1" : "";;
|
||||
$resultdata['viewclass'] = ($this->type == 'class') ? "1" : "";;
|
||||
$resultdata['viewroom'] = ($this->type == 'room') ? "1" : "";;
|
||||
$resultdata['name'] = $this->name;
|
||||
$resultdata['description'] = $this->description;
|
||||
$resultdata['date'] = $this->monday->format('d.m') . " - " . $this->lastday->format('d.m');
|
||||
|
|
@ -225,12 +240,27 @@ class timetable {
|
|||
$mylesson['teachera'] = $lesson->teachera;
|
||||
$mylesson['rooma'] = $lesson->rooma;
|
||||
$mylesson['subjecta'] = $lesson->subjecta;
|
||||
$mylesson['classb'] = property_exists($lesson,'classb') ? $lesson->classb : null;
|
||||
$mylesson['teacherb'] = property_exists($lesson,'teacherb') ? $lesson->teacherb : null;
|
||||
$mylesson['roomb'] = property_exists($lesson,'roomb') ? $lesson->roomb : null;
|
||||
$mylesson['subjectb'] = property_exists($lesson,'subjectb') ? $lesson->subjectb : null;
|
||||
$mylesson['subjectchanged'] = $lesson->subjectchanged;
|
||||
$mylesson['teacherchanged'] = $lesson->teacherchanged;
|
||||
$mylesson['classchanged'] = $lesson->classchanged;
|
||||
$mylesson['roomchanged'] = $lesson->roomchanged;
|
||||
$mylesson['substitution'] = $lesson->substitution;
|
||||
$mylesson['cancel'] = "";
|
||||
$mylesson['cancel4me'] = "";
|
||||
$mylesson['event'] = $lesson->reason ? $lesson->reason : "Event";
|
||||
$mylesson['status'] = "1";
|
||||
$mylesson['flag'] = "1";
|
||||
$mylesson['text'] = $lesson->text;
|
||||
$mylesson['subtype'] = Array();
|
||||
if ($lesson->type) {
|
||||
for ($i=0; $i<32; $i++) {
|
||||
if ($lesson->type & (1<<$i)) $mylesson['subtype'][] = $i+1;
|
||||
}
|
||||
}
|
||||
$days[$day]['substitutionold'] .= $lesson->text;
|
||||
$days[$day]['lessons'][] = $mylesson;
|
||||
}
|
||||
|
|
@ -244,12 +274,27 @@ class timetable {
|
|||
$mylesson['teachera'] = $lesson->teachera;
|
||||
$mylesson['rooma'] = $lesson->rooma;
|
||||
$mylesson['subjecta'] = $lesson->subjecta;
|
||||
$mylesson['classb'] = property_exists($lesson,'classb') ? $lesson->classb : null;
|
||||
$mylesson['teacherb'] = property_exists($lesson,'teacherb') ? $lesson->teacherb : null;
|
||||
$mylesson['roomb'] = property_exists($lesson,'roomb') ? $lesson->roomb : null;
|
||||
$mylesson['subjectb'] = property_exists($lesson,'subjectb') ? $lesson->subjectb : null;
|
||||
$mylesson['substitution'] = $lesson->substitution;
|
||||
$mylesson['subjectchanged'] = $lesson->subjectchanged;
|
||||
$mylesson['teacherchanged'] = $lesson->teacherchanged;
|
||||
$mylesson['classchanged'] = $lesson->classchanged;
|
||||
$mylesson['roomchanged'] = $lesson->roomchanged;
|
||||
$mylesson['cancel'] = "";
|
||||
$mylesson['cancel4me'] = "";
|
||||
$mylesson['event'] = "";
|
||||
$mylesson['status'] = "";
|
||||
$mylesson['flag'] = "";
|
||||
$mylesson['text'] = $lesson->text;
|
||||
$mylesson['subtype'] = Array();
|
||||
if ($lesson->type) {
|
||||
for ($i=0; $i<32; $i++) {
|
||||
if ($lesson->type & (1<<$i)) $mylesson['subtype'][] = $i+1;
|
||||
}
|
||||
}
|
||||
$days[$day]['substitutionold'] .= $lesson->text;
|
||||
$days[$day]['lessons'][] = $mylesson;
|
||||
}
|
||||
|
|
@ -263,12 +308,33 @@ class timetable {
|
|||
$mylesson['teachera'] = $lesson->teachera;
|
||||
$mylesson['rooma'] = $lesson->rooma;
|
||||
$mylesson['subjecta'] = $lesson->subjecta;
|
||||
$mylesson['classb'] = property_exists($lesson,'classb') ? $lesson->classb : null;
|
||||
$mylesson['teacherb'] = property_exists($lesson,'teacherb') ? $lesson->teacherb : null;
|
||||
$mylesson['roomb'] = property_exists($lesson,'roomb') ? $lesson->roomb : null;
|
||||
$mylesson['subjectb'] = property_exists($lesson,'subjectb') ? $lesson->subjectb : null;
|
||||
$mylesson['substitution'] = $lesson->substitution;
|
||||
$mylesson['cancel'] = "1";
|
||||
$mylesson['cancel4me'] = "";
|
||||
if (($lesson->teacherchanged && $this->type == 'teacher') ||
|
||||
($lesson->classchanged && $this->type == 'class') ||
|
||||
($lesson->roomchanged && $this->type == 'room')) $mylesson['cancel4me'] = "cancel4me";
|
||||
$mylesson['subjectchanged'] = $lesson->subjectchanged;
|
||||
$mylesson['teacherchanged'] = $lesson->teacherchanged;
|
||||
$mylesson['classchanged'] = $lesson->classchanged;
|
||||
$mylesson['roomchanged'] = $lesson->roomchanged;
|
||||
#if ((property_exists($lesson,'teacherb') && $this->type == 'teacher') ||
|
||||
# (property_exists($lesson,'classb') && $this->type == 'class') ||
|
||||
# (property_exists($lesson,'roomb') && $this->type == 'room')) $mylesson['cancel4me'] = "cancel4me";
|
||||
$mylesson['event'] = "";
|
||||
$mylesson['status'] = "1";
|
||||
$mylesson['flag'] = "1"; // status und flag werden vertauscht (im Template bzw. extern-lib.php
|
||||
$mylesson['text'] = $lesson->text;
|
||||
$mylesson['subtype'] = Array();
|
||||
if ($lesson->type) {
|
||||
for ($i=0; $i<32; $i++) {
|
||||
if ($lesson->type & (1<<$i)) $mylesson['subtype'][] = $i+1;
|
||||
}
|
||||
}
|
||||
$days[$day]['substitutionold'] .= $lesson->text;
|
||||
$days[$day]['lessons'][] = $mylesson;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue