Skip to content

Commit

Permalink
Update teams meeting plugin for…someone.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusso committed Nov 29, 2023
1 parent dd0bb89 commit 04aba12
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 73 deletions.
14 changes: 7 additions & 7 deletions lib/editor/atto/plugins/teamsmeeting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@
![Screenshot of the settings](docs/settings.png)

## Usage Guide
1. When editing description using the Atto Editor type the text which you want to make as meeting link, select it and click on the Microsoft Teams icon.
1. When editing description using the Atto Editor type the text which you want to make as meeting link, select it and click on the Microsoft Teams icon.

![Screenshot of the toolbar](docs/toolbar.png)

2. Then select Create meeting link (you will need to sign into your Microsoft Teams account the first time you use it).
2. Then select Create meeting link (you will need to sign in to your Microsoft Teams account the first time you use it).

![Screenshot of the sign in page](docs/signin.png)

![Screenshot of the create meeting page](docs/createmeeting.png)

3. Enter a meeting title, date, and time, then clickCreate.
3. Enter a meeting title, date, and time, then click Create.

![Screenshot of the enter meeting data page](docs/meetingdata.png)

4. The link will show in the field “Your meeting URL”. Mark “Open in a new window” if you want the meeting to open in a new tab and click “Add link” to finish.

![Screenshot of the meeting created page](docs/meetingcreated.png)

5. To reach meeting options select the text with the meeting link that you have created before and click on the Microsoft Teams icon in Atto Editor toolbar.
5. To reach meeting options select the text with the meeting link that you have created before and click on the Microsoft Teams icon in Atto Editor toolbar.

![Screenshot of the selected link page](docs/selected.png)

Expand All @@ -44,13 +44,13 @@ Atto Teams Meeting plugin also enables to use Meetings App locale feature. User

