Skip to content

Commit

Permalink
Merge branch 'MDL-54682_master' of git://github.com/markn86/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Oct 11, 2016
2 parents 1e1dbc6 + d4b2c19 commit c830313
Show file tree
Hide file tree
Showing 226 changed files with 19,621 additions and 7,307 deletions.
26 changes: 14 additions & 12 deletions admin/tool/monitor/tests/behat/subscription.feature
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ Feature: tool_monitor_subscriptions
Scenario: Receiving notification on site level
Given I log in as "admin"
And I follow "Preferences" in the user menu
And I follow "Messaging"
And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
And I press "Save changes"
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
And I click on ".preference-state" "css_element" in the "Notifications of rule subscriptions" "table_row"
And I wait until the page is ready
And I follow "Preferences" in the user menu
And I follow "Event monitoring"
And I set the field "Select a course" to "Acceptance test site"
Expand All @@ -113,16 +113,17 @@ Feature: tool_monitor_subscriptions
And I am on site homepage
And I trigger cron
And I am on site homepage
When I follow "Messages" in the user menu
And I follow "Do not reply to this email (1)"
Then I should see "The course was viewed."
When I click on ".popover-region-notifications" "css_element"
And I click on "View more" "link" in the ".popover-region-notifications" "css_element"
Then I should see "New rule site level"
And I should see "The course was viewed"

Scenario: Receiving notification on course level
Given I log in as "teacher1"
And I follow "Preferences" in the user menu
And I follow "Messaging"
And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
And I press "Save changes"
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
And I click on ".preference-state" "css_element" in the "Notifications of rule subscriptions" "table_row"
And I wait until the page is ready
And I follow "Preferences" in the user menu
And I follow "Event monitoring"
And I set the field "Select a course" to "Course 1"
Expand All @@ -133,9 +134,10 @@ Feature: tool_monitor_subscriptions
And I follow "Course 1"
And I trigger cron
And I am on site homepage
When I follow "Messages" in the user menu
And I follow "Do not reply to this email (1)"
Then I should see "The course was viewed."
When I click on ".popover-region-notifications" "css_element"
And I click on "View more" "link" in the ".popover-region-notifications" "css_element"
Then I should see "New rule course level"
And I should see "The course was viewed"

Scenario: Navigating via quick link to rules
Given I log in as "admin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ Feature: View the course overview block on the dashboard and test it's functiona
Then I should see "Welcome Student" in the "Course overview" "block"
And I should see "You have no unread messages" in the "Course overview" "block"
And I follow "messages"
And I should see "Contact list empty"
And I should see "No messages"

@javascript
Scenario: View the block by a user with the welcome area and the user having messages.
Given the following config values are set as admin:
| showwelcomearea | 1 | block_course_overview |
Expand Down
4 changes: 3 additions & 1 deletion blocks/messages/tests/behat/block_messages_course.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Feature: The messages block allows users to list new messages an a course
And I add the "Messages" block
Then I should see "No messages waiting" in the "Messages" "block"

@javascript
Scenario: View the block by a user who has messages.
Given I log in as "student1"
And I follow "Messages" in the user menu
Expand All @@ -45,12 +46,13 @@ Feature: The messages block allows users to list new messages an a course
And I add the "Messages" block
Then I should see "Student 1" in the "Messages" "block"

@javascript
Scenario: Use the block to send a message to a user.
Given I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Messages" block
And I follow "Messages"
And I click on "//a[normalize-space(.) = 'Messages']" "xpath_element" in the "Messages" "block"
And I send "This is message 1" message to "Student 1" user
And I log out
When I log in as "student1"
Expand Down
4 changes: 3 additions & 1 deletion blocks/messages/tests/behat/block_messages_dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Feature: The messages block allows users to list new messages on the dashboard
When I add the "Messages" block
Then I should see "No messages waiting" in the "Messages" "block"

@javascript
Scenario: View the block by a user who has messages.
Given I log in as "student1"
And I follow "Messages" in the user menu
Expand All @@ -35,11 +36,12 @@ Feature: The messages block allows users to list new messages on the dashboard
And I add the "Messages" block
Then I should see "Student 1" in the "Messages" "block"

@javascript
Scenario: Use the block to send a message to a user.
Given I log in as "teacher1"
And I press "Customise this page"
And I add the "Messages" block
And I follow "Messages"
And I click on "//a[normalize-space(.) = 'Messages']" "xpath_element" in the "Messages" "block"
And I send "This is message 1" message to "Student 1" user
And I log out
When I log in as "student1"
Expand Down
4 changes: 3 additions & 1 deletion blocks/messages/tests/behat/block_messages_frontpage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Feature: The messages block allows users to list new messages on the frontpage
When I am on site homepage
Then I should not see "Messages"

