function _AdvisingScreen::build_footnotes

4.x _AdvisingScreen.php _AdvisingScreen::build_footnotes($bool_include_box_top = TRUE)
5.x _AdvisingScreen.php _AdvisingScreen::build_footnotes($bool_include_box_top = TRUE)

Constructs the HTML which will show footnotes for substitutions and transfer credits.

1 call to _AdvisingScreen::build_footnotes()
_AdvisingScreen::build_screen_elements in classes/_AdvisingScreen.php
This function calls the other "build" functions to assemble the View or What If tabs in FlightPath.

File

classes/_AdvisingScreen.php, line 589

Class

_AdvisingScreen

Code

function build_footnotes($bool_include_box_top = TRUE) 
 {
  // Display the footnotes & messages.

  $pC = "";
  $is_empty = true;
  if ($bool_include_box_top) {
    $pC .= $this->draw_semester_box_top(t("Footnotes & Messages"), true);
  }

  $pC .= "<tr><td colspan='8' class='tenpt'>
					";
  $fn_type_array = array("substitution", "transfer");
  $fn_char = array("substitution" => "S", "transfer" => "T");
  $fn_name = array("substitution" => t("Substitutions"),
    "transfer" => t("Transfer Equivalency Footnotes"));
  $fn_between = array("substitution" => t("for"),
    "transfer" => t("for") . " {$GLOBALS ["fp_system_settings"]["school_initials"]}'s");
  for ($xx = 0; $xx <= 1; $xx++) 
   {
    $fn_type = $fn_type_array [$xx];
    if (count($this->footnote_array [$fn_type]) < 1) 
     {
      continue;
    }

    $pC .= "<div style='padding-bottom: 10px;'>
						<b>{$fn_name [$fn_type]}</b>";
    $is_empty = false;
    for ($t = 1; $t <= count($this->footnote_array [$fn_type]); $t++) 
     {
      $line = $this->footnote_array [$fn_type][$t];

      if ($line == "") 
       {
        continue;
      }

      $extra = ".";

      $temp = explode(" ~~ ", $line);
      $o_course = trim($temp [0]);
      $new_course = trim($temp [1]);
      $using_hours = trim($temp [2]);
      if ($using_hours != "") 
       {
        $using_hours = "($using_hours hrs)";
      }
      $in_group = trim($temp [3]);

      $fbetween = $fn_between [$fn_type];

      if ($in_group > 0 && $fn_type == "substitution") 
       {
        $new_group = new Group();
        $new_group->group_id = $in_group;
        $new_group->load_descriptive_data();
        $extra = "<div style='padding-left:45px;'><i>" . t("in") . " $new_group->title.</i></div>";
        if ($new_course == $o_course || $o_course == "") 
         {
          $o_course = t("was added");
          $fbetween = "";
          $extra = str_replace("<i>" . t("in"), "<i>" . t("to"), $extra);
        }
      }



      $pC .= "<div class='tenpt'>&nbsp; &nbsp;
					<sup>{$fn_char [$fn_type]}$t</sup>
					$new_course $using_hours $fbetween $o_course$extra</div>";

    }
    $pC .= "</div>";
  }


  ////////////////////////////////////
  ////  Moved Courses...
  $m_is_empty = true;
  $pC .= "<!--MOVEDCOURSES-->";
  $this->student->list_courses_taken->sort_alphabetical_order();
  $this->student->list_courses_taken->reset_counter();
  while ($this->student->list_courses_taken->has_more()) 
   {
    $c = $this->student->list_courses_taken->get_next();
    // Skip courses which haven't had anything moved.
    if ($c->group_list_unassigned->is_empty == true) 
     {
      continue;
    }

    if ($c->course_id > 0) 
     {
      $c->load_descriptive_data();
    }

    $l_s_i = $c->subject_id;
    $l_c_n = $c->course_num;
    $l_term = $c->get_term_description(true);

    $pC .= "<div class='tenpt' style='padding-left: 10px; padding-bottom: 5px;'>
							$l_s_i $l_c_n ($c->hours_awarded " . t("hrs") . ") - $c->grade - $l_term
								";

    $c->group_list_unassigned->reset_counter();
    while ($c->group_list_unassigned->has_more()) 
     {
      $group = $c->group_list_unassigned->get_next();
      $group->load_descriptive_data();
      $group_title = "";
      if ($group->group_id > 0) 
       {
        $group_title = "<i>$group->title</i>";
      }
      else {
        $group_title = t("the degree plan");
      }
      $pC .= t("was removed from") . " $group_title.";
    }



    $pC .= "</div>";

    $m_is_empty = false;
    $is_empty = false;
  }

  if ($m_is_empty == false) 
   {
    $mtitle = "<div style='padding-bottom: 10px;'>
						<div style='padding-bottom: 5px;'>
						<b>" . t("Moved Courses") . "</b><br>
				" . t("Some courses have been moved out of their 
				original positions on your degree plan.") . "</div>";
    $pC = str_replace("<!--MOVEDCOURSES-->", $mtitle, $pC);
    $pC .= "</div>";
  }



  // For admins only....
  if (user_has_permission("can_substitute") && $bool_include_box_top) {
    if ($this->bool_print != true) 
     { // Don't display in print view.
      $pC .= "<div style='tenpt'>				
					<a href='javascript: popupWindow2(\"" . base_path() . "/advise/popup-toolbox/transfers\",\"\");'><img src='" . fp_theme_location() . "/images/toolbox.gif' border='0'>" . t("Administrator's Toolbox") . "</a>
				</div>";
      $is_empty = false;
    }
  }


  $pC .= "</td></tr>";

  if ($bool_include_box_top) {
    $pC .= $this->draw_semester_box_bottom();
  }

  if (!$is_empty) 
   {
    $this->add_to_screen($pC);
  }

  // Return so other functions can use this output, if needed.
  return $pC;
}