More tidy ups in displays

This commit is contained in:
martin 2002-08-08 16:22:44 +00:00
parent 0087d8a6d7
commit a2ab3b0511
4 changed files with 31 additions and 25 deletions

View File

@ -121,6 +121,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
if ($course->category) {
$selector = "WHERE l.course='$course->id' AND l.user = u.id";
} else {
$selector = "WHERE l.user = u.id"; // Show all courses
if ($ccc = get_records_sql("SELECT * FROM course ORDER BY fullname")) {

View File

@ -7,6 +7,8 @@
require_variable($user); // user id
optional_variable($mode, "outline");
$modes = array("outline", "complete", "todaylogs", "alllogs");
if (! $course = get_record("course", "id", $id)) {
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");
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=\"../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> ->
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");
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
echo "<TD>Reports: </TD>";
if ($mode != "outline") {
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=outline>Outline</A></TD>";
} else {
echo "<TD><U>Outline</U></TD>";
}
if ($mode != "complete") {
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>";
foreach ($modes as $listmode) {
$strmode = get_string($listmode);
if ($mode == $listmode) {
echo "<TD><U>$strmode</U></TD>";
} else {
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
}
}
echo "</TR></TABLE>";
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts);
switch ($mode) {
case "today" :
case "todaylogs" :
echo "<HR><CENTER>";
print_log_graph($course, $user->id, "userday.png", time() );
echo "</CENTER>";

View File

@ -23,6 +23,7 @@ $string[choosecourse] = "Choose a course";
$string[chooseuser] = "Choose a user";
$string[city] = "City/town";
$string[confirmed] = "Your registration has been confirmed";
$string[complete] = "Complete";
$string["continue"] = "Continue";
$string[country] = "Country";
$string[course] = "Course";
@ -190,6 +191,7 @@ $string[numberweeks] = "Number of weeks/topics";
$string[ok] = "OK";
$string[opentoguests] = "Open to guests?";
$string[optional] = "optional";
$string[outline] = "Outline";
$string[participants] = "Participants";
$string[password] = "Password";
$string[passwordchanged] = "Password has been changed";

View File

@ -117,7 +117,7 @@
// Print other functions
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 "<INPUT type=hidden name=id value=\"$course->id\">";
echo "<INPUT type=hidden name=user value=\"$user->id\">";