2003-05-01 13:16:58 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
|
|
|
require("../../config.php");
|
|
|
|
require("lib.php");
|
|
|
|
|
|
|
|
require_variable($id); // course
|
|
|
|
|
|
|
|
if (! $course = get_record("course", "id", $id)) {
|
|
|
|
error("Course ID is incorrect");
|
|
|
|
}
|
|
|
|
|
|
|
|
require_login($course->id);
|
|
|
|
add_to_log($course->id, "workshop", "view all", "index.php?id=$course->id", "");
|
|
|
|
|
|
|
|
if ($course->category) {
|
|
|
|
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
|
|
|
|
}
|
|
|
|
|
|
|
|
$strworkshops = get_string("modulenameplural", "workshop");
|
|
|
|
$strworkshop = get_string("modulename", "workshop");
|
|
|
|
$strweek = get_string("week");
|
|
|
|
$strtopic = get_string("topic");
|
|
|
|
$strname = get_string("name");
|
2003-10-13 14:56:25 +00:00
|
|
|
$strphase = get_string("phase", "workshop");
|
2003-05-01 13:16:58 +00:00
|
|
|
$strdeadline = get_string("deadline", "workshop");
|
|
|
|
$strsubmitted = get_string("submitted", "assignment");
|
|
|
|
|
|
|
|
print_header("$course->shortname: $strworkshops", "$course->fullname", "$navigation $strworkshops", "", "", true, "", navmenu($course));
|
|
|
|
|
2003-07-12 05:19:18 +00:00
|
|
|
if (! $workshops = get_all_instances_in_course("workshop", $course)) {
|
2003-05-01 13:16:58 +00:00
|
|
|
notice("There are no workshops", "../../course/view.php?id=$course->id");
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
|
|
|
$timenow = time();
|
|
|
|
|
|
|
|
if ($course->format == "weeks") {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->head = array ($strweek, $strname, $strphase, $strsubmitted, $strdeadline);
|
|
|
|
$table->align = array ("CENTER", "LEFT", "LEFT", "LEFT", "LEFT");
|
2003-10-08 18:15:22 +00:00
|
|
|
} elseif ($course->format == "topics") {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->head = array ($strtopic, $strname, $strphase, $strsubmitted, $strdeadline);
|
|
|
|
$table->align = array ("CENTER", "LEFT", "left", "LEFT", "LEFT");
|
2003-05-01 13:16:58 +00:00
|
|
|
} else {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->head = array ($strname, $strphase, $strsubmitted, $strdeadline);
|
|
|
|
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT");
|
2003-05-01 13:16:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($workshops as $workshop) {
|
2003-10-13 14:56:25 +00:00
|
|
|
switch ($workshop->phase) {
|
|
|
|
case 0:
|
|
|
|
case 1: $phase = get_string("phase1short", "workshop");
|
|
|
|
break;
|
|
|
|
case 2: $phase = get_string("phase2short", "workshop");
|
|
|
|
break;
|
|
|
|
case 3: $phase = get_string("phase3short", "workshop");
|
|
|
|
break;
|
|
|
|
case 4: $phase = get_string("phase4short", "workshop");
|
|
|
|
break;
|
|
|
|
case 5: $phase = get_string("phase5short", "workshop");
|
|
|
|
break;
|
|
|
|
case 6: $phase = get_string("phase6short", "workshop");
|
|
|
|
break;
|
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
if ($submissions = workshop_get_user_submissions($workshop, $USER)) {
|
|
|
|
foreach ($submissions as $submission) {
|
|
|
|
if ($submission->timecreated <= $workshop->deadline) {
|
|
|
|
$submitted = userdate($submission->timecreated);
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
else {
|
|
|
|
$submitted = "<FONT COLOR=red>".userdate($submission->timecreated)."</FONT>";
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
$due = userdate($workshop->deadline);
|
2003-10-08 18:15:22 +00:00
|
|
|
if (!$workshop->visible) {
|
|
|
|
//Show dimmed if the mod is hidden
|
|
|
|
$link = "<A class=\"dimmed\" HREF=\"view.php?id=$workshop->coursemodule\">$workshop->name</A><br />".
|
2003-09-28 10:57:22 +00:00
|
|
|
"($submission->title)";
|
2003-10-08 18:15:22 +00:00
|
|
|
} else {
|
|
|
|
//Show normal if the mod is visible
|
|
|
|
$link = "<A HREF=\"view.php?id=$workshop->coursemodule\">$workshop->name</A><br />".
|
2003-09-28 10:57:22 +00:00
|
|
|
"($submission->title)";
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
if ($course->format == "weeks" or $course->format == "topics") {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->data[] = array ($workshop->section, $link, $phase, $submitted, $due);
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
else {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->data[] = array ($link, $phase, $submitted, $due);
|
2003-05-01 13:16:58 +00:00
|
|
|
}
|
|
|
|
}
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
else {
|
|
|
|
$submitted = get_string("no");
|
|
|
|
$due = userdate($workshop->deadline);
|
2003-10-08 18:15:22 +00:00
|
|
|
if (!$workshop->visible) {
|
|
|
|
//Show dimmed if the mod is hidden
|
|
|
|
$link = "<A class=\"dimmed\" HREF=\"view.php?id=$workshop->coursemodule\">$workshop->name</A>";
|
|
|
|
} else {
|
|
|
|
//Show normal if the mod is visible
|
|
|
|
$link = "<A HREF=\"view.php?id=$workshop->coursemodule\">$workshop->name</A>";
|
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
if ($course->format == "weeks" or $course->format == "topics") {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->data[] = array ($workshop->section, $link, $phase, $submitted, $due);
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
2003-05-01 13:16:58 +00:00
|
|
|
else {
|
2003-10-13 14:56:25 +00:00
|
|
|
$table->data[] = array ($link, $phase, $submitted, $due);
|
2003-05-01 13:16:58 +00:00
|
|
|
}
|
|
|
|
}
|
2003-10-08 18:15:22 +00:00
|
|
|
}
|
|
|
|
echo "<br />";
|
2003-05-01 13:16:58 +00:00
|
|
|
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
print_footer($course);
|
|
|
|
?>
|