Add config options for Province/State and Postal Code/Zip Code

This commit is contained in:
james 2008-07-16 17:23:53 +00:00
parent 986ce4ef44
commit 651d6235a4
20 changed files with 55 additions and 54 deletions

View File

@ -108,10 +108,10 @@
echo "<tr><td>".i18n("Organization Name")."</td><td><input type=\"text\" id=\"organization\" name=\"organization\" value=\"".htmlspecialchars($r->organization)."\" size=\"60\" maxlength=\"128\" /><script type=\"text/javascript\">translateButton('organization');</script></td></tr>\n";
echo "<tr><td>".i18n("Address")."</td><td><input type=\"text\" name=\"address\" value=\"".htmlspecialchars($r->address)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("City")."</td><td><input type=\"text\" name=\"city\" value=\"".htmlspecialchars($r->city)."\" size=\"32\" maxlength=\"32\" /></td></tr>\n";
echo "<tr><td>".i18n("Province")."</td><td>";
echo "<tr><td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province_code",$r->province_code);
echo "</td></tr>\n";
echo "<tr><td>".i18n("Postal Code")."</td><td><input type=\"text\" name=\"postalcode\" value=\"$r->postalcode\" size=\"8\" maxlength=\"7\" /></td></tr>\n";
echo "<tr><td>".i18n($config['postalzip'])."</td><td><input type=\"text\" name=\"postalcode\" value=\"$r->postalcode\" size=\"8\" maxlength=\"7\" /></td></tr>\n";
echo "<tr><td>".i18n("Phone")."</td><td><input type=\"text\" name=\"phone\" value=\"".htmlspecialchars($r->phone)."\" size=\"16\" maxlength=\"32\" /></td></tr>\n";
echo "<tr><td>".i18n("Fax")."</td><td><input type=\"text\" name=\"fax\" value=\"".htmlspecialchars($r->fax)."\" size=\"16\" maxlength=\"32\" /></td></tr>\n";
echo "<tr><td>".i18n("Email")."</td><td><input type=\"text\" name=\"email\" value=\"".htmlspecialchars($r->email)."\" size=\"60\" maxlength=\"128\" /></td></tr>\n";

View File

@ -71,7 +71,7 @@ $preferencechoices=array(
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Address 1")."</th><td>$judgeinfo->address</td>\n";
echo " <th>".i18n("Province")."</th><td>$judgeinfo->province";
echo " <th>".i18n($config['provincestate'])."</th><td>$judgeinfo->province";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
@ -80,7 +80,7 @@ $preferencechoices=array(
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Postal Code")."</th><td>$judgeinfo->postalcode</td>\n";
echo " <th>".i18n($config['postalzip'])."</th><td>$judgeinfo->postalcode</td>\n";
echo " <th>".i18n("Phone (Work)")."</th><td>$judgeinfo->phonework&nbsp;ext $judgeinfo->phoneworkext</td>\n";
echo "</tr>";

View File

@ -90,14 +90,14 @@ $report_awards_fields = array(
'table' => 'award_sponsors.city' ),
'sponsor_province' => array(
'name' => 'Sponsor -- Province',
'header' => 'Sp. Province',
'name' => 'Sponsor -- '.$config['provincestate'],
'header' => 'Sp. '.$config['provincestate'],
'width' => 0.75,
'table' => 'award_sponsors.province_code' ),
'sponsor_postal' => array(
'name' => 'Sponsor -- Postal Code',
'header' => 'Sp. Postal',
'name' => 'Sponsor -- '.$config['postalzip'],
'header' => 'Sp. '.$config['postalzip'],
'width' => 0.75,
'table' => 'award_sponsors.postalcode' ),

View File

@ -78,14 +78,14 @@ $report_committees_fields = array(
'table' => 'users.city' ),
'province' => array(
'name' => 'Committee Member -- Address Province',
'header' => 'Province',
'name' => 'Committee Member -- Address '.$config['provincestate'],
'header' => $config['provincestate'],
'width' => 0.75,
'table' => 'users.province' ),
'postal' => array(
'name' => 'Committee Member -- Address Postal Code',
'header' => 'Postal',
'name' => 'Committee Member -- Address '.$config['postalzip'],
'header' => $config['postalzip'],
'width' => 0.75,
'table' => 'users.postalcode' ),

View File

@ -69,14 +69,14 @@ $report_judges_fields = array(
'table' => 'judges.city' ),
'province' => array(
'name' => 'Judge -- Address Province',
'header' => 'Province',
'name' => 'Judge -- Address '.$config['provincestate'],
'header' => $config['provincestate'],
'width' => 0.75,
'table' => 'judges.province' ),
'postal' => array(
'name' => 'Judge -- Address Postal Code',
'header' => 'Postal',
'name' => 'Judge -- Address '.$config['postalzip'],
'header' => $config['postalzip'],
'width' => 0.75,
'table' => 'judges.postalcode' ),

View File

@ -61,8 +61,8 @@ $table['header']=array( i18n("ID"),
i18n("Address 1"),
i18n("Address 2"),
i18n("City"),
i18n("Province"),
i18n("Postal Code"),
i18n($config['provincestate']),
i18n($config['postalzip']),
i18n("Highest PostSecDeg"),
i18n("Professional Quals"),
i18n("Expertise Other"));

View File

@ -139,8 +139,8 @@ if($report)
i18n("C/O"),
i18n("Address"),
i18n("City"),
i18n("Province"),
i18n("Postal Code"));
i18n($config['provincestate']),
i18n($config['postalzip']));
}
while($r=mysql_fetch_object($q))

