Fix rolestasks saving of the level for each item

Fix tableeditor css to only modify anything in the tableeditor/tableview classes
Fix saving language for volunteers
Fix error message for saving phone numbers on organization and personal
Fix schoolfeedback and schoolinfo pages
Update school select tab, better html and school options list
Fix css for tertiary menu to show difference between selected and non-selected
This commit is contained in:
james 2010-10-14 19:42:20 +00:00
parent 01d70abf74
commit ba793ac8e0
13 changed files with 143 additions and 169 deletions

View File

@ -151,9 +151,9 @@ if(isset($_SESSION['roles']) && $_SESSION['username']) {
<form method="post" action="user_login.php"> <form method="post" action="user_login.php">
<input type="hidden" name="action" value="login" /> <input type="hidden" name="action" value="login" />
<table><tr><td> <table><tr><td>
<?=i18n("Username")?>:</td><td><input type="text" size="14" name="username" /> <?=i18n("Username")?>:</td><td><input type="text" size="18" name="username" />
</td></tr><tr><td> </td></tr><tr><td>
<?=i18n("Password")?>:</td><td><input type="password" size="14" name="password" /> <?=i18n("Password")?>:</td><td><input type="password" size="18" name="password" />
</td></tr> </td></tr>
<tr><td style="text-align: center;" colspan="2"> <tr><td style="text-align: center;" colspan="2">
<a href="register.php"><?=i18n("Register")?></a> <a href="register.php"><?=i18n("Register")?></a>
@ -288,7 +288,7 @@ if(array_key_exists('users_id', $_SESSION)) {
</div> </div>
<div id="division-menu" class="clear"> <div id="division-menu" class="clear">
<? <?
$q=mysql_query("SELECT * FROM rolestasks WHERE pid='{$_SESSION['nav']['primary']}' AND level=1 AND conferencetype='{$conference['type']}' ORDER By ord,task"); $q=mysql_query("SELECT * FROM rolestasks WHERE pid='{$_SESSION['nav']['primary']}' AND conferencetype='{$conference['type']}' ORDER By ord,task");
echo "<ul class=\"secondarynav\">"; echo "<ul class=\"secondarynav\">";
$cl=""; $cl="";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
@ -318,10 +318,10 @@ if(array_key_exists('users_id', $_SESSION)) {
$topicMenuStyle = 'style="display:none;"'; $topicMenuStyle = 'style="display:none;"';
} }
?> ?>
<div id="topic-menu" <?=$topicMenuStyle?>> <div id="topic-menu" class="clear" <?=$topicMenuStyle?>>
<? <?
$q=mysql_query("SELECT * FROM rolestasks WHERE pid='{$_SESSION['nav']['secondary']}' AND level=2 AND conferencetype='{$conference['type']}' ORDER By ord,task"); $q=mysql_query("SELECT * FROM rolestasks WHERE pid='{$_SESSION['nav']['secondary']}' AND conferencetype='{$conference['type']}' ORDER By ord,task");
echo "<ul class=\"topic-menu sfiab-menu\">"; echo "<ul class=\"tertiarynav\">";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
$cl="class=\""; $cl="class=\"";
if($r->link) if($r->link)

View File

@ -2,52 +2,38 @@
require_once('common.inc.php'); require_once('common.inc.php');
require_once('user.inc.php'); require_once('user.inc.php');
user_auth_required("teacher");
$schoolid=user_field_required("schools_id","user_edit.php?tab=school");
if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) send_header("Feedback / Questions");
{
$title = i18n("Feedback / Questions");
send_header($title, array("School Home" => "schoolaccess.php"));
// load the school info // load the school info
$q=mysql_query("SELECT * FROM schools WHERE id='".$_SESSION['schoolid']."' AND accesscode='".$_SESSION['schoolaccesscode']."' AND year='".$config['FAIRYEAR']."'"); $q=mysql_query("SELECT * FROM schools WHERE id='$schoolid'");
echo mysql_error(); echo mysql_error();
$school=mysql_fetch_object($q); $school=mysql_fetch_object($q);
if($school->sciencehead_uid > 0) // send the e-mail if we're receiving a post
$sh = user_load_by_uid($school->sciencehead_uid); if(array_key_exists('feedbacktext', $_POST)){
else $body="";
$sh = array(); $body.=date("r")."\n";
$sh_email = ($sh['email'] != '' && $sh['email'][0] != '*') ? $sh['email'] : ''; $body.=$_SERVER['REMOTE_ADDR']." (".$_SERVER['REMOTE_HOST'].")\n";
$body.="School ID: $school->id\n";
// send the e-mail if we're receiving a post $body.="School Name: $school->school\n";
if(array_key_exists('feedbacktext', $_POST)){ if($sh['name']) $body.="Science Teacher: {$sh['name']}\n";
$body=""; if($sh['phonework']) $body.="Science Teacher Phone: {$sh['phonework']}\n";
$body.=date("r")."\n"; if($sh_email) $body.="Science Teacher Email: $sh_email\n";
$body.=$_SERVER['REMOTE_ADDR']." (".$_SERVER['REMOTE_HOST'].")\n"; $body.="\nFeedback:\n".stripslashes($_POST['feedbacktext'])."\n";
$body.="School ID: $school->id\n"; $returnEmailAddress = $sh_email;
$body.="School Name: $school->school\n"; mail($config['fairmanageremail'],"School Feedback",$body,"From: ". $returnEmailAddress."\nReply-To: ".$returnEmailAddress."\nReturn-Path: ".$returnEmailAddress);
if($sh['name']) $body.="Science Teacher: {$sh['name']}\n"; echo happy_("Your feedback has been sent");
if($sh['phonework']) $body.="Science Teacher Phone: {$sh['phonework']}\n";
if($sh_email) $body.="Science Teacher Email: $sh_email\n";
$body.="\nFeedback:\n".stripslashes($_POST['feedbacktext'])."\n";
$returnEmailAddress = $sh_email;
mail($config['fairmanageremail'],"School Feedback",$body,"From: ". $returnEmailAddress."\nReply-To: ".$returnEmailAddress."\nReturn-Path: ".$returnEmailAddress);
echo happy_("Your feedback has been sent");
}
// draw the feedback form
echo i18n("We are always welcome to any feedback (both positive and constructive criticism!), or any questions you may have. Please use the following form to communicate with the science fair committee!");
if($sh_email != '') {
echo "<form method=POST action=\"schoolfeedback.php\">";
echo "<br><textarea name=feedbacktext rows=8 cols=60></textarea><br>";
echo "<input type=submit value=\"Send Feedback\">";
echo "</form>";
}else{
echo error("Feedback is disabled until a science teacher email address is entered above");
}
send_footer();
}else{
header('Location: schoolaccess.php');
} }
// draw the feedback form
echo i18n("We are always welcome to any feedback (both positive and constructive criticism!), or any questions you may have. Please use the following form to communicate with the science fair committee!");
echo "<form method=\"post\" action=\"schoolfeedback.php\">";
echo "<br><textarea name=\"feedbacktext\" rows=\"8\" cols=\"60\"></textarea><br />";
echo "<input type=\"submit\" value=\"".i18n("Send Feedback")."\">";
echo "</form>";
send_footer();
?> ?>

