forked from science-ation/science-ation
Judge list - delete now unlinks the judge from the current year
Judge manager - delete now deletes the judge completely Judge list only shows judges active for current fairyear Clarify a few issues on the judge registration page
This commit is contained in:
parent
4cd4738a4f
commit
091c2ceffd
@ -66,14 +66,12 @@ function openjudgeinfo(id)
|
||||
judges.email,
|
||||
judges.complete,
|
||||
judges_years.year
|
||||
|
||||
FROM
|
||||
judges
|
||||
LEFT JOIN judges_years ON judges.id=judges_years.judges_id
|
||||
JOIN judges_years ON judges.id=judges_years.judges_id
|
||||
WHERE
|
||||
(judges_years.year='".$config['FAIRYEAR']."'
|
||||
OR
|
||||
judges_years.year IS NULL)
|
||||
judges_years.year='".$config['FAIRYEAR']."'
|
||||
AND judges.deleted='no'
|
||||
ORDER BY
|
||||
lastname,
|
||||
firstname";
|
||||
@ -81,12 +79,10 @@ function openjudgeinfo(id)
|
||||
$num=mysql_num_rows($q);
|
||||
echo i18n("Listing %1 judges total. See the bottom for breakdown of judges by complete status",array($num),array("the number of judges"));
|
||||
|
||||
|
||||
echo mysql_error();
|
||||
echo "<tr>";
|
||||
echo " <th>".i18n("Judge Name")."</th>";
|
||||
echo " <th>".i18n("Email Address")."</th>";
|
||||
echo " <th>".i18n("Active")."</th>";
|
||||
echo " <th>".i18n("Complete")."</th>";
|
||||
echo " <th>".i18n("Actions")."</th>";
|
||||
echo "</tr>";
|
||||
@ -98,16 +94,6 @@ function openjudgeinfo(id)
|
||||
echo "<a href=\"\" onclick=\"return openjudgeinfo($r->id)\">$r->firstname $r->lastname</a>";
|
||||
echo "</td>";
|
||||
echo "<td>$r->email</td>";
|
||||
if($r->year)
|
||||
{
|
||||
echo "<td class=\"happy\" align=\"center\">".i18n("yes")."</td>";
|
||||
$active++;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<td class=\"error\" align=\"center\">".i18n("no")."</td>";
|
||||
$inactive++;
|
||||
}
|
||||
|
||||
if($r->complete=="yes" && $r->year)
|
||||
{
|
||||
@ -121,14 +107,16 @@ function openjudgeinfo(id)
|
||||
$completeno++;
|
||||
}
|
||||
echo "<td align=\"center\">";
|
||||
echo "<a onclick=\"return confirmClick('Are you sure you want to remove this judge from this years fair?')\" href=\"judges_judges.php?action=remove&remove=$r->id\"><img border=0 src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\"></a>";
|
||||
echo "<a onclick=\"return confirmClick('Are you sure you want to deactivate this judge from this years fair?')\" href=\"judges_judges.php?action=remove&remove=$r->id\"><img border=0 src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\"></a>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo i18n("Note: Deleting judges from this list only deactivates the judge for this year's fair. To completely delete a judge, use the 'Manage Judges' page");
|
||||
echo "<br />";
|
||||
echo i18n("There are %1 total judges, %2 of which are active for this year, %3 are inactive.",array($num,$active,$inactive),array("the number of judges","number of active judges","number of inactive judges"));
|
||||
echo "<br />";
|
||||
echo i18n("There are %1 total active judges.",array($num),array("the number of judges"));
|
||||
echo "<br />";
|
||||
echo i18n("There are %1 complete judges.",array($completeyes),array("the number of judges"));
|
||||
echo "<br />";
|
||||
|
@ -73,7 +73,7 @@ function openjudgeinfo(id)
|
||||
print("<input type=submit value=\"".i18n("Show")."\">");
|
||||
print("</form>");
|
||||
|
||||
echo i18n("Note: Deleting a judge from this screen only unlinks them from the current fairyear");
|
||||
// echo i18n("Note: Deleting a judge from this screen only unlinks them from the current fairyear");
|
||||
|
||||
$editor = new TableEditor('judge');
|
||||
|
||||
|
@ -166,6 +166,9 @@ function tableEditorGetList($editor)
|
||||
$where[] = "judges.complete='yes'";
|
||||
break;
|
||||
}
|
||||
//only show non-deleted judges
|
||||
$where[] = "judges.deleted='no'";
|
||||
|
||||
return array($sel, $from, $where);
|
||||
}
|
||||
|
||||
@ -327,8 +330,9 @@ function tableEditorDelete()
|
||||
|
||||
mysql_query("DELETE FROM judges_teams_link WHERE judges_id='$id' AND year=".$config['FAIRYEAR']."'");
|
||||
mysql_query("DELETE FROM judges_years WHERE judges_id='$id' AND year='".$config['FAIRYEAR']."'");
|
||||
mysql_query("UPDATE judges SET deleted='yes', deleteddatetime=NOW() WHERE id='$id'");
|
||||
|
||||
echo happy(i18n("Successfully removed judge from this year's fair"));
|
||||
echo happy(i18n("Successfully deleted the judge"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,8 +41,8 @@
|
||||
if($_GET['action']=="delete")
|
||||
{
|
||||
//okay here we go, lets get rid of them completely, since this is what theyve asked for
|
||||
echo happy(i18n("Judge account successfully deactivated. Goodbye!",array($config['FAIRYEAR'])));
|
||||
mysql_query("UPDATE judges SET deleted='Y', deleteddatetime=NOW() WHERE id='".$_SESSION['judges_id']."'");
|
||||
echo happy(i18n("Judge account successfully deleted. Goodbye!",array($config['FAIRYEAR'])));
|
||||
mysql_query("UPDATE judges SET deleted='yes', deleteddatetime=NOW() WHERE id='".$_SESSION['judges_id']."'");
|
||||
|
||||
unset($_SESSION['judges_id']);
|
||||
unset($_SESSION['email']);
|
||||
|
@ -145,7 +145,7 @@ echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan=\"2\">".i18n("I can judge in the following languages")."</td>";
|
||||
echo " <td colspan=\"2\">".i18n("I can judge in the following languages")." ".REQUIREDFIELD."</td>";
|
||||
echo " <td colspan=\"2\">";
|
||||
|
||||
//grab the current languages that are selected
|
||||
@ -161,7 +161,7 @@ while($r=mysql_fetch_object($q))
|
||||
{
|
||||
if(in_array($r->lang,$currentlanguages)) $ch="checked=\"checked\""; else $ch="";
|
||||
|
||||
echo "<input onclick=\"fieldChanged()\" $ch type=\"checkbox\" name=\"languages[]\" value=\"$r->lang\" /> $r->langname ".REQUIREDFIELD."<br />";
|
||||
echo "<input onclick=\"fieldChanged()\" $ch type=\"checkbox\" name=\"languages[]\" value=\"$r->lang\" /> $r->langname <br />";
|
||||
}
|
||||
|
||||
echo " </td>\n";
|
||||
|
Loading…
Reference in New Issue
Block a user