Update BBB code BT#17329

pull/4101/head
Julio Montoya 6 years ago
parent 27effddfb9
commit 4194551d27
  1. 48
      main/inc/lib/api.lib.php
  2. 5
      plugin/bbb/README.md
  3. 49
      plugin/bbb/admin.php
  4. 5
      plugin/bbb/install.php
  5. 11
      plugin/bbb/lang/english.php
  6. 1
      plugin/bbb/lang/french.php
  7. 4
      plugin/bbb/lang/spanish.php
  8. 1455
      plugin/bbb/lib/bbb.lib.php
  9. 5
      plugin/bbb/lib/bbb_api.php
  10. 114
      plugin/bbb/lib/bbb_plugin.class.php
  11. 213
      plugin/bbb/listing.php
  12. 86
      plugin/bbb/start.php
  13. 12
      plugin/bbb/view/admin.tpl
  14. 6
      plugin/bbb/view/listing.tpl

@ -1817,7 +1817,7 @@ function api_get_user_entity($userId)
*
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
function api_get_user_info_from_username($username = '')
function api_get_user_info_from_username($username)
{
if (empty($username)) {
return false;
@ -1947,6 +1947,27 @@ function api_get_course_setting($setting_name, $course_code = null)
return -1;
}
function api_get_course_plugin_setting($plugin, $settingName, $courseInfo = [])
{
$value = api_get_course_setting($settingName, $courseInfo['code'], true);
if (-1 === $value) {
// Check global settings
$value = api_get_plugin_setting($plugin, $settingName);
if ($value === 'true') {
return 1;
}
if ($value === 'false') {
return 0;
}
if (null === $value) {
return -1;
}
}
return $value;
}
/**
* Gets an anonymous user ID.
*
@ -1983,7 +2004,8 @@ function api_get_anonymous_id()
break;
}
}
$userId = UserManager::create_user(
// Return the user ID
return UserManager::create_user(
$login,
'anon',
ANONYMOUS,
@ -1991,8 +2013,6 @@ function api_get_anonymous_id()
$login,
$login
);
return $userId;
} else {
$row = Database::fetch_array($result, 'ASSOC');
@ -2482,7 +2502,7 @@ function api_clear_anonymous($db_check = false)
*
* @author Noel Dieschburg
*
* @param the int status code
* @param int $status_code The integer status code (usually in the form of a constant)
*
* @return string
*/
@ -2497,7 +2517,23 @@ function get_status_from_code($status_code)
return get_lang('SessionsAdmin', '');
case DRH:
return get_lang('Drh', '');
}
case ANONYMOUS:
return get_lang('Anonymous', '');
case PLATFORM_ADMIN:
return get_lang('Administrator', '');
case SESSION_COURSE_COACH:
return get_lang('SessionCourseCoach', '');
case SESSION_GENERAL_COACH:
return get_lang('SessionGeneralCoach', '');
case COURSE_TUTOR:
return get_lang('CourseAssistant', '');
case STUDENT_BOSS:
return get_lang('StudentBoss', '');
case INVITEE:
return get_lang('Invitee', '');
}
return '';
}
/**

@ -16,7 +16,8 @@ ALTER TABLE plugin_bbb_meeting ADD voice_bridge int NOT NULL DEFAULT 1;
ALTER TABLE plugin_bbb_meeting ADD group_id int unsigned NOT NULL DEFAULT 0;
```
## Migrating to Chamilo LMS 1.11.x
For Chamilo 1.11.x, Videoconference plugin has two new settings options:
For Chamilo 1.11.x, Videoconference plugin has one new setting option:
*Disable Course Settings*.
##### Database changes
You need execute this SQL query in your database after making the Chamilo migration process from 1.10.x.
@ -60,4 +61,6 @@ ALTER TABLE plugin_bbb_room MODIFY COLUMN out_at datetime;
For version 2.8
```sql
ALTER TABLE plugin_bbb_meeting ADD COLUMN internal_meeting_id VARCHAR(255) DEFAULT NULL;
```

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\UserBundle\Entity\User;
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
$cidReset = true;
@ -46,11 +45,12 @@ $meetings = $bbb->getMeetings(0, 0, 0, true, $dateRange);
foreach ($meetings as &$meeting) {
$participants = $bbb->findConnectedMeetingParticipants($meeting['id']);
foreach ($participants as $meetingParticipant) {
/** @var User $participant */
$participant = $meetingParticipant['participant'];
$meeting['participants'][] = $participant->getCompleteName().' ('.$participant->getEmail().')';
if ($participant) {
$meeting['participants'][] = $participant->getCompleteName().' ('.$participant->getEmail().')';
}
}
}
@ -105,8 +105,46 @@ $tpl = new Template($tool_name);
$tpl->assign('meetings', $meetings);
$tpl->assign('search_form', $form->returnForm());
$content = $tpl->fetch('bbb/view/admin.tpl');
$settingsForm = new FormValidator('settings', api_get_self());
$settingsForm->addHeader($plugin->get_lang('UpdateAllCourseSettings'));
$settingsForm->addHtml(Display::return_message($plugin->get_lang('ThisWillUpdateAllSettingsInAllCourses')));
$settings = $plugin->course_settings;
$defaults = [];
foreach ($settings as $setting) {
$setting = $setting['name'];
$text = $settingsForm->addText($setting, $plugin->get_lang($setting), false);
$text->freeze();
$defaults[$setting] = api_get_plugin_setting('bbb', $setting) === 'true' ? get_lang('Yes') : get_lang('No');
}
$settingsForm->addButtonSave($plugin->get_lang('UpdateAllCourses'));
if ($settingsForm->validate()) {
$table = Database::get_course_table(TABLE_COURSE_SETTING);
foreach ($settings as $setting) {
$setting = $setting['name'];
$setting = Database::escape_string($setting);
if (empty($setting)) {
continue;
}
$value = api_get_plugin_setting('bbb', $setting);
if ($value === 'true') {
$value = 1;
} else {
$value = '';
}
$sql = "UPDATE $table SET value = '$value' WHERE variable = '$setting'";
Database::query($sql);
}
Display::addFlash(Display::return_message(get_lang('Updated')));
header('Location: '.api_get_self());
exit;
}
$settingsForm->setDefaults($defaults);
$tpl->assign('settings_form', $settingsForm->returnForm());
$content = $tpl->fetch('bbb/view/admin.tpl');
if ($meetings) {
$actions = Display::toolbarButton(
get_lang('ExportInExcel'),
@ -125,6 +163,5 @@ if ($meetings) {
);
}
$tpl->assign('header', $plugin->get_lang('RecordList'));
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -1,9 +1,10 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table).
*
* @package chamilo.plugin.bigbluebutton
*/
require_once __DIR__.'/config.php';
BBBPlugin::create()->install();

