Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion connect_class_dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/


require_once('connect_class.php');
require_once($CFG->dirroot . '/mod/adobeconnect/connect_class.php');

class connect_class_dom extends connect_class {

Expand Down
18 changes: 9 additions & 9 deletions db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ function xmldb_adobeconnect_install() {
if (isset($coursecreatorrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($coursecreatorrid->id, $mrole->id);
core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id);
}
}

if (isset($editingteacherrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($editingteacherrid->id, $mrole->id);
core_role_set_assign_allowed($editingteacherrid->id, $mrole->id);
}
}

if (isset($teacherrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($teacherrid->id, $mrole->id);
core_role_set_assign_allowed($teacherrid->id, $mrole->id);
}
}

Expand All @@ -113,21 +113,21 @@ function xmldb_adobeconnect_install() {
if (isset($coursecreatorrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($coursecreatorrid->id, $mrole->id);
core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id);
}
}

if (isset($editingteacherrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($editingteacherrid->id, $mrole->id);
core_role_set_assign_allowed($editingteacherrid->id, $mrole->id);
}
}

if (isset($teacherrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($teacherrid->id, $mrole->id);
core_role_set_assign_allowed($teacherrid->id, $mrole->id);
}
}

Expand All @@ -150,21 +150,21 @@ function xmldb_adobeconnect_install() {
if (isset($coursecreatorrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($coursecreatorrid->id, $mrole->id);
core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id);
}
}

if (isset($editingteacherrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($editingteacherrid->id, $mrole->id);
core_role_set_assign_allowed($editingteacherrid->id, $mrole->id);
}
}

if (isset($teacherrid->id)) {
$param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
if (!$DB->get_record('role_allow_assign', $param)) {
allow_assign($teacherrid->id, $mrole->id);
core_role_set_assign_allowed($teacherrid->id, $mrole->id);
}
}

Expand Down
5 changes: 3 additions & 2 deletions db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<FIELD NAME="intro" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="General introduction of the adobeconnect activity" PREVIOUS="name" NEXT="introformat"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Format of the intro field (MOODLE, HTML, MARKDOWN...)" PREVIOUS="intro" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="User who created the meeting" PREVIOUS="introformat" NEXT="templatescoid"/>
<FIELD NAME="templatescoid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Meeting template sco-id" PREVIOUS="userid" NEXT="meeturl"/>
<FIELD NAME="meeturl" TYPE="char" LENGTH="60" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Meeting URL" PREVIOUS="templatescoid" NEXT="starttime"/>
<FIELD NAME="templatescoid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Meeting template sco-id" PREVIOUS="userid" NEXT="audiosetting"/>
<FIELD NAME="audiosetting" TYPE="int" LENGTH="20" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="templatescoid" NEXT="meeturl"/>
<FIELD NAME="meeturl" TYPE="char" LENGTH="60" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Meeting URL" PREVIOUS="audiosetting" NEXT="starttime"/>
<FIELD NAME="starttime" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Meeting start time" PREVIOUS="meeturl" NEXT="endtime"/>
<FIELD NAME="endtime" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Meeting start time" PREVIOUS="starttime" NEXT="meetingpublic"/>
<FIELD NAME="meetingpublic" TYPE="int" LENGTH="1" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Meetings can be public or non-public" PREVIOUS="endtime" NEXT="timecreated"/>
Expand Down
19 changes: 15 additions & 4 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function xmldb_adobeconnect_upgrade($oldversion=0) {
$rs->close();
}

/// adobeconnect savepoint reached
// adobeconnect savepoint reached
upgrade_mod_savepoint(true, 2010120800, 'adobeconnect');
}

Expand All @@ -67,18 +67,29 @@ function xmldb_adobeconnect_upgrade($oldversion=0) {
// adobeconnect savepoint reached
upgrade_mod_savepoint(true, 2011041400, 'adobeconnect');
}

if ($oldversion < 2012012250) {
$table = new xmldb_table('adobeconnect');
$field = new xmldb_field('userid', XMLDB_TYPE_INTEGER, '10', true, true, null, 0, 'introformat');

if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

// adobeconnect savepoint reached
upgrade_mod_savepoint(true, 2012012500, 'adobeconnect');
}

if ($oldversion < 2018071200) {
$table = new xmldb_table('adobeconnect');
$field = new xmldb_field('audiosetting', XMLDB_TYPE_INTEGER, '20', true, true, null, 0, 'templatescoid');

if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

// adobeconnect savepoint reached
upgrade_mod_savepoint(true, 2018071200, 'adobeconnect');
}

return true;
Expand Down
5 changes: 4 additions & 1 deletion lang/en/adobeconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
$string['meetingname'] = 'Meeting Name';
$string['meetingstart'] = 'Meeting start time';
$string['meetingtype'] = 'Meeting type';
$string['audiosetting'] = 'Audio type';
$string['modulename'] = 'Adobe Connect';
$string['modulenameplural'] = 'Adobe Connect';
$string['meettemplates'] = 'Meeting Templates';
Expand Down Expand Up @@ -149,6 +150,7 @@
If the meeting has support for separate groups at least 1 user in each group, who is
to be present in the meeting, should have either the host or presenter role.
</p>';
$string['audiosetting_help'] = 'Select Audio profile for the conference room. Default is always VOIP.';
$string['meettemplates_help'] = '<p>A meeting room template creates meeting with a custom layout for the meeting room.</p>';
$string['pluginadministration'] = 'Adobe Connect Administration';
$string['pluginname'] = 'Adobe Connect';
Expand All @@ -167,4 +169,5 @@
$string['event_join_meeting'] = 'User joined a meeting';
$string['event_view_recording'] = 'User viewed a recording';
$string['event_assign_role'] = 'User assigned a Connect Pro role';
$string['event_unassign_role'] = 'User unassigned a Connect Pro role';
$string['event_unassign_role'] = 'User unassigned a Connect Pro role';
$string['audio_default'] = 'Default (VOIP)';
8 changes: 6 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
*/

