diff --git a/README.md b/README.md index c82f45f..ccca141 100755 --- a/README.md +++ b/README.md @@ -5,5 +5,10 @@ This Module provides a timetable block for moodle based on untis export-files: l ## Screenshot: +Students view: + ![image](doc/timetable_screenshot1.png) +Teachers view: + +![image](doc/timetable_screenshot2.png) diff --git a/block_timetable.php b/block_timetable.php index 9424e52..144da43 100755 --- a/block_timetable.php +++ b/block_timetable.php @@ -73,7 +73,7 @@ class block_timetable extends block_base { $class = $this->page->course->shortname; $this->content->text .= "Stundenplan der Klasse $class
"; $ttable = new timetable('class',$class); - } elseif ($USER->department == "Lehrer") { + } elseif ($USER->department == "Lehrer" || $USER->department == "Lehrer_fvs") { $teacher = $USER->username; $teacher = str_replace("l_", "", $teacher); $teacher = str_replace("-fvs", "", $teacher); diff --git a/classes/timetable.php b/classes/timetable.php index c46ffc9..48e3eda 100755 --- a/classes/timetable.php +++ b/classes/timetable.php @@ -87,14 +87,8 @@ class timetable { } } $day = new \DateTime($this->monday->format('Y-m-d\TH:i:sP')); - // TODO CHANGE DATABASE: table substitution: classesa -> classa, classesb -> classb !!! for ($i=0; $i<$this->numdayweek; $i++) { - if ($this->type == 'class') { - $sql = "date = '".$day->format('Ymd')."' AND ({$this->type}esa LIKE '%{$this->name}%' OR {$this->type}esb LIKE '%{$this->name}%')"; - } else { - $sql = "date = '".$day->format('Ymd')."' AND ({$this->type}a LIKE '%{$this->name}%' OR {$this->type}b LIKE '%{$this->name}%')"; - - } + $sql = "date = '".$day->format('Ymd')."' AND ({$this->type}a LIKE '%{$this->name}%' OR {$this->type}b LIKE '%{$this->name}%')"; if ($result = $DB->get_records_select('timetable_substitution',$sql)) { foreach ($result as $substitution) { diff --git a/doc/.gitkeep b/doc/.gitkeep old mode 100644 new mode 100755 diff --git a/doc/timetable_screenshot1.png b/doc/timetable_screenshot1.png old mode 100644 new mode 100755 index 291f6b7..a859cd8 Binary files a/doc/timetable_screenshot1.png and b/doc/timetable_screenshot1.png differ diff --git a/doc/timetable_screenshot2.png b/doc/timetable_screenshot2.png new file mode 100755 index 0000000..3610f4e Binary files /dev/null and b/doc/timetable_screenshot2.png differ diff --git a/module.js b/module.js old mode 100644 new mode 100755 diff --git a/styles.css b/styles.css old mode 100644 new mode 100755