Add admin view for BBB plugin - refs BT#11636

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 497a825d15
commit 61feb92221
  1. 41
      plugin/bbb/admin.php
  2. 45
      plugin/bbb/admin.tpl
  3. 35
      plugin/bbb/lib/bbb.lib.php
  4. 6
      plugin/bbb/lib/bbb_plugin.class.php
  5. 6
      plugin/bbb/listing.php

@ -0,0 +1,41 @@
<?php
/**
* 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;
require_once __DIR__ . '/../../main/inc/global.inc.php';
api_protect_admin_script();
$plugin = BBBPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$tpl = new Template($tool_name);
$isGlobal = isset($_GET['global']) ? true : false;
$bbb = new bbb('', '', $isGlobal);
$action = isset($_GET['action']) ? $_GET['action'] : null;
$meetings = $bbb->getMeetings();
if (!empty($meetings)) {
$meetings = array_reverse($meetings);
}
if (!$bbb->isServerRunning()) {
Display::addFlash(
Display::return_message(get_lang('ServerIsNotRunning'), 'error')
);
}
$tpl->assign('meetings', $meetings);
$content = $tpl->fetch('bbb/admin.tpl');
$tpl->assign('header', get_lang('RecordList'));
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -0,0 +1,45 @@
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ 'CreatedAt'|get_lang }}</th>
<th>{{ 'Status'|get_lang }}</th>
<th>{{ 'Records'|get_lang }}</th>
<th>{{ 'Course'|get_lang }}</th>
<th>{{ 'Session'|get_lang }}</th>
<th>{{ 'Actions'|get_lang }}</th>
</tr>
</thead>
<tbody>
{% for meeting in meetings %}
<tr id="meeting-{{ meeting.id }}">
{% if meeting.visibility == 0 %}
<td class="muted">{{ meeting.created_at }}</td>
{% else %}
<td>{{ meeting.created_at }}</td>
{% endif %}
<td>
{% if meeting.status == 1 %}
<span class="label label-success">{{ 'MeetingOpened'|get_lang }}</span>
{% else %}
<span class="label label-info">{{ 'MeetingClosed'|get_lang }}</span>
{% endif %}
</td>
<td>
{% if meeting.record == 1 %}
{# Record list #}
{{ meeting.show_links }}
{% endif %}
</td>
<td>{{ meeting.course ? meeting.course.title : '-' }}</td>
<td>{{ meeting.session ? meeting.session.name : '-' }}</td>
<td>
{% if meeting.status == 1 %}
<a class="btn btn-default" href="{{ meeting.end_url }} "> {{ 'CloseMeeting'|get_lang }}</a>
{% else %}
{{ meeting.action_links }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

@ -445,29 +445,26 @@ class bbb
* Gets all the course meetings saved in the plugin_bbb_meeting table
* @return array Array of current open meeting rooms
*/
public function getMeetings()
public function getMeetings($courseId = 0, $sessionId = 0, $groupId = 0)
{
$em = Database::getManager();
$pass = $this->getUserMeetingPassword();
$courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
$conditions = array(
'where' => array(
'c_id = ? AND session_id = ? ' => array(
$courseId,
$sessionId,
),
),
);
$conditions = [];
if ($this->hasGroupSupport()) {
$groupId = api_get_group_id();
if ($courseId || $sessionId || $groupId) {
$conditions = array(
'where' => array(
'c_id = ? AND session_id = ? AND group_id = ? ' =>
array($courseId, $sessionId, $groupId)
)
'c_id = ? AND session_id = ? ' => array($courseId, $sessionId),
),
);
if ($this->hasGroupSupport()) {
$conditions = array(
'where' => array(
'c_id = ? AND session_id = ? AND group_id = ? ' => array($courseId, $sessionId, $groupId)
)
);
}
}
$meetingList = Database::select(
@ -690,6 +687,10 @@ class bbb
$item['go_url'] = $this->protocol.$this->api->getJoinMeetingURL($joinParams);
}
$item = array_merge($item, $meetingDB, $meetingBBB);
$item['course'] = $em->find('ChamiloCoreBundle:Course', $item['c_id']);
$item['session'] = $em->find('ChamiloCoreBundle:Session', $item['session_id']);
$newMeetingList[] = $item;
}

@ -34,8 +34,8 @@ class BBBPlugin extends Plugin
protected function __construct()
{
parent::__construct(
'2.4',
'Julio Montoya, Yannick Warnier',
'2.5',
'Julio Montoya, Yannick Warnier, Angel Fernando Quiroz Campos',
[
'tool_enable' => 'boolean',
'host' => 'text',
@ -44,6 +44,8 @@ class BBBPlugin extends Plugin
'enable_conference_in_course_groups' => 'boolean',
]
);
$this->isAdminPlugin = true;
}
/**

@ -107,7 +107,11 @@ if ($conferenceManager) {
}
$meetings = $bbb->getMeetings();
$meetings = $bbb->getMeetings(
api_get_course_int_id(),
api_get_session_id(),
api_get_group_id()
);
if (!empty($meetings)) {
$meetings = array_reverse($meetings);
}

Loading…
Cancel
Save