Atto Teams Meeting plugin itself by default supports only 'en' locale. However, Moodle community is adding more translations for the plugin. [Full list can be found here](https://moodle.org/plugins/translations.php?plugin=atto_teamsmeeting).

You can allways add translations yourself. [More details here](https://docs.moodle.org/dev/Translating_plugins).
You can always add translations yourself. [More details here](https://docs.moodle.org/dev/Translating_plugins).

## Hosting Meetings App (optional)
You can host Microsoft Meetings application yourself. To do this:
* Download Meetings App code prepared to work with Atto plugin from https://github.com/enovation/msteams-app-lms-meetings
* Follow instructions in README file to setup application.
* Change Meetings appllication url in Atto plugin settings to your new URL (<moodle_url>/admin/settings.php?section=atto_teamsmeeting_settings).
* Follow instructions in README file to set up application.
* Change Meetings application url in Atto plugin settings to your new URL (<moodle_url>/admin/settings.php?section=atto_teamsmeeting_settings).



14 changes: 7 additions & 7 deletions lib/editor/atto/plugins/teamsmeeting/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Gets data from DB about the meeting
* Gets data from DB about the meeting.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

define('AJAX_SCRIPT', true);

require_once(__DIR__ . '/../../../../../config.php');


require_login();

$url = required_param('url', PARAM_URL);
$result = '';
if (!empty($url)) {
$record = $DB->get_record_sql('SELECT * FROM {atto_teamsmeeting} WHERE ' . $DB->sql_compare_text('link') . ' = ' . $DB->sql_compare_text(':url'),
array('url' => $url), IGNORE_MISSING);
$result = json_encode([$CFG->wwwroot.'/lib/editor/atto/plugins/teamsmeeting/result.php', $record->title, $record->link, $record->options]);
$record = $DB->get_record_sql('SELECT * FROM {atto_teamsmeeting} WHERE ' . $DB->sql_compare_text('link') . ' = ' .
$DB->sql_compare_text(':url'), ['url' => $url]);
$result = json_encode([$CFG->wwwroot . '/lib/editor/atto/plugins/teamsmeeting/result.php', $record->title, $record->link,
$record->options]);
}

echo $result;
die();

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Privacy Subsystem implementation for block_activity_modules.
* Privacy Subsystem implementation for atto_teamsmeeting.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/editor/atto/plugins/teamsmeeting/db/install.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/editor/atto/plugins/teamsmeeting/db" VERSION="20200326" COMMENT="XMLDB file for Moodle atto/teamsmeeting plugin"
<XMLDB PATH="lib/editor/atto/plugins/teamsmeeting/db" VERSION="20200326" COMMENT="XMLDB file for Moodle atto_teamsmeeting plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../xmldb/xmldb.xsd"
>
Expand Down
4 changes: 2 additions & 2 deletions lib/editor/atto/plugins/teamsmeeting/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Atto text editor Meetings integration upgrade file.
* Atto text editor Teams Meeting integration upgrade file.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Strings for component 'atto_teamsmeeting', language 'en'.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -32,9 +32,8 @@
$string['meetingurl'] = 'Your meeting URL';
$string['openinnewwindow'] = 'Open in new window';
$string['pluginname'] = 'Teams Meeting';
$string['privacy:metadata:msteamsapp'] = 'The Atto Teams Meeting plugin does not store any data. However, it sends user
language code to Microsoft Teams application to provide user interface based on user language.';
$string['privacy:metadata:msteamsapp'] = 'The Atto Teams Meeting plugin does not store any data. However, it sends user language code to Microsoft Teams application to provide user interface based on user language.';
$string['privacy:metadata:msteamsapp:userlang'] = 'User language code sent to Microsoft Teams application.';
$string['settings'] = 'Teams Meeting Settings';
$string['legacy_setting_warning'] = '<br/>
<span style="color:red">WARNING: The Meetings app deployed at https://enovation.ie/msteams is deprecated and will be removed soon. A new app has been created at https://enomsteams.z16.web.core.windows.net.</span>';
<span style="color:red">WARNING: The Meetings app deployed at https://enovation.ie/msteams is deprecated and will be removed soon. A new app has been created at https://enomsteams.z16.web.core.windows.net.</span>';
21 changes: 12 additions & 9 deletions lib/editor/atto/plugins/teamsmeeting/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
* Atto text editor integration lib file.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once(__DIR__ . '/../../../../../repository/url/locallib.php');
require_once($CFG->dirroot . '/repository/url/lib.php');

/**
* Set params for this button.
Expand All @@ -38,8 +39,10 @@ function atto_teamsmeeting_params_for_js($elementid, $options, $fpoptions) {
'clientdomain' => encode_url($CFG->wwwroot),
'appurl' => get_config('atto_teamsmeeting', 'meetingapplink'),
'locale' => (empty($SESSION->lang) ? $USER->lang : $SESSION->lang),
'msession' => sesskey()
'msession' => sesskey(),
'editor' => 'atto',
];

return $params;
}

Expand All @@ -49,11 +52,11 @@ function atto_teamsmeeting_params_for_js($elementid, $options, $fpoptions) {
function atto_teamsmeeting_strings_for_js() {
global $PAGE;

$PAGE->requires->strings_for_js(array(
'addlink',
'createteamsmeeting',
'meetingurl',
'openinnewwindow'),
'atto_teamsmeeting');
$PAGE->requires->strings_for_js([
'addlink',
'createteamsmeeting',
'meetingurl',
'openinnewwindow'],
'atto_teamsmeeting');
}

35 changes: 17 additions & 18 deletions lib/editor/atto/plugins/teamsmeeting/result.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Atto text editor integration result file.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -31,16 +31,15 @@
$preview = optional_param('preview', null, PARAM_RAW);
$optionslink = optional_param('options', null, PARAM_RAW);


$meetingoptions = null;

if (!empty($preview)) {
$htmlDom = new DOMDocument;
@$htmlDom->loadHTML($preview);
$links = $htmlDom->getElementsByTagName('a');
foreach($links as $link){
foreach ($links as $link) {
$href = $link->getAttribute('href');
if ($href && strpos($href, 'meetingOptions') !== FALSE) {
if ($href && strpos($href, 'meetingOptions') !== false) {
$meetingoptions = $href;
break;
}
Expand All @@ -52,7 +51,7 @@
$meetingdata->options = $meetingoptions;
$meetingdata->timecreated = time();
$DB->insert_record('atto_teamsmeeting', $meetingdata);
} else if(!empty($optionslink)) {
} else if (!empty($optionslink)) {
$meetingoptions = $optionslink;
}

Expand All @@ -72,22 +71,22 @@
0 24 0zm7.9 17.1c-.6 0-1.2.2-1.6.7l-8.5 8.5-3-3c-.4-.4-1-.7-1.6-.7-.3 0-.6.1-.8.2-.3.1-.5.3-.7.5s-.4.4-.5.7c-.2.3-.2.5-.2.8
0 .6.2 1.2.7 1.6l4.6 4.6c.4.4 1 .7 1.6.7.6 0 1.2-.2 1.6-.7l10.1-10.1c.4-.5.7-1
.7-1.6 0-.3-.1-.6-.2-.8-.1-.3-.3-.5-.5-.7s-.4-.4-.7-.5c-.4-.2-.7-.2-1-.2z" fill="#599c00"></path></svg>
<span class="meetingcreatedheader" style="font-size: 20px; font-weight: 600; display: block; text-align: center;">'.
get_string('meetingcreatedsuccess', 'atto_teamsmeeting', $title).
'</span>';
if(!empty($meetinglink)) {
echo '<span class="meetinglink" style="display: block; text-align: center;"><a class="btn btn-primary" href="'.
$meetinglink.'" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
<span class="meetingcreatedheader" style="font-size: 20px; font-weight: 600; display: block; text-align: center;">' .
get_string('meetingcreatedsuccess', 'atto_teamsmeeting', $title) .
'</span>';
if (!empty($meetinglink)) {
echo '<span class="meetinglink" style="display: block; text-align: center;"><a class="btn btn-primary" href="' .
$meetinglink . '" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
border: 1px solid hsla(0,0%,100%,.04); user-select: none; font-size: .875rem; line-height: 1.5; border-radius: 3px;
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">'.
get_string('gotomeeting', 'atto_teamsmeeting').'</a></span>';
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">' .
get_string('gotomeeting', 'atto_teamsmeeting') . '</a></span>';
}
if(!empty($meetingoptions)) {
echo '<span class="meetingoptions" style="display: block; text-align: center;"><a class="btn btn-primary" href="'.
$meetingoptions.'" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
if (!empty($meetingoptions)) {
echo '<span class="meetingoptions" style="display: block; text-align: center;"><a class="btn btn-primary" href="' .
$meetingoptions . '" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
border: 1px solid hsla(0,0%,100%,.04); user-select: none; font-size: .875rem; line-height: 1.5; border-radius: 3px;
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">'.
get_string('meetingoptions', 'atto_teamsmeeting').'</a></span>';
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">' .
get_string('meetingoptions', 'atto_teamsmeeting') . '</a></span>';
}
echo '</div>';

Expand Down
4 changes: 2 additions & 2 deletions lib/editor/atto/plugins/teamsmeeting/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Settings for the Teams Meetings application atto plugin.
* Settings for the Teams Meeting atto plugin.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/editor/atto/plugins/teamsmeeting/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.atto_form .meeting-app #meetingapp {
display: block;
height: 360px;
height: 420px;
width: 600px;
background-color: #f3f2f1
}
14 changes: 7 additions & 7 deletions lib/editor/atto/plugins/teamsmeeting/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Atto text editor integration version file.
* Plugin version information.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2020032705; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016052318; // Requires this Moodle version.
$plugin->component = 'atto_teamsmeeting'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE; // Maturity level of this plugin version
$plugin->release = 'v1.2.5';
$plugin->version = 2020032706;
$plugin->requires = 2016052318;
$plugin->component = 'atto_teamsmeeting';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'v1.2.6';

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ YUI.add('moodle-atto_teamsmeeting-button', function (Y, NAME) {
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/*
/**
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -32,7 +32,6 @@ YUI.add('moodle-atto_teamsmeeting-button', function (Y, NAME) {
* @class button
* @extends M.editor_atto.EditorPlugin
*/

var COMPONENTNAME = 'atto_teamsmeeting',
CSS = {
NEWWINDOW: 'atto_teamsmeeting_openinnewwindow',
Expand All @@ -47,7 +46,7 @@ var COMPONENTNAME = 'atto_teamsmeeting',
'<label class="meeting-app-label" for="meetingapp">' +
'{{get_string "createteamsmeeting" component}}' +
'</label>' +
'<iframe id="meetingapp" src="{{appurl}}?url={{clientdomain}}&locale={{locale}}&msession={{msession}}"></iframe>' +
'<iframe id="meetingapp" src="{{appurl}}?url={{clientdomain}}&locale={{locale}}&msession={{msession}}&editor=atto"></iframe>' +
'</div>' +
'<div class="mb-1">' +
'<label for="{{elementid}}_atto_teamsmeeting_urlentry">{{get_string "meetingurl" component}}</label>' +
Expand Down
Loading

0 comments on commit 04aba12

Please sign in to comment.