Adding a field is fairly complex.
  1. Become the www user on moog. Edit ~www/php/include/apply.inc.php. That file defines a number of arrays.
    Note:There is also ~www/php/apply/appply.php, which uses apply.inc.php and displays the appropriate web pages.
  2. In the $apply_fields array, add the new field name and the text that is to be displayed.
    Important: The last element in each of the arrays does not have a trailing comma. If you are addding an element to the end of an array, pay attention to the commas. If you don't then, look in /export/home1/tmp/php.err for the error message.
    $apply_fields = array(
    ...
            'statementofpurposeURL' => "URL of StatementOfPurpose",
            'otherprogram'          => " If you are not selected for the TRUST PROGRAM, would you like to be considered for a REU position in another NSF-funded Science and Technology Center?"
            );
    
  3. In $apply_formats add the new field name and the type, for example:
    $apply_formats = array(
    ...
            'statementofpurposeURL' => "text",
            'otherprogram'          => "tinyint"
            );
    

    Possible Types:

    enum
    Used for multiple choices. You will need to add these choices to the database
    tinyint
    Used for Yes/No Check boxes
  4. In $apply_map add your new field to the appropriate subarray. For example:
        'star'        => array('motherseducation', 'fatherseducation',
                                 'major', 'majorgpa', 'overallgpa',
                                 'communitycollege',
    	                     'anticipatedtransferdate',
                                 'standing',
                                 'honors', 'researchprograms',
                               'statementofpurpose', 'resume', 'otherprogram'),
    
  5. Edit $apply_summary_headers and add the short name for the new field.
    $apply_summary_headers = array(
    ...
            'statementofpurposeURL' => "SoP",
            'otherprogram'          => "tinyint"
           );
    
  6. Add the appropropriate initialization to the section that creates the table if it does not exist.
        if (!sqli_exists($db, $table)) {
            //log_event("apply.inc.php: creating $table");                                                                 
            $query = "                                                                                                     
    create TABLE $table ( 
    ...
    
              'resumeURL' varchar(256),                                                                                    
              'statementofpurposeURL' varchar(256),                                                                        
            otherprogram     tinyint(1) NOT NULL default 1 
    
    Don't forget to pay attention to the commas
  7. Important: You must add the field to the database by hand. Go to http://truststc.org/mysql and find the database for the workgroup. For example the TRUST star workgroup is in the star_4 database.
  8. On the mysql page for the database, find the apply table, and click on the structure link.
  9. Find the add column line and click on the go button.
  10. Enter the field name. See the apply.php file for possible sizes and defaults.
  11. Save the apply.php file and try out the application.