@ -45,9 +45,7 @@ $strings['enable_global_conference'] = 'Enable global conference';
$strings['enable_global_conference_per_user'] = 'Enable global conference per user';
$strings['enable_conference_in_course_groups'] = 'Enable conference in course groups';
$strings['enable_global_conference_link'] = 'Enable the link to the global conference in the homepage';
$strings['disable_download_conference_link'] = 'Disable download conference';
$strings['big_blue_button_record_and_store'] = 'Record and store sessions';
$strings['bbb_enable_conference_in_groups'] = 'Allow conference in groups';
$strings['plugin_tool_bbb'] = 'Video';
@ -56,7 +54,6 @@ $strings['NoRecording'] = 'No recording';
$strings['ClickToContinue'] = 'Click to continue';
$strings['NoGroup'] = 'No group';
$strings['UrlMeetingToShare'] = 'URL to share';
$strings['AdminView'] = 'View for administrators';
$strings['max_users_limit'] = 'Max users limit';
$strings['max_users_limit_help'] = 'Set this to the maximum number of users you want to allow by course or session-course. Leave empty or set to 0 to disable this limit.';
@ -64,9 +61,8 @@ $strings['MaxXUsersWarning'] = 'This conference room has a maximum number of %s
$strings['MaxXUsersReached'] = 'The limit of %s simultaneous users has been reached for this conference room. Please wait for one seat to be freed or for another conference to start in order to join.';
$strings['MaxXUsersReachedManager'] = 'The limit of %s simultaneous users has been reached for this conference room. To increase this limit, please contact the platform administrator.';
$strings['MaxUsersInConferenceRoom'] = 'Max simultaneous users in a conference room';
$strings['global_conference_allow_roles'] = "Global conference link only visible for this user roles";
$strings['global_conference_allow_roles'] = "Global conference link only visible for these user roles";
$strings['CreatedAt'] = 'Created at';
$strings['interface'] = 'Default Interface';
$strings['launch_type'] = 'Client launch choice';
$strings['EnterConferenceFlash'] = 'Enter the videoconference (Flash client)';
@ -77,3 +73,8 @@ $strings['SetByTeacher'] = 'Set by teacher';
$strings['SetByDefault'] = 'Set to default interface';
$strings['allow_regenerate_recording'] = 'Allow regenerate recording';
$strings['bbb_force_record_generation'] = 'Force record generation at the end of the meeting';
$strings['disable_course_settings'] = 'Disable course settings';
$strings['UpdateAllCourses'] = 'Update all courses';
$strings['UpdateAllCourseSettings'] = 'Update all course settings';
$strings['ThisWillUpdateAllSettingsInAllCourses'] = 'This will update at once all your course settings.';
$strings['ThereIsNoVideoConferenceActive'] = 'There is no videoconference currently active';

