function _AdvisingScreen::display_toolbox_transfers

4.x _AdvisingScreen.php _AdvisingScreen::display_toolbox_transfers()
5.x _AdvisingScreen.php _AdvisingScreen::display_toolbox_transfers()

Used in the Toolbox popup, this will display content of the tab which shows a student's transfers

Return value

string

File

classes/_AdvisingScreen.php, line 869

Class

_AdvisingScreen

Code

function display_toolbox_transfers() 
 {
  $pC = "";
  // This will display the substitution management screen.

  $pC .= fp_render_curved_line(t("Manage Transfer Equivalencies"));

  $pC .= "<div class='tenpt'>
				" . t("This student has the following transfer credits and equivalencies.") . "
				<br><br>
				";
  $is_empty = true;

  $this->student->list_courses_taken->sort_alphabetical_order(false, true);
  $this->student->list_courses_taken->reset_counter();
  while ($this->student->list_courses_taken->has_more()) 
   {
    $c = $this->student->list_courses_taken->get_next();

    // Skip non transfer credits.
    if ($c->bool_transfer != true) 
     {
      continue;
    }

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

    $course->load_descriptive_transfer_data();

    $l_s_i = $c->subject_id;
    $l_c_n = $c->course_num;
    $l_title = $this->fix_course_title($c->title);

    $t_s_i = $course->subject_id;
    $t_c_n = $course->course_num;
    $t_term = $c->get_term_description(true);
    $grade = $c->grade;
    if ($grade == "W" || $grade == "F" || $grade == "NC" || $grade == "I") 
     {
      $grade = "<span style='color: red;'>$grade</span>";
    }

    $t_inst = $this->fix_institution_name($course->institution_name);

    $pC .= "<div class='tenpt' style='padding-bottom: 15px;'>
							<b>$t_s_i $t_c_n</b> ($c->hours_awarded hrs) - $grade - $t_term - $t_inst
								";
    if ($c->bool_substitution_split == true) 
     {
      $pC .= "<div class='tenpt'><b> +/- </b> This course's hours were split in a substitution.</div>";
    }
    $initials = $GLOBALS ["fp_system_settings"]["school_initials"];
    // Does this course NOT have an equivalency?
    if ($c->course_id == 0) 
     {
      // But, has the eqv been removed?  If so, display a link to restore it,
      // if not, show a link to remove it!
      if ($rC = $this->student->list_transfer_eqvs_unassigned->find_match($course)) 
       {
        // Yes, the eqv WAS removed (or unassigned)
        $pC .= "<div class='tenpt'>" . t("This course's @initials equivalency was removed for this student.", array("@initials" => $initials)) . "<br>
							<a href='javascript: popupRestoreTransferEqv(\"$rC->db_unassign_transfer_id\")'>" . t("Restore?") . "</a></div>";
      }
      else {
        $pC .= "<div class='tenpt'>" . t("@initials equivalency not yet entered (or is not applicable).", array("@initials" => $initials)) . "</div>";
      }
    }
    else {
      // This course *DOES* have an equivalency.
      $pC .= "<div class='tenpt'>$initials eqv: $l_s_i $l_c_n - $l_title</div>";

      $pC .= "<div class='tenpt' align='right'>
							<a href='javascript: popupUnassignTransferEqv(\"" . $course->course_id . "\");'>" . t("Remove this equivalency?") . "</a>
							</div>";

    }

    $pC .= "</div>";

    $is_empty = false;
  }

  if ($is_empty == true) {
    $pC .= "<div align='center'>" . t("There are no transfer equivalencies for this student.") . "</div>";
  }

  $pC .= "</div>";

  watchdog("toolbox", "transfers", array(), WATCHDOG_DEBUG);

  return $pC;
}