Merge branch 'MDL-87458-501' of https://github.com/jfederico/moodle into MOODLE_501_STABLE
This commit is contained in:
@@ -54,9 +54,9 @@ class reset {
|
||||
true
|
||||
);
|
||||
if ($recordings) {
|
||||
// Remove all the recordings.
|
||||
// Remove all the recordings locally only (do NOT delete from BBB server).
|
||||
foreach ($recordings as $recording) {
|
||||
$recording->delete();
|
||||
$recording->set_skip_remote_deletion(true)->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,9 @@ class recording extends persistent {
|
||||
/** @var bool Whether metadata been changed so the remote information needs to be updated ? */
|
||||
protected $metadatachanged = false;
|
||||
|
||||
/** @var bool When true, skip remote BBB deletion in before_delete(). */
|
||||
protected $skipremotedeletion = false;
|
||||
|
||||
/** @var int A refresh period for recordings, defaults to 300s (5mins) */
|
||||
public const RECORDING_REFRESH_DEFAULT_PERIOD = 300;
|
||||
|
||||
@@ -436,6 +439,10 @@ class recording extends persistent {
|
||||
* @return void
|
||||
*/
|
||||
protected function before_delete() {
|
||||
if ($this->skipremotedeletion) {
|
||||
return;
|
||||
}
|
||||
|
||||
$recordid = $this->get('recordingid');
|
||||
if ($recordid && !$this->get('imported')) {
|
||||
recording_proxy::delete_recording($recordid);
|
||||
@@ -445,6 +452,18 @@ class recording extends persistent {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark this recording so that delete() only removes the local DB row
|
||||
* and does NOT delete the recording from the BigBlueButton server.
|
||||
*
|
||||
* @param bool $skipremote
|
||||
* @return $this
|
||||
*/
|
||||
public function set_skip_remote_deletion(bool $skipremote = true): self {
|
||||
$this->skipremotedeletion = $skipremote;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name
|
||||
*
|
||||
|
||||
@@ -70,7 +70,7 @@ $string['resettags'] = 'Delete tags';
|
||||
$string['resetlogs'] = 'Delete custom logs';
|
||||
$string['resetrecordings'] = 'Delete recordings';
|
||||
$string['resetlogs_help'] = 'Deleting the logs will result in lost references to recordings.';
|
||||
$string['resetrecordings_help'] = 'Deleting the recordings will make them inaccessible from anywhere. This action cannot be undone!';
|
||||
$string['resetrecordings_help'] = 'Deleting the recordings will remove them from this course. The media stored on the BigBlueButton server are not affected.';
|
||||
|
||||
$string['search:activity'] = 'BigBlueButton - activity information';
|
||||
$string['search:tags'] = 'BigBlueButton - tags information';
|
||||
@@ -537,7 +537,7 @@ $string['view_conference_action_end'] = 'End session';
|
||||
$string['view_recording'] = 'recording';
|
||||
$string['view_recording_link'] = 'imported link';
|
||||
$string['view_recording_link_warning'] = 'This is a link pointing to a recording that was created in a different course or activity.';
|
||||
$string['view_recording_delete_confirmation'] = 'Are you sure you want to delete {$a}?';
|
||||
$string['view_recording_delete_confirmation'] = 'Are you sure you want to permanently delete the {$a}? This will remove the media file from the BigBlueButton server and cannot be undone.';
|
||||
$string['view_recording_delete_confirmation_warning_s'] = 'This recording has {$a} link associated that was imported into a different course or activity. If the recording is deleted, this link will also be removed.';
|
||||
$string['view_recording_delete_confirmation_warning_p'] = 'This recording has {$a} links associated that were imported into different courses or activities. If the recording is deleted, these links will also be removed.';
|
||||
$string['view_recording_publish_confirmation'] = 'Are you sure you want to publish this {$a}?';
|
||||
|
||||
Reference in New Issue
Block a user