From 9feff2d04b49069a513ddf02faba9d3e20baec00 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 6 Aug 2020 12:01:40 +0200 Subject: [PATCH] Minor - Plugins: Zoom - Fix links BT#17288 --- plugin/zoom/lib/ZoomPlugin.php | 87 ++++++++++++++++++---------------- plugin/zoom/meeting.php | 6 ++- plugin/zoom/meetings.php | 1 + plugin/zoom/view/meeting.tpl | 61 ++++++++++++++---------- 4 files changed, 86 insertions(+), 69 deletions(-) diff --git a/plugin/zoom/lib/ZoomPlugin.php b/plugin/zoom/lib/ZoomPlugin.php index d077d08c98..9b9fce46aa 100644 --- a/plugin/zoom/lib/ZoomPlugin.php +++ b/plugin/zoom/lib/ZoomPlugin.php @@ -139,15 +139,18 @@ class ZoomPlugin extends Plugin public function getProfileBlockItems() { $elements = $this->meetingsToWhichCurrentUserIsRegisteredComingSoon(); - /*if (self::currentUserCanJoinGlobalMeeting()) { - $elements[$this->get_lang('CreateGlobalVideoConference')] = api_get_path(WEB_PLUGIN_PATH).'zoom/global.php'; + $addMeetingLink = false; + if (self::currentUserCanJoinGlobalMeeting()) { + $addMeetingLink = true; } if (self::currentUserCanCreateUserMeeting()) { - $elements[$this->get_lang('CreateUserVideoConference')] = api_get_path(WEB_PLUGIN_PATH).'zoom/user.php'; - }*/ + $addMeetingLink = true; + } - $elements[$this->get_lang('Meetings')] = api_get_path(WEB_PLUGIN_PATH).'zoom/meetings.php'; + if ($addMeetingLink) { + $elements[$this->get_lang('Meetings')] = api_get_path(WEB_PLUGIN_PATH).'zoom/meetings.php'; + } $items = []; foreach ($elements as $title => $link) { @@ -892,7 +895,7 @@ class ZoomPlugin extends Plugin $durationNumeric = $form->addNumeric('duration', $this->get_lang('DurationInMinutes')); $form->setRequired($durationNumeric); - /*if (null === $course) { + if (null === $course) { $options = []; if ('true' === $this->get('enableGlobalConference')) { $options['everyone'] = $this->get_lang('ForEveryone'); @@ -914,41 +917,42 @@ class ZoomPlugin extends Plugin $form->addHidden('type', 'course'); } - // $passwordText = $form->addText('password', get_lang('Password'), false, ['maxlength' => '10']); - if (null !== $course) { - $registrationOptions = [ - 'RegisterAllCourseUsers' => $this->get_lang('RegisterAllCourseUsers'), - ]; - $groups = GroupManager::get_groups(); - if (!empty($groups)) { - $registrationOptions['RegisterTheseGroupMembers'] = get_lang('RegisterTheseGroupMembers'); - } - $registrationOptions['RegisterNoUser'] = $this->get_lang('RegisterNoUser'); - $userRegistrationRadio = $form->addRadio( - 'userRegistration', - $this->get_lang('UserRegistration'), - $registrationOptions - ); - $groupOptions = []; - foreach ($groups as $group) { - $groupOptions[$group['id']] = $group['name']; - } - $groupIdsSelect = $form->addSelect( - 'groupIds', - $this->get_lang('RegisterTheseGroupMembers'), - $groupOptions - ); - $groupIdsSelect->setMultiple(true); - if (!empty($groups)) { - $jsCode = sprintf( - "getElementById('%s').parentNode.parentNode.parentNode.style.display = getElementById('%s').checked ? 'block' : 'none'", - $groupIdsSelect->getAttribute('id'), - $userRegistrationRadio->getelements()[1]->getAttribute('id') - ); - - $form->setAttribute('onchange', $jsCode); - } - }*/ + /* + // $passwordText = $form->addText('password', get_lang('Password'), false, ['maxlength' => '10']); + if (null !== $course) { + $registrationOptions = [ + 'RegisterAllCourseUsers' => $this->get_lang('RegisterAllCourseUsers'), + ]; + $groups = GroupManager::get_groups(); + if (!empty($groups)) { + $registrationOptions['RegisterTheseGroupMembers'] = get_lang('RegisterTheseGroupMembers'); + } + $registrationOptions['RegisterNoUser'] = $this->get_lang('RegisterNoUser'); + $userRegistrationRadio = $form->addRadio( + 'userRegistration', + $this->get_lang('UserRegistration'), + $registrationOptions + ); + $groupOptions = []; + foreach ($groups as $group) { + $groupOptions[$group['id']] = $group['name']; + } + $groupIdsSelect = $form->addSelect( + 'groupIds', + $this->get_lang('RegisterTheseGroupMembers'), + $groupOptions + ); + $groupIdsSelect->setMultiple(true); + if (!empty($groups)) { + $jsCode = sprintf( + "getElementById('%s').parentNode.parentNode.parentNode.style.display = getElementById('%s').checked ? 'block' : 'none'", + $groupIdsSelect->getAttribute('id'), + $userRegistrationRadio->getelements()[1]->getAttribute('id') + ); + + $form->setAttribute('onchange', $jsCode); + } + }*/ $form->addButtonCreate(get_lang('Save')); @@ -1329,7 +1333,6 @@ class ZoomPlugin extends Plugin $actionsLeft = ''; $back = ''; $courseId = api_get_course_id(); - if (empty($courseId)) { $actionsLeft .= Display::url( diff --git a/plugin/zoom/meeting.php b/plugin/zoom/meeting.php index c1ca471007..aa4031b76b 100755 --- a/plugin/zoom/meeting.php +++ b/plugin/zoom/meeting.php @@ -21,11 +21,12 @@ if (null === $meeting) { $course_plugin = 'zoom'; // needed in order to load the plugin lang variables $returnURL = 'meetings.php'; - +$urlExtra = ''; if ($meeting->isCourseMeeting()) { api_protect_course_script(true); $this_section = SECTION_COURSES; - $returnURL = 'start.php?cId='.api_get_course_id().'&sessionId='.api_get_session_id(); + $returnURL = 'start.php?'.api_get_cidreq(); + $urlExtra = api_get_cidreq(); } $logInfo = [ @@ -75,5 +76,6 @@ if ($plugin->userIsConferenceManager($meeting)) { $tpl->assign('actions', $plugin->getToolbar()); $tpl->assign('meeting', $meeting); +$tpl->assign('url_extra', $urlExtra); $tpl->assign('content', $tpl->fetch('zoom/view/meeting.tpl')); $tpl->display_one_col_template(); diff --git a/plugin/zoom/meetings.php b/plugin/zoom/meetings.php index c4567308fa..4fe5bb7348 100644 --- a/plugin/zoom/meetings.php +++ b/plugin/zoom/meetings.php @@ -4,6 +4,7 @@ $course_plugin = 'zoom'; // needed in order to load the plugin lang variables +$cidReset = true; require_once __DIR__.'/config.php'; if (!ZoomPlugin::currentUserCanCreateUserMeeting()) { diff --git a/plugin/zoom/view/meeting.tpl b/plugin/zoom/view/meeting.tpl index d380b8f054..b2432f22f6 100644 --- a/plugin/zoom/view/meeting.tpl +++ b/plugin/zoom/view/meeting.tpl @@ -5,7 +5,7 @@
{% if meeting.meetingInfoGet.status != 'finished' %} - + {{ 'ViewMeeting'|get_plugin_lang('ZoomPlugin') }} {% endif %} @@ -17,12 +17,36 @@ {% endif %} - + {{ 'Activity'|get_plugin_lang('ZoomPlugin') }} {% endif %} -
+ +{% if isConferenceManager %} +
+
+
+
+ +
+
+ + +
+
+
+
+{% endif %} + {% if currentUserJoinURL %} {#

#} {# #} @@ -31,19 +55,6 @@ {#

#} {% endif %} -{% if meeting.meetingInfoGet.settings.approval_type == 2 %} - -
-
- -
-
-{% endif %} - {% if isConferenceManager %} {{ editMeetingForm }} {{ deleteMeetingForm }} @@ -73,15 +84,15 @@ {{ registrant.fullName }} - {% if registrant.joinUrl %} -
- {{ 'CopyJoinAsURL'|get_plugin_lang('ZoomPlugin') }} - - {% else %} - - {{ 'JoinURLNotAvailable'|get_plugin_lang('ZoomPlugin') }} - - {% endif %} +{# {% if registrant.joinUrl %}#} +{# #} +{# {{ 'CopyJoinAsURL'|get_plugin_lang('ZoomPlugin') }}#} +{# #} +{# {% else %}#} +{# #} +{# {{ 'JoinURLNotAvailable'|get_plugin_lang('ZoomPlugin') }}#} +{# #} +{# {% endif %}#} {% endfor %}