mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
More tidy ups in displays
This commit is contained in:
parent
0087d8a6d7
commit
a2ab3b0511
@ -121,6 +121,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
|
|||||||
|
|
||||||
if ($course->category) {
|
if ($course->category) {
|
||||||
$selector = "WHERE l.course='$course->id' AND l.user = u.id";
|
$selector = "WHERE l.course='$course->id' AND l.user = u.id";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$selector = "WHERE l.user = u.id"; // Show all courses
|
$selector = "WHERE l.user = u.id"; // Show all courses
|
||||||
if ($ccc = get_records_sql("SELECT * FROM course ORDER BY fullname")) {
|
if ($ccc = get_records_sql("SELECT * FROM course ORDER BY fullname")) {
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
require_variable($user); // user id
|
require_variable($user); // user id
|
||||||
optional_variable($mode, "outline");
|
optional_variable($mode, "outline");
|
||||||
|
|
||||||
|
$modes = array("outline", "complete", "todaylogs", "alllogs");
|
||||||
|
|
||||||
if (! $course = get_record("course", "id", $id)) {
|
if (! $course = get_record("course", "id", $id)) {
|
||||||
error("Course id is incorrect.");
|
error("Course id is incorrect.");
|
||||||
}
|
}
|
||||||
@ -24,42 +26,43 @@
|
|||||||
|
|
||||||
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
|
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
|
||||||
|
|
||||||
print_header("$course->shortname: Activity Report ($mode)", "$course->fullname",
|
$stractivityreport = get_string("activityreport");
|
||||||
|
$strparticipants = get_string("participants");
|
||||||
|
$stroutline = get_string("outline");
|
||||||
|
$strcomplete = get_string("complete");
|
||||||
|
$stralllogs = get_string("alllogs");
|
||||||
|
$strtodaylogs = get_string("todaylogs");
|
||||||
|
$strmode = get_string($mode);
|
||||||
|
|
||||||
|
if ($course->category) {
|
||||||
|
print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
|
||||||
"<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> ->
|
"<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> ->
|
||||||
<A HREF=\"../user/index.php?id=$course->id\">Participants</A> ->
|
<A HREF=\"../user/index.php?id=$course->id\">$strparticipants</A> ->
|
||||||
<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
|
<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
|
||||||
Activity Report ($mode)", "");
|
$stractivityreport -> $strmode");
|
||||||
|
} else {
|
||||||
|
print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
|
||||||
|
"<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
|
||||||
|
$stractivityreport -> $strmode");
|
||||||
|
}
|
||||||
print_heading("$user->firstname $user->lastname");
|
print_heading("$user->firstname $user->lastname");
|
||||||
|
|
||||||
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
|
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
|
||||||
echo "<TD>Reports: </TD>";
|
echo "<TD>Reports: </TD>";
|
||||||
if ($mode != "outline") {
|
foreach ($modes as $listmode) {
|
||||||
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=outline>Outline</A></TD>";
|
$strmode = get_string($listmode);
|
||||||
} else {
|
if ($mode == $listmode) {
|
||||||
echo "<TD><U>Outline</U></TD>";
|
echo "<TD><U>$strmode</U></TD>";
|
||||||
}
|
} else {
|
||||||
if ($mode != "complete") {
|
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
|
||||||
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=complete>Complete</A></TD>";
|
}
|
||||||
} else {
|
|
||||||
echo "<TD><U>Complete</U></TD>";
|
|
||||||
}
|
|
||||||
if ($mode != "today") {
|
|
||||||
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=today>Today</A></TD>";
|
|
||||||
} else {
|
|
||||||
echo "<TD><U>Today</U></TD>";
|
|
||||||
}
|
|
||||||
if ($mode != "alllogs") {
|
|
||||||
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=alllogs>All logs</A></TD>";
|
|
||||||
} else {
|
|
||||||
echo "<TD><U>All logs</U></TD>";
|
|
||||||
}
|
}
|
||||||
echo "</TR></TABLE>";
|
echo "</TR></TABLE>";
|
||||||
|
|
||||||
|
|
||||||
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts);
|
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts);
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case "today" :
|
case "todaylogs" :
|
||||||
echo "<HR><CENTER>";
|
echo "<HR><CENTER>";
|
||||||
print_log_graph($course, $user->id, "userday.png", time() );
|
print_log_graph($course, $user->id, "userday.png", time() );
|
||||||
echo "</CENTER>";
|
echo "</CENTER>";
|
||||||
|
@ -23,6 +23,7 @@ $string[choosecourse] = "Choose a course";
|
|||||||
$string[chooseuser] = "Choose a user";
|
$string[chooseuser] = "Choose a user";
|
||||||
$string[city] = "City/town";
|
$string[city] = "City/town";
|
||||||
$string[confirmed] = "Your registration has been confirmed";
|
$string[confirmed] = "Your registration has been confirmed";
|
||||||
|
$string[complete] = "Complete";
|
||||||
$string["continue"] = "Continue";
|
$string["continue"] = "Continue";
|
||||||
$string[country] = "Country";
|
$string[country] = "Country";
|
||||||
$string[course] = "Course";
|
$string[course] = "Course";
|
||||||
@ -190,6 +191,7 @@ $string[numberweeks] = "Number of weeks/topics";
|
|||||||
$string[ok] = "OK";
|
$string[ok] = "OK";
|
||||||
$string[opentoguests] = "Open to guests?";
|
$string[opentoguests] = "Open to guests?";
|
||||||
$string[optional] = "optional";
|
$string[optional] = "optional";
|
||||||
|
$string[outline] = "Outline";
|
||||||
$string[participants] = "Participants";
|
$string[participants] = "Participants";
|
||||||
$string[password] = "Password";
|
$string[password] = "Password";
|
||||||
$string[passwordchanged] = "Password has been changed";
|
$string[passwordchanged] = "Password has been changed";
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
// Print other functions
|
// Print other functions
|
||||||
echo "<CENTER><TABLE ALIGN=CENTER><TR>";
|
echo "<CENTER><TABLE ALIGN=CENTER><TR>";
|
||||||
if (isteacher($course->id) or ($user->id == $USER->id and !isguest()) ) {
|
if ($course->category and (isteacher($course->id) or ($user->id == $USER->id and !isguest())) ) {
|
||||||
echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
|
echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
|
||||||
echo "<INPUT type=hidden name=id value=\"$course->id\">";
|
echo "<INPUT type=hidden name=id value=\"$course->id\">";
|
||||||
echo "<INPUT type=hidden name=user value=\"$user->id\">";
|
echo "<INPUT type=hidden name=user value=\"$user->id\">";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user