forked from science-ation/science-ation
Make the status on the judge other and judge expertise pages work.
A few updates for consistency when embedded in the editor popup
This commit is contained in:
parent
dbad8ae320
commit
2e65273b97
@ -72,11 +72,20 @@ case 'save':
|
||||
}
|
||||
user_save($u);
|
||||
happy_("Preferences successfully saved");
|
||||
|
||||
//reload the user record because we dont know if we saved or didnt save above, we just want
|
||||
//to know what the user looks like _now_
|
||||
$u = user_load($eid);
|
||||
$newstatus=judge_status_expertise($u);
|
||||
echo "<script type=\"text/javascript\">";
|
||||
echo "expertise_update_status('$newstatus');\n";
|
||||
echo "</script>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
echo "<br /><h3>".i18n("Judging Expertise")."</h3>";
|
||||
display_messages();
|
||||
} else {
|
||||
//send the header
|
||||
@ -85,6 +94,7 @@ case 'save':
|
||||
);
|
||||
}
|
||||
|
||||
$newstatus=judge_status_expertise($u);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function judgeexpertise_save()
|
||||
@ -92,20 +102,24 @@ function judgeexpertise_save()
|
||||
$("#debug").load("<?=$config['SFIABDIRECTORY']?>/judge_expertise.php?action=save", $("#judgeexpertise_form").serializeArray());
|
||||
return false;
|
||||
}
|
||||
|
||||
function expertise_update_status(s) {
|
||||
if(s!='complete') {
|
||||
$("#expertise_info_status").html('<?=error(i18n("Divisional Judging Information Incomplete"))?>');
|
||||
}
|
||||
else
|
||||
$("#expertise_info_status").html('<?=happy(i18n("Divisional Judging Information Complete"))?>');
|
||||
}
|
||||
|
||||
//when we're ready, output the status
|
||||
$(document).ready( function() { expertise_update_status('<?=$newstatus?>');});
|
||||
|
||||
</script>
|
||||
<?
|
||||
|
||||
|
||||
judge_status_update($u);
|
||||
|
||||
if($_SESSION['embed'] != true) {
|
||||
//output the current status
|
||||
$newstatus=judge_status_expertise($u);
|
||||
if($newstatus!="complete")
|
||||
echo error(i18n("Divisional Judging Information Incomplete"));
|
||||
else
|
||||
echo happy(i18n("Divisional Judging Information Complete"));
|
||||
}
|
||||
echo "<div id=\"expertise_info_status\"></div>\n";
|
||||
|
||||
if($u['special_award_only'] == 'yes') {
|
||||
echo i18n("You have specified that you are a judge for a specific special award. Divisional Judging preferences have been disabled because they do not apply to you.");
|
||||
@ -114,13 +128,12 @@ if($_SESSION['embed'] != true) {
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
echo "<form name=\"expertiseform\" id=\"judgeexpertise_form\">\n";
|
||||
echo "<input type=\"hidden\" name=\"users_id\" value=\"{$u['id']}\">\n";
|
||||
|
||||
$q=mysql_query("SELECT * FROM projectcategories WHERE year='{$config['FAIRYEAR']}' ORDER BY mingrade");
|
||||
echo "<h4>".i18n("Age Category Preferences")."</h4><br>";
|
||||
echo "<table class=\"editor\" >";
|
||||
echo "<br /><h4>".i18n("Age Category Preferences")."</h4><br>";
|
||||
echo "<table class=\"editor\" style=\"width: 300px;\" >";
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
echo "<tr><td class=\"label\" >";
|
||||
|
@ -61,13 +61,19 @@ case 'save':
|
||||
user_save($u);
|
||||
questions_save_answers("judgereg",$u['id'],$_POST['questions']);
|
||||
happy_("Preferences successfully saved");
|
||||
|
||||
$u=user_load($eid);
|
||||
$newstatus=judge_status_other($u);
|
||||
echo "<script type=\"text/javascript\">";
|
||||
echo "other_update_status('$newstatus');\n";
|
||||
echo "</script>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
echo "<br />";
|
||||
display_messages();
|
||||
echo "<h4>".i18n('Other Information')."</h4>";
|
||||
echo "<h3>".i18n('Other Information')."</h3>";
|
||||
echo "<br />";
|
||||
} else {
|
||||
//send the header
|
||||
@ -76,6 +82,7 @@ case 'save':
|
||||
);
|
||||
}
|
||||
|
||||
$newstatus=judge_status_other($u);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function judgeother_save()
|
||||
@ -83,22 +90,23 @@ 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
|
||||
$newstatus=judge_status_other($u);
|
||||
if($newstatus!="complete")
|
||||
echo error(i18n("Other Information Incomplete"));
|
||||
function other_update_status(s) {
|
||||
if(s!='complete') {
|
||||
$("#other_info_status").html('<?=error(i18n("Other Information Incomplete"))?>');
|
||||
}
|
||||
else
|
||||
echo happy(i18n("Other Information Complete"));
|
||||
$("#other_info_status").html('<?=happy(i18n("Other Information Complete"))?>');
|
||||
}
|
||||
|
||||
?>
|
||||
//when we're ready, output the status
|
||||
$(document).ready( function() { other_update_status('<?=$newstatus?>');});
|
||||
|
||||
</script>
|
||||
<?
|
||||
judge_status_update($u);
|
||||
echo "<div id=\"other_info_status\"></div>\n";
|
||||
?>
|
||||
<form name="otherform" id="judgeother_form">
|
||||
<input type="hidden" name="users_id" value="<?=$u['id']?>">
|
||||
<table class="editor">
|
||||
|
@ -59,7 +59,7 @@ case 'save':
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
display_messages();
|
||||
echo "<h4>".i18n('Special Awards')."</h4>";
|
||||
echo "<br /><h3>".i18n('Special Awards')."</h3>";
|
||||
echo "<br />";
|
||||
} else {
|
||||
//send the header
|
||||
|
Loading…
Reference in New Issue
Block a user