View File

@ -65,20 +65,20 @@ $report_schools_fields = array(
'table' => 'schools.city' ),
'school_province' => array(
'name' => 'School Address -- Province',
'header' => 'Province',
'name' => 'School Address -- '.$config['provincestate'],
'header' => $config['provincestate'],
'width' => 0.75,
'table' => 'schools.province_code' ),
'school_city_prov' => array(
'name' => 'School Address -- City, Province (for mailing)',
'name' => 'School Address -- City, '.$config['provincestate'].' (for mailing)',
'header' => 'City',
'width' => 1.5,
'table' => "CONCAT(schools.city, ', ', schools.province_code)" ),
'school_postal' => array(
'name' => 'School Address -- Postal Code',
'header' => 'Postal',
'name' => 'School Address -- '.$config['postalzip'],
'header' => $config['postalzip'],
'width' => 0.75,
'table' => 'schools.postalcode' ),

View File

@ -300,14 +300,14 @@ $report_students_fields = array(
'table' => 'students.city' ),
'province' => array(
'name' => 'Student Address -- Province',
'header' => 'Province',
'name' => 'Student Address -- '.$config['provincestate'],
'header' => $config['provincestate'],
'width' => 0.75,
'table' => 'students.province' ),
'postal' => array(
'name' => 'Student Address -- Postal Code',
'header' => 'Postal',
'name' => 'Student Address -- '.$config['postalzip'],
'header' => $config['postalzip'],
'width' => 0.75,
'table' => 'students.postalcode' ),
@ -370,20 +370,20 @@ $report_students_fields = array(
'table' => 'schools.city' ),
'school_province' => array(
'name' => 'School Address -- Province',
'header' => 'Province',
'name' => 'School Address -- '.$config['provincestate'],
'header' => $config['provincestate'],
'width' => 0.75,
'table' => 'schools.province_code' ),
'school_city_prov' => array(
'name' => 'School Address -- City, Province (for mailing)',
'name' => 'School Address -- City, '.$config['provincestate'].' (for mailing)',
'header' => 'City',
'width' => 1.5,
'table' => "CONCAT(schools.city, ', ', schools.province_code)" ),
'school_postal' => array(
'name' => 'School Address -- Postal Code',
'header' => 'Postal',
'name' => 'School Address -- '.$config['postalzip'],
'header' => $config['postalzip'],
'width' => 0.75,
'table' => 'schools.postalcode' ),

View File

