forked from science-ation/science-ation
- Fix the judge other info form, configurable questions are still broken
This commit is contained in:
parent
d10c98f8fd
commit
211b5be1a5
146
judge_other.php
146
judge_other.php
@ -27,16 +27,24 @@
|
||||
require_once('judge.inc.php');
|
||||
require_once("questions.inc.php");
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
$u = user_load($_SESSION['embed_edit_id']);
|
||||
} else {
|
||||
$u = user_load($_SESSION['users_id']);
|
||||
}
|
||||
/* Sort out who we're editting */
|
||||
if($_POST['users_id'])
|
||||
$eid = intval($_POST['users_id']); /* From a save form */
|
||||
else if(array_key_exists('embed_edit_id', $_SESSION))
|
||||
$eid = $_SESSION['embed_edit_id']; /* From the embedded editor */
|
||||
else
|
||||
$eid = $_SESSION['users_id']; /* Regular entry */
|
||||
|
||||
if($eid != $_SESSION['users_id']) {
|
||||
/* Not editing ourself, we had better be
|
||||
* a committee member */
|
||||
user_auth_required('committee','admin');
|
||||
}
|
||||
|
||||
if($_POST['action']=="save")
|
||||
{
|
||||
$u = user_load($eid);
|
||||
|
||||
switch($_GET['action']) {
|
||||
case 'save':
|
||||
if(!is_array($_POST['languages'])) $_POST['languages']=array();
|
||||
|
||||
$u['languages'] = array();
|
||||
@ -51,9 +59,9 @@
|
||||
$u['highest_psd'] = stripslashes($_POST['highest_psd']);
|
||||
|
||||
user_save($u);
|
||||
message_push(notice(i18n("Preferences successfully saved")));
|
||||
$u = user_load($u['id']);
|
||||
}
|
||||
happy_("Preferences successfully saved");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
echo "<br />";
|
||||
@ -67,8 +75,17 @@
|
||||
);
|
||||
}
|
||||
|
||||
judge_status_update($u);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function judgeother_save()
|
||||
{
|
||||
$("#debug").load("<?=$config['SFIABDIRECTORY']?>/judge_other.php?action=save", $("#judgeother_form").serializeArray());
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
|
||||
judge_status_update($u);
|
||||
|
||||
if($_SESSION['embed'] != true) {
|
||||
//output the current status
|
||||
@ -79,80 +96,75 @@ if($_SESSION['embed'] != true) {
|
||||
echo happy(i18n("Other Information Complete"));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
echo "<form name=\"otherform\" method=\"post\" action=\"{$_SESSION['embed_submit_url']}\">\n";
|
||||
} else {
|
||||
echo "<form name=\"otherform\" method=\"post\" action=\"judge_other.php\">\n";
|
||||
}
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
|
||||
|
||||
echo "<table>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("I can judge in the following languages")." ".REQUIREDFIELD."</td>";
|
||||
echo " <td colspan=\"2\">";
|
||||
|
||||
<form name="otherform" id="judgeother_form">
|
||||
<input type="hidden" name="users_id" value="<?=$u['id']?>">
|
||||
<table class="tableedit">
|
||||
<tr>
|
||||
<td style="width:50%"><?=i18n("I can judge in the following languages")." ".REQUIREDFIELD?></td>
|
||||
<td>
|
||||
<?
|
||||
$q=mysql_query("SELECT * FROM languages WHERE active='Y' ORDER BY langname");
|
||||
echo mysql_error();
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
$ch = (in_array($r->lang,$u['languages'])) ? 'checked="checked"' : '';
|
||||
|
||||
echo "<input onclick=\"fieldChanged()\" $ch type=\"checkbox\" name=\"languages[]\" value=\"$r->lang\" /> $r->langname <br />";
|
||||
}
|
||||
?>
|
||||
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
</td></tr>
|
||||
|
||||
<?
|
||||
if($config['judges_specialaward_only_enable'] == 'yes') {
|
||||
echo "<tr><td colspan=\"4\"><hr /></td></tr>";
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("I am a judge for a specific special award")."<br /><font size=-1>(".i18n("Check this box if you are supposed to judge a specific special award, and please select that award on the Special Award Preferences page.").")</font></td>";
|
||||
?>
|
||||
<tr><td colspan="2"><hr /></td></tr>
|
||||
<tr><td><?=i18n("I am a judge for a specific special award")?><br />
|
||||
<font size=-1>(<?=i18n("Check this box if you are supposed to judge a specific special award, and please select that award on the Special Award Preferences page.")?>
|
||||
</font></td>
|
||||
<td>
|
||||
<?
|
||||
$ch = ($u['special_award_only'] == 'yes') ? 'checked="checked"' : '';
|
||||
echo " <td colspan=\"2\"><input $ch type=\"checkbox\" name=\"special_award_only\" value=\"yes\" />";
|
||||
echo " </td>";
|
||||
echo "</tr>\n";
|
||||
echo "<input $ch type=\"checkbox\" name=\"special_award_only\" value=\"yes\" />";
|
||||
?>
|
||||
</td></tr>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
||||
echo "<tr><td colspan=\"4\"><hr /></td></tr>";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("Years of judging experience at a School level:")."</td>";
|
||||
echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\"years_school\" size=\"5\" value=\"{$u['years_school']}\" /></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("Years of judging experience at a Regional level:")."</td>";
|
||||
echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\"years_regional\" size=\"5\" value=\"{$u['years_regional']}\" /></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("Years of judging experience at a National level:")."</td>";
|
||||
echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\"years_national\" size=\"5\" value=\"{$u['years_national']}\" /></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("I am willing to be the lead for my judging team")."</td>";
|
||||
$ch = ($u['willing_chair'] == 'yes') ? 'checked="checked"' : '';
|
||||
echo " <td colspan=\"2\"><input $ch type=\"checkbox\" name=\"willing_chair\" value=\"yes\" />";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("Highest post-secondary degree")."</td>";
|
||||
echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\"highest_psd\" size=\"35\" value=\"{$u['highest_psd']}\" /></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr><td colspan=\"4\"><hr /></td></tr>";
|
||||
<tr><td colspan="2"><hr /></td></tr>
|
||||
|
||||
<tr> <td><?=i18n("Years of judging experience at a School level:")?></td>
|
||||
<td><input onchange="fieldChanged()" type="text" name="years_school" size="5" value="<?=$u['years_school']?>" /></td>
|
||||
</tr><tr>
|
||||
<td><?=i18n("Years of judging experience at a Regional level:")?></td>
|
||||
<td><input onchange="fieldChanged()" type="text" name="years_regional" size="5" value="<?=$u['years_regional']?>" /></td>
|
||||
</tr><tr>
|
||||
<td><?=i18n("Years of judging experience at a National level:")?></td>
|
||||
<td><input onchange="fieldChanged()" type="text" name="years_national" size="5" value="<?=$u['years_national']?>" /></td>
|
||||
</tr><tr>
|
||||
<td><?=i18n("I am willing to be the lead for my judging team")?></td>
|
||||
<td>
|
||||
<? $ch = ($u['willing_chair'] == 'yes') ? 'checked="checked"' : ''; ?>
|
||||
<input <?=$ch?> type="checkbox" name="willing_chair" value="yes" />
|
||||
</tr><tr>
|
||||
<td><?=i18n("Highest post-secondary degree")?></td>
|
||||
<td><input onchange="fieldChanged()" type="text" name="highest_psd" size="35" value="<?=$u['highest_psd']?>" /></td>
|
||||
</tr><tr>
|
||||
<td colspan="2"><hr /></td></tr>
|
||||
</table>
|
||||
<table class="tableedit">
|
||||
<?
|
||||
questions_print_answer_editor('judgereg', $u, 'questions');
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br /><br />
|
||||
|
||||
echo "</table>";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
||||
echo "<input type=\"submit\" value=\"".i18n("Save Information")."\" />\n";
|
||||
echo "</form>";
|
||||
|
||||
<input type="submit" onclick="judgeother_save(); return false;" value="<?=i18n("Save Information")?>" />
|
||||
</form>
|
||||
|
||||
<?
|
||||
if($_SESSION['embed'] != true) send_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user