@ -74,3 +74,4 @@ $strings['SetByDefault'] = 'Lancement de l\'interface par défaut';
$strings['SetByTeacher'] = 'Choisi par le professeur';
$strings['SetByStudent'] = 'Choisi par l\'apprenant';
$strings['bbb_force_record_generation'] = 'Forcer la génération de l\'enregistrement à la fin de la session';
$strings['ThereIsNoVideoConferenceActive'] = "Il n'y a aucune vidéoconférence actuellement active";

@ -9,6 +9,7 @@ $strings['MeetingOpened'] = "Sala abierta";
$strings['MeetingClosed'] = "Sala cerrada";
$strings['MeetingClosedComment'] = "Si ha pedido grabar la sesión de videoconferencia en los parámetros del curso, esta grabación aparecerá en la lista siguiente una vez generada.";
$strings['CloseMeeting'] = "Cerrar sala";
$strings['RoomExit'] = "Ha salido de la sesión de Videoconferencia";
$strings['VideoConferenceXCourseX'] = "Videoconferencia #%s, curso %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconferencia añadida al calendario";
@ -61,7 +62,7 @@ $strings['MaxXUsersWarning'] = 'Esta sala de conferencia es limitada a un máxim
$strings['MaxXUsersReached'] = 'El límite de %s usuarios simultáneos ha sido alcanzado en esta sala de conferencia. Por favor refresque la página en unos minutos para ver si un asiento se ha liberado, o espere la apertura de una nueva sala para poder participar.';
$strings['MaxXUsersReachedManager'] = 'El límite de %s usuarios simultáneos ha sido alcanzado en esta sala de conferencia. Para aumentar el límite, contáctese con el administrador del portal.';
$strings['MaxUsersInConferenceRoom'] = 'Número máximo de usuarios simultáneos en una sala de conferencia';
$strings['global_conference_allow_roles'] = 'El enlace para la videoconferencia ';
$strings['global_conference_allow_roles'] = 'El enlace de videoconferencia global es disponible para estos perfiles';
$strings['CreatedAt'] = 'Creado el';
$strings['interface'] = 'Interfaz por defecto';
@ -72,3 +73,4 @@ $strings['ParticipantsWillUseSameInterface'] = 'Los participantes usarán la mis
$strings['SetByDefault'] = 'Lanzamiento con la interfaz por defecto';
$strings['SetByTeacher'] = 'Elegido por el profesor';
$strings['SetByStudent'] = 'Elegido por el alumno';
$strings['ThereIsNoVideoConferenceActive'] = "No hay una videoconferencia actualmente activa";

