function _AdvisingScreen::display_toolbox_moved

4.x _AdvisingScreen.php _AdvisingScreen::display_toolbox_moved()
5.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 1104

Class

_AdvisingScreen

Code

function display_toolbox_moved() 
 {
  $pC = "";


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

  $pC .= "<div class='tenpt'>
				" . 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->hours_awarded;
    if ($c->bool_ghost_hour) {
      $h .= " [" . t("ghost") . "<a href='javascript:alertSubGhost();'>?</a>] ";
    }

    $pC .= "<div class='tenpt' 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");
      }
      $pC .= "<div class='tenpt'>" . t("This course was removed from") . " $group_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;
}