Merge branch 'MDL-46506-master' of git://github.com/damyon/moodle
authorSam Hemelryk <sam@moodle.com>
Sun, 27 Jul 2014 20:46:03 +0000 (08:46 +1200)
committerSam Hemelryk <sam@moodle.com>
Sun, 27 Jul 2014 20:46:03 +0000 (08:46 +1200)
1  2 
mod/assign/locallib.php

diff --combined mod/assign/locallib.php
@@@ -1888,12 -1888,12 +1888,12 @@@ class assign 
          if (!$batchusers) {
              $userid = required_param('userid', PARAM_INT);
  
-             $grade = $this->get_user_grade($userid, false);
+             $flags = $this->get_user_flags($userid, false);
  
              $user = $DB->get_record('user', array('id'=>$userid), '*', MUST_EXIST);
  
-             if ($grade) {
-                 $data->extensionduedate = $grade->extensionduedate;
+             if ($flags) {
+                 $data->extensionduedate = $flags->extensionduedate;
              }
              $data->userid = $userid;
          } else {
              $user = $DB->get_record('user', array('id' => $submission->userid), '*', MUST_EXIST);
              $name = fullname($user);
          } else {
 -            $group = $DB->get_record('groups', array('id' => $submission->groupid), '*', MUST_EXIST);
 -            $name = $group->name;
 +            $group = $this->get_submission_group($submission->userid);
 +            if ($group) {
 +                $name = $group->name;
 +            } else {
 +                $name = get_string('defaultteam', 'assign');
 +            }
          }
          $status = get_string('submissionstatus_' . $submission->status, 'assign');
          $params = array('id'=>$submission->userid, 'fullname'=>$name, 'status'=>$status);