Skip to content

Commit 109371b

Browse files
committed
Plugins - Zoom - Change setting enableCloudRecording
In order to use the zoom settings: local, cloud, none BT#17288
1 parent 930aea2 commit 109371b

File tree

7 files changed

+41
-10
lines changed

7 files changed

+41
-10
lines changed

plugin/zoom/Entity/Meeting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ public function requiresRegistration()
498498
*/
499499
public function hasCloudAutoRecordingEnabled()
500500
{
501-
return 'cloud' === $this->meetingInfoGet->settings->auto_recording;
501+
return \ZoomPlugin::RECORDING_TYPE_NONE !== $this->meetingInfoGet->settings->auto_recording;
502502
}
503503

504504
/**

plugin/zoom/lang/english.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$strings['apiSecret'] = 'API Secret';
1111
$strings['verificationToken'] = 'Verification Token';
1212
$strings['enableParticipantRegistration'] = 'Enable participant registration';
13-
$strings['enableCloudRecording'] = 'Enable cloud recording';
13+
$strings['enableCloudRecording'] = 'Automatic recording type';
1414
$strings['enableGlobalConference'] = 'Enable global conference';
1515
$strings['enableGlobalConferencePerUser'] = 'Enable global conference per user';
1616
$strings['globalConferenceAllowRoles'] = "Global conference link only visible for these user roles";

plugin/zoom/lang/french.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$strings['apiKey'] = "Clé d'API (<em>API Key</em>)";
1010
$strings['apiSecret'] = "Code secret d'API (<em>API Secret</em>)";
1111
$strings['enableParticipantRegistration'] = "Activer l'inscription des participants";
12-
$strings['enableCloudRecording'] = "Activer l'enregistrement sur les serveurs de Zoom";
12+
$strings['enableCloudRecording'] = "Type d'enregistrement automatique";
1313
$strings['enableGlobalConference'] = "Activer les conférences globales";
1414
$strings['enableGlobalConferencePerUser'] = "Activer les conférences globales par utilisateur";
1515
$strings['globalConferenceAllowRoles'] = "Visibilité du lien de vidéo conférence global pour les profils suivant";

plugin/zoom/lang/spanish.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$strings['apiKey'] = "Clave API (<em>API Key</em>)";
1010
$strings['apiSecret'] = "Código secreto de API (<em>API Secret</em>)";
1111
$strings['enableParticipantRegistration'] = "Activar la inscripción de participantes";
12-
$strings['enableCloudRecording'] = "Activar la grabación en los servidores de Zoom";
12+
$strings['enableCloudRecording'] = "Tipo de grabación automática";
1313
$strings['enableGlobalConference'] = "Activar las conferencias globales";
1414
$strings['enableGlobalConferencePerUser'] = "Activar las conferencias globales por usuario";
1515
$strings['globalConferenceAllowRoles'] = "Visibilidad del enlace global de videoconferencia para los perfiles siguientes";

plugin/zoom/lib/ZoomPlugin.php

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class ZoomPlugin extends Plugin
3636
*/
3737
private $jwtClient;
3838

39+
const RECORDING_TYPE_CLOUD = 'cloud';
40+
const RECORDING_TYPE_LOCAL = 'local';
41+
const RECORDING_TYPE_NONE = 'none';
42+
3943
/**
4044
* ZoomPlugin constructor.
4145
* {@inheritdoc}
@@ -44,15 +48,22 @@ class ZoomPlugin extends Plugin
4448
public function __construct()
4549
{
4650
parent::__construct(
47-
'0.2',
51+
'0.3',
4852
'Sébastien Ducoulombier, Julio Montoya',
4953
[
5054
'tool_enable' => 'boolean',
5155
'apiKey' => 'text',
5256
'apiSecret' => 'text',
5357
'verificationToken' => 'text',
5458
'enableParticipantRegistration' => 'boolean',
55-
'enableCloudRecording' => 'boolean',
59+
'enableCloudRecording' => [
60+
'type' => 'select',
61+
'options' => [
62+
self::RECORDING_TYPE_CLOUD => 'Cloud',
63+
self::RECORDING_TYPE_LOCAL => 'Local',
64+
self::RECORDING_TYPE_NONE => get_lang('None'),
65+
],
66+
],
5667
'enableGlobalConference' => 'boolean',
5768
'globalConferenceAllowRoles' => [
5869
'type' => 'select',
@@ -1273,8 +1284,7 @@ private function createMeetingFromMeeting($meeting)
12731284

12741285
$meeting->getMeetingInfoGet()->settings->contact_email = $currentUser->getEmail();
12751286
$meeting->getMeetingInfoGet()->settings->contact_name = $currentUser->getFullname();
1276-
$recording = 'true' === $this->get('enableCloudRecording') ? 'cloud' : 'local';
1277-
$meeting->getMeetingInfoGet()->settings->auto_recording = $recording;
1287+
$meeting->getMeetingInfoGet()->settings->auto_recording = $this->getRecordingSetting();
12781288
$meeting->getMeetingInfoGet()->settings->registrants_email_notification = false;
12791289

12801290
//$meeting->getMeetingInfoGet()->host_email = $currentUser->getEmail();
@@ -1289,6 +1299,25 @@ private function createMeetingFromMeeting($meeting)
12891299
return $meeting;
12901300
}
12911301

1302+
public function getRecordingSetting()
1303+
{
1304+
$recording = (string) $this->get('enableCloudRecording');
1305+
1306+
if (in_array($recording, [self::RECORDING_TYPE_LOCAL, self::RECORDING_TYPE_CLOUD], true)) {
1307+
1308+
return $recording;
1309+
}
1310+
1311+
return self::RECORDING_TYPE_NONE;
1312+
}
1313+
1314+
public function hasRecordingAvailable()
1315+
{
1316+
$recording = $this->getRecordingSetting();
1317+
1318+
return self::RECORDING_TYPE_NONE !== $recording;
1319+
}
1320+
12921321
/**
12931322
* @throws Exception
12941323
*

plugin/zoom/meeting.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
}
6666
}
6767

68-
if ('true' === $plugin->get('enableCloudRecording') && $meeting->hasCloudAutoRecordingEnabled()) {
68+
if (ZoomPlugin::RECORDING_TYPE_NONE !== $plugin->getRecordingSetting() &&
69+
$meeting->hasCloudAutoRecordingEnabled()
70+
) {
6971
$tpl->assign('fileForm', $plugin->getFileForm($meeting, $returnURL)->returnForm());
7072
$tpl->assign('recordings', $meeting->getRecordings());
7173
}

plugin/zoom/meetings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
$scheduleForm = $plugin->getScheduleMeetingForm($user);
2121
$tpl = new Template();
2222
$tpl->assign('meetings', $plugin->getMeetingRepository()->periodUserMeetings($startDate, $endDate, $user));
23-
$tpl->assign('allow_recording', 'true' === $plugin->get('enableCloudRecording'));
23+
$tpl->assign('allow_recording', $plugin->hasRecordingAvailable());
2424
$tpl->assign('actions', $plugin->getToolbar());
2525
$tpl->assign('search_form', $form->returnForm());
2626
$tpl->assign('schedule_form', $scheduleForm->returnForm());

0 commit comments

Comments
 (0)