gradebook MDL-25769 Fixed SQL syntax formatting
[moodle.git] / grade / import / lib.php
index 331a80a..1209e1c 100644 (file)
@@ -171,19 +171,21 @@ function get_unenrolled_users_in_import($importcode, $courseid) {
     list($enrolledsql, $enrolledparams) = get_enrolled_sql($context);
 
     $sql = "SELECT giv.id, u.firstname, u.lastname, u.idnumber AS useridnumber,
-                COALESCE(gi.idnumber, gin.itemname) AS gradeidnumber
-            FROM
-                {grade_import_values} giv
-                JOIN {user} u ON giv.userid = u.id
-                LEFT JOIN {grade_items} gi ON gi.id = giv.itemid
-                LEFT JOIN {grade_import_newitem} gin ON gin.id = giv.newgradeitem
-                LEFT JOIN ($enrolledsql) je ON je.id = u.id
-                LEFT JOIN {role_assignments} ra ON (giv.userid = ra.userid AND
-                    ra.roleid $gradebookrolessql AND
-                    ra.contextid $relatedctxcondition)
-                WHERE giv.importcode = :importcode
-                    AND (ra.id IS NULL OR je.id IS NULL)
-                ORDER BY gradeidnumber, u.lastname, u.firstname";
+                   COALESCE(gi.idnumber, gin.itemname) AS gradeidnumber
+              FROM {grade_import_values} giv
+              JOIN {user} u
+                   ON giv.userid = u.id
+              LEFT JOIN {grade_items} gi
+                        ON gi.id = giv.itemid
+              LEFT JOIN {grade_import_newitem} gin
+                        ON gin.id = giv.newgradeitem
+              LEFT JOIN ($enrolledsql) je
+                        ON je.id = u.id
+              LEFT JOIN {role_assignments} ra
+                        ON (giv.userid = ra.userid AND ra.roleid $gradebookrolessql AND ra.contextid $relatedctxcondition)
+             WHERE giv.importcode = :importcode
+                   AND (ra.id IS NULL OR je.id IS NULL)
+          ORDER BY gradeidnumber, u.lastname, u.firstname";
     $params = array_merge($gradebookrolesparams, $enrolledparams);
     $params['importcode'] = $importcode;