Commit 4ecd78f42b2dcc66f37b78142be7cb3ac08dddbe

Authored by DFNVC
1 parent 4c84f89750
Exists in master

Informationen über Aufzeichnungen werden ausführlich angezeigt.

Moodle-Nutzer mit der Rolle Meeting Host können Aufzeichnungen
unter Windows ausführen.

Showing 13 changed files with 197 additions and 66 deletions Side-by-side Diff

... ... @@ -18,6 +18,7 @@ $id = required_param('id', PARAM_INT);
18 18 $groupid = required_param('groupid', PARAM_INT);
19 19 // DFNVC
20 20 $recordingscoid = required_param('recording', PARAM_INT);
  21 +$convert = optional_param('convert', null, PARAM_INT);
21 22  
22 23 global $CFG, $USER, $DB;
23 24  
... ... @@ -57,6 +58,7 @@ if (isset($CFG->adobeconnect_email_login) and !empty($CFG->adobeconnect_email_lo
57 58 }
58 59 $login = $usrobj->username;
59 60  
  61 +
60 62 //$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port,
61 63 // '', '', '', $https);
62 64 $aconnect = aconnect_login();
... ... @@ -77,6 +79,89 @@ $sql = "SELECT meetingscoid FROM {adobeconnect_meeting_groups} amg WHERE ".
77 79 //$meetscoids = $DB->get_record_sql($sql, $params);
78 80 $meetscoid = $DB->get_record_sql($sql, $params);
79 81  
  82 +//
  83 +// DFNVC
  84 +// In order to access recordings, users have to be affiliated to the meetings
  85 +// participant list even if they have not attended the meeting before.
  86 +//
  87 +$usrprincipal = 0;
  88 +$validuser = true;
  89 +$groupobj = groups_get_group($groupid);
  90 +
  91 +// Get the meeting sco-id
  92 +$param = array('instanceid' => $cm->instance, 'groupid' => $groupid);
  93 +$meetingscoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid', $param);
  94 +
  95 +$aconnect = aconnect_login();
  96 +
  97 +// Check if the meeting still exists on the Adobe server
  98 +$meetfldscoid = aconnect_get_meeting_folder($aconnect);
  99 +
  100 +$filter = array('filter-sco-id' => $meetingscoid);
  101 +$meeting = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter);
  102 +
  103 +if (!empty($meeting)) {
  104 + $meeting = current($meeting);
  105 +}
  106 +
  107 +if (!($usrprincipal = lms_user_exists($aconnect, $usrobj))) {
  108 + if (!($usrprincipal = aconnect_create_user($aconnect, $usrobj))) {
  109 + print_object("error creating user");
  110 + print_object($aconnect->_xmlresponse);
  111 + $validuser = false;
  112 + }
  113 +}
  114 +
  115 +$context = get_context_instance(CONTEXT_MODULE, $id);
  116 +
  117 +if (!empty($meetscoid) and !empty($usrprincipal) and !empty($meeting)) {
  118 + if (has_capability('mod/adobeconnect:meetinghost', $context, $usrobj->id, false)) {
  119 + if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_HOST, true)) {
  120 + } else {
  121 + print_object('error assign user adobe host role');
  122 + print_object($usrprincipal);
  123 + print_object($meetingscoid);
  124 + print_object($aconnect->_xmlrequest);
  125 + print_object($aconnect->_xmlresponse);
  126 + $validuser = false;
  127 + }
  128 + } elseif (has_capability('mod/adobeconnect:meetingpresenter', $context, $usrobj->id, false)) {
  129 + if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PRESENTER, true)) {
  130 + } else {
  131 + print_object('error assign user adobe presenter role');
  132 + print_object($aconnect->_xmlrequest);
  133 + print_object($aconnect->_xmlresponse);
  134 + $validuser = false;
  135 + }
  136 + } elseif (has_capability('mod/adobeconnect:meetingparticipant', $context, $usrobj->id, false)) {
  137 + if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true)) {
  138 + } else {
  139 + print_object('error assign user adobe particpant role');
  140 + print_object($aconnect->_xmlrequest);
  141 + print_object($aconnect->_xmlresponse);
  142 + $validuser = false;
  143 + }
  144 + } else {
  145 + // Check if meeting is public and allow them to join
  146 + if ($adobeconnect->meetingpublic) {
  147 + // if for a public meeting the user does not not have either of presenter or participant capabilities then give
  148 + // the user the participant role for the meeting
  149 + aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true);
  150 + $validuser = true;
  151 + } else {
  152 + $validuser = false;
  153 + }
  154 + }
  155 +} else {
  156 + $validuser = false;
  157 + notice(get_string('unableretrdetails', 'adobeconnect'));
  158 +}
  159 +
  160 +//
  161 +// DFNVC END
  162 +//
  163 +
  164 +