@ -138,10 +138,10 @@
echo "<tr><td>".i18n("School District")."</td><td><input type=\"text\" name=\"district\" value=\"".htmlspecialchars($r->district)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("Address")."</td><td><input type=\"text\" name=\"address\" value=\"".htmlspecialchars($r->address)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";
echo "<tr><td>".i18n("City")."</td><td><input type=\"text\" name=\"city\" value=\"".htmlspecialchars($r->city)."\" size=\"32\" maxlength=\"32\" /></td></tr>\n";
echo "<tr><td>".i18n("Province")."</td><td>";
echo "<tr><td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province_code",$r->province_code);
echo "</td></tr>\n";
echo "<tr><td>".i18n("Postal Code")."</td><td><input type=\"text\" name=\"postalcode\" value=\"$r->postalcode\" size=\"8\" maxlength=\"7\" /></td></tr>\n";
echo "<tr><td>".i18n($config['postalzip'])."</td><td><input type=\"text\" name=\"postalcode\" value=\"$r->postalcode\" size=\"8\" maxlength=\"7\" /></td></tr>\n";
echo "<tr><td>".i18n("Phone")."</td><td><input type=\"text\" name=\"phone\" value=\"".htmlspecialchars($r->phone)."\" size=\"16\" maxlength=\"16\" /></td></tr>\n";
echo "<tr><td>".i18n("Fax")."</td><td><input type=\"text\" name=\"fax\" value=\"".htmlspecialchars($r->fax)."\" size=\"16\" maxlength=\"16\" /></td></tr>\n";
echo "<tr><td>".i18n("Principal")."</td><td><input type=\"text\" name=\"principal\" value=\"".htmlspecialchars($r->principal)."\" size=\"60\" maxlength=\"64\" /></td></tr>\n";

View File

@ -104,7 +104,7 @@
echo i18n("Choose the CSV file containing the school information. The COLUMNS of the file must contain the following information, in this exact order, separated by comma's (,) with fields optionally enclosed by quotes (\"):");
echo "<br />";
echo "<br />";
echo i18n("School Name, School Lang, School Level, Board, District, Phone, Fax, Address, City, Province, Postal Code, Principal, School Email, Science Head, Science Head Email, Science Head Phone, Access Code, Registration Password, Project Limit, Project Limit Per(total or agecategory)");
echo i18n("School Name, School Lang, School Level, Board, District, Phone, Fax, Address, City, %1, %2, Principal, School Email, Science Head, Science Head Email, Science Head Phone, Access Code, Registration Password, Project Limit, Project Limit Per(total or agecategory)",array(i18n($config['provincestate']),i18n($config['postalzip'])));
echo "<br />";
echo "<br />";

View File

@ -241,12 +241,12 @@ if($config['participant_student_personal']=="yes")
{
echo "<tr>\n";
echo " <td>".i18n("Address")."</td><td><input type=\"text\" name=\"address[$x]\" value=\"$studentinfo->address\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Province")."</td><td>";
echo " <td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province[$x]",$studentinfo->province);
echo REQUIREDFIELD."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Postal Code")."</td><td><input type=\"text\" name=\"postalcode[$x]\" value=\"$studentinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n($config['postalzip'])."</td><td><input type=\"text\" name=\"postalcode[$x]\" value=\"$studentinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Phone")."</td><td><input type=\"text\" name=\"phone[$x]\" value=\"$studentinfo->phone\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";

View File

@ -65,8 +65,8 @@
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Province")."</th><td>$studentinfo->province";
echo " <th>".i18n("Postal Code")."</th><td>$studentinfo->postalcode</td>\n";
echo " <th>".i18n($config['provincestate'])."</th><td>$studentinfo->province";
echo " <th>".i18n($config['postalzip'])."</th><td>$studentinfo->postalcode</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Medical Information")."</th><td>$studentinfo->medicalalert";

View File

