Fix displaying science head emails, and add them to the list-view as well for convenience

This commit is contained in:
james 2011-02-22 15:49:06 +00:00
parent 7eb89d98a2
commit a451a47a94

View File

@ -294,13 +294,15 @@
echo "<tr><td>".i18n("School Email")."</td><td><input type=\"text\" name=\"schoolemail\" value=\"".htmlspecialchars($r->schoolemail)."\" size=\"60\" maxlength=\"128\" /></td></tr>\n";
echo "<tr><td>".i18n("Access Code")."</td><td><input type=\"text\" name=\"accesscode\" value=\"".htmlspecialchars($r->accesscode)."\" size=\"32\" maxlength=\"32\" /></td></tr>\n";
echo "<tr><td colspan=2><br /><b>".i18n("Science head/teacher or science fair contact at school")."</b></td></tr>";
if($r->sciencehead_uid > 0)
if($r->sciencehead_uid > 0){
$sh = user_load($r->sciencehead_uid);
$sha = account_load($sh['accounts_id']);
}
else
$sh = array();
/* Don't show autogenerated emails */
$e = $sh['email'][0] == '*' ? '' : $sh['email'];
echo "<tr><td>".i18n("Email")."</td><td><input type=\"text\" name=\"scienceheademail\" value=\"".htmlspecialchars($e)."\" size=\"60\" maxlength=\"128\" /></td></tr>\n";
echo "<tr><td>".i18n("Email")."</td><td><input type=\"text\" name=\"scienceheademail\" value=\"".htmlspecialchars($sha['email'])."\" size=\"60\" maxlength=\"128\" /></td></tr>\n";
echo "<tr><td>".i18n("Name")."</td><td><input type=\"text\" name=\"sciencehead\" value=\"".htmlspecialchars($sh['name'])."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("Phone")."</td><td><input type=\"text\" name=\"scienceheadphone\" value=\"".htmlspecialchars($sh['phonework'])."\" size=\"16\" maxlength=\"16\" /></td></tr>\n";
@ -459,7 +461,8 @@
echo " <th>".i18n("School")."</th>";
echo " <th>".i18n("Address")."</th>";
echo " <th>".i18n("Phone")."</th>";
echo " <th>".i18n("Contact")."</th>";
echo " <th>".i18n("Science Head")."</th>";
echo " <th>".i18n("Science Head Email")."</th>";
if($config['participant_registration_type']=="schoolpassword")
echo " <th>".i18n("Reg Pass")."</th>";
echo " <th>".i18n("Access Code")."</th>";
@ -474,11 +477,16 @@
echo " <td>$r->address, $r->city, $r->postalcode</td>\n";
echo " <td>$r->phone</td>\n";
$sciencehead = '';
$scienceheademail = '';
if($r->sciencehead_uid > 0) {
$sh = user_load($r->sciencehead_uid);
$sciencehead = $sh['name'];
// print_r($sh);
$sha=account_load($sh['accounts_id']);
$scienceheademail=$sha['email'];
}
echo " <td>$sciencehead</td>\n";
echo " <td><a href=\"mailto:$scienceheademail\">$scienceheademail</a></td>\n";
if($config['participant_registration_type']=="schoolpassword")
echo " <td>$r->registration_password</td>\n";
echo " <td>$r->accesscode</td>\n";