Skip to content

Commit

Permalink
More tidy ups in displays
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Aug 8, 2002
1 parent 0087d8a commit a2ab3b0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
1 change: 1 addition & 0 deletions course/lib.php
Expand Up @@ -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")) {
Expand Down
51 changes: 27 additions & 24 deletions course/user.php
Expand Up @@ -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.");
} }
Expand All @@ -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>";
Expand Down
2 changes: 2 additions & 0 deletions lang/en/moodle.php
Expand Up @@ -23,6 +23,7 @@
$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";
Expand Down Expand Up @@ -190,6 +191,7 @@
$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";
Expand Down
2 changes: 1 addition & 1 deletion user/view.php
Expand Up @@ -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\">";
Expand Down

0 comments on commit a2ab3b0

Please sign in to comment.