require_once('locallib.php');
require_once($CFG->dirroot . '/mod/adobeconnect/locallib.php');

/**
* Library of functions and constants for module adobeconnect
Expand Down Expand Up @@ -170,6 +170,7 @@ function adobeconnect_add_instance($adobeconnect) {
aconnect_update_meeting_perm($aconnect, $meetingscoid, ADOBE_MEETPERM_PUBLIC);
}

aconnect_update_telephony($aconnect, $meetingscoid, $adobeconnect->audiosetting);

// Insert record to activity instance in meeting_groups table
$record = new stdClass;
Expand Down Expand Up @@ -214,6 +215,8 @@ function adobeconnect_add_instance($adobeconnect) {
aconnect_update_meeting_perm($aconnect, $meetingscoid, ADOBE_MEETPERM_PUBLIC);
}

aconnect_update_telephony($aconnect, $meetingscoid, $adobeconnect->audiosetting);

// Insert record to activity instance in meeting_groups table
$record = new stdClass;
$record->instanceid = $recid;
Expand Down Expand Up @@ -404,6 +407,8 @@ function adobeconnect_update_instance($adobeconnect) {
aconnect_update_meeting_perm($aconnect, $grpmeeting->meetingscoid, ADOBE_MEETPERM_PUBLIC);
}

aconnect_update_telephony($aconnect, $grpmeeting->meetingscoid, $adobeconnect->audiosetting);

// Update calendar event
$param = array('courseid' => $adobeconnect->course, 'instance' =>
$adobeconnect->id, 'groupid' => $grpmeeting->groupid,
Expand Down Expand Up @@ -434,7 +439,6 @@ function adobeconnect_update_instance($adobeconnect) {
}

aconnect_logout($aconnect);

return $DB->update_record('adobeconnect', $adobeconnect);
}

Expand Down
43 changes: 41 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* @copyright (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
*/

require_once('connect_class.php');
require_once('connect_class_dom.php');
require_once($CFG->dirroot . '/mod/adobeconnect/connect_class.php');
require_once($CFG->dirroot . '/mod/adobeconnect/connect_class_dom.php');

define('ADOBE_VIEW_ROLE', 'view');
define('ADOBE_HOST_ROLE', 'host');
Expand Down Expand Up @@ -1446,6 +1446,45 @@ function get_connect_username($userid) {
return $username;
}

function get_all_telephony_options($aconnect) {

$params = array(
'action' => 'telephony-profile-list',
);

$aconnect->create_request($params);

if ($aconnect->call_success()) {
// Get shared templates folder sco-id
$audiosettings = new SimpleXMLElement($aconnect->_xmlresponse);

$audiooptions = [0 => get_string('audio_default', 'adobeconnect')];
foreach ((array) $audiosettings->{'telephony-profiles'} as $audioprofile) {
$audioprofile = (array) $audioprofile;
$audiooptions[$audioprofile['@attributes']['profile-id']] = $audioprofile['profile-name'];
}
$audiosettings = $audiooptions;
}
return $audiosettings;
}

function aconnect_update_telephony($aconnect, $meetingscoid, $telephonyid) {
$params = array(
'action' => 'acl-field-update',
'field-id' => 'telephony-profile',
'value' => $telephonyid,
'acl-id' => $meetingscoid
);

$aconnect->create_request($params);

if ($aconnect->call_success()) {
return true;
} else {
return false;
}
}

/**
* TEST FUNCTIONS - DELETE THIS AFTER COMPLETION OF TEST
*/
Expand Down
16 changes: 14 additions & 2 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ function definition() {
$mform->addHelpButton('meetingpublic', 'meetingtype', 'adobeconnect');
// $mform->addHelpButton('meetingpublic', array('meetingtype', get_string('meetingtype', 'adobeconnect'), 'adobeconnect'));

// Audio Settings
$audiosettings = $this->get_audiosettings();
$mform->addElement('select', 'audiosetting', get_string('audiosetting', 'adobeconnect'), $audiosettings);
$mform->addHelpButton('audiosetting', 'audiosetting', 'adobeconnect');

// Meeting Template
$templates = array();
$templates = $this->get_templates();
Expand Down Expand Up @@ -149,8 +154,8 @@ function validation($data, $files) {
/// Search the user's adobe connect folder
$usrfldscoid = aconnect_get_user_folder_sco_id($aconnect, $username);

if (!empty($usrfldscoid)) {
$namematches = $namematches + aconnect_meeting_exists($aconnect, $usrfldscoid, $filter);
if (!empty($usrfldscoid)) {
$namematches = $namematches + aconnect_meeting_exists($aconnect, $usrfldscoid, $filter);
}

if (empty($namematches)) {
Expand Down Expand Up @@ -285,4 +290,11 @@ function get_templates() {
return $templates_meetings;
}

function get_audiosettings() {
$aconnect = aconnect_login();

$audiosettings = get_all_telephony_options($aconnect);
aconnect_logout($aconnect);
return $audiosettings;
}
}
2 changes: 1 addition & 1 deletion participants.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
require_once('locallib.php');
require_once($CFG->dirroot . '/mod/adobeconnect/locallib.php');

define("MAX_USERS_TO_LIST_PER_ROLE", 10);

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
* @copyright (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
*/

$plugin->version = 2017111300;
$plugin->version = 2018071202;
$plugin->requires = 2017111300;
$plugin->cron = 0;
$plugin->component = 'mod_adobeconnect';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.4.0.0';
$plugin->release = '3.4.0.1';