function admin_copy_degree_form

7.x admin.degrees.inc admin_copy_degree_form()
6.x admin.degrees.inc admin_copy_degree_form()
4.x admin.degrees.inc admin_copy_degree_form()
5.x admin.degrees.inc admin_copy_degree_form()

This form lets the user copy a degree and all of it's tracks & concentrations.

File

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

Code

function admin_copy_degree_form() {


  $de_catalog_year = admin_get_de_catalog_year();

  fp_set_title(t("Copy Degree for") . " $de_catalog_year");

  $form = array();

  $m = 0;

  $form ["mark" . $m++] = array(
    "type" => "markup",
    "value" => t("Use this form to duplicate a degree plan in this catalog year."),
    "weight" => 10,
  );


  $form ["de_catalog_year"] = array(
    "type" => "hidden",
    "value" => $de_catalog_year,
  );


  $form ["source_major_code"] = array(
    "type" => "textfield",
    "size" => 35,
    "label" => t("Enter the SOURCE major code you wish to copy:"),
    "required" => TRUE,
    "description" => t("Ex: ART or GBUS. Do not enter any track or concentration codes here."),
    "weight" => 20,
  );


  /* use default school_id */
  $form ['school_id'] = array(
    'type' => 'hidden',
    'value' => '0',
  );




  $form ["include_tracks"] = array(
    "type" => "checkboxes",
    "label" => t("Include tracks/level-3 degrees?"),
    "options" => array("yes" => "Yes, include all associated tracks (level-3 degrees)."),
    "description" => t("Check this box if you wish to also copy any tracks/level-3 degrees 
                        this major code may have associated with it. If you do not check this box, 
                        only the base degree will be copied. If the major does not have 
                        tracks/level-3 degrees, leave this unchecked."),
    "weight" => 30,
  );


  $form ['destination_school_id'] = array(
    'type' => 'hidden',
    'value' => '0',
  );

  $form ["destination_major_code"] = array(
    "type" => "textfield",
    "size" => 35,
    "label" => t("Enter the DESTINATION major code you wish to create/overwrite:"),
    "required" => TRUE,
    "description" => t("Ex: CHEM or XYZ. Do not enter any track or concentration codes here."),
    "weight" => 40,
  );


  $form ["allow_overwrite"] = array(
    "type" => "radios",
    "label" => t("Overwrite if major code already exists?"),
    "options" => array(
      "no" => t("No, DO NOT delete and overwrite any existing major codes & associated tracks/level-3 degrees.  Instead, return here with a warning message."),
      "yes" => t("Yes, if my destination major already exists, overwrite <b>and delete all associated tracks/level-3 degrees</b> for this year.  (Use caution with this option!)"),
    ),
    "value" => "no",
    "weight" => 50,
  );



  // Our submit button.
  $form ["submit"] = array(
    "type" => "submit",
    "value" => "Submit",
    "prefix" => "<hr>",
    "weight" => 200,
  );



  return $form;
}