File diff suppressed because it is too large Load Diff

@ -70,10 +70,11 @@ class BigBlueButtonBN
$data = curl_exec( $ch );
curl_close( $ch );
if($data)
if ($data) {
return (new SimpleXMLElement($data));
else
} else {
return false;
}
}
return (simplexml_load_file($url));
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/* To show the plugin course icons you need to add these icons:
@ -6,12 +7,10 @@
* main/img/icons/64/plugin_name.png
* main/img/icons/64/plugin_name_na.png
*/
/**
* Videoconference plugin with BBB
*/
/**
* Class BBBPlugin
* Videoconference plugin with BBB
*/
class BBBPlugin extends Plugin
{
@ -37,7 +36,7 @@ class BBBPlugin extends Plugin
[
'name' => 'bbb_force_record_generation',
'type' => 'checkbox',
]
],
];
/**
@ -64,16 +63,16 @@ class BBBPlugin extends Plugin
PLATFORM_ADMIN => get_lang('Administrator'),
COURSEMANAGER => get_lang('Teacher'),
STUDENT => get_lang('Student'),
STUDENT_BOSS => get_lang('StudentBoss')
STUDENT_BOSS => get_lang('StudentBoss'),
],
'attributes' => ['multiple' => 'multiple']
'attributes' => ['multiple' => 'multiple'],
],
'interface' => [
'type' => 'select',
'options' => [
self::INTERFACE_FLASH => 'Flash',
self::INTERFACE_HTML5 => 'HTML5',
]
],
],
'launch_type' => [
'type' => 'select',
@ -85,36 +84,85 @@ class BBBPlugin extends Plugin
'translate_options' => true, // variables will be translated using the plugin->get_lang
],
'allow_regenerate_recording' => 'boolean',
// Default course settings, must be the same as $course_settings
'big_blue_button_record_and_store' => 'checkbox',
'bbb_enable_conference_in_groups' => 'checkbox',
'bbb_force_record_generation' => 'checkbox',
'disable_course_settings' => 'boolean',
]
);
$this->isAdminPlugin = true;
}
/**
* @return BBBPlugin|null
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
/**
* @param string $variable
*
* @return bool
*/
public function validateCourseSetting($variable)
{
if ($variable === 'bbb_enable_conference_in_groups') {
if ($this->get('enable_conference_in_course_groups') === 'true') {
return true;
}
if ($this->get('disable_course_settings') === 'true') {
return false;
}
return true;
$result = true;
switch ($variable) {
case 'bbb_enable_conference_in_groups':
$result = $this->get('enable_conference_in_course_groups') === 'true';
break;
case 'bbb_force_record_generation':
$result = $this->get('allow_regenerate_recording') === 'true';
break;
case 'big_blue_button_record_and_store':
}
return $result;
}
/**
* @return BBBPlugin|null
*
* @return array
*/
public static function create()
public function getCourseSettings()
{
static $result = null;
return $result ? $result : $result = new self();
$settings = [];
if ($this->get('disable_course_settings') !== 'true') {
$settings = parent::getCourseSettings();
}
return $settings;
}
/**
*
* @return \Plugin
*/
public function performActionsAfterConfigure()
{
$result = $this->get('disable_course_settings') === 'true';
if ($result) {
$valueConference = $this->get('bbb_enable_conference_in_groups') === 'true' ? 1 : 0;
self::update_course_field_in_all_courses('bbb_enable_conference_in_groups', $valueConference);
$valueForceRecordGeneration = $this->get('bbb_force_record_generation') === 'true' ? 1 : 0;
self::update_course_field_in_all_courses('bbb_force_record_generation', $valueForceRecordGeneration);
$valueForceRecordStore = $this->get('big_blue_button_record_and_store') === 'true' ? 1 : 0;
self::update_course_field_in_all_courses('big_blue_button_record_and_store', $valueForceRecordStore);
}
return $this;
}
/**
@ -144,7 +192,7 @@ class BBBPlugin extends Plugin
access_url INT NOT NULL DEFAULT 1,
video_url TEXT NULL,
has_video_m4v TINYINT NOT NULL DEFAULT 0,
interface INT NOT NULL DEFAULT 0
interface INT NOT NULL DEFAULT 0
)";
Database::query($sql);
@ -176,7 +224,7 @@ class BBBPlugin extends Plugin
'variable' => 'plugin_bbb_course_users_limit',
'changeable' => 1,
'visible_to_self' => 1,
'visible_to_others' => 0
'visible_to_others' => 0,
]
);
$fieldLabel = 'plugin_bbb_session_users_limit';
@ -194,7 +242,7 @@ class BBBPlugin extends Plugin
'variable' => 'plugin_bbb_session_users_limit',
'changeable' => 1,
'visible_to_self' => 1,
'visible_to_others' => 0
'visible_to_others' => 0,
]
);
@ -287,8 +335,9 @@ class BBBPlugin extends Plugin
$data = [
'text' => $this->get_lang('EnterConferenceFlash'),
'url' => $conferenceUrl.'&interface='.self::INTERFACE_FLASH,
'icon' => 'resources/img/64/videoconference_flash.png'
'icon' => 'resources/img/64/videoconference_flash.png',
];
return $data;
}
@ -304,6 +353,29 @@ class BBBPlugin extends Plugin
'url' => $conferenceUrl.'&interface='.self::INTERFACE_HTML5,
'icon' => 'resources/img/64/videoconference_html5.png',
];
return $data;
}
/**
* Set the course setting in all courses
*
* @param bool $variable Course setting to update
* @param bool $value New values of the course setting
*/
public function update_course_field_in_all_courses($variable, $value)
{
// Update existing courses to add the new course setting value
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id FROM $table ORDER BY id";
$res = Database::query($sql);
$courseSettingTable = Database::get_course_table(TABLE_COURSE_SETTING);
while ($row = Database::fetch_assoc($res)) {
Database::update(
$courseSettingTable,
['value' => $value],
['variable = ? AND c_id = ?' => [$variable, $row['id']]]
);
}
}
}

