diff --git a/controllers/show.php b/controllers/show.php index 56f7c2c..db5b3ec 100644 --- a/controllers/show.php +++ b/controllers/show.php @@ -51,22 +51,35 @@ public function index_action() foreach ($meetings as $meeting) { $all_meetings++; - $seminar = null; + $course = null; + $current_course_date = null; if ($this->plugin->meeting_plugin_installed) { - $seminar = $this->getSeminar((string)$meeting->meetingID); + $course = Course::findOneBySQL('JOIN vc_meeting_course vmc on vmc.course_id = Seminar_id + JOIN vc_meetings vm ON vm.id = vmc.meeting_id WHERE vm.remote_id = ?', + [(string)$meeting->meetingID] + ); + + if ($course) { + $current_course_date = CourseDate::findOneBySQL( + 'range_id = ? AND UNIX_TIMESTAMP() BETWEEN date and end_time', + [$course->id] + ); + } } $result['meetings'][] = [ 'meeting_id' => (string)$meeting->meetingID, 'meeting_name' => (string)$meeting->meetingName, 'participant_count' => (string)$meeting->participantCount, + 'max_users' => (int)$meeting->maxUsers, 'video_count' => (int)$meeting->videoCount, 'listener_count' => (int)$meeting->listenerCount, 'voice_participant_count' => (int)$meeting->voiceParticipantCount, 'moderator_count' => (int)$meeting->moderatorCount, 'moderator_pw' => (string)$meeting->moderatorPW, 'is_break_out' => (string)$meeting->isBreakout === "true", - 'seminar' => $seminar + 'course' => $course, + 'current_course_date' => $current_course_date ]; $complete_participant_count += (int)$meeting->participantCount; @@ -165,17 +178,4 @@ private function buildSidebar() ); Sidebar::Get()->addWidget($actions); } - - private function getSeminar($meeting_id) { - $sem_id = DBManager::get()->fetchColumn('SELECT Seminar_id FROM seminare JOIN vc_meeting_course vmc on vmc.course_id = Seminar_id - JOIN vc_meetings vm ON vm.id = vmc.meeting_id - WHERE vm.remote_id = ?', [$meeting_id]); - - $seminar = null; - - if($sem_id) { - $seminar = Seminar::GetInstance($sem_id); - } - return $seminar; - } } diff --git a/package-lock.json b/package-lock.json index c899070..b85b767 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simplebbbconnector", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a1c2664..2a83f7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simplebbbconnector", - "version": "1.2.3", + "version": "1.2.4", "description": "To use the connector you need the api-informations for your BBB-Server.", "main": "index.js", "scripts": { diff --git a/plugin.manifest b/plugin.manifest index beb310a..06ae5f8 100644 --- a/plugin.manifest +++ b/plugin.manifest @@ -1,5 +1,5 @@ pluginname=SimpleBBB-Connector pluginclassname=SimpleBBBConnector origin=Vec -version=1.2.3 +version=1.2.4 studipMinVersion=4.2 diff --git a/views/show/_meeting.php b/views/show/_meeting.php index d8b185c..9661058 100644 --- a/views/show/_meeting.php +++ b/views/show/_meeting.php @@ -4,14 +4,16 @@ if ($plugin->meeting_plugin_installed) : ?>