Skip to content

Commit

Permalink
v2.1.0-rc2: Fixed a bug in import recording. Recordings from deleted …
Browse files Browse the repository at this point in the history
…activities were not considered.
  • Loading branch information
jfederico committed Jul 13, 2016
1 parent ff9cd71 commit 16d8be1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
10 changes: 4 additions & 6 deletions config-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,12 @@
// recordings from a different activity even from a different course.
//
// When the value is set to 1 (checked) the bigbluebuttonbn rooms or
// activities will have the 'import recordings' capability enabled by
// default.
$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_default = 0;
// activities will have the 'import recordings' capability enabled.
$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled = 0;

// When the value is set to 1 (checked) the import recordings capability
// can be enabled/disabled by the user creating or editing the room or
// activity.
$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_editable = 0;
// can import recordings from deleted activities.
$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled = 0;


//=========================================================================
Expand Down
2 changes: 2 additions & 0 deletions lang/en/bigbluebuttonbn.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
$string['config_feature_importrecordings_description'] = 'These settings are feature specific';
$string['config_feature_importrecordings_enabled'] = 'Import recordings enabled';
$string['config_feature_importrecordings_enabled_description'] = 'When this and the recording feature are enabled, it is possible to import recordings from different courses into an activity.';
$string['config_feature_importrecordings_from_deleted_activities_enabled'] = 'Import recordings from deleted activities enabled';
$string['config_feature_importrecordings_from_deleted_activities_enabled_description'] = 'When this and the import recording feature are enabled, it is possible to import recordings from activities that are no longer in the course.';

$string['config_feature_waitformoderator'] = 'Configuration for "Wait for moderator" feature';
$string['config_feature_waitformoderator_description'] = 'These settings are feature specific';
Expand Down
11 changes: 11 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@ function bigbluebuttonbn_get_cfg_importrecordings_enabled() {
return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_enabled)? $CFG->bigbluebuttonbn_importrecordings_enabled: false));
}

function bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() {
global $BIGBLUEBUTTONBN_CFG, $CFG;
return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: false));
}

function bigbluebuttonbn_get_cfg_waitformoderator_default() {
global $BIGBLUEBUTTONBN_CFG, $CFG;
return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default: (isset($CFG->bigbluebuttonbn_waitformoderator_default)? $CFG->bigbluebuttonbn_waitformoderator_default: false));
Expand Down Expand Up @@ -1499,6 +1504,12 @@ function bigbluebuttonbn_getRecordingsArrayByCourse($courseID, $URL, $SALT) {
$meetingID = '';
if ( is_numeric($courseID) ) {
$results = bigbluebuttonbn_getRecordedMeetings($courseID);

if( bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() ) {
$results_deleted = bigbluebuttonbn_getRecordedMeetingsDeleted($courseID);
$results = array_merge($results, $results_deleted);
}

if( $results ) {
//Eliminates duplicates
$mIDs = array();
Expand Down
22 changes: 16 additions & 6 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,26 @@
}

//// Configuration for 'import recordings' feature
if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ) {
if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ||
!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) {
$settings->add( new admin_setting_heading('bigbluebuttonbn_importrecordings',
get_string('config_feature_importrecordings', 'bigbluebuttonbn'),
get_string('config_feature_importrecordings_description', 'bigbluebuttonbn')));

// default value for 'import recordings' feature
$settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_enabled',
get_string('config_feature_importrecordings_enabled', 'bigbluebuttonbn'),
get_string('config_feature_importrecordings_enabled_description', 'bigbluebuttonbn'),
0));
if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ) {
// default value for 'import recordings' feature
$settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_enabled',
get_string('config_feature_importrecordings_enabled', 'bigbluebuttonbn'),
get_string('config_feature_importrecordings_enabled_description', 'bigbluebuttonbn'),
0));
}
if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) {
// consider deleted activities for 'import recordings' feature
$settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_from_deleted_activities_enabled',
get_string('config_feature_importrecordings_from_deleted_activities_enabled', 'bigbluebuttonbn'),
get_string('config_feature_importrecordings_from_deleted_activities_enabled_description', 'bigbluebuttonbn'),
0));
}
}

//// Configuration for wait for moderator feature
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2016051902;
$plugin->version = 2016051903;
$plugin->requires = 2013111800;
$plugin->cron = 0;
$plugin->component = 'mod_bigbluebuttonbn';
Expand Down

0 comments on commit 16d8be1

Please sign in to comment.