@ -1,22 +1,23 @@
<?php
/* For license terms, see /license.txt */
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
require_once __DIR__.'/config.php';
$plugin = BBBPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$roomTable = Database::get_main_table('plugin_bbb_room');
$htmlHeadXtra[] = api_get_js_simple(api_get_path(WEB_PLUGIN_PATH).'bbb/resources/utils.js');
$isGlobal = isset($_GET['global']) ? true : false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
$action = isset($_GET['action']) ? $_GET['action'] : '';
$userId = api_get_user_id();
$bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);
@ -130,27 +131,183 @@ if ($conferenceManager) {
exit;
break;
case 'logout':
if ($plugin->get('allow_regenerate_recording') !== 'true') {
api_not_allowed(true);
if ($plugin->get('allow_regenerate_recording') === 'true') {
$setting = api_get_course_plugin_setting('bbb', 'bbb_force_record_generation', $courseInfo);
$allow = $setting == 1 ? true : false;
if ($allow) {
$result = $bbb->getMeetingByRemoteId($_GET['remote_id']);
if (!empty($result)) {
$result = $bbb->regenerateRecording($result['id']);
if ($result) {
Display::addFlash(Display::return_message(get_lang('Success')));
} else {
Display::addFlash(Display::return_message(get_lang('Error'), 'error'));
}
}
}
}
$allow = api_get_course_setting('bbb_force_record_generation', $courseCode) == 1 ? true : false;
if ($allow) {
$result = $bbb->getMeetingByRemoteId($_GET['remote_id']);
if (!empty($result)) {
$result = $bbb->regenerateRecording($result['id']);
if ($result) {
Display::addFlash(Display::return_message(get_lang('Success')));
} else {
Display::addFlash(Display::return_message(get_lang('Error'), 'error'));
$remoteId = Database::escape_string($_GET['remote_id']);
$meetingData = Database::select(
'*',
Database::get_main_table('plugin_bbb_meeting'),
['where' => ['remote_id = ? AND access_url = ?' => [$remoteId, api_get_current_access_url_id()]]],
'first'
);
if (empty($meetingData) || !is_array($meetingData)) {
error_log("meeting does not exist - remote_id: $remoteId");
} else {
$meetingId = $meetingData['id'];
// If creator -> update
if ($meetingData['creator_id'] == api_get_user_id()) {
$pass = $bbb->getModMeetingPassword($courseCode);
$meetingBBB = $bbb->getMeetingInfo(
[
'meetingId' => $remoteId,
'password' => $pass,
]
);
if ($meetingBBB === false) {
//checking with the remote_id didn't work, so just in case and
// to provide backwards support, check with the id
$params = [
'meetingId' => $meetingId,
// -- REQUIRED - The unique id for the meeting
'password' => $pass,
// -- REQUIRED - The moderator password for the meeting
];
$meetingBBB = $bbb->getMeetingInfo($params);
}
if (!empty($meetingBBB)) {
$i = 0;
while ($i < $meetingBBB['participantCount']) {
$participantId = $meetingBBB[$i]['userId'];
$roomData = Database::select(
'*',
$roomTable,
[
'where' => [
'meeting_id = ? AND participant_id = ?' => [$meetingId, $participantId],
],
'order' => 'id DESC',
],
'first'
);
if (!empty($roomData)) {
$roomId = $roomData['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
}
$i++;
}
}
$conditions['where'] = ['meeting_id=? AND in_at=out_at' => [$meetingId]];
$roomList = Database::select(
'*',
$roomTable,
$conditions
);
if (!empty($roomList)) {
foreach ($roomList as $roomDB) {
$roomId = $roomDB['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
}
}
}
// Update out_at field of user
$roomData = Database::select(
'*',
$roomTable,
[
'where' => ['meeting_id = ? AND participant_id = ?' => [$meetingId, $userId]],
'order' => 'id DESC',
],
'first'
);
if (!empty($roomData)) {
$roomId = $roomData['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
}
$message = Display::return_message(
$plugin->get_lang('RoomClosed').'<br />'.$plugin->get_lang('RoomClosedComment'),
'success',
false
);
Display::addFlash($message);
}
header('Location: '.$bbb->getListingUrl());
exit;
break;
default:
break;
}
} else {
if ($action == 'logout') {
// Update out_at field of user
$remoteId = Database::escape_string($_GET['remote_id']);
$meetingData = Database::select(
'*',
Database::get_main_table('plugin_bbb_meeting'),
['where' => ['remote_id = ? AND access_url = ?' => [$remoteId, api_get_current_access_url_id()]]],
'first'
);
if (empty($meetingData) || !is_array($meetingData)) {
error_log("meeting does not exist - remote_id: $remoteId");
} else {
$meetingId = $meetingData['id'];
$roomData = Database::select(
'*',
$roomTable,
[
'where' => ['meeting_id = ? AND participant_id = ?' => [$meetingId, $userId]],
'order' => 'id DESC',
],
'first'
);
if (!empty($roomData)) {
$roomId = $roomData['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
}
$message = Display::return_message(
$plugin->get_lang('RoomExit'),
'success',
false
);
Display::addFlash($message);
}
header('Location: '.$bbb->getListingUrl());
exit;
}
}
$meetings = $bbb->getMeetings(
@ -183,38 +340,45 @@ $courseInfo = api_get_course_info();
$formToString = '';
if ($bbb->isGlobalConference() === false &&
$conferenceManager &&
!empty($courseInfo) &&
$plugin->get('enable_conference_in_course_groups') === 'true'
) {
$url = api_get_self().'?'.api_get_cidreq(true, false).'&gidReq=';
$htmlHeadXtra[] = '<script>
$htmlHeadXtra[] = '<script>
$(document).ready(function() {
$("#group_select").on("change", function() {
var groupId = $(this).find("option:selected").val();
var url = "'.$url.'";
window.location.replace(url+groupId);
var url = "'.$url.'";
window.location.replace(url+groupId);
});
});
</script>';
$form = new FormValidator(api_get_self().'?'.api_get_cidreq());
$groupId = api_get_group_id();
$groups = GroupManager::get_groups();
if ($conferenceManager) {
$groups = GroupManager::get_groups();
} else {
$groups = GroupManager::getAllGroupPerUserSubscription(
api_get_user_id(),
api_get_course_int_id(),
api_get_session_id()
);
}
if ($groups) {
$meetingsInGroup = $bbb->getAllMeetingsInCourse(api_get_course_int_id(), api_get_session_id(), 1);
$meetingsGroup = array_column($meetingsInGroup, 'status', 'group_id');
foreach ($groups as &$groupData) {
$itemGroupId = $groupData['id'];
$groupList[0] = get_lang('Select');
foreach ($groups as $groupData) {
$itemGroupId = $groupData['iid'];
if (isset($meetingsGroup[$itemGroupId]) && $meetingsGroup[$itemGroupId] == 1) {
$groupData['name'] .= ' ('.get_lang('Active').')';
}
$groupList[$itemGroupId] = $groupData['name'];
}
$groupList[0] = get_lang('Select');
$groupList = array_merge($groupList, array_column($groups, 'name', 'iid'));
$form->addSelect('group_id', get_lang('Groups'), $groupList, ['id' => 'group_select']);
$form->setDefaults(['group_id' => $groupId]);
$formToString = $form->returnForm();
@ -286,8 +450,7 @@ $tpl->assign('enter_conference_links', $urlList);
$tpl->assign('warning_inteface_msg', $warningInterfaceMessage);
$tpl->assign('show_client_options', $showClientOptions);
$listing_tpl = 'bbb/view/listing.tpl';
$content = $tpl->fetch($listing_tpl);
$content = $tpl->fetch('bbb/view/listing.tpl');
$actionLinks = '';
if (api_is_platform_admin()) {

@ -3,8 +3,6 @@
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
require_once __DIR__.'/../../vendor/autoload.php';
@ -36,61 +34,69 @@ if ($bbb->isGlobalConference()) {
}
if ($bbb->pluginEnabled) {
if ($bbb->isServerRunning()) {
if (isset($_GET['launch']) && $_GET['launch'] == 1) {
if (file_exists(__DIR__.'/config.vm.php')) {
$config = require __DIR__.'/config.vm.php';
$vmIsEnabled = true;
$host = '';
$salt = '';
if ($bbb->isServerConfigured()) {
if ($bbb->isServerRunning()) {
if (isset($_GET['launch']) && $_GET['launch'] == 1) {
if (file_exists(__DIR__.'/config.vm.php')) {
$config = require __DIR__.'/config.vm.php';
$vmIsEnabled = true;
$host = '';
$salt = '';
require __DIR__.'/lib/vm/AbstractVM.php';
require __DIR__.'/lib/vm/VMInterface.php';
require __DIR__.'/lib/vm/DigitalOceanVM.php';
require __DIR__.'/lib/VM.php';
require __DIR__.'/lib/vm/AbstractVM.php';
require __DIR__.'/lib/vm/VMInterface.php';
require __DIR__.'/lib/vm/DigitalOceanVM.php';
require __DIR__.'/lib/VM.php';
$vm = new VM($config);
$vm = new VM($config);
if ($vm->isEnabled()) {
try {
$vm->resizeToMaxLimit();
} catch (\Exception $e) {
echo $e->getMessage();
exit;
if ($vm->isEnabled()) {
try {
$vm->resizeToMaxLimit();
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}
}
}
}
$meetingParams = [];
$meetingParams['meeting_name'] = $bbb->getCurrentVideoConferenceName();
$meetingParams['interface'] = $interface;
if ($bbb->meetingExists($meetingParams['meeting_name'])) {
$joinUrl = $bbb->joinMeeting($meetingParams['meeting_name']);
if ($joinUrl) {
$url = $joinUrl;
$meetingParams = [];
$meetingParams['meeting_name'] = $bbb->getCurrentVideoConferenceName();
$meetingParams['interface'] = $interface;
$url = null;
if ($bbb->meetingExists($meetingParams['meeting_name'])) {
$joinUrl = $bbb->joinMeeting($meetingParams['meeting_name']);
if ($joinUrl) {
$url = $joinUrl;
}
} else {
$url = $bbb->createMeeting($meetingParams);
if ($bbb->isConferenceManager()) {
$url = $bbb->createMeeting($meetingParams);
}
}
} else {
$url = $bbb->isConferenceManager() ? $bbb->createMeeting($meetingParams) : $bbb->getListingUrl();
}
$meetingInfo = $bbb->findMeetingByName($meetingParams['meeting_name']);
if (!empty($meetingInfo) && $url) {
$bbb->saveParticipant($meetingInfo['id'], api_get_user_id(), $interface);
$bbb->redirectToBBB($url);
$meetingInfo = $bbb->findMeetingByName($meetingParams['meeting_name']);
if (!empty($meetingInfo) && $url) {
$bbb->saveParticipant($meetingInfo['id'], api_get_user_id(), $interface);
$bbb->redirectToBBB($url);
} else {
Display::addFlash(
Display::return_message($bbb->plugin->get_lang('ThereIsNoVideoConferenceActive'))
);
$url = $bbb->getListingUrl();
header('Location: '.$url);
exit;
}
} else {
$url = $bbb->getListingUrl();
header('Location: '.$url);
exit;
}
} else {
$url = $bbb->getListingUrl();
header('Location: '.$url);
exit;
$message = Display::return_message(get_lang('ServerIsNotRunning'), 'warning');
}
} else {
$message = Display::return_message(get_lang('ServerIsNotRunning'), 'warning');
$message = Display::return_message(get_lang('ServerIsNotConfigured'), 'warning');
}
} else {
$message = Display::return_message(get_lang('ServerIsNotConfigured'), 'warning');

@ -1,13 +1,19 @@
{{ settings_form }}
{{ 'RecordList'|get_plugin_lang('BBBPlugin') }}
{{ search_form }}
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ 'CreatedAt'|get_lang }}</th>
<th>{{ 'DateStart'|get_lang }}</th>
<th>{{ 'DateEnd'|get_lang }}</th>
<th>{{ 'Status'|get_lang }}</th>
<th>{{ 'Records'|get_plugin_lang('BBBPlugin') }}</th>
<th>{{ 'Course'|get_lang }}</th>
<th>{{ 'Session'|get_lang }}</th>
<th>{{ 'Participants'|get_lang }}</th>
<th>{{ 'CountUsers'|get_lang }}</th>
<th>{{ 'Actions'|get_lang }}</th>
</tr>
</thead>
@ -19,6 +25,7 @@
{% else %}
<td>{{ meeting.created_at }}</td>
{% endif %}
<td>{{ meeting.closed_at }}</td>
<td>
{% if meeting.status == 1 %}
<span class="label label-success">{{ 'MeetingOpened'|get_plugin_lang('BBBPlugin') }}</span>
@ -39,6 +46,9 @@
<td>
{{ meeting.participants ? meeting.participants|join('<br>') : '-' }}
</td>
<td>
{{ meeting.participants ? meeting.participants | length : 0 }}
</td>
<td>
{{ meeting.action_links }}
</td>

@ -1,4 +1,4 @@
<style type="text/css">
<style>
.conference .url{
padding: 5px;
margin-bottom: 5px;
@ -40,7 +40,6 @@
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
@ -115,7 +114,6 @@
<div class="page-header">
<h2>{{ 'RecordList'| get_plugin_lang('BBBPlugin') }}</h2>
</div>
<table class="table">
<tr>
<th>{{ 'CreatedAt'| get_plugin_lang('BBBPlugin') }}</th>
@ -154,8 +152,6 @@
<a class="btn btn-default" href="{{ meeting.end_url }} ">
{{ 'CloseMeeting'|get_plugin_lang('BBBPlugin') }}
</a>
{% else %}
{% endif %}
{{ meeting.action_links }}
</td>

Loading…
Cancel
Save