80 165 // Get the Meeting recording details
81 166 $aconnect = aconnect_login();
82 167 $recording = array();
... ... @@ -133,4 +218,9 @@ if (!empty($CFG->adobeconnect_port) and (80 != $CFG->adobeconnect_port)) {
133 218 //redirect($protocol . $CFG->adobeconnect_meethost . $port
134 219 // . $recording->url . '?session=' . $adobesession);
135 220 // DFNVC
136   -redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?session=' . $user_session_cookie);
  221 +if ($convert == 'true') {
  222 + redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?pbMode=offline&session=' . $user_session_cookie);
  223 +}
  224 +else {
  225 + redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?session=' . $user_session_cookie);
  226 +}
lang/de/adobeconnect.php
... ... @@ -61,6 +61,19 @@ $string['presenterlabel'] = 'Moderator';
61 61 $string['recordinghdr'] = 'Meeting-Aufzeichnung';
62 62 $string['record_force'] = 'Meeting-Aufzeichnung erzwingen';
63 63 $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. ';
  64 +$string['record_convert'] = 'Konvertieren';
  65 +$string['record_convert_help'] = 'Hilfe: Konvertieren von Aufzeichnungen';
  66 +$string['convert_recording_help'] = '<h2>Konvertierung von Adobe Connect Aufzeichnungen</h2>
  67 +<p>
  68 +Adobe-Connect-Aufzeichnungen können unter Windows in FLV oder MP4-Videos umgewandelt werden,<br>
  69 +falls die aktuelle Flash-Version und das Adobe-Connect-Add-In installiert sind.<br>
  70 +Außerdem muss dem Moodle-Nutzer, der die Konvertierung durchführen will, die Rolle<br>
  71 +Adobe Connect Host zugewiesen werden.
  72 +</p>
  73 +<p>
  74 +Die Konvertierungsdauer entspricht immer der Länge der Aufzeichnung, da ein Download<br>
  75 +der Original-Aufzeichnungen unter Adobe Connect nicht möglich ist.
  76 +</p>';
64 77  
65 78 $string['removeparticipant'] = 'Entfernen';
66 79 $string['removepresenter'] = 'Entfernen';
... ... @@ -81,6 +94,13 @@ $string[&#39;adobeconnect:meetingparticipant&#39;] = &#39;Teilnehmer&#39;;
81 94 $string['adobeconnect:meetinghost'] = 'Veranstalter';
82 95 $string['public'] = 'Öffentlich';
83 96 $string['private'] = 'Privat';
  97 +
  98 +$string['duration'] = 'Dauer';
  99 +$string['action'] = 'Aktion';
  100 +
  101 +
  102 +
  103 +
84 104 //
85 105 // Fehlermeldungen
86 106 //
... ... @@ -140,7 +160,7 @@ $string[&#39;meettemplates_help&#39;] = &#39;&lt;p&gt;Eine Vorlage für einen Meeting-Raum erzeugt
140 160 $string['pluginadministration'] = 'Adobe Connect Administration';
141 161 $string['pluginname'] = 'Adobe Connect';
142 162 $string['modulename'] = 'Adobe Connect';
143   -$string['recordinghdr'] = 'Aufzeichungen';
  163 +$string['recordinghdr'] = 'Aufzeichnungen';
144 164 $string['https'] = 'HTTPS-Verbindung';
145 165 $string['https_desc'] = 'Verbindung zum Connect-Server über HTTPS';
146 166 $string['invalidurl'] = 'Die URL muss mit einem Buchstaben beginnen (a-z)';
... ... @@ -168,4 +188,4 @@ nur für diese Gruppe angelegt wurde.
168 188 ';
169 189  
170 190  
171   -?>
172 191 \ No newline at end of file
  192 +?>
lang/de/help/adobeconnect/meeturl.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting URL</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting URL</b></p>
2 2 <div class="indent">
3 3 <p>Sie können die URL anpassen, die für das Adobe Connect Meeting verwendet werden soll.
4 4 Die Server-Domain bleibt immer die gleiche. Der letzte Teil der URL kann angepasst werden.
lang/en/adobeconnect.php
... ... @@ -62,6 +62,20 @@ $string[&#39;presenterlabel&#39;] = &#39;Presenter&#39;;
62 62 $string['recordinghdr'] = 'Meeting Recordings';
63 63 $string['record_force'] = 'Force Meeting Recordings';
64 64 $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';
  65 +$string['record_convert'] = 'Convert';
  66 +$string['record_convert_help'] = 'Help: Converting Recordings';
  67 +$string['convert_recording_help'] = '<h2>Converting Adobe Connect Recordings</h2>
  68 +<p>
  69 +Adobe Connect recordings can be converted with Windows into FLV or MP4 videos<br>
  70 +if an up to date Flash version and the Adobe Connect-Add-In are installed.<br>
  71 +In addition the moodle user who wants to convert the recording must be granted<br>
  72 +the Adobe Connect Host role.<br>
  73 +</p>
  74 +<p>
  75 +The conversion duration eqates to the length of the recording becaus it is<br>
  76 +not possible to download the original Adobe Connect recording in advance.
  77 +</p>';
  78 +
65 79 $string['removeparticipant'] = 'Remove';
66 80 $string['removepresenter'] = 'Remove';
67 81 $string['roletoassign'] = 'Role to assign';
... ... @@ -85,6 +99,11 @@ $string[&#39;adobeconnect:meetinghost&#39;] = &#39;Meeting Host&#39;;
85 99 $string['public'] = 'Public';
86 100 $string['private'] = 'Private';
87 101  
  102 +$string['duration'] = 'Duration';
  103 +$string['action'] = 'Action';
  104 +
  105 +
  106 +
88 107 // Error codes
89 108 $string['emptyxml'] = 'Unable to connect to the Adobe Connect Pro server at this time. Please inform your Moodle administrator.';
90 109 $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';
lang/en/help/adobeconnect/meetingtype.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting Type</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting Type</b></p>
2 2 <div class="indent">
3 3 <p>A public meeting type is one where anyone who has the URL for the meeting can enter the room.</p>
4 4 <p>A private meeting type is one where only registered users and participants can enter. The login page does not allow
lang/en/help/adobeconnect/meeturl.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting URL</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting URL</b></p>
2 2 <div class="indent">
3 3 <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.
4 4 However the last part of the URL can be customized.
lang/en/help/adobeconnect/mods.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp<b>Adobe Connect</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp<b>Adobe Connect</b></p>
2 2 <div class="indent">
3 3 <p>The Adobe Connect Pro activity module provides the officially sponsored integration
4 4 method between Moodle and Adobe Connect Pro. It was developed in conjunction with the Remote-Learner
lang/en/help/adobeconnect/templatescoid.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting Template</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting Template</b></p>
2 2 <div class="indent">
3 3 <p>A meeting room template creates meeting with a custom layout for the meeting room.</p>
4 4 </div>
lang/it/help/adobeconnect/meetingtype.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting Type</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting Type</b></p>
2 2 <div class="indent">
3 3 <p>A public meeting type is one where anyone who has the URL for the meeting can enter the room.</p>
4 4 <p>A private meeting type is one where only registered users and participants can enter. The login page does not allow
lang/it/help/adobeconnect/meeturl.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting URL</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting URL</b></p>
2 2 <div class="indent">
3 3 <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.
4 4 However the last part of the URL can be customized.
lang/it/help/adobeconnect/mods.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp<b>Adobe Connect</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp<b>Adobe Connect</b></p>
2 2 <div class="indent">
3 3 <p>The Adobe Connect Pro activity module provides the officially sponsored integration
4 4 method between Moodle and Adobe Connect Pro. It was developed in conjunction with the Remote-Learner
lang/it/help/adobeconnect/templatescoid.html
1   -<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/icon.gif" />&nbsp;<b>Meeting Template</b></p>
  1 +<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting Template</b></p>
2 2 <div class="indent">
3 3 <p>A meeting room template creates meeting with a custom layout for the meeting room.</p>
4 4 </div>
... ... @@ -45,43 +45,27 @@ class mod_adobeconnect_renderer extends plugin_renderer_base {
45 45 $param = array('class'=>'aconfldset');
46 46 $html .= html_writer::start_tag('div', $param);
47 47  
48   - // DFNVC
49   - //
50   - $table = new html_table();
51   - $table->attributes['class'] = 'blockstable';
52   - //$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
53   -
54   - $meet_array = array(array('<b>' . get_string('meetingstart', 'adobeconnect') . ':</b>', $meetingdetail->starttime));
55   - array_push($meet_array, array('<b>' . get_string('meetingend', 'adobeconnect') . ':</b>', $meetingdetail->endtime));
56   - array_push($meet_array, array('<b>' . get_string('meeturl', 'adobeconnect') . ':</b>', $meetingdetail->url));
57   -
58   - $table->data = $meet_array;
59   - $html .= '<center>' . html_writer::table($table) . '</center>';
60   -
61   -
62   - // Print buttons
63   - $param = array('class' => 'aconbtnrow');
64   - $html .= html_writer::start_tag('div', $param);
65   -
66   - $param = array('class' => 'aconbtnjoin');
67   - $html .= html_writer::start_tag('div', $param);
68   -
  48 + $table = new html_table();
  49 + $table->attributes['class'] = 'generaltable';
  50 +
  51 + // meeting details
  52 + $meet_array = array(array('<b>' . get_string('meetingstart', 'adobeconnect') . ':</b>', $meetingdetail->starttime));
  53 + array_push($meet_array, array('<b>' . get_string('meetingend', 'adobeconnect') . ':</b>', $meetingdetail->endtime));
  54 + array_push($meet_array, array('<b>' . get_string('meeturl', 'adobeconnect') . ':</b>', $meetingdetail->url));
  55 + // Join meeting button
69 56 $param = array('id' => $cmid, 'sesskey' => sesskey(), 'groupid' => 0);
70 57 $target = new moodle_url('/mod/adobeconnect/join.php', $param);
71 58  
72 59 $param = array('type'=>'button',
73 60 'value'=>get_string('joinmeeting','adobeconnect'),
74 61 'name'=>'btnname',
75   - 'onclick' => 'window.open(\''.$target->out(false).'\', \'btnname\',
76   - \'menubar=0,location=0,scrollbars=0,resizable=0,width=900,height=900\', 0);',
77   - );
78   -
79   -
80   - $html .= html_writer::empty_tag('input', $param);
81   - $html .= html_writer::end_tag('div');
82   -
83   -
84   - $html .= html_writer::end_tag('div');
  62 + 'onclick' => 'window.open(\''.$target->out(false).'\', \'btnname\', \'menubar=0,location=0,scrollbars=0,resizable=0,width=900,height=900\', 0);',
  63 + );
  64 + $meetingbutton = html_writer::empty_tag('input', $param);
  65 + array_push($meet_array,array('',$meetingbutton));
  66 +
  67 + $table->data = $meet_array;
  68 + $html .= '<center>' . html_writer::table($table) . '</center>';
85 69 $html .= html_writer::end_tag('div');
86 70 $html .= html_writer::end_tag('form');
87 71  
... ... @@ -90,7 +74,7 @@ class mod_adobeconnect_renderer extends plugin_renderer_base {
90 74 }
91 75  
92 76 function display_meeting_recording($recordings, $cmid, $groupid, $adobesession) {
93   - global $CFG, $USER;
  77 + global $CFG, $USER,$COURSE;
94 78  
95 79 $html = '';
96 80 $protocol = 'http://';
... ... @@ -104,42 +88,60 @@ class mod_adobeconnect_renderer extends plugin_renderer_base {
104 88 $protocol = 'https://';
105 89 }
106 90  
  91 + $context = context_module::instance($cmid);
  92 + $user_is_host = has_capability('mod/adobeconnect:meetinghost', $context);
107 93 // Display the meeting name field and value
108 94 $param = array('id' => 'aconfldset2', 'class' => 'aconfldset');
109 95 $html .= html_writer::start_tag('div', $param);
110   -
111   - $html .= html_writer::tag('h3', get_string('recordinghdr', 'adobeconnect'), $param);
112   -
  96 + $html .= html_writer::tag('h5', get_string('recordinghdr', 'adobeconnect'), $param);
113 97 $param = array('class' => 'aconrecording');
114 98 $html .= html_writer::start_tag('div', $param);
115 99  
  100 + $table = new html_table();
  101 + $table->tablealign = 'center';
  102 + $table->width = '60%';
  103 + $table->head = array(get_string('name'), get_string('starttime','adobeconnect'), get_string('duration','adobeconnect'));
  104 + if ($user_is_host) {
  105 + array_push($table->head, get_string('action','adobeconnect'));
  106 + array_push($table->head, '');
  107 + }
116 108 foreach ($recordings as $key => $recordinggrp) {
117 109 if (!empty($recordinggrp)) {
118 110 foreach($recordinggrp as $recording_scoid => $recording) {
119   -
120   - $param = array('class' => 'aconrecordingrow');
121   - $html .= html_writer::start_tag('div', $param);
122   -
123   -// $url = $protocol . $CFG->adobeconnect_meethost.$port
124   -// .$recording->url.'?session='.$adobesession;
125   -
126   - $url = 'joinrecording.php?id=' . $cmid . '&recording='. $recording_scoid .
127   - '&groupid='. $groupid . '&sesskey=' . $USER->sesskey;
128   -
129   - $param = array('target' => '_blank');
130   - $html .= html_writer::link($url, format_string($recording->name), $param);
131   -
132   - $html .= html_writer::end_tag('div');
133   -
  111 + // recording url
  112 + $url = '/mod/adobeconnect/joinrecording.php?id=' . $cmid . '&recording='. $recording_scoid . '&groupid='. $groupid . '&sesskey=' . $USER->sesskey;
  113 + // recording name
  114 + $name = '<img src="/pix/e/insert_edit_video.svg"/>&nbsp;&nbsp;';
  115 + $name .= html_writer::link($url, format_string($recording->name), array('target' => '_blank','title'=>'Play Recording'));
  116 + // start date
  117 + $startdate = format_string($recording->startdate);
  118 + $time = strtotime($startdate);
  119 + $startdate = date("d.m.Y H:i:s", $time);
  120 + // duration
  121 + $duration = format_string($recording->duration);
  122 + $duration = gmdate("H:i:s", $duration);
  123 + // create initial row
  124 + $row = array ($name,$startdate,$duration);
  125 + // Display convert button if user has role meeting host in course
  126 + $action = '';
  127 + if ($user_is_host) {
  128 + $converturl = $url . '&convert=true';
  129 + $param = array('target' => '_blank','title'=>get_string('record_convert','adobeconnect'));
  130 + $action = html_writer::link($converturl,get_string('record_convert','adobeconnect'),$param);
  131 + array_push($row, $action);
  132 + // Help
  133 + $param = array('target' => '_blank','title'=>get_string('record_convert_help','adobeconnect'));
  134 + $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);
  135 + array_push($row, $help);
  136 + }
  137 + $table->data[] = $row;
134 138 }
135 139 }
136 140 }
137   -
138   - $html .= html_writer::end_tag('div');
139   -
  141 + $html .= html_writer::table($table);
140 142 $html .= html_writer::end_tag('div');
141 143  
142 144 return $html;
143 145 //$html .= html_writer::link($url, get_string('removemychoice','choice'));
144 146 }
145   -}
146 147 \ No newline at end of file
  148 +}