Skip to content

Commit

Permalink
Add link in group_space if tool is enabled + group setting is on. BT#…
Browse files Browse the repository at this point in the history
…11014

Added bbb plugin setting "enable_conference_in_course_groups".
  • Loading branch information
jmontoyaa committed May 10, 2016
1 parent 0111ccb commit 92218a8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 23 deletions.
11 changes: 11 additions & 0 deletions main/group/group_space.php
Expand Up @@ -204,6 +204,17 @@
}
}

$enabled = api_get_plugin_setting('bbb', 'tool_enable');
if ($enabled === 'true') {
$bbb = new bbb();
if ($bbb->hasGroupSupport()) {
$actions_array[] = array(
'url' => api_get_path(WEB_PLUGIN_PATH)."bbb/start.php?".api_get_cidreq(),
'content' => Display::return_icon('bbb.png', get_lang('VideoConference'), array(), 32)
);
}
}

if (!empty($actions_array)) {
echo Display::actions($actions_array);
}
Expand Down
Binary file added main/img/icons/32/bbb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added main/img/icons/32/bbb_na.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions plugin/bbb/changelog.md
@@ -1,16 +1,17 @@
Version 2.4
Version 2.4 2016-05
------------------------
Changes:

* Global conference support (Requires to turn on, in plugin settings)
* Course group conference support.
* Requires a DB change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN group_id INT DEFAULT 0"
* Global conference support (Requires to update the plugin settings).
* Course group conference support
* Requires a database change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN group_id INT DEFAULT 0"
* Requires to update the plugin settings.

Version 2.3 - 2015-05-18
------------------------
Changes:
* Added support for variable voiceBridge to be sent on meeting creation. See https://code.google.com/p/bigbluebutton/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Component%20Summary&groupby=&sort=&id=1186 and https://support.chamilo.org/issues/7669 for details.
* Requires a DB change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN voice_bridge INT NOT NULL DEFAULT 1;"
* Requires a database change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN voice_bridge INT NOT NULL DEFAULT 1;"

Version 2.2 - 2014-10-15
------------------------
Expand Down
6 changes: 5 additions & 1 deletion plugin/bbb/lib/bbb.lib.php
Expand Up @@ -53,6 +53,10 @@ public function __construct($host = '', $salt = '', $isGlobalConference = false)
$columns = Database::listTableColumns($this->table);
$this->groupSupport = isset($columns['group_id']) ? true : false;

if ($this->groupSupport) {
$this->groupSupport = (bool) $plugin->get('enable_conference_in_course_groups');
}

if ($bbbPlugin === true) {
$userInfo = api_get_user_info();
$this->user_complete_name = $userInfo['complete_name'];
Expand Down Expand Up @@ -998,7 +1002,7 @@ public function getCurrentVideoConferenceName()

return api_get_course_id().'-'.api_get_session_id().'-'.api_get_group_id();
}

return api_get_course_id().'-'.api_get_session_id();
}

Expand Down
36 changes: 19 additions & 17 deletions plugin/bbb/lib/bbb_plugin.class.php
Expand Up @@ -37,6 +37,7 @@ protected function __construct()
'host' => 'text',
'salt' => 'text',
'enable_global_conference' => 'boolean',
'enable_conference_in_course_groups' => 'boolean',
]
);
}
Expand Down Expand Up @@ -76,7 +77,7 @@ public function install()
)";
Database::query($sql);

//Installing course settings
// Installing course settings
$this->install_course_fields_in_all_courses();
}

Expand All @@ -89,33 +90,34 @@ public function uninstall()
$t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
$t_tool = Database::get_course_table(TABLE_TOOL_LIST);

// New settings
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_tool_enable'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_salt'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_host'";
Database::query($sql);
$variables = [
'bbb_salt',
'bbb_host',
'bbb_tool_enable',
'enable_global_conference',
'enable_conference_in_course_groups',
'bbb_plugin',
'bbb_plugin_host',
'bbb_plugin_salt'
];

foreach ($variables as $variable) {
$sql = "DELETE FROM $t_settings WHERE variable = '$variable'";
Database::query($sql);
}

//Old settings deleting just in case
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_options WHERE variable = 'bbb_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_host'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_salt'";
Database::query($sql);

//hack to get rid of Database::query warning (please add c_id...)
// hack to get rid of Database::query warning (please add c_id...)
$sql = "DELETE FROM $t_tool WHERE name = 'bbb' AND c_id != 0";
Database::query($sql);

$t = Database::get_main_table('plugin_bbb_meeting');
$sql = "DROP TABLE IF EXISTS $t";
Database::query($sql);

//Deleting course settings
// Deleting course settings
$this->uninstall_course_fields_in_all_courses($this->course_settings);
}
}

0 comments on commit 92218a8

Please sign in to comment.