forked from science-ation/science-ation
fix schedule display boxes to be the same for FF/IE/Chrome
Add min/max judges/volunteers/teams Add defaults Update science olympic tab display Add Teams/Volunteers/Judges status to admin schedule view
This commit is contained in:
parent
2b4b42c250
commit
e55a6f901a
@ -47,11 +47,14 @@ $editor = new TableEditor('events',
|
|||||||
"summary" => "Summary",
|
"summary" => "Summary",
|
||||||
"website" => "Link to Description",
|
"website" => "Link to Description",
|
||||||
"suggested_grades" => "Suggested Grades",
|
"suggested_grades" => "Suggested Grades",
|
||||||
"min_judges" => "Minimum Number of Judges",
|
"default_min_teams" => "Minimum Number of Teams",
|
||||||
"max_judges" => "Maximum Number of Judges",
|
|
||||||
"default_max_teams" => "Maximum Number of Teams",
|
"default_max_teams" => "Maximum Number of Teams",
|
||||||
"default_min_team_size" => "Minimum Team Size",
|
"default_min_team_size" => "Minimum Team Size",
|
||||||
"default_max_team_size" => "Maximum Team Size"
|
"default_max_team_size" => "Maximum Team Size",
|
||||||
|
"default_min_judges" => "Minimum Number of Judges",
|
||||||
|
"default_max_judges" => "Maximum Number of Judges",
|
||||||
|
"default_min_volunteers" => "Minimum Number of Volunteers",
|
||||||
|
"default_max_volunteers" => "Maximum Number of Volunteers"
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
"conferences_id" => $conference['id']
|
"conferences_id" => $conference['id']
|
||||||
@ -68,6 +71,19 @@ $editor->setPrimaryKey("id");
|
|||||||
$editor->setRecordType("Event");
|
$editor->setRecordType("Event");
|
||||||
$editor->setDefaultSortField("eventtype,name");
|
$editor->setDefaultSortField("eventtype,name");
|
||||||
$editor->filterList("conferences_id", $conference['id']);
|
$editor->filterList("conferences_id", $conference['id']);
|
||||||
|
|
||||||
|
$editor->setFieldDefaultValue("default_min_teams",1);
|
||||||
|
$editor->setFieldDefaultValue("default_max_teams",4);
|
||||||
|
|
||||||
|
$editor->setFieldDefaultValue("default_min_team_size",1);
|
||||||
|
$editor->setFieldDefaultValue("default_max_team_size",6);
|
||||||
|
|
||||||
|
$editor->setFieldDefaultValue("default_min_judges",1);
|
||||||
|
$editor->setFieldDefaultValue("default_max_judges",2);
|
||||||
|
|
||||||
|
$editor->setFieldDefaultValue("default_min_volunteers",1);
|
||||||
|
$editor->setFieldDefaultValue("default_max_volunteers",5);
|
||||||
|
|
||||||
$editor->execute();
|
$editor->execute();
|
||||||
|
|
||||||
send_footer();
|
send_footer();
|
||||||
|
@ -72,8 +72,8 @@
|
|||||||
}
|
}
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
foreach($locations AS $id=>$name) {
|
foreach($locations AS $id=>$name) {
|
||||||
echo "<td id=\"{$h}_{$m}_{$id}\" onclick=\"clickTableCell(this)\">";
|
echo "<td id=\"{$h}_{$m}_{$id}\" onclick=\"clickTableCell(this)\"><div>";
|
||||||
echo "</td>";
|
echo "</div></td>";
|
||||||
}
|
}
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
@ -99,14 +99,44 @@
|
|||||||
echo format_time($starttime);
|
echo format_time($starttime);
|
||||||
echo " to ";
|
echo " to ";
|
||||||
echo format_time($endtime);
|
echo format_time($endtime);
|
||||||
|
echo "<br />";
|
||||||
|
|
||||||
if($r->eventtype=="scienceolympic") {
|
if($r->eventtype=="scienceolympic") {
|
||||||
echo "<br />";
|
|
||||||
echo i18n("Teams")." : ";
|
|
||||||
$regteams=getNumRegistrations($r->id);
|
|
||||||
$maxteams=$r->somaxteams;
|
|
||||||
echo i18n("%1 of %2",array($regteams,$maxteams));
|
|
||||||
|
|
||||||
|
$regteams=getNumRegistrations($r->id);
|
||||||
|
$minteams=$r->sominteams;
|
||||||
|
$maxteams=$r->somaxteams;
|
||||||
|
if($regteams<$minteams || $regteams >$maxteams)
|
||||||
|
$cl="class=\"error\"";
|
||||||
|
else $cl="";
|
||||||
|
echo "<span $cl>";
|
||||||
|
echo i18n("Teams")." : ";
|
||||||
|
echo i18n("%1 of %2-%3",array($regteams,$minteams,$maxteams));
|
||||||
|
echo "</span>";
|
||||||
|
echo "<br />";
|
||||||
|
|
||||||
|
$regjudges=getNumJudges($r->id);
|
||||||
|
$minjudges=$r->sominjudges;
|
||||||
|
$maxjudges=$r->somaxjudges;
|
||||||
|
if($regjudges<$minjudges || $regjudges >$maxjudges)
|
||||||
|
$cl="class=\"error\"";
|
||||||
|
else $cl="";
|
||||||
|
echo "<span $cl>";
|
||||||
|
echo i18n("Judges")." : ";
|
||||||
|
echo i18n("%1 of %2-%3",array($regjudges,$minjudges,$maxjudges));
|
||||||
|
echo "</span>";
|
||||||
|
echo "<br />";
|
||||||
|
|
||||||
|
$regvolunteers=getNumVolunteers($r->id);
|
||||||
|
$minvolunteers=$r->sominvolunteers;
|
||||||
|
$maxvolunteers=$r->somaxvolunteers;
|
||||||
|
if($regvolunteers<$minvolunteers || $regvolunteers>$maxvolunteers)
|
||||||
|
$cl="class=\"error\"";
|
||||||
|
else $cl="";
|
||||||
|
echo "<span $cl>";
|
||||||
|
echo i18n("Volunteers")." : ";
|
||||||
|
echo i18n("%1 of %2-%3",array($regvolunteers,$minvolunteers,$maxvolunteers));
|
||||||
|
echo "</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
@ -168,7 +198,12 @@
|
|||||||
duration='".mysql_real_escape_string($_POST['duration'])."',
|
duration='".mysql_real_escape_string($_POST['duration'])."',
|
||||||
events_id='$event_id',
|
events_id='$event_id',
|
||||||
locations_id='".mysql_real_escape_string($_POST['location_id'])."',
|
locations_id='".mysql_real_escape_string($_POST['location_id'])."',
|
||||||
|
sominteams='".mysql_real_escape_string($_POST['sominteams'])."',
|
||||||
somaxteams='".mysql_real_escape_string($_POST['somaxteams'])."',
|
somaxteams='".mysql_real_escape_string($_POST['somaxteams'])."',
|
||||||
|
sominjudges='".mysql_real_escape_string($_POST['sominjudges'])."',
|
||||||
|
somaxjudges='".mysql_real_escape_string($_POST['somaxjudges'])."',
|
||||||
|
sominvolunteers='".mysql_real_escape_string($_POST['sominvolunteers'])."',
|
||||||
|
somaxvolunteers='".mysql_real_escape_string($_POST['somaxvolunteers'])."',
|
||||||
sominteamsize='".mysql_real_escape_string($_POST['sominteamsize'])."',
|
sominteamsize='".mysql_real_escape_string($_POST['sominteamsize'])."',
|
||||||
somaxteamsize='".mysql_real_escape_string($_POST['somaxteamsize'])."'
|
somaxteamsize='".mysql_real_escape_string($_POST['somaxteamsize'])."'
|
||||||
WHERE id='$id' AND conferences_id='{$conference['id']}'");
|
WHERE id='$id' AND conferences_id='{$conference['id']}'");
|
||||||
@ -248,7 +283,7 @@
|
|||||||
|
|
||||||
if($("#"+tablecellid).length) {
|
if($("#"+tablecellid).length) {
|
||||||
var eheight=((eventobj.duration/15)*<?=$ROWHEIGHT?>)-<? echo $BORDERSIZE*2; ?>;
|
var eheight=((eventobj.duration/15)*<?=$ROWHEIGHT?>)-<? echo $BORDERSIZE*2; ?>;
|
||||||
var ewidth=$("#"+tablecellid).width()-<? echo $BORDERSIZE; ?>;
|
var ewidth=$("#"+tablecellid).width()-<? echo $BORDERSIZE*2; ?>;
|
||||||
var p=$("#"+tablecellid).offset();
|
var p=$("#"+tablecellid).offset();
|
||||||
$("#"+item.id).css(p);
|
$("#"+item.id).css(p);
|
||||||
$("#"+item.id).show();
|
$("#"+item.id).show();
|
||||||
@ -285,7 +320,15 @@
|
|||||||
|
|
||||||
if(json.eventtype=="scienceolympic") {
|
if(json.eventtype=="scienceolympic") {
|
||||||
//science olympics tab
|
//science olympics tab
|
||||||
|
$("#edit_sominteams").val(json.sominteams);
|
||||||
$("#edit_somaxteams").val(json.somaxteams);
|
$("#edit_somaxteams").val(json.somaxteams);
|
||||||
|
|
||||||
|
$("#edit_sominjudges").val(json.sominjudges);
|
||||||
|
$("#edit_somaxjudges").val(json.somaxjudges);
|
||||||
|
|
||||||
|
$("#edit_sominvolunteers").val(json.sominvolunteers);
|
||||||
|
$("#edit_somaxvolunteers").val(json.somaxvolunteers);
|
||||||
|
|
||||||
$("#edit_sominteamsize").val(json.sominteamsize);
|
$("#edit_sominteamsize").val(json.sominteamsize);
|
||||||
$("#edit_somaxteamsize").val(json.somaxteamsize);
|
$("#edit_somaxteamsize").val(json.somaxteamsize);
|
||||||
|
|
||||||
@ -317,11 +360,21 @@
|
|||||||
|
|
||||||
//science olympics tab
|
//science olympics tab
|
||||||
$("#edit_somaxteams").val("");
|
$("#edit_somaxteams").val("");
|
||||||
|
$("#edit_sominteams").val("");
|
||||||
|
|
||||||
|
$("#edit_somaxjudges").val("");
|
||||||
|
$("#edit_sominjudges").val("");
|
||||||
|
|
||||||
|
$("#edit_somaxvolunteers").val("");
|
||||||
|
$("#edit_sominvolunteers").val("");
|
||||||
|
|
||||||
$("#edit_sominteamsize").val("");
|
$("#edit_sominteamsize").val("");
|
||||||
$("#edit_somaxteamsize").val("");
|
$("#edit_somaxteamsize").val("");
|
||||||
|
|
||||||
$("#schedule_tabs").tabs('select',0);
|
$("#schedule_tabs").tabs('select',0);
|
||||||
|
|
||||||
|
$("#event_editor_tab_scienceolympics_registeredteams").html("");
|
||||||
|
|
||||||
}
|
}
|
||||||
$("#event_editor_dialog").dialog('option','width',600);
|
$("#event_editor_dialog").dialog('option','width',600);
|
||||||
$("#event_editor_dialog").dialog('option','height',400);
|
$("#event_editor_dialog").dialog('option','height',400);
|
||||||
|
@ -61,7 +61,15 @@ function event_change() {
|
|||||||
$("#edit_title").val($("#edit_event option:selected").text());
|
$("#edit_title").val($("#edit_event option:selected").text());
|
||||||
//}
|
//}
|
||||||
var ed=eventdefaults[ea[0]];
|
var ed=eventdefaults[ea[0]];
|
||||||
|
$("#edit_sominteams").val(ed.default_min_teams);
|
||||||
$("#edit_somaxteams").val(ed.default_max_teams);
|
$("#edit_somaxteams").val(ed.default_max_teams);
|
||||||
|
|
||||||
|
$("#edit_sominjudges").val(ed.default_min_judges);
|
||||||
|
$("#edit_somaxjudges").val(ed.default_max_judges);
|
||||||
|
|
||||||
|
$("#edit_sominvolunteers").val(ed.default_min_volunteers);
|
||||||
|
$("#edit_somaxvolunteers").val(ed.default_max_volunteers);
|
||||||
|
|
||||||
$("#edit_somaxteamsize").val(ed.default_max_team_size);
|
$("#edit_somaxteamsize").val(ed.default_max_team_size);
|
||||||
$("#edit_sominteamsize").val(ed.default_min_team_size);
|
$("#edit_sominteamsize").val(ed.default_min_team_size);
|
||||||
}
|
}
|
||||||
@ -142,27 +150,39 @@ echo "</table>";
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="schedule_tab_scienceolympics">
|
<div id="schedule_tab_scienceolympics">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th><?=i18n("Minimum")?></th>
|
||||||
|
<th><?=i18n("Maximum")?></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><?=i18n("Number of Teams")?></td>
|
||||||
|
<td><input type="text" name="sominteams" id="edit_sominteams" size="4"></td>
|
||||||
|
<td><input type="text" name="somaxteams" id="edit_somaxteams" size="4"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><?=i18n("Team Member Size")?></td>
|
||||||
|
<td><input type="text" name="sominteamsize" id="edit_sominteamsize" size="4"></td>
|
||||||
|
<td><input type="text" name="somaxteamsize" id="edit_somaxteamsize" size="4"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><?=i18n("Number of Judges")?></td>
|
||||||
|
<td><input type="text" name="sominjudges" id="edit_sominjudges" size="4"></td>
|
||||||
|
<td><input type="text" name="somaxjudges" id="edit_somaxjudges" size="4"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><?=i18n("Number of Volunteers")?></td>
|
||||||
|
<td><input type="text" name="sominvolunteers" id="edit_sominvolunteers" size="4"></td>
|
||||||
|
<td><input type="text" name="somaxvolunteers" id="edit_somaxvolunteers" size="4"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
<?
|
<?
|
||||||
echo "<table>";
|
|
||||||
echo "<tr><td>";
|
|
||||||
echo i18n("Maximum Number of Teams").": ";
|
|
||||||
echo "</td><td>";
|
|
||||||
echo "<input type=\"text\" name=\"somaxteams\" id=\"edit_somaxteams\" size=\"4\">";
|
|
||||||
echo "</td></tr>";
|
|
||||||
|
|
||||||
echo "<tr><td>";
|
|
||||||
echo i18n("Minimum Team Size").": ";
|
|
||||||
echo "</td><td>";
|
|
||||||
echo "<input type=\"text\" name=\"sominteamsize\" id=\"edit_sominteamsize\" size=\"4\">";
|
|
||||||
echo "</td></tr>";
|
|
||||||
|
|
||||||
echo "<tr><td>";
|
|
||||||
echo i18n("Maximum Team Size").": ";
|
|
||||||
echo "</td><td>";
|
|
||||||
echo "<input type=\"text\" name=\"somaxteamsize\" id=\"edit_somaxteamsize\" size=\"4\">";
|
|
||||||
echo "</td></tr>";
|
|
||||||
|
|
||||||
echo "</table>";
|
|
||||||
|
|
||||||
echo "<h4>".i18n("Judges")."</h4>";
|
echo "<h4>".i18n("Judges")."</h4>";
|
||||||
echo "<table style=\"width: 95%;\">";
|
echo "<table style=\"width: 95%;\">";
|
||||||
|
@ -1 +1 @@
|
|||||||
212
|
213
|
||||||
|
11
db/db.update.213.sql
Normal file
11
db/db.update.213.sql
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
ALTER TABLE `schedule` ADD `sominteams` INT NOT NULL AFTER `title`;
|
||||||
|
ALTER TABLE `schedule` ADD `sominjudges` INT NOT NULL AFTER `somaxteams` ,
|
||||||
|
ADD `somaxjudges` INT NOT NULL AFTER `sominjudges` ,
|
||||||
|
ADD `sominvolunteers` INT NOT NULL AFTER `somaxjudges` ,
|
||||||
|
ADD `somaxvolunteers` INT NOT NULL AFTER `sominvolunteers`;
|
||||||
|
ALTER TABLE `events` CHANGE `min_judges` `default_min_judges` INT( 11 ) NULL DEFAULT NULL;
|
||||||
|
ALTER TABLE `events` CHANGE `max_judges` `default_max_judges` INT( 11 ) NULL DEFAULT NULL;
|
||||||
|
ALTER TABLE `events` ADD `default_min_teams` INT NOT NULL AFTER `default_max_judges`;
|
||||||
|
ALTER TABLE `events` ADD `default_min_volunteers` INT NOT NULL ,
|
||||||
|
ADD `default_max_volunteers` INT NOT NULL;
|
||||||
|
|
@ -21,7 +21,7 @@
|
|||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$ROWHEIGHT=20;
|
$ROWHEIGHT=32;
|
||||||
$BORDERSIZE=2;
|
$BORDERSIZE=2;
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +44,18 @@ function getNumRegistrations($scheduleid) {
|
|||||||
return $r->num;
|
return $r->num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FIXME: implement getNumJudges
|
||||||
|
function getNumJudges($scheduleid) {
|
||||||
|
global $conference;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//FIXME: implement getNumVolunteers
|
||||||
|
function getNumVolunteers($scheduleid) {
|
||||||
|
global $conference;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
function getEventList($conferencesId, $school_id){
|
function getEventList($conferencesId, $school_id){
|
||||||
global $conference;
|
global $conference;
|
||||||
$events = array();
|
$events = array();
|
||||||
|
@ -88,8 +88,8 @@ if($_GET['action']=="loadschedule") {
|
|||||||
}
|
}
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
foreach($locations AS $id=>$name) {
|
foreach($locations AS $id=>$name) {
|
||||||
echo "<td id=\"{$h}_{$m}_{$id}\">";
|
echo "<td id=\"{$h}_{$m}_{$id}\"><div>";
|
||||||
echo "</td>";
|
echo "</div></td>";
|
||||||
}
|
}
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
@ -124,9 +124,9 @@ if($_GET['action']=="loadschedule") {
|
|||||||
echo format_time($starttime);
|
echo format_time($starttime);
|
||||||
echo " to ";
|
echo " to ";
|
||||||
echo format_time($endtime);
|
echo format_time($endtime);
|
||||||
|
echo "<br />";
|
||||||
|
|
||||||
if($eventType == "scienceolympic") {
|
if($eventType == "scienceolympic") {
|
||||||
echo "<br />";
|
|
||||||
echo i18n("Capacity").": ";
|
echo i18n("Capacity").": ";
|
||||||
$regteams = getNumRegistrations($eid);
|
$regteams = getNumRegistrations($eid);
|
||||||
$maxteams= $event['somaxteams'];
|
$maxteams= $event['somaxteams'];
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
*{margin:0}
|
||||||
|
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
font-family: Verdana, Arial, Sans-Serif;
|
font-family: Verdana, Arial, Sans-Serif;
|
||||||
@ -643,9 +645,10 @@ ul.conferencenav li a:hover {
|
|||||||
|
|
||||||
|
|
||||||
.schedule {
|
.schedule {
|
||||||
border: 2px solid black;
|
border: 2px solid silver;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.schedule th {
|
.schedule th {
|
||||||
@ -654,15 +657,24 @@ ul.conferencenav li a:hover {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
width: 150px;
|
width: 150px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid black;
|
border: 0px solid black;
|
||||||
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.schedule td {
|
.schedule td {
|
||||||
border: 1px solid #CCCCCC;
|
border: 0px;
|
||||||
height: 20px;
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.schedule td div {
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
height: 30px;
|
||||||
|
border: 1px solid #CCCCCC;
|
||||||
|
}
|
||||||
|
|
||||||
.scheduletime {
|
.scheduletime {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@ -676,15 +688,18 @@ ul.conferencenav li a:hover {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
border: 2px solid #777777;
|
border: 2px solid #777777;
|
||||||
background: #FFC143;
|
background: #FFC143;
|
||||||
width: 150px;
|
|
||||||
margin:0;
|
margin:0;
|
||||||
width: 148px;
|
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
display: none;
|
display: none;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
padding: 0px;
|
||||||
|
box-sizing: content-box;
|
||||||
|
moz-box-sizing: content-box;
|
||||||
|
webkit-box-sizing: content-box;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.scheduleevent_title {
|
.scheduleevent_title {
|
||||||
|
Loading…
Reference in New Issue
Block a user