Merge branch 'wip-MDL-47919-master2' of https://github.com/marinaglancy/moodle

This commit is contained in:
Dan Poltawski 2014-10-30 08:30:43 +00:00
commit fe5c340197
3 changed files with 14 additions and 12 deletions

View file

@ -129,6 +129,7 @@ class rules extends \table_sql implements \renderable {
public function col_select(\tool_monitor\rule $rule) {
global $OUTPUT;
$select = $rule->get_module_select($this->courseid);
$select->set_label(get_string('subscribeto', 'tool_monitor', $rule->get_name($this->context)), array('class' => 'accesshide'));
return is_object($select) ? $OUTPUT->render($select) : $select;
}

View file

@ -93,6 +93,7 @@ $string['subcreatesuccess'] = "Subscription successfully created";
$string['subdeletesuccess'] = "Subscription successfully removed";
$string['subhelp'] = 'Subscription details';
$string['subhelp_help'] = 'This subscription listens for when the event \'{$a->eventname}\' has been triggered in \'{$a->moduleinstance}\' {$a->frequency} time(s) in {$a->minutes} minute(s).';
$string['subscribeto'] = 'Subscribe to rule "{$a}"';
$string['system'] = "System";
$string['taskcleanevents'] = 'Removes any unnecessary event monitor events';
$string['title'] = '{$a->coursename} : {$a->reportname}';

View file

@ -44,8 +44,8 @@ Feature: tool_monitor_subscriptions
Given I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Event monitoring" node in "My profile settings"
And I set the field "courseid" to "Course 1"
When I set the field "cmid" to "All events"
And I set the field "Select a course" to "Course 1"
When I set the field "Subscribe to rule \"New rule course level\"" to "All events"
Then I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
@ -53,8 +53,8 @@ Feature: tool_monitor_subscriptions
Given I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Event monitoring" node in "My profile settings"
And I set the field "courseid" to "Course 1"
And I set the field "cmid" to "All events"
And I set the field "Select a course" to "Course 1"
And I set the field "Subscribe to rule \"New rule course level\"" to "All events"
And I should see "Subscription successfully created"
When I click on "Delete subscription" "link" in the "New rule course level" "table_row"
And I should see "Are you sure you want to delete this subscription for the rule \"New rule course level\"?"
@ -65,16 +65,16 @@ Feature: tool_monitor_subscriptions
Scenario: Subscribe to a rule on site level
Given I log in as "admin"
And I navigate to "Event monitoring" node in "My profile settings"
And I set the field "courseid" to "Site"
When I set the field "cmid" to "All events"
And I set the field "Select a course" to "Site"
When I set the field "Subscribe to rule \"New rule site level\"" to "All events"
Then I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
Scenario: Delete a subscription on site level
Given I log in as "admin"
And I navigate to "Event monitoring" node in "My profile settings"
And I set the field "courseid" to "Site"
And I set the field "cmid" to "All events"
And I set the field "Select a course" to "Site"
And I set the field "Subscribe to rule \"New rule site level\"" to "All events"
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
When I click on "Delete subscription" "link" in the "New rule site level" "table_row"
@ -91,8 +91,8 @@ Feature: tool_monitor_subscriptions
And I am on homepage
And I follow "Course 1"
And I navigate to "Event monitoring" node in "My profile settings"
And I set the field "courseid" to "Site"
And I set the field "cmid" to "All events"
And I set the field "Select a course" to "Site"
And I set the field "Subscribe to rule \"New rule site level\"" to "All events"
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
And I am on homepage
@ -110,8 +110,8 @@ Feature: tool_monitor_subscriptions
And I am on homepage
And I follow "Course 1"
And I navigate to "Event monitoring" node in "My profile settings"
And I set the field "courseid" to "Course 1"
And I set the field "cmid" to "All events"
And I set the field "Select a course" to "Course 1"
And I set the field "Subscribe to rule \"New rule course level\"" to "All events"
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
And I am on homepage