]> git.mjollnir.org Git - moodle.git/commitdiff
Now scales users are in backup too. See bug 824.
authorstronk7 <stronk7>
Wed, 8 Oct 2003 07:35:53 +0000 (07:35 +0000)
committerstronk7 <stronk7>
Wed, 8 Oct 2003 07:35:53 +0000 (07:35 +0000)
Closing it in some hours.

backup/backuplib.php

index 6d07a6043f8646f07ce035ac03fd4ac3aad108ff..9098127a2bde4091342d11f647731aa1c76058a1 100644 (file)
@@ -39,7 +39,7 @@
 
         $count_users = 0;
         
-        //Calculate needed users (calling every xxxx_get_participants function)
+        //Calculate needed users (calling every xxxx_get_participants function + scales users)
         $needed_users = backup_get_needed_users($course);
 
         //Calculate enrolled users (students + teachers)
     }
 
     //Returns every needed user (participant) in a course
-    //It uses the xxxx_get_participants() function.
+    //It uses the xxxx_get_participants() function
+    //plus users needed to backup scales.
     //WARNING: It returns only NEEDED users, not every 
     //   every student and teacher in the course, so it
     //must be merged with backup_get_enrrolled_users !!
                  }            
             }
         }
+
+        //Now, add scales users (from site and course scales)
+        //Get users
+        $scaleusers = get_records_sql("SELECT DISTINCT userid,userid
+                                       FROM {$CFG->prefix}scale
+                                       WHERE courseid = '0' or courseid = '$courseid'");
+        //Add scale users to results
+        if ($scaleusers) {
+            foreach ($scaleusers as $scaleuser) {
+                //If userid != 0
+                if ($scaleuser->userid != 0) {
+                    $result[$scaleuser->userid]->id = $scaleuser->userid;
+                }
+            }
+        }
     
         return $result;