function AdvisingScreen::display_toolbox_moved

7.x AdvisingScreen.php AdvisingScreen::display_toolbox_moved()
6.x AdvisingScreen.php AdvisingScreen::display_toolbox_moved()

Used in the Toolbox popup, this will display content of the tab which shows a student's moved courses. That is, courses which have had their group memberships changed.

Return value

string

File

classes/AdvisingScreen.php, line 1565

Class

AdvisingScreen

Code

function display_toolbox_moved() 
 {
  $pC = "";


  $pC .= fp_render_section_title(t("Manage Moved Courses"));

  $pC .= "<div class=' '>
        " . t("This student has the following course movements.") . "
        <br><br>
        ";
  $is_empty = true;

  $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_title = $this->fix_course_title($c->title);
    $l_term = $c->get_term_description(true);

    $h = $c->get_hours_awarded();
    if ($c->bool_ghost_hour) {
      $h .= " [" . t("ghost") . "<a href='javascript:alertSubGhost();'>?</a>] ";
    }

    $pC .= "<div class=' ' style='padding-bottom: 15px;'>
              <b>$l_s_i $l_c_n</b> ($h " . 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");
      }

      $degree_title = "";
      if ($group->req_by_degree_id != 0) {
        $tdeg = new DegreePlan();
        $tdeg->degree_id = $group->req_by_degree_id;
        $degree_title = " (" . $tdeg->get_title2(FALSE, TRUE) . ")";
      }


      $pC .= "<div class=' '>" . t("This course was removed from") . " $group_title$degree_title.<br>
              <a href='javascript: popupRestoreUnassignFromGroup(\"$group->db_unassign_group_id\")'>" . t("Restore?") . "</a>
              </div>
              ";
    }



    $pC .= "</div>";

    $is_empty = false;
  }

  if ($is_empty == true) 
   {
    $pC .= "<div align='center'>" . t("No courses have been moved for this student.") . "</div>";
  }

  $pC .= "</div>";

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

  return $pC;
}