@javascript
Scenario: View the block by a user who has messages.
Given I log in as "student1"
And I follow "Messages" in the user menu
Expand All @@ -45,10 +46,11 @@ Feature: The messages block allows users to list new messages on the frontpage
And I am on site homepage
Then I should see "Student 1" in the "Messages" "block"

@javascript
Scenario: Use the block to send a message to a user.
Given I log in as "teacher1"
And I am on site homepage
And I follow "Messages"
And I click on "//a[normalize-space(.) = 'Messages']" "xpath_element" in the "Messages" "block"
And I send "This is message 1" message to "Student 1" user
And I log out
When I log in as "student1"
Expand Down
9 changes: 3 additions & 6 deletions blocks/online_users/block_online_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function has_config() {
}

function get_content() {
global $USER, $CFG, $DB, $OUTPUT, $PAGE;
global $USER, $CFG, $DB, $OUTPUT;

if ($this->content !== NULL) {
return $this->content;
Expand Down Expand Up @@ -106,7 +106,6 @@ function get_content() {
if (isloggedin() && has_capability('moodle/site:sendmessage', $this->page->context)
&& !empty($CFG->messaging) && !isguestuser()) {
$canshowicon = true;
message_messenger_requirejs();
} else {
$canshowicon = false;
}
Expand All @@ -126,10 +125,8 @@ function get_content() {
if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="'. get_string('messageselectadd') .'" />';
$anchorurl = new moodle_url('/message/index.php', array('id' => $user->id));
$anchortag = html_writer::link($anchorurl, $anchortagcontents, array_merge(
message_messenger_sendmessage_link_params($user),
array('title' => get_string('messageselectadd'))
));
$anchortag = html_writer::link($anchorurl, $anchortagcontents,
array('title' => get_string('messageselectadd')));

$this->content->text .= '<div class="message">'.$anchortag.'</div>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: People Block used in a course
When I log in as "student1"
And I follow "Course 1"
And I click on "Participants" "link" in the "People" "block"
Then I should see "All participants" in the "h3" "css_element"
Then I should see "All participants" in the "#page-content" "css_element"
And the "My courses" select box should contain "C101"

Scenario: Student without permission can not view participants link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: Course category management interface performs as expected
And I go to the courses management page
And I should see "Course and category management" in the "h2" "css_element"
And I should see "Course categories" in the ".view-mode-selector" "css_element"
And I should see "Course categories" in the "h3" "css_element"
And I should see "Course categories" in the "#page-content" "css_element"
And I should see the "Course categories and courses" management page

@javascript
Expand Down
68 changes: 55 additions & 13 deletions lang/en/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,32 @@
$string['addcontact'] = 'Add contact';
$string['addsomecontacts'] = 'To send a message to someone, or to add a shortcut for them on this page, use the <a href="{$a}">search tab</a> above.';
$string['addsomecontactsincoming'] = 'These messages are from people who are not in your contact list. To add them to your contacts, click the "Add contact" icon next to their name.';
$string['addtoyourcontacts'] = 'Add to your contacts';
$string['ago'] = '{$a} ago';
$string['ajax_gui'] = 'Ajax chat room';
$string['allmine'] = 'All messages to me or from me';
$string['allstudents'] = 'All messages between students in course';
$string['allusers'] = 'All messages from all users';
$string['alwayssend'] = 'Always send me';
$string['backupmessageshelp'] = 'If enabled, then instant messages will be included in SITE automated backups';
$string['beepnewmessage'] = 'Beep when popup notification is displayed';
$string['blockcontact'] = 'Block contact';
$string['blockedmessages'] = '{$a} message(s) to/from blocked users';
$string['blockedusers'] = 'Blocked users ({$a})';
$string['blocknoncontacts'] = 'Prevent non-contacts from messaging me';
$string['collapsenotification'] = 'Collapse notification';
$string['contactblocked'] = 'Contact blocked';
$string['contactlistempty'] = 'Contact list empty';
$string['contacts'] = 'Contacts';
$string['context'] = 'context';
$string['defaultmessageoutputs'] = 'Default message outputs';
$string['defaults'] = 'Defaults';
$string['deleteallconfirm'] = "Are you sure you would like to delete this entire conversation?";
$string['deletemessage'] = 'Delete message';
$string['deletemessageconfirmation'] = 'Are you sure you want to delete this message? It will only be deleted from your messaging history and will still be viewable by the user who sent or received the message.';
$string['deleteselectedmessages'] = 'Delete selected messages';
$string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted';
$string['disableall'] = 'Temporarily disable notifications';
$string['disableall_help'] = 'Temporarily disable all notifications except those marked as "forced" by the site administrator';
$string['disableall'] = 'Disable notifications';
$string['disabled'] = 'Messaging is disabled on this site';
$string['disallowed'] = 'Disallowed';
$string['discussion'] = 'Discussion';
Expand All @@ -54,7 +59,6 @@
$string['emptysearchstring'] = 'You must search for something';
$string['enabled'] = 'Enabled';
$string['errorcallingprocessor'] = 'Error calling defined output';
$string['errorwhilesendingmessage'] = 'An error occurred while sending the message; please try again later.';
$string['errortranslatingdefault'] = 'Error translating default setting provided by plugin, using system defaults instead.';
$string['eventmessagecontactadded'] = 'Message contact added';
$string['eventmessagecontactblocked'] = 'Message contact blocked';
Expand All @@ -63,23 +67,30 @@
$string['eventmessagedeleted'] = 'Message deleted';
$string['eventmessageviewed'] = 'Message viewed';
$string['eventmessagesent'] = 'Message sent';
$string['forced'] = 'Forced';
$string['expandnotification'] = 'Expand notification';
$string['forced'] = 'Locked';
$string['formorethan'] = 'For more than';
$string['guestnoeditmessage'] = 'Guest user can not edit messaging options';
$string['guestnoeditmessageother'] = 'Guest user can not edit other user messaging options';
$string['gotomessages'] = 'Go to messages';
$string['hidemessagewindow'] = 'Hide message window';
$string['hidenotificationwindow'] = 'Hide notification window';
$string['includeblockedusers'] = 'Include blocked users';
$string['incomingcontacts'] = 'Incoming contacts ({$a})';
$string['keywords'] = 'Keywords';
$string['keywordssearchresults'] = 'Messages found: {$a}';
$string['keywordssearchresultstoomany'] = 'More than {$a} messages found. Refine your search.';
$string['loading'] = 'Loading ...';
$string['loggedin'] = 'Online';
$string['loggedindescription'] = 'When I\'m logged in';
$string['loggedoff'] = 'Not online';
$string['loggedoffdescription'] = 'When I\'m offline';
$string['loggedin_help'] = 'Configure how you would like to receive notifications when you are logged into Moodle';
$string['loggedindescription'] = 'When you are logged into Moodle';
$string['loggedoff'] = 'Offline';
$string['loggedoff_help'] = 'Configure how you would like to receive notifications when you are not logged into Moodle';
$string['loggedoffdescription'] = 'When you are not logged into Moodle';
$string['managecontacts'] = 'Manage my contacts';
$string['managemessageoutputs'] = 'Manage message outputs';
$string['messageoutputs'] = 'Message outputs';
$string['messagepreferences'] = 'Message preferences';
$string['mostrecent'] = 'Recent messages';
$string['mostrecentconversations'] = 'Recent conversations';
$string['mostrecentnotifications'] = 'Recent notifications';
Expand All @@ -89,21 +100,31 @@
$string['messagehistory'] = 'Message history';
$string['messagehistoryfull'] = 'All messages';
$string['messagenavigation'] = 'Message navigation:';
$string['messagetosend'] = 'Message to send';
$string['messagepreferences'] = 'Message preferences';
$string['messageprocessors'] = 'Message processors';
$string['messages'] = 'Messages';
$string['messagesent'] = 'Message sent';
$string['messaging'] = 'Messaging';
$string['messagingblockednoncontact'] = '{$a} will not be able to reply as you have blocked non-contacts';
$string['messagingdisabled'] = 'Messaging is disabled on this site, emails will be sent instead';
$string['newonlymsg'] = 'Show only new';
$string['newsearch'] = 'New search';
$string['noframesjs'] = 'Use more accessible interface';
$string['nomessages'] = 'No messages waiting';
$string['nocontacts'] = 'No contacts';
$string['nomessages'] = 'No messages';
$string['nomessagesfound'] = 'No messages were found';
$string['noreply'] = 'Do not reply to this message';
$string['nosearchresults'] = 'There were no results from your search';
$string['noncontacts'] = 'Non-contacts';
$string['nonotifications'] = 'You have no notifications';
$string['nonewnotifications'] = 'You have no new notifications';
$string['notificationwindow'] = 'Notification window';
$string['notificationpreferences'] = 'Notification preferences';
$string['notificationimage'] = 'Notification image';
$string['notifications'] = 'Notifications';
$string['off'] = 'Off';
$string['offline'] = 'Offline';
$string['offlinecontacts'] = 'Offline contacts ({$a})';
$string['on'] = 'On';
$string['online'] = 'Online';
$string['onlinecontacts'] = 'Online contacts ({$a})';
$string['onlyfromme'] = 'Only messages from me';
Expand All @@ -118,37 +139,58 @@
$string['permitted'] = 'Permitted';
$string['page-message-x'] = 'Any message pages';
$string['private_config'] = 'Popup message window';
$string['processorsettings'] = 'Processor settings';
$string['processortag'] = 'Destination';
$string['providers_config'] = 'Configure notification methods for incoming messages';
$string['providerstag'] = 'Source';
$string['recent'] = 'Recent';
$string['readmessages'] = '{$a} read messages';
$string['removecontact'] = 'Remove contact';
$string['removefromyourcontacts'] = 'Remove from your contacts';
$string['requiresconfiguration'] = 'Requires configuration';
$string['savemysettings'] = 'Save my settings';
$string['search'] = 'Search';
$string['searchforperson'] = 'Search for a person';
$string['searchforuser'] = 'Search for a user';
$string['searchforuserorcourse'] = 'Search for a user or course';
$string['searchmessages'] = 'Search messages';
$string['searchcombined'] = 'Search people and messages';
$string['selectmessagestodelete'] = 'Select messages to delete';
$string['selectnotificationtoview'] = 'Select from the list of notifications on the side to view more details';
$string['send'] = 'Send';
$string['sendingvia'] = 'Sending "{$a->provider}" via "{$a->processor}"';
$string['sendingviawhen'] = 'Sending "{$a->provider}" via "{$a->processor}" when {$a->state}';
$string['sendingmessage'] = 'Sending message';
$string['sendmessage'] = 'Send message';
$string['sendmessageto'] = 'Send message to {$a}';
$string['sendmessagetopopup'] = 'Send message to {$a} - new window';
$string['settings'] = 'Settings';
$string['settingssaved'] = 'Your settings have been saved';
$string['showmessagewindow'] = 'Popup window on new message';
$string['showmessagewindownonew'] = 'Show message window with no new messages';
$string['showmessagewindowwithcount'] = 'Show message window with {$a} new messages';
$string['showallnotifications'] = 'Show all notifications';
$string['shownewnotifications'] = 'Show new notifications';
$string['shownotificationwindownonew'] = 'Show notification window with no new notifications';
$string['shownotificationwindowwithcount'] = 'Show notification window with {$a} new notifications';
$string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p';
$string['thisconversation'] = 'this conversation';
$string['timenosee'] = 'Minutes since I was last seen online';
$string['timesent'] = 'Time sent';
$string['togglenotificationmenu'] = 'Toggle notification menu';
$string['togglemessagemenu'] = 'Toggle message menu';
$string['touserdoesntexist'] = 'You can not send a message to a user id ({$a}) that doesn\'t exist';
$string['unabletomessageuser'] = 'You are not permitted to send a message to that user';
$string['unblockcontact'] = 'Unblock contact';
$string['unreadmessages'] = 'Unread messages ({$a})';
$string['unreadnotification'] = 'Unread notification: {$a}';
$string['unreadnewmessages'] = 'New messages ({$a})';
$string['unreadnewmessage'] = 'New message from {$a}';
$string['userisblockingyou'] = 'This user has blocked you from sending messages to them';
$string['userisblockingyounoncontact'] = '{$a} only accepts messages from their contacts.';
$string['userssearchresults'] = 'Users found: {$a}';
$string['viewconversation'] = 'View conversation';
$string['viewinganotherusersmessagearea'] = 'You are viewing another user\'s message area.';
$string['viewmessages'] = 'View messages';
$string['viewmessageswith'] = 'View messages with {$a}';
$string['viewnotificationresource'] = 'Go to: {$a}';
$string['viewunreadmessageswith'] = 'View unread messages with {$a}';
$string['writeamessage'] = 'Write a message...';
$string['you'] = 'You:';
Loading

0 comments on commit c830313

Please sign in to comment.