function admin_display_degrees_popup_add_group2

7.x admin.degrees.inc admin_display_degrees_popup_add_group2()
6.x admin.degrees.inc admin_display_degrees_popup_add_group2()
5.x admin.degrees.inc admin_display_degrees_popup_add_group2()

File

modules/admin/admin.degrees.inc, line 6

Code

function admin_display_degrees_popup_add_group2() {
  $semester_num = trim($_GET ["semester_num"]);
  $school_id = intval($_GET ["school_id"]);
  $de_catalog_year = admin_get_de_catalog_year(TRUE, $school_id);

  $school_name = "";
  if ($school_id > 0) {
    $school_name = " School-" . $school_id;
  }
  if (module_enabled("schools")) {
    $defs = schools_get_school_definitions();
    if (isset($defs [$school_id])) {
      $school_name = $defs [$school_id];
    }
  }

  fp_add_js(fp_get_module_path("admin") . "/js/admin.js");

  $rtn = "";

  $rtn .= "<b>" . t("Add an elective group to block number: @semester_num in catalog year @de_catalog_year", array("@semester_num" => ($semester_num + 1), "@de_catalog_year" => $de_catalog_year)) . "</b><br>";

  if ($school_name) {
    $rtn .= "<div class='add-group-popup-school-line'><strong>" . t("Groups in School: %school", array("%school" => $school_name)) . "</strong></div>";
  }

  $rtn .= "<span class='tenpt'>" . t("Use keyboard shortcut CTRL-F to find groups quickly.") . "</span>
        <br><br>
        " . t("First, select a group (from  @cat)", array("@cat" => $de_catalog_year));
  if ($school_name) {
    $rtn .= " " . t(" and school <b>%school</b>", array("%school" => $school_name));

  }
  $rtn .= ":      
        <div class='tenpt' 
          style='height:200px; overflow-y: scroll; border: 1px solid black;
          margin:5px;'>
        <table border='0' cellspacing='5'>";

  $res = db_query("SELECT * FROM draft_groups
              WHERE catalog_year = ?
              AND delete_flag = 0
              AND school_id = ?
              ORDER BY title ", $de_catalog_year, $school_id);
  while ($cur = db_fetch_array($res)) {
    extract($cur, 3, "db");
    $rtn .= "<tr><td valign='middle'>
                <input type='radio' name='rgroups' value='$db_group_id'></td>
          <td valign='top' class='tenpt'>
          $db_title<br><i>$db_group_name</i>
          </td>
        </tr>
          
        ";
  }

  $min_grades = csv_to_array(variable_get_for_school("group_min_grades", "A,B,C,D", $school_id));


  $rtn .= "</table></div>
      " . t("Next, select properties for this group:") . "
      <a href='javascript: adminPopupAlertHelp(\"group_properties\");'>?</a>
      <div class='tenpt' style='padding-top: 5px;'>
      " . t("Hrs:") . " <input type='text' name='hours' id='hours' size='2'>
      " . t("Min Grade:") . " <select name='min_grade' id='min_grade'>
              <option value=''>--</option>
              ";
  foreach ($min_grades as $g) {
    $rtn .= "<option value='$g'>$g</option>";
  }

  $rtn .= "              
            </select>
      Type: <select name='type' id='type'>";
  // Get our list of requirement types from our settings.
  $types = fp_get_requirement_types($school_id);
  foreach ($types as $code => $desc) {
    $rtn .= "<option value='$code'>$code - $desc</option>";
  }
  $rtn .= "
          </select> 
        &nbsp; &nbsp;
        " . fp_render_button("Add group &raquo;", "adminPopupAddGroup2(\"$semester_num\");") . "
      </div>";


  return $rtn;
}