From 4ecd78f42b2dcc66f37b78142be7cb3ac08dddbe Mon Sep 17 00:00:00 2001 From: DFNVC <git@vc.dfn.de> Date: Fri, 3 Mar 2017 14:33:07 +0100 Subject: [PATCH] =?UTF-8?q?Informationen=20=C3=BCber=20Aufzeichnungen=20we?= =?UTF-8?q?rden=20ausf=C3=BChrlich=20angezeigt.=20Moodle-Nutzer=20mit=20de?= =?UTF-8?q?r=20Rolle=20Meeting=20Host=20k=C3=B6nnen=20Aufzeichnungen=20unt?= =?UTF-8?q?er=20Windows=20ausf=C3=BChren.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- joinrecording.php | 92 +++++++++++++++- lang/de/adobeconnect.php | 24 +++- lang/de/help/adobeconnect/meeturl.html | 2 +- lang/en/adobeconnect.php | 19 ++++ lang/en/help/adobeconnect/meetingtype.html | 2 +- lang/en/help/adobeconnect/meeturl.html | 2 +- lang/en/help/adobeconnect/mods.html | 2 +- lang/en/help/adobeconnect/templatescoid.html | 2 +- lang/it/help/adobeconnect/meetingtype.html | 2 +- lang/it/help/adobeconnect/meeturl.html | 2 +- lang/it/help/adobeconnect/mods.html | 2 +- lang/it/help/adobeconnect/templatescoid.html | 2 +- renderer.php | 110 ++++++++++--------- 13 files changed, 197 insertions(+), 66 deletions(-) diff --git a/joinrecording.php b/joinrecording.php index 0e8818a..80ddbb0 100644 --- a/joinrecording.php +++ b/joinrecording.php @@ -18,6 +18,7 @@ $id = required_param('id', PARAM_INT); $groupid = required_param('groupid', PARAM_INT); // DFNVC $recordingscoid = required_param('recording', PARAM_INT); +$convert = optional_param('convert', null, PARAM_INT); global $CFG, $USER, $DB; @@ -57,6 +58,7 @@ if (isset($CFG->adobeconnect_email_login) and !empty($CFG->adobeconnect_email_lo } $login = $usrobj->username; + //$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port, // '', '', '', $https); $aconnect = aconnect_login(); @@ -77,6 +79,89 @@ $sql = "SELECT meetingscoid FROM {adobeconnect_meeting_groups} amg WHERE ". //$meetscoids = $DB->get_record_sql($sql, $params); $meetscoid = $DB->get_record_sql($sql, $params); +// +// DFNVC +// In order to access recordings, users have to be affiliated to the meetings +// participant list even if they have not attended the meeting before. +// +$usrprincipal = 0; +$validuser = true; +$groupobj = groups_get_group($groupid); + +// Get the meeting sco-id +$param = array('instanceid' => $cm->instance, 'groupid' => $groupid); +$meetingscoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid', $param); + +$aconnect = aconnect_login(); + +// Check if the meeting still exists on the Adobe server +$meetfldscoid = aconnect_get_meeting_folder($aconnect); + +$filter = array('filter-sco-id' => $meetingscoid); +$meeting = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter); + +if (!empty($meeting)) { + $meeting = current($meeting); +} + +if (!($usrprincipal = lms_user_exists($aconnect, $usrobj))) { + if (!($usrprincipal = aconnect_create_user($aconnect, $usrobj))) { + print_object("error creating user"); + print_object($aconnect->_xmlresponse); + $validuser = false; + } +} + +$context = get_context_instance(CONTEXT_MODULE, $id); + +if (!empty($meetscoid) and !empty($usrprincipal) and !empty($meeting)) { + if (has_capability('mod/adobeconnect:meetinghost', $context, $usrobj->id, false)) { + if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_HOST, true)) { + } else { + print_object('error assign user adobe host role'); + print_object($usrprincipal); + print_object($meetingscoid); + print_object($aconnect->_xmlrequest); + print_object($aconnect->_xmlresponse); + $validuser = false; + } + } elseif (has_capability('mod/adobeconnect:meetingpresenter', $context, $usrobj->id, false)) { + if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PRESENTER, true)) { + } else { + print_object('error assign user adobe presenter role'); + print_object($aconnect->_xmlrequest); + print_object($aconnect->_xmlresponse); + $validuser = false; + } + } elseif (has_capability('mod/adobeconnect:meetingparticipant', $context, $usrobj->id, false)) { + if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true)) { + } else { + print_object('error assign user adobe particpant role'); + print_object($aconnect->_xmlrequest); + print_object($aconnect->_xmlresponse); + $validuser = false; + } + } else { + // Check if meeting is public and allow them to join + if ($adobeconnect->meetingpublic) { + // if for a public meeting the user does not not have either of presenter or participant capabilities then give + // the user the participant role for the meeting + aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true); + $validuser = true; + } else { + $validuser = false; + } + } +} else { + $validuser = false; + notice(get_string('unableretrdetails', 'adobeconnect')); +} + +// +// DFNVC END +// + + // Get the Meeting recording details $aconnect = aconnect_login(); $recording = array(); @@ -133,4 +218,9 @@ if (!empty($CFG->adobeconnect_port) and (80 != $CFG->adobeconnect_port)) { //redirect($protocol . $CFG->adobeconnect_meethost . $port // . $recording->url . '?session=' . $adobesession); // DFNVC -redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?session=' . $user_session_cookie); +if ($convert == 'true') { + redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?pbMode=offline&session=' . $user_session_cookie); +} +else { + redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?session=' . $user_session_cookie); +} diff --git a/lang/de/adobeconnect.php b/lang/de/adobeconnect.php index 1d92628..d129f1f 100644 --- a/lang/de/adobeconnect.php +++ b/lang/de/adobeconnect.php @@ -61,6 +61,19 @@ $string['presenterlabel'] = 'Moderator'; $string['recordinghdr'] = 'Meeting-Aufzeichnung'; $string['record_force'] = 'Meeting-Aufzeichnung erzwingen'; $string['record_force_desc'] = 'Alle Meetings aufzeichnen. Dies ist eine Einstellung für den gesamten Adobe Connect Server. Der Server muss dazu neu gestartet werden. '; +$string['record_convert'] = 'Konvertieren'; +$string['record_convert_help'] = 'Hilfe: Konvertieren von Aufzeichnungen'; +$string['convert_recording_help'] = '<h2>Konvertierung von Adobe Connect Aufzeichnungen</h2> +<p> +Adobe-Connect-Aufzeichnungen können unter Windows in FLV oder MP4-Videos umgewandelt werden,<br> +falls die aktuelle Flash-Version und das Adobe-Connect-Add-In installiert sind.<br> +Außerdem muss dem Moodle-Nutzer, der die Konvertierung durchführen will, die Rolle<br> +Adobe Connect Host zugewiesen werden. +</p> +<p> +Die Konvertierungsdauer entspricht immer der Länge der Aufzeichnung, da ein Download<br> +der Original-Aufzeichnungen unter Adobe Connect nicht möglich ist. +</p>'; $string['removeparticipant'] = 'Entfernen'; $string['removepresenter'] = 'Entfernen'; @@ -81,6 +94,13 @@ $string['adobeconnect:meetingparticipant'] = 'Teilnehmer'; $string['adobeconnect:meetinghost'] = 'Veranstalter'; $string['public'] = 'Öffentlich'; $string['private'] = 'Privat'; + +$string['duration'] = 'Dauer'; +$string['action'] = 'Aktion'; + + + + // // Fehlermeldungen // @@ -140,7 +160,7 @@ $string['meettemplates_help'] = '<p>Eine Vorlage für einen Meeting-Raum erzeugt $string['pluginadministration'] = 'Adobe Connect Administration'; $string['pluginname'] = 'Adobe Connect'; $string['modulename'] = 'Adobe Connect'; -$string['recordinghdr'] = 'Aufzeichungen'; +$string['recordinghdr'] = 'Aufzeichnungen'; $string['https'] = 'HTTPS-Verbindung'; $string['https_desc'] = 'Verbindung zum Connect-Server über HTTPS'; $string['invalidurl'] = 'Die URL muss mit einem Buchstaben beginnen (a-z)'; @@ -168,4 +188,4 @@ nur für diese Gruppe angelegt wurde. '; -?> \ No newline at end of file +?> diff --git a/lang/de/help/adobeconnect/meeturl.html b/lang/de/help/adobeconnect/meeturl.html index 0ff03a5..08e18ea 100644 --- a/lang/de/help/adobeconnect/meeturl.html +++ b/lang/de/help/adobeconnect/meeturl.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting URL</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting URL</b></p> <div class="indent"> <p>Sie können die URL anpassen, die für das Adobe Connect Meeting verwendet werden soll. Die Server-Domain bleibt immer die gleiche. Der letzte Teil der URL kann angepasst werden. diff --git a/lang/en/adobeconnect.php b/lang/en/adobeconnect.php index 9bcc240..e7bdf88 100644 --- a/lang/en/adobeconnect.php +++ b/lang/en/adobeconnect.php @@ -62,6 +62,20 @@ $string['presenterlabel'] = 'Presenter'; $string['recordinghdr'] = 'Meeting Recordings'; $string['record_force'] = 'Force Meeting Recordings'; $string['record_force_desc'] = 'Force all Adobe Connect meetings to be recorded. This is a site wide effect and the Adobe Connect server must be restarted'; +$string['record_convert'] = 'Convert'; +$string['record_convert_help'] = 'Help: Converting Recordings'; +$string['convert_recording_help'] = '<h2>Converting Adobe Connect Recordings</h2> +<p> +Adobe Connect recordings can be converted with Windows into FLV or MP4 videos<br> +if an up to date Flash version and the Adobe Connect-Add-In are installed.<br> +In addition the moodle user who wants to convert the recording must be granted<br> +the Adobe Connect Host role.<br> +</p> +<p> +The conversion duration eqates to the length of the recording becaus it is<br> +not possible to download the original Adobe Connect recording in advance. +</p>'; + $string['removeparticipant'] = 'Remove'; $string['removepresenter'] = 'Remove'; $string['roletoassign'] = 'Role to assign'; @@ -85,6 +99,11 @@ $string['adobeconnect:meetinghost'] = 'Meeting Host'; $string['public'] = 'Public'; $string['private'] = 'Private'; +$string['duration'] = 'Duration'; +$string['action'] = 'Action'; + + + // Error codes $string['emptyxml'] = 'Unable to connect to the Adobe Connect Pro server at this time. Please inform your Moodle administrator.'; $string['adminemptyxml'] = 'Unable to connect to the Adobe Connect Pro server at this time. Click continue to proceed to the activity settings page and test the connection'; diff --git a/lang/en/help/adobeconnect/meetingtype.html b/lang/en/help/adobeconnect/meetingtype.html index b5f7671..557f727 100644 --- a/lang/en/help/adobeconnect/meetingtype.html +++ b/lang/en/help/adobeconnect/meetingtype.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting Type</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting Type</b></p> <div class="indent"> <p>A public meeting type is one where anyone who has the URL for the meeting can enter the room.</p> <p>A private meeting type is one where only registered users and participants can enter. The login page does not allow diff --git a/lang/en/help/adobeconnect/meeturl.html b/lang/en/help/adobeconnect/meeturl.html index c3ab510..e034efe 100644 --- a/lang/en/help/adobeconnect/meeturl.html +++ b/lang/en/help/adobeconnect/meeturl.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting URL</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting URL</b></p> <div class="indent"> <p>You can customize the URL that is used to connect to the Adobe connect meeting. The Adobe Server domain will always remain the same. However the last part of the URL can be customized. diff --git a/lang/en/help/adobeconnect/mods.html b/lang/en/help/adobeconnect/mods.html index 3949d20..06909f0 100644 --- a/lang/en/help/adobeconnect/mods.html +++ b/lang/en/help/adobeconnect/mods.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Adobe Connect</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Adobe Connect</b></p> <div class="indent"> <p>The Adobe Connect Pro activity module provides the officially sponsored integration method between Moodle and Adobe Connect Pro. It was developed in conjunction with the Remote-Learner diff --git a/lang/en/help/adobeconnect/templatescoid.html b/lang/en/help/adobeconnect/templatescoid.html index 238cb19..e7ef61f 100644 --- a/lang/en/help/adobeconnect/templatescoid.html +++ b/lang/en/help/adobeconnect/templatescoid.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting Template</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting Template</b></p> <div class="indent"> <p>A meeting room template creates meeting with a custom layout for the meeting room.</p> </div> diff --git a/lang/it/help/adobeconnect/meetingtype.html b/lang/it/help/adobeconnect/meetingtype.html index b5f7671..557f727 100644 --- a/lang/it/help/adobeconnect/meetingtype.html +++ b/lang/it/help/adobeconnect/meetingtype.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting Type</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting Type</b></p> <div class="indent"> <p>A public meeting type is one where anyone who has the URL for the meeting can enter the room.</p> <p>A private meeting type is one where only registered users and participants can enter. The login page does not allow diff --git a/lang/it/help/adobeconnect/meeturl.html b/lang/it/help/adobeconnect/meeturl.html index c3ab510..e034efe 100644 --- a/lang/it/help/adobeconnect/meeturl.html +++ b/lang/it/help/adobeconnect/meeturl.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting URL</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting URL</b></p> <div class="indent"> <p>You can customize the URL that is used to connect to the Adobe connect meeting. The Adobe Server domain will always remain the same. However the last part of the URL can be customized. diff --git a/lang/it/help/adobeconnect/mods.html b/lang/it/help/adobeconnect/mods.html index 3949d20..06909f0 100644 --- a/lang/it/help/adobeconnect/mods.html +++ b/lang/it/help/adobeconnect/mods.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Adobe Connect</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Adobe Connect</b></p> <div class="indent"> <p>The Adobe Connect Pro activity module provides the officially sponsored integration method between Moodle and Adobe Connect Pro. It was developed in conjunction with the Remote-Learner diff --git a/lang/it/help/adobeconnect/templatescoid.html b/lang/it/help/adobeconnect/templatescoid.html index 238cb19..e7ef61f 100644 --- a/lang/it/help/adobeconnect/templatescoid.html +++ b/lang/it/help/adobeconnect/templatescoid.html @@ -1,4 +1,4 @@ -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" /> <b>Meeting Template</b></p> +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" /> <b>Meeting Template</b></p> <div class="indent"> <p>A meeting room template creates meeting with a custom layout for the meeting room.</p> </div> diff --git a/renderer.php b/renderer.php index aaac22f..0decc61 100644 --- a/renderer.php +++ b/renderer.php @@ -45,43 +45,27 @@ class mod_adobeconnect_renderer extends plugin_renderer_base { $param = array('class'=>'aconfldset'); $html .= html_writer::start_tag('div', $param); - // DFNVC - // - $table = new html_table(); - $table->attributes['class'] = 'blockstable'; - //$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide'); - - $meet_array = array(array('<b>' . get_string('meetingstart', 'adobeconnect') . ':</b>', $meetingdetail->starttime)); - array_push($meet_array, array('<b>' . get_string('meetingend', 'adobeconnect') . ':</b>', $meetingdetail->endtime)); - array_push($meet_array, array('<b>' . get_string('meeturl', 'adobeconnect') . ':</b>', $meetingdetail->url)); - - $table->data = $meet_array; - $html .= '<center>' . html_writer::table($table) . '</center>'; - - - // Print buttons - $param = array('class' => 'aconbtnrow'); - $html .= html_writer::start_tag('div', $param); - - $param = array('class' => 'aconbtnjoin'); - $html .= html_writer::start_tag('div', $param); - + $table = new html_table(); + $table->attributes['class'] = 'generaltable'; + + // meeting details + $meet_array = array(array('<b>' . get_string('meetingstart', 'adobeconnect') . ':</b>', $meetingdetail->starttime)); + array_push($meet_array, array('<b>' . get_string('meetingend', 'adobeconnect') . ':</b>', $meetingdetail->endtime)); + array_push($meet_array, array('<b>' . get_string('meeturl', 'adobeconnect') . ':</b>', $meetingdetail->url)); + // Join meeting button $param = array('id' => $cmid, 'sesskey' => sesskey(), 'groupid' => 0); $target = new moodle_url('/mod/adobeconnect/join.php', $param); $param = array('type'=>'button', 'value'=>get_string('joinmeeting','adobeconnect'), 'name'=>'btnname', - 'onclick' => 'window.open(\''.$target->out(false).'\', \'btnname\', - \'menubar=0,location=0,scrollbars=0,resizable=0,width=900,height=900\', 0);', - ); - - - $html .= html_writer::empty_tag('input', $param); - $html .= html_writer::end_tag('div'); - - - $html .= html_writer::end_tag('div'); + 'onclick' => 'window.open(\''.$target->out(false).'\', \'btnname\', \'menubar=0,location=0,scrollbars=0,resizable=0,width=900,height=900\', 0);', + ); + $meetingbutton = html_writer::empty_tag('input', $param); + array_push($meet_array,array('',$meetingbutton)); + + $table->data = $meet_array; + $html .= '<center>' . html_writer::table($table) . '</center>'; $html .= html_writer::end_tag('div'); $html .= html_writer::end_tag('form'); @@ -90,7 +74,7 @@ class mod_adobeconnect_renderer extends plugin_renderer_base { } function display_meeting_recording($recordings, $cmid, $groupid, $adobesession) { - global $CFG, $USER; + global $CFG, $USER,$COURSE; $html = ''; $protocol = 'http://'; @@ -104,42 +88,60 @@ class mod_adobeconnect_renderer extends plugin_renderer_base { $protocol = 'https://'; } + $context = context_module::instance($cmid); + $user_is_host = has_capability('mod/adobeconnect:meetinghost', $context); // Display the meeting name field and value $param = array('id' => 'aconfldset2', 'class' => 'aconfldset'); $html .= html_writer::start_tag('div', $param); - - $html .= html_writer::tag('h3', get_string('recordinghdr', 'adobeconnect'), $param); - + $html .= html_writer::tag('h5', get_string('recordinghdr', 'adobeconnect'), $param); $param = array('class' => 'aconrecording'); $html .= html_writer::start_tag('div', $param); + $table = new html_table(); + $table->tablealign = 'center'; + $table->width = '60%'; + $table->head = array(get_string('name'), get_string('starttime','adobeconnect'), get_string('duration','adobeconnect')); + if ($user_is_host) { + array_push($table->head, get_string('action','adobeconnect')); + array_push($table->head, ''); + } foreach ($recordings as $key => $recordinggrp) { if (!empty($recordinggrp)) { foreach($recordinggrp as $recording_scoid => $recording) { - - $param = array('class' => 'aconrecordingrow'); - $html .= html_writer::start_tag('div', $param); - -// $url = $protocol . $CFG->adobeconnect_meethost.$port -// .$recording->url.'?session='.$adobesession; - - $url = 'joinrecording.php?id=' . $cmid . '&recording='. $recording_scoid . - '&groupid='. $groupid . '&sesskey=' . $USER->sesskey; - - $param = array('target' => '_blank'); - $html .= html_writer::link($url, format_string($recording->name), $param); - - $html .= html_writer::end_tag('div'); - + // recording url + $url = '/mod/adobeconnect/joinrecording.php?id=' . $cmid . '&recording='. $recording_scoid . '&groupid='. $groupid . '&sesskey=' . $USER->sesskey; + // recording name + $name = '<img src="/pix/e/insert_edit_video.svg"/> '; + $name .= html_writer::link($url, format_string($recording->name), array('target' => '_blank','title'=>'Play Recording')); + // start date + $startdate = format_string($recording->startdate); + $time = strtotime($startdate); + $startdate = date("d.m.Y H:i:s", $time); + // duration + $duration = format_string($recording->duration); + $duration = gmdate("H:i:s", $duration); + // create initial row + $row = array ($name,$startdate,$duration); + // Display convert button if user has role meeting host in course + $action = ''; + if ($user_is_host) { + $converturl = $url . '&convert=true'; + $param = array('target' => '_blank','title'=>get_string('record_convert','adobeconnect')); + $action = html_writer::link($converturl,get_string('record_convert','adobeconnect'),$param); + array_push($row, $action); + // Help + $param = array('target' => '_blank','title'=>get_string('record_convert_help','adobeconnect')); + $help = html_writer::link("/help.php?component=adobeconnect&identifier=convert_recording&lang=$COURSE->lang", '<img alt="' . get_string('record_convert_help','adobeconnect') . '" src="/pix/help.svg" />', $param); + array_push($row, $help); + } + $table->data[] = $row; } } } - - $html .= html_writer::end_tag('div'); - + $html .= html_writer::table($table); $html .= html_writer::end_tag('div'); return $html; //$html .= html_writer::link($url, get_string('removemychoice','choice')); } -} \ No newline at end of file +} -- GitLab