From fe35e46f1591cee16653ada983341f51cc764236 Mon Sep 17 00:00:00 2001
From: Brett Bieber <brett.bieber@gmail.com>
Date: Wed, 6 Jan 2010 14:23:59 +0000
Subject: [PATCH] Add year2 endorsement table and specific fields.

---
 data/ucare.sql                         | 26 +++++++++++++++++++++++++-
 www/templates/Year1Endorsement.tpl.php |  9 +++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/data/ucare.sql b/data/ucare.sql
index 95b77c1..4ec96af 100644
--- a/data/ucare.sql
+++ b/data/ucare.sql
@@ -3,7 +3,7 @@
 -- http://www.phpmyadmin.net
 --
 -- Host: localhost
--- Generation Time: Jan 05, 2010 at 02:20 PM
+-- Generation Time: Jan 06, 2010 at 08:24 AM
 -- Server version: 5.1.39
 -- PHP Version: 5.3.0
 
@@ -106,3 +106,27 @@ CREATE TABLE IF NOT EXISTS `year2applications` (
   PRIMARY KEY (`id`),
   KEY `sponsor_uid` (`sponsor_uid`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `year2endorsements`
+--
+
+CREATE TABLE IF NOT EXISTS `year2endorsements` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `uid` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
+  `first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
+  `last_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
+  `rank` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
+  `department` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+  `college` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+  `application_id` int(10) unsigned NOT NULL,
+  `student_role` mediumtext COLLATE utf8_unicode_ci NOT NULL,
+  `student_ability` mediumtext COLLATE utf8_unicode_ci NOT NULL,
+  `project_relation` mediumtext COLLATE utf8_unicode_ci NOT NULL,
+  `datesubmitted` datetime NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `uid` (`uid`,`application_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
diff --git a/www/templates/Year1Endorsement.tpl.php b/www/templates/Year1Endorsement.tpl.php
index 5936616..76dafe4 100644
--- a/www/templates/Year1Endorsement.tpl.php
+++ b/www/templates/Year1Endorsement.tpl.php
@@ -44,16 +44,25 @@ function checkForm()
                 <div class="element">
                 <textarea id="student_role" name="student_role" cols="60" rows="5"><?php echo getValue($this, 'student_role'); ?></textarea></div>
             </li>
+            <?php if ($year == 1): ?>
             <li>
                 <label for="second_year" class="element"><span class="required">*</span>Will working on this project help the student conceptualize a second year, more independent project?</label>
                 <div class="element">
                 <textarea id="second_year" name="second_year" cols="60" rows="5"><?php echo getValue($this, 'second_year'); ?></textarea></div>
             </li>
+            <?php endif; ?>
             <li>
                 <label for="student_ability" class="element"><span class="required">*</span>Please comment on the ability of the student to carry out this research.</label>
                 <div class="element">
                 <textarea id="student_ability" name="student_ability" cols="60" rows="5"><?php echo getValue($this, 'student_ability'); ?></textarea></div>
             </li>
+            <?php if ($year == 2): ?>
+            <li>
+                <label for="project_relation" class="element"><span class="required">*</span>Please indicate if the student's project is closely related to your own and how it might contribute to your own research.  If it is not, please indicate the significance of the project to your discipline as a whole.</label>
+                <div class="element">
+                <textarea id="project_relation" name="project_relation" cols="60" rows="5"><?php echo getValue($this, 'project_relation'); ?></textarea></div>
+            </li>
+            <?php endif; ?>
         </ol>
     </fieldset>
     <p class="submit"><input id="submit" name="submit" value="Submit My Endorsement" type="submit"></p>
-- 
GitLab