# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- /Applications/XAMPP/xamppfiles/htdocs/trunk/group/overview.php
+++ /Applications/XAMPP/xamppfiles/htdocs/learn/group/overview.php
@@ -1,6 +1,4 @@
-<?php
-
-// $Id: overview.php,v 1.1.2.3 2008/10/02 15:29:57 poltawski Exp $
+<?php // $Id: overview.php,v 1.1.2.3 2008/10/02 15:29:57 poltawski Exp $
 /**
  * Print an overview of groupings & group membership
  *
@@ -14,7 +12,6 @@
 $courseid   = required_param('id', PARAM_INT);
 $groupid    = optional_param('group', 0, PARAM_INT);
 $groupingid = optional_param('grouping', 0, PARAM_INT);
-$download = optional_param('download', '', PARAM_ALPHA);
 
 $returnurl = $CFG->wwwroot.'/group/index.php?id='.$courseid;
 $rooturl   = $CFG->wwwroot.'/group/overview.php?id='.$courseid;
@@ -62,7 +59,7 @@
 
 if (empty($CFG->enablegroupings)) {
     $groupwhere    = $groupid ? "AND g.id = $groupid" : "";
-    $sql = "SELECT g.id AS groupid, NULL AS groupingid, u.id AS userid, u.firstname, u.lastname, u.idnumber, u.username, u.email
+    $sql = "SELECT g.id AS groupid, NULL AS groupingid, u.id AS userid, u.firstname, u.lastname, u.idnumber, u.username
               FROM {$CFG->prefix}groups g
                    LEFT JOIN {$CFG->prefix}groups_members gm ON g.id = gm.groupid
                    LEFT JOIN {$CFG->prefix}user u ON gm.userid = u.id
@@ -71,7 +68,7 @@
 } else {
     $groupingwhere = $groupingid ? "AND gg.groupingid = $groupingid" : "";
     $groupwhere    = $groupid ? "AND g.id = $groupid" : "";
-    $sql = "SELECT g.id AS groupid, gg.groupingid, u.id AS userid, u.firstname, u.lastname, u.idnumber, u.username, u.email
+    $sql = "SELECT g.id AS groupid, gg.groupingid, u.id AS userid, u.firstname, u.lastname, u.idnumber, u.username
               FROM {$CFG->prefix}groups g
                    LEFT JOIN {$CFG->prefix}groupings_groups gg ON g.id = gg.groupid
                    LEFT JOIN {$CFG->prefix}groups_members gm ON g.id = gm.groupid
@@ -88,21 +85,20 @@
         $user->lastname  = $row->lastname;
         $user->username  = $row->username;
         $user->idnumber  = $row->idnumber;
-        $user->email = $row->email;
         if (!$row->groupingid) {
             $row->groupingid = -1;
         }
         if (!array_key_exists($row->groupid, $members[$row->groupingid])) {
             $members[$row->groupingid][$row->groupid] = array();
         }
-        if (isset($user->id)) {
+        if(isset($user->id)){
             $members[$row->groupingid][$row->groupid][] = $user;
         }
     }
     rs_close($rs);
 }
 
-if (!$download) {
+
 // Print the page and form
 $navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
                   array('name'=>$strgroups, 'link'=>'', 'type'=>'misc'));
@@ -185,200 +181,6 @@
         print_table($table, false);
         $printed = true;
     }
-}
 
-if ($download == "ods" && has_capability('moodle/course:managegroups', $context)) {
-    require_once("$CFG->libdir/odslib.class.php");
-
-    /// Calculate file name
-    $filename = clean_filename("$course->shortname " . strip_tags(format_string($courseid, true))) . '.ods';
-    /// Creating a workbook
-    $workbook = new MoodleODSWorkbook("-");
-    /// Send HTTP headers
-    $workbook->send($filename);
-    /// Creating the first worksheet
-    $myxls = & $workbook->add_worksheet($strresponses);
-
-     /// Print names of all the fields
-    $myxls->write_string(0, 0, $strgrouping);
-    $myxls->write_string(0, 1, get_string("group"));
-    $myxls->write_string(0, 2, get_string("idnumber"));
-    $myxls->write_string(0, 3, get_string("username"));
-    $myxls->write_string(0, 4, get_string("lastname"));
-    $myxls->write_string(0, 5, get_string("firstname"));
-    $myxls->write_string(0, 6, get_string("email"));
-
-    /// generate the data for the body of the spreadsheet
-    $row = 1;
-    foreach ($members as $gpgid => $groupdata) {
-        if (!empty($CFG->enablegroupings)) {
-            if ($gpgid < 0) {
-                $myxls->write_string($row, 0, $strnotingrouping);
-            } else {
-                $myxls->write_string($row, 0, format_string($groupings[$gpgid]->name));
-            }
-            $row++;
-        }
-        if ($groupingid and $groupingid != $gpgid) {
-            continue; // do not show
-        }
-        foreach ($groupdata as $gpid => $users) {
-            if ($groupid and $groupid != $gpid) {
-                continue;
-            }
-            $name = format_string($groups[$gpid]->name);
-            $myxls->write_string($row, 1, $name);
-            $row++;
-            foreach ($users as $user) {
-                $studentid = (!empty($user->idnumber) ? $user->idnumber : " ");
-                $myxls->write_string($row, 2, $studentid);
-                $myxls->write_string($row, 3, $user->username);
-                $myxls->write_string($row, 4, $user->lastname);
-                $myxls->write_string($row, 5, $user->firstname);
-                $myxls->write_string($row, 6, $user->email);
-                $row++;
-            }
-        }
-        if ($groupid and empty($groupdata)) {
-            continue;
-        }
-
-    }
-    /// Close the workbook
-    $workbook->close();
-
-    exit;
-}
-
-//print spreadsheet if one is asked for:
-if ($download == "xls" && has_capability('moodle/course:managegroups', $context)) {
-    require_once("$CFG->libdir/excellib.class.php");
-
-    /// Calculate file name
-    $filename = clean_filename("$course->shortname " . strip_tags(format_string($courseid, true))) . '.xls';
-    /// Creating a workbook
-    $workbook = new MoodleExcelWorkbook("-");
-    /// Send HTTP headers
-    $workbook->send($filename);
-    /// Creating the first worksheet
-    $myxls = & $workbook->add_worksheet($strresponses);
-
-    /// Print names of all the fields
-    //$myxls->write_string(0, 0, $strgrouping);
-    $myxls->write_string(0, 1, get_string("group"));
-    $myxls->write_string(0, 2, get_string("idnumber"));
-    $myxls->write_string(0, 3, get_string("username"));
-    $myxls->write_string(0, 4, get_string("lastname"));
-    $myxls->write_string(0, 5, get_string("firstname"));
-    $myxls->write_string(0, 6, get_string("email"));
-
-    /// generate the data for the body of the spreadsheet
-    $row = 1;
-    foreach ($members as $gpgid => $groupdata) {
-        if (!empty($CFG->enablegroupings)) {
-            if ($gpgid < 0) {
-                $myxls->write_string($row, 0, $strnotingrouping);
-            } else {
-                $myxls->write_string($row, 0, format_string($groupings[$gpgid]->name));
-            }
-            $row++;
-        }
-        if ($groupingid and $groupingid != $gpgid) {
-            continue; // do not show
-        }
-        foreach ($groupdata as $gpid => $users) {
-            if ($groupid and $groupid != $gpid) {
-                continue;
-            }
-            $name = format_string($groups[$gpid]->name);
-            $myxls->write_string($row, 1, $name);
-            $row++;
-            foreach ($users as $user) {
-                $studentid = (!empty($user->idnumber) ? $user->idnumber : " ");
-                $myxls->write_string($row, 2, $studentid);
-                $myxls->write_string($row, 3, $user->username);
-                $myxls->write_string($row, 4, $user->lastname);
-                $myxls->write_string($row, 5, $user->firstname);
-                $myxls->write_string($row, 6, $user->email);
-                $row++;
-            }
-        }
-        if ($groupid and empty($groupdata)) {
-            continue;
-        }
-
-    }
-
-/// Close the workbook
-    $workbook->close();
-    exit;
-}
-
-// print text file
-if ($download == "txt" && has_capability('moodle/course:managegroups', $context)) {
-    $filename = clean_filename("$course->shortname " . strip_tags(format_string($courseid, true))) . '.txt';
-
-    header("Content-Type: application/download\n");
-    header("Content-Disposition: attachment; filename=\"$filename\"");
-    header("Expires: 0");
-    header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
-    header("Pragma: public");
-
-    /// Print names of all the fields
-
-    echo $strgrouping."\t".get_string('group'). "\t" . get_string('idnumber') . "\t" . get_string('username') . "\t";
-    echo get_string("firstname") . "\t" . get_string("lastname") . "\t" . get_string("email") . "\n";
-
-    foreach ($members as $gpgid => $groupdata) {
-        if (!empty($CFG->enablegroupings)) {
-            if ($gpgid < 0) {
-                echo $strnotingrouping . "\n";
-            } else {
-                echo format_string($groupings[$gpgid]->name) . "\n";
-            }
-        }
-        if ($groupingid and $groupingid != $gpgid) {
-            continue; // do not show
-        }
-        foreach ($groupdata as $gpid => $users) {
-            if ($groupid and $groupid != $gpid) {
-                continue;
-            }
-            $name = format_string($groups[$gpid]->name);
-            echo "\t". $name . "\n";
-            foreach ($users as $user) {
-                echo "\t\t".$user->idnumber . "\t";
-                echo $user->username . "\t";
-                echo $user->firstname . "\t";
-                echo $user->lastname . "\t";
-                echo $user->email . "\n";
-            }
-        }
-        if ($groupid and empty($groupdata)) {
-            continue;
-        }
-    }
-    exit;
-}
-
-//now give links for downloading spreadsheets.
-if (!empty($user) && has_capability('moodle/course:managegroups', $context)) {
-    echo "<br />\n";
-    echo "<table class=\"downloadreport\"><tr>\n";
-    echo "<td>";
-    $options = array();
-    $options["id"] = "$courseid";
-    $options["download"] = "ods";
-    print_single_button("overview.php", $options, get_string("downloadods"));
-    echo "</td><td>";
-    $options["download"] = "xls";
-    print_single_button("overview.php", $options, get_string("downloadexcel"));
-    echo "</td><td>";
-    $options["download"] = "txt";
-    print_single_button("overview.php", $options, get_string("downloadtext"));
-
-    echo "</td></tr></table>";
-}
-
 print_footer($course);
 ?>