@ -809,6 +809,7 @@ function emit_time_selector($name,$selected="")
function emit_province_selector($name,$selected="",$extra="")
{
global $config;
$q=mysql_query("SELECT * FROM provinces ORDER BY province");
if(mysql_num_rows($q)==1)
{
@ -819,7 +820,7 @@ function emit_province_selector($name,$selected="",$extra="")
else
{
echo "<select name=\"$name\" $extra>\n";
echo "<option value=\"\">".i18n("Select a Province")."</option>\n";
echo "<option value=\"\">".i18n("Select a {$config['provincestate']}")."</option>\n";
while($r=mysql_fetch_object($q))
{
if($r->code == $selected) $sel="selected=\"selected\""; else $sel="";

View File

@ -1 +1 @@
106
107

View File

@ -16,8 +16,8 @@ $judges_fields = array( 'firstname' => 'First Name',
'address' =>"Address 1",
'address2' =>"Address 2",
'city' => 'City',
'province' => 'Province',
'postalcode' => 'Postal Code',
'province' => $config['provincestate'],
'postalcode' => $config['postalzip'],
// 'deleted' => 'Deleted',
// 'deleteddatetime' => 'Deleted Date/Time',
'expertise_other' => 'Other Expertise/Notes',

View File

@ -101,7 +101,7 @@ echo " <td>".i18n("City")."</td><td><input onchange=\"fieldChanged()\" type=\"te
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Address 1")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"address\" value=\"$judgeinfo->address\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Province")."</td><td>";
echo " <td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province",$judgeinfo->province,"onchange=\"fieldChanged()\"");
echo REQUIREDFIELD."</td>\n";
echo "</tr>\n";
@ -111,7 +111,7 @@ echo " <td>".i18n("Phone (Home)")."</td><td><input onchange=\"fieldChanged()\" t
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Postal Code")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"postalcode\" value=\"$judgeinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n($config['postalzip'])."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"postalcode\" value=\"$judgeinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Phone (Work)")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"phonework\" value=\"$judgeinfo->phonework\" />&nbsp;ext<input size=\"5\" onchange=\"fieldChanged()\" type=\"text\" name=\"phoneworkext\" value=\"$judgeinfo->phoneworkext\" /></td>\n";
echo "</tr>";

View File

@ -332,12 +332,12 @@ if($config['participant_student_personal']=="yes")
{
echo "<tr>\n";
echo " <td>".i18n("Address")."</td><td><input type=\"text\" name=\"address[$x]\" value=\"$studentinfo->address\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Province")."</td><td>";
echo " <td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province[$x]",$studentinfo->province);
echo REQUIREDFIELD."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Postal Code")."</td><td><input type=\"text\" name=\"postalcode[$x]\" value=\"$studentinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n($config['postalzip'])."</td><td><input type=\"text\" name=\"postalcode[$x]\" value=\"$studentinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Phone")."</td><td><input type=\"text\" name=\"phone[$x]\" value=\"$studentinfo->phone\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";

View File

@ -100,10 +100,10 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
// 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("City")."</td><td><input value=\"$school->city\" type=text name=city size=30></td></tr>";
echo "<tr><td>".i18n("Province")."</td><td>";
echo "<tr><td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province_code",$school->province_code);
echo "</td></tr>\n";
echo "<tr><td>".i18n("Postal Code")."</td><td><input value=\"$school->postalcode\" type=text name=postalcode size=10></td></tr>";
echo "<tr><td>".i18n($config['postalzip'])."</td><td><input value=\"$school->postalcode\" type=text name=postalcode size=10></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("Science Teacher")."</td><td><input value=\"$school->sciencehead\" type=text name=sciencehead size=40></td></tr>";

View File

@ -42,7 +42,7 @@
'address' => array('name' => 'Address 1'),
'address2' => array('name' => 'Address 2'),
'city' => array('name' => 'City'),
'province' => array('name' => 'Province'),
'province' => array('name' => $config['provincestate']),
'organization' => array('name' => 'Organization'),
'sex' => array('name' => 'Gender'),
'firstaid' => array ('name' => 'First Aid Training',
@ -61,7 +61,7 @@
'fax' => array('name' => 'Fax',
'regexp' => '^[1-9][0-9]{2}-[1-9][0-9]{2}-[0-9]{4}$',
'format' => '\'NNN-NNN-NNNN\'',),
'postalcode' => array('name' => 'Postal Code',
'postalcode' => array('name' => $config['postalzip'],
'regexp' => '^(([A-Z][0-9][A-Z] [0-9][A-Z][0-9])|([0-9]{5}))$',
'format' => '\'ANA NAN\' or \'NNNNN\'',),
@ -280,7 +280,7 @@ echo "</tr>\n";
echo "<tr>\n";
item($u, 'address2');
if(in_array('province', $fields)) {
echo '<td>'.i18n('Province').': </td>';
echo '<td>'.i18n($config['provincestate']).': </td>';
echo '<td>';
emit_province_selector("province",$u['province'],"onchange=\"fieldChanged()\"");
if(in_array('province', $required)) echo REQUIREDFIELD;