function _AdvisingScreen::display_toolbox_substitutions
Search API
4.x _AdvisingScreen.php | _AdvisingScreen::display_toolbox_substitutions() |
5.x _AdvisingScreen.php | _AdvisingScreen::display_toolbox_substitutions() |
Used in the Toolbox popup, this will display content of the tab which shows a student's substututions
Return value
string
File
- classes/
_AdvisingScreen.php, line 921
Class
Code
function display_toolbox_substitutions()
{
$pC = "";
// This will display the substitution management screen.
$pC .= fp_render_curved_line(t("Manage Substitutions"));
$pC .= "<div class='tenpt'>
" . t("The following substitutions have been made for this student:") . "
<br><br>
";
$is_empty = true;
$this->student->list_substitutions->reset_counter();
while ($this->student->list_substitutions->has_more())
{
$substitution = $this->student->list_substitutions->get_next();
$db_substitution_id = $substitution->db_substitution_id;
$course_requirement = $substitution->course_requirement;
$subbed_course = $substitution->course_list_substitutions->get_first();
$assigned_to_degree_id = $substitution->assigned_to_degree_id;
$sub_s_i = $subbed_course->subject_id;
$sub_c_n = $subbed_course->course_num;
$cr_s_i = $course_requirement->subject_id;
$cr_c_n = $course_requirement->course_num;
$cr_hrs = $course_requirement->get_hours();
$in_group = ".";
//if ($subbed_course->assigned_to_group_id > 0)
//if ($subbed_course->get_first_assigned_to_group_id() != "")
if ($substitution->db_required_group_id != "")
{
$new_group = new Group();
//$new_group->group_id = $subbed_course->assigned_to_group_id;
//$new_group->group_id = $subbed_course->get_first_assigned_to_group_id();
$new_group->group_id = $substitution->db_required_group_id;
$new_group->load_descriptive_data();
$in_group = " in $new_group->title.";
}
$sub_action = t("was substituted for");
$sub_trans_notice = "";
if ($substitution->bool_group_addition == true)
{
$sub_action = t("was added to");
$cr_s_i = $cr_c_n = "";
$in_group = str_replace("in", "", $in_group);
}
if ($subbed_course->bool_transfer == true && is_object($subbed_course->course_transfer))
{
$sub_s_i = $subbed_course->course_transfer->subject_id;
$sub_c_n = $subbed_course->course_transfer->course_num;
$sub_trans_notice = "[" . t("transfer") . "]";
}
$extra = $by = $remarks = "";
$temp = $this->db->get_substitution_details($db_substitution_id);
$by = $this->db->get_faculty_name($temp ["faculty_id"], false);
$remarks = $temp ["remarks"];
$ondate = format_date($temp ["posted"]);
if ($by != "")
{
$by = " <br> " . t("Substitutor:") . " $by.
<br> <i>$ondate.</i>";
}
if ($remarks != "")
{
$remarks = " <br> " . t("Remarks:") . " <i>$remarks</i>.";
}
// If the sub'd course had ghost hours, make a note of that.
if ($subbed_course->bool_ghost_hour) {
$subbed_course->substitution_hours = "0 (1 ghost) ";
}
if ($substitution->bool_outdated)
{
$extra .= " <span style='color:red'>[OUTDATED: ";
$extra .= $substitution->outdated_note;
$extra .= "]</span>";
}
$substitution_hours = $subbed_course->get_substitution_hours($assigned_to_degree_id);
$pC .= "<div class='tenpt' style='margin-bottom: 20px;'>
$sub_s_i $sub_c_n $sub_trans_notice ($substitution_hours hrs) $sub_action
$cr_s_i $cr_c_n$in_group $by$remarks $extra
<br>
<a href='javascript: popupRemoveSubstitution(\"$db_substitution_id\");'>" . t("Remove substitution?") . "</a>
</div>";
$is_empty = false;
}
if ($is_empty == true)
{
$pC .= "<div align='center'>" . t("No substitutions have been made for this student.") . "</div>";
}
$pC .= "</div>";
watchdog("toolbox", "substitutions", array(), WATCHDOG_DEBUG);
return $pC;
}