Merge branch 'MDL-49753-master' of https://github.com/alexmitin/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 22 Apr 2015 03:00:21 +0000 (11:00 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 22 Apr 2015 03:00:21 +0000 (11:00 +0800)
1  2 
enrol/users.php

diff --combined enrol/users.php
@@@ -144,12 -144,7 +144,12 @@@ if ($action) 
                  $mform = new enrol_users_addmember_form(NULL, array('user'=>$user, 'course'=>$course, 'allgroups'=>$manager->get_all_groups()));
                  $mform->set_data($PAGE->url->params());
                  $data = $mform->get_data();
 -                if ($mform->is_cancelled() || ($data && $manager->add_user_to_group($user, $data->groupid))) {
 +                if ($mform->is_cancelled()) {
 +                    redirect($PAGE->url);
 +                } if (!empty($data->groupids)) {
 +                    foreach ($data->groupids as $groupid) {
 +                        $manager->add_user_to_group($user, $groupid);
 +                    }
                      redirect($PAGE->url);
                  } else {
                      $pagetitle = get_string('addgroup', 'group');
@@@ -225,7 -220,8 +225,8 @@@ if (!has_capability('moodle/course:view
  
  $filterform = new enrol_users_filter_form('users.php', array('manager' => $manager, 'id' => $id, 'newcourse' => $newcourse),
          'get', '', array('id' => 'filterform'));
- $filterform->set_data(array('search' => $search, 'ifilter' => $filter, 'role' => $role, 'filtergroup' => $fgroup));
+ $filterform->set_data(array('search' => $search, 'ifilter' => $filter, 'role' => $role,
+     'filtergroup' => $fgroup, 'status' => $status));
  
  $table->set_fields($fields, $renderer);