View File

@ -2,89 +2,37 @@
require_once('common.inc.php'); require_once('common.inc.php');
require_once('user.inc.php'); require_once('user.inc.php');
user_auth_required("teacher");
$schoolid=user_field_required("schools_id","user_edit.php?tab=school");
if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) send_header("School Details");
{
$title = i18n("School Information");
send_header($title, array("School Home" => "schoolaccess.php"));
$q=mysql_query("SELECT * FROM schools WHERE id='".$_SESSION['schoolid']."' AND accesscode='".$_SESSION['schoolaccesscode']."' AND year='".$config['FAIRYEAR']."'"); if($_POST['action']=="save") {
echo mysql_error(); // load the school info so we know which one we're saving
$q=mysql_query("SELECT * FROM schools WHERE id='$schoolid'");
$school=mysql_fetch_object($q); $school=mysql_fetch_object($q);
if($school->sciencehead_uid > 0) mysql_query("UPDATE schools SET
$sh = user_load_by_uid($school->sciencehead_uid); school='".mysql_real_escape_string($_POST['school'])."',
address='".mysql_real_escape_string($_POST['address'])."',
city='".mysql_real_escape_string($_POST['city'])."',
province_code='".mysql_real_escape_string($_POST['province_code'])."',
postalcode='".mysql_real_escape_string($_POST['postalcode'])."',
phone='".mysql_real_escape_string($_POST['phone'])."',
fax='".mysql_real_escape_string($_POST['fax'])."'
WHERE id='$school->id'");
echo mysql_error();
if(mysql_error())
echo error(i18n("An Error occured trying to save the school information"));
else else
$sh = array(); echo happy(i18n("School information successfully updated"));
$sh_email = ($sh['email'] != '' && $sh['email'][0] != '*') ? $sh['email'] : '';
if($_POST['action']=="save") {
/* Get info about science head */
$sciencehead_update = '';
list($first, $last) = explode(' ', $_POST['sciencehead'], 2);
$em = $_POST['scienceheademail'];
if($em == '' && ($first != '' || $last != '')) $em = "*$first$last".user_generate_password();
if($school->sciencehead_uid > 0)
$sh = user_load_by_uid($school->sciencehead_uid);
else if($em != '') {
$sh = user_create('teacher', $em);
$sciencehead_update = "sciencehead_uid='{$sh['uid']}',";
} else
$sh = false;
/* If we have a record, either delete it or update it */
if(is_array($sh)) {
if($em == '') {
user_purge($sh, 'teacher');
$sciencehead_update = 'sciencehead_uid=NULL,';
} else {
$sh['firstname'] = $first;
$sh['lastname'] = $last;
$sh['phonework'] = $_POST['scienceheadphone'];
$sh['email'] = $em;
$sh['username'] = $em;
user_save($sh);
}
}
mysql_query("UPDATE schools SET
school='".mysql_escape_string(stripslashes($_POST['school']))."',
address='".mysql_escape_string(stripslashes($_POST['address']))."',
city='".mysql_escape_string(stripslashes($_POST['city']))."',
province_code='".mysql_escape_string(stripslashes($_POST['province_code']))."',
postalcode='".mysql_escape_string(stripslashes($_POST['postalcode']))."',
phone='".mysql_escape_string(stripslashes($_POST['phone']))."',
$sciencehead_update
fax='".mysql_escape_string(stripslashes($_POST['fax']))."'
WHERE id='$school->id'");
echo mysql_error();
if(mysql_error())
echo error(i18n("An Error occured trying to save the school information"));
else
echo happy(i18n("School information successfully updated"));
}
}else{
header('Location: schoolaccess.php');
exit();
} }
// load the school info // load the school info
$q=mysql_query("SELECT * FROM schools WHERE id='".$_SESSION['schoolid']."' AND accesscode='".$_SESSION['schoolaccesscode']."' AND year='".$config['FAIRYEAR']."'"); $q=mysql_query("SELECT * FROM schools WHERE id='$schoolid'");
echo mysql_error();
$school=mysql_fetch_object($q); $school=mysql_fetch_object($q);
if($school->sciencehead_uid > 0)
$sh = user_load_by_uid($school->sciencehead_uid);
else
$sh = array();
$sh_email = ($sh['email'] != '' && $sh['email'][0] != '*') ? $sh['email'] : '';
draw_page(); draw_page();
send_footer(); send_footer();
@ -92,10 +40,10 @@ function draw_page(){
global $config, $school, $sh_email, $sh_email, $sh; global $config, $school, $sh_email, $sh_email, $sh;
echo i18n("Please make sure your school contact information is correct, make any necessary changes:"); echo i18n("Please make sure your school contact information is correct, make any necessary changes:");
echo "<form method=POST action=\"schoolinfo.php\">"; echo "<form method=\"post\" action=\"schoolinfo.php\">";
echo "<input type=hidden name=action value=\"save\">"; echo "<input type=\"hidden\" name=\"action\" value=\"save\">";
echo "<table border=0 cellspacing=0 cellpadding=3>"; echo "<table border=0 cellspacing=0 cellpadding=3>";
echo "<tr><td>".i18n("School Name")."</td><td><input value=\"$school->school\" type=text name=school size=40></td></tr>"; echo "<tr><td>".i18n("School Name")."</td><td><input value=\"$school->school\" type=\"text\" name=\"school\" size=\"40\"></td></tr>";
// echo "<tr><td>Registration Password</td><td><input value=\"$school->registration_password\" type=text name=\"registration_password\" size=\"20\"></td></tr>"; // echo "<tr><td>Registration Password</td><td><input value=\"$school->registration_password\" type=text name=\"registration_password\" size=\"20\"></td></tr>";
echo "<tr><td>".i18n("Address")."</td><td><input value=\"$school->address\" type=text name=address size=40></td></tr>"; echo "<tr><td>".i18n("Address")."</td><td><input value=\"$school->address\" type=text name=address size=40></td></tr>";
echo "<tr><td>".i18n("City")."</td><td><input value=\"$school->city\" type=text name=city size=30></td></tr>"; echo "<tr><td>".i18n("City")."</td><td><input value=\"$school->city\" type=text name=city size=30></td></tr>";
@ -106,9 +54,11 @@ function draw_page(){
echo "<tr><td>".i18n("Phone Number")."</td><td><input value=\"$school->phone\" type=text name=phone size=30></td></tr>"; echo "<tr><td>".i18n("Phone Number")."</td><td><input value=\"$school->phone\" type=text name=phone size=30></td></tr>";
echo "<tr><td>".i18n("Fax Number")."</td><td><input value=\"$school->fax\" type=text name=fax size=30></td></tr>"; echo "<tr><td>".i18n("Fax Number")."</td><td><input value=\"$school->fax\" type=text name=fax size=30></td></tr>";
/*
echo "<tr><td>".i18n("Science Teacher")."</td><td><input value=\"{$sh['name']}\" type=text name=sciencehead size=40></td></tr>"; echo "<tr><td>".i18n("Science Teacher")."</td><td><input value=\"{$sh['name']}\" type=text name=sciencehead size=40></td></tr>";
echo "<tr><td>".i18n("Science Teacher Email")."</td><td><input value=\"$sh_email\" type=text name=scienceheademail size=40></td></tr>"; echo "<tr><td>".i18n("Science Teacher Email")."</td><td><input value=\"$sh_email\" type=text name=scienceheademail size=40></td></tr>";
echo "<tr><td>".i18n("Science Teacher Phone")."<br><font size=1>(".i18n("If different than above").")</font></td><td><input value=\"{$sh['phonework']}\" type=text name=scienceheadphone size=30></td></tr>"; echo "<tr><td>".i18n("Science Teacher Phone")."<br><font size=1>(".i18n("If different than above").")</font></td><td><input value=\"{$sh['phonework']}\" type=text name=scienceheadphone size=30></td></tr>";
*/
echo "</table>"; echo "</table>";
echo "<input type=submit value=\"".i18n("Save Changes")."\">"; echo "<input type=submit value=\"".i18n("Save Changes")."\">";
echo "</form>"; echo "</form>";

View File

@ -162,10 +162,12 @@ function doTree($id,$roleid,$ctype) {
echo mysql_error(); echo mysql_error();
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
echo "comparing {$r->id} with {$dropid} \n"; echo "comparing {$r->id} with {$dropid} \n";
$droplevel=$r->level;
if($r->id==$dropid) { if($r->id==$dropid) {
$ord++; $ord++;
mysql_query("UPDATE rolestasks SET pid='$droppid', ord='$ord' WHERE id='$dragid'"); //dropped on something, so put it at the same level as what we dropped
mysql_query("UPDATE rolestasks SET pid='$droppid', level='$droplevel', ord='$ord' WHERE id='$dragid'");
echo "found!"; echo "found!";
$updated=true; $updated=true;
} }
@ -175,7 +177,7 @@ function doTree($id,$roleid,$ctype) {
if(!$updated) { if(!$updated) {
echo "not found, putting it at the end"; echo "not found, putting it at the end";
$ord++; $ord++;
mysql_query("UPDATE rolestasks SET pid='$droppid', ord='$ord' WHERE id='$dragid'"); mysql_query("UPDATE rolestasks SET pid='$droppid', level='$droplevel', ord='$ord' WHERE id='$dragid'");
} }
echo mysql_error(); echo mysql_error();
} }

View File

@ -1,8 +1,8 @@
select { .tableedit select {
font-size: 1.0em; font-size: 1.0em;
} }
input { .tableedit input {
font-size: 1.0em; font-size: 1.0em;
} }

View File

@ -17,7 +17,8 @@ body
input, textarea, select input, textarea, select
{ {
font-family: Verdana, Arial, Sans-Serif; font-family: Verdana, Arial, Sans-Serif;
font-size: small; font-size: 0.85em;
margin: 0;
} }
td { td {
@ -67,7 +68,7 @@ table tr.odd {
#header-conferences { #header-conferences {
border: 1px solid #777777; border: 1px solid #777777;
position: absolute; position: absolute;
right: 210px; right: 240px;
height: 70px; height: 70px;
background-color: #DDDDDD; background-color: #DDDDDD;
} }
@ -78,7 +79,11 @@ table tr.odd {
position: absolute; position: absolute;
right: 5px; right: 5px;
height: 70px; height: 70px;
width: 200px; width: 230px;
}
#header-login table {
border-collapse: collapse;
width: 100%;
} }
#primarymenu, #primarymenu,
@ -112,8 +117,34 @@ table tr.odd {
float: left; float: left;
margin-left: 0px; margin-left: 0px;
margin-right: 10px; margin-right: 10px;
padding-left: 3px;
} }
.topic-menu ul {
margin-left: 0px;
padding-left: 0px;
}
.topic-menu li {
margin-left: 0px;
padding-left: 0px;
}
.topic-menu li.selected {
color: red;
}
.sfiab-menu {
list-style-position: inside;
list-style-type: none;
}
.sfiab-menu .selected {
color: red;
}
#main { #main {
background: #FFFFFF; background: #FFFFFF;
padding: 3px; padding: 3px;
@ -275,18 +306,24 @@ ul.secondarynav li.secondarynav-selected a {
} }
ul.tertiarynav { ul.tertiarynav {
font-size: 0.9em; list-style : none;
padding: 0;
} }
ul.tertiarynav li a { ul.tertiarynav li {
display: block;
margin-left: 5px;
margin-top: 5px;
} }
.tertiarylinknav-selected a { li.link a {
color: black;
}
li.selected a {
font-weight: bold; font-weight: bold;
} }
.aligncenter { .aligncenter {
width: 100%; width: 100%;
text-align: center; text-align: center;

View File

@ -148,6 +148,7 @@ function user_load($users_id, $accounts_id = false)
convenience variable, not not the email itself, for that, they need to access convenience variable, not not the email itself, for that, they need to access
the account. */ the account. */
unset($u['email']); unset($u['email']);
$should_be_arrays=array();
foreach(array_keys($u['roles']) as $r) { foreach(array_keys($u['roles']) as $r) {
@ -176,11 +177,7 @@ function user_load($users_id, $accounts_id = false)
// $u['highest_psd'] = $u['highest_psd']; // $u['highest_psd'] = $u['highest_psd'];
/* Sanity check the arrays, make sure they are arrays */ /* Sanity check the arrays, make sure they are arrays */
$should_be_arrays = array('cat_prefs','div_prefs', $should_be_arrays = array('cat_prefs','div_prefs', 'divsub_prefs','languages');
'divsub_prefs','languages');
foreach($should_be_arrays as $k) {
if(!is_array($u[$k])) $u[$k] = array();
}
break; break;
case 'sponsor': case 'sponsor':
@ -190,12 +187,19 @@ function user_load($users_id, $accounts_id = false)
$u['sponsor']=mysql_fetch_assoc($q); $u['sponsor']=mysql_fetch_assoc($q);
} }
break; break;
case 'volunteer':
$u['languages'] = (strlen($u['languages']) > 0) ? unserialize($u['languages']) : array();
$should_be_arrays = array('languages');
break;
default: default:
/* Nothing to do for all other roles */ /* Nothing to do for all other roles */
break; break;
} }
} }
foreach($should_be_arrays as $k) {
if(!is_array($u[$k])) $u[$k] = array();
}
/* Do this assignment without recursion :) */ /* Do this assignment without recursion :) */
unset($u['orig']); unset($u['orig']);
@ -286,6 +290,8 @@ function user_save(&$u)
$fields_for_role['student'] = array('schools_id'); $fields_for_role['student'] = array('schools_id');
$fields_for_role['fair'] = array('fairs_id'); $fields_for_role['fair'] = array('fairs_id');
$fields_for_role['sponsor'] = array('sponsors_id','primary','position'); $fields_for_role['sponsor'] = array('sponsors_id','primary','position');
$fields_for_role['teacher'] = array();
$fields_for_role['volunteer'] = array('languages');
/* Merge fields as necessary, build a big list of fields to save */ /* Merge fields as necessary, build a big list of fields to save */
foreach($new_roles as $r) { foreach($new_roles as $r) {

View File

@ -82,7 +82,7 @@ function user_edit_item(&$u, $label, $fname, $type='textbox', $data1=NULL, $data
foreach($config['languages'] AS $l=>$ln) { foreach($config['languages'] AS $l=>$ln) {
$ch = (in_array($l,$u['languages'])) ? 'checked="checked"' : ''; $ch = (in_array($l,$u['languages'])) ? 'checked="checked"' : '';
if($x) echo '<br />'; if($x) echo '<br />';
echo "<input $ch type=\"checkbox\" name=\"$fname\" value=\"$l\" />$ln"; echo "<label><input $ch type=\"checkbox\" name=\"$fname\" value=\"$l\" /> $ln</label>";
$x=1; $x=1;
} }
echo "</span>"; echo "</span>";
@ -95,7 +95,7 @@ function user_edit_item(&$u, $label, $fname, $type='textbox', $data1=NULL, $data
foreach($data1 AS $key=>$txt) { foreach($data1 AS $key=>$txt) {
$ch = (in_array($key,$data2)) ? 'checked="checked"' : ''; $ch = (in_array($key,$data2)) ? 'checked="checked"' : '';
if($x) echo '<br />'; if($x) echo '<br />';
echo "<input $ch type=\"checkbox\" name=\"$fname\" value=\"$key\" />$txt"; echo "<label><input $ch type=\"checkbox\" name=\"$fname\" value=\"$key\" /> $txt</label>";
$x=1; $x=1;
} }
echo "</span>"; echo "</span>";

View File

@ -201,7 +201,7 @@ if(count($a) == 0) {
} }
send_header(i18n("User Editor").": {$u['name']}"); send_header($u['name']);
/* Setup tabs */ /* Setup tabs */
echo '<div id="tabs">'; echo '<div id="tabs">';

View File

@ -146,20 +146,13 @@ send_header("Main Page", array());
</script> </script>
<?php <?php
// draw the main body of the page // draw the main body of the page
echo "<div><p>";
//only display the named greeting if we have their name //only display the named greeting if we have their name
echo i18n("Hello <strong>%1</strong>",array($_SESSION['name'])); echo i18n("Hello %1",array($_SESSION['name']));
echo "<p>This is a placeholder for the main user page until all the specific user-role pages are removed. For now, here's what you can do: </p></div>";
draw_roles();
echo "<br />"; echo "<br />";
echo i18n('Other Options and Things To Do').':<br />'; echo "<br />";
echo '<ul>'; draw_roles();
echo '<li><a href="user_edit.php">'.i18n('Change Password').'</a> - '.i18n('Change your email, username, and password').'</li>';
echo '<li>'.i18n('To logout, use the "Logout" link in the upper-right of the page').'</li>';
echo '</ul>';
send_footer(); send_footer();
@ -186,7 +179,7 @@ function draw_roles(){
echo '<div id="roles">'; echo '<div id="roles">';
if(count($registered) > 0){ if(count($registered) > 0){
$rowNumber = 0; $rowNumber = 0;
echo "<h4>" . i18n("You are currently registered for the following roles") . ":</h4>"; echo "<h3>" . i18n("You are currently registered for the following roles") . ":</h3>";
echo '<form class="editor" id="rolesform">'; echo '<form class="editor" id="rolesform">';
echo "<table class=\"summarytable\" style=\"width:95%;margin-bottom:1em\">"; echo "<table class=\"summarytable\" style=\"width:95%;margin-bottom:1em\">";
foreach($registered as $role => $title){ foreach($registered as $role => $title){
@ -225,7 +218,7 @@ function draw_roles(){
} }
if(count($available) > 0){ if(count($available) > 0){
echo "<h4>" . i18n("The following roles are available") . ":</h4>"; echo "<h3>" . i18n("The following roles are available") . ":</h3>";
$rowNumber = 0; $rowNumber = 0;
echo "<table class=\"summarytable\" style=\"width:95%\">"; echo "<table class=\"summarytable\" style=\"width:95%\">";
foreach($available as $type => $title){ foreach($available as $type => $title){

View File

@ -123,7 +123,7 @@ jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
phone_number = phone_number.replace(/\s+/g, ""); phone_number = phone_number.replace(/\s+/g, "");
return this.optional(element) || phone_number.length > 9 && return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^[2-9]\d{2}-[2-9]\d{2}-\d{4}$/); phone_number.match(/^[2-9]\d{2}-[2-9]\d{2}-\d{4}$/);
}, "Please specify a valid phone number"); }, "Please specify a valid phone number (NNN-NNN-NNNN)");
$(document).ready(function() { $(document).ready(function() {
$("#orgform").validate({ $("#orgform").validate({

View File

@ -236,7 +236,7 @@ jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
phone_number = phone_number.replace(/\s+/g, ""); phone_number = phone_number.replace(/\s+/g, "");
return this.optional(element) || phone_number.length > 9 && return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^[2-9]\d{2}-[2-9]\d{2}-\d{4}$/); phone_number.match(/^[2-9]\d{2}-[2-9]\d{2}-\d{4}$/);
}, "Please specify a valid phone number"); }, "Please specify a valid phone number (NNN-NNN-NNNN)");
$(document).ready(function() { $(document).ready(function() {
$("#personalform").validate({ $("#personalform").validate({

View File

@ -109,7 +109,7 @@ if($currentSchool){
// draw the form elements for changing the school // draw the form elements for changing the school
echo "<table><tr><td>"; echo "<table><tr><td>";
echo "<strong>" . i18n("School") . ": </strong>"; echo i18n("School").":";
echo "</td><td>"; echo "</td><td>";
// build a select box for them to pick out a school // build a select box for them to pick out a school
@ -117,23 +117,23 @@ echo '<select id="schoolId">';
$query = "SELECT MAX(id) AS id,school,city FROM schools GROUP BY school, city"; $query = "SELECT MAX(id) AS id,school,city FROM schools GROUP BY school, city";
$q = mysql_query($query); $q = mysql_query($query);
$prev="somethingthatdoesnotexist"; $prev="somethingthatdoesnotexist";
echo "<option value=\"\">".i18n("Choose a school")."</option>\n";
while($r=mysql_fetch_object($q)){ while($r=mysql_fetch_object($q)){
if($r->school == $schoolData['school']){ if($r->school == $schoolData['school']){
$selected = "SELECTED"; $sel= "selected=\"selected\"";
}else{ }else{
$selected = ""; $sel= "";
} }
if($r->school==$prev) if($r->school==$prev)
echo "<option $selected value=\"$r->id\">$r->school ($r->city)</option>\n"; echo "<option $sel value=\"$r->id\">$r->school ($r->city)</option>\n";
else else
echo "<option $selected value=\"$r->id\">$r->school</option>\n"; echo "<option $sel value=\"$r->id\">$r->school</option>\n";
$prev=$r->school; $prev=$r->school;
} }
echo "</select>"; echo "</select>";
echo "</td></tr><tr><td>"; echo "</td></tr>";
echo "<tr><td>";
// and the rest of the form... echo i18n("Access Code") . ":";
echo "<strong>" . i18n("Access Code") . ": </strong>";
echo "</td><td>"; echo "</td><td>";
echo '<input type="text" id="accessCode"></input><br/>'; echo '<input type="text" id="accessCode"></input><br/>';
echo "</td></tr><tr><td colspan = 2>"; echo "</td></tr><tr><td colspan = 2>";