Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/candidates/Add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
<label id="addressLabel" for="address">Address:</label>
</td>
<td class="tdData">
<textarea tabindex="9" name="address" id="address" rows="2" cols="40" class="inputbox" style="width: 150px"><?php if(isset($this->preassignedFields['address'])) $this->_($this->preassignedFields['address']); if(isset($this->preassignedFields['address2'])) $this->_("\n" . $this->preassignedFields['address2']); ?></textarea>
<input type="text" tabindex="9" name="address" id="address" class="inputbox" style="width: 150px" value="<?php if (isset($this->preassignedFields['address'])) $this->_($this->preassignedFields['address']); ?>" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/indicator2.gif" id="addressParserIndicator" alt="" style="visibility: hidden; margin-left: 10px;" height="16" width="16" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion modules/candidates/Edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<label id="addressLabel" for="address1">Address:</label>
</td>
<td class="tdData">
<textarea class="inputbox" id="address" name="address" style="width: 150px;"><?php $this->_($this->data['address']); ?></textarea>
<input type="text" class="inputbox" id="address" name="address" style="width: 150px;" value="<?php $this->_($this->data['address']); ?>" />
</td>
</tr>

Expand Down
139 changes: 137 additions & 2 deletions modules/careers/CareersUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private function careersPage()
/* Replace input fields. */
$content = str_replace('<input-firstName>', '<input name="firstName" id="firstName" class="inputBoxName" value="' . $candidate['firstName'] . '" />', $content);
$content = str_replace('<input-lastName>', '<input name="lastName" id="lastName" class="inputBoxName" value="' . $candidate['lastName'] . '" />', $content);
$content = str_replace('<input-address>', '<textarea name="address" class="inputBoxArea">'. $candidate['address'] .'</textarea>', $content);
$content = str_replace('<input-address>', '<input name="address" id="address" class="inputBoxNormal" value="' . $candidate['address'] . '" />', $content);
$content = str_replace('<input-city>', '<input name="city" id="city" class="inputBoxNormal" value="' . $candidate['city'] . '" />', $content);
$content = str_replace('<input-state>', '<input name="state" id="state" class="inputBoxNormal" value="' . $candidate['state'] . '" />', $content);
$content = str_replace('<input-zip>', '<input name="zip" id="zip" class="inputBoxNormal" value="' . $candidate['zip'] . '" />', $content);
Expand Down Expand Up @@ -581,7 +581,7 @@ private function careersPage()
$template['Content'] = str_replace('<title>', $jobOrderData['title'], $template['Content']);
$template['Content'] = str_replace('<input-firstName>', '<input name="firstName" id="firstName" class="inputBoxName" value="' . $firstName . '" />', $template['Content']);
$template['Content'] = str_replace('<input-lastName>', '<input name="lastName" id="lastName" class="inputBoxName" value="' . $lastName . '" />', $template['Content']);
$template['Content'] = str_replace('<input-address>', '<textarea name="address" class="inputBoxArea">'. $address .'</textarea>', $template['Content']);
$template['Content'] = str_replace('<input-address>', '<input name="address" id="address" class="inputBoxNormal" value="' . $address . '" />', $template['Content']);
$template['Content'] = str_replace('<input-city>', '<input name="city" id="city" class="inputBoxNormal" value="' . $city . '" />', $template['Content']);
$template['Content'] = str_replace('<input-state>', '<input name="state" id="state" class="inputBoxNormal" value="' . $state . '" />', $template['Content']);
$template['Content'] = str_replace('<input-zip>', '<input name="zip" id="zip" class="inputBoxNormal" value="' . $zip . '" />', $template['Content']);
Expand Down Expand Up @@ -974,6 +974,7 @@ private function _makeApplyValidator($template)
{
$validator = '';

// First name is always required if the field is present in the template.
if (strpos($template['Content'], '<input-firstName>') !== false || strpos($template['Content'], '<input-firstName req>') !== false)
{
$validator .= '
Expand All @@ -985,6 +986,7 @@ private function _makeApplyValidator($template)
}';
}

// Last name is always required if the field is present in the template.
if (strpos($template['Content'], '<input-lastName>') !== false || strpos($template['Content'], '<input-lastName req>') !== false)
{
$validator .= '
Expand All @@ -996,6 +998,7 @@ private function _makeApplyValidator($template)
}';
}

// Email confirmation must match the primary email if the field is present.
if (strpos($template['Content'], '<input-emailconfirm>') !== false || strpos($template['Content'], '<input-emailconfirm req>') !== false)
{
$validator .= '
Expand All @@ -1007,6 +1010,7 @@ private function _makeApplyValidator($template)
}';
}

// Primary email must be present and must look somewhat valid.
if (strpos($template['Content'], '<input-email>') !== false || strpos($template['Content'], '<input-email req>') !== false)
{
$validator .= '
Expand All @@ -1025,6 +1029,11 @@ private function _makeApplyValidator($template)
}';
}

/*
* Optional fields that can be made required by using the "req" marker
* in the template, for example <input-phone-cell req>.
*/

if (strpos($template['Content'], '<input-address req>') !== false)
{
$validator .= '
Expand Down Expand Up @@ -1080,6 +1089,84 @@ private function _makeApplyValidator($template)
}';
}

if (strpos($template['Content'], '<input-phone-cell req>') !== false)
{
$validator .= '
if (document.getElementById(\'phoneCell\').value == \'\')
{
alert(\'Please enter a mobile phone number.\');
document.getElementById(\'phoneCell\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-phone-home req>') !== false)
{
$validator .= '
if (document.getElementById(\'phoneHome\').value == \'\')
{
alert(\'Please enter a home phone number.\');
document.getElementById(\'phoneHome\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-best-time-to-call req>') !== false ||
strpos($template['Content'], '<input-bestTimeToCall req>') !== false)
{
$validator .= '
if (document.getElementById(\'bestTimeToCall\').value == \'\')
{
alert(\'Please enter the best time to call.\');
document.getElementById(\'bestTimeToCall\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-email2 req>') !== false)
{
$validator .= '
if (document.getElementById(\'email2\').value == \'\')
{
alert(\'Please enter an E-Mail address.\');
document.getElementById(\'email2\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-source req>') !== false)
{
$validator .= '
if (document.getElementById(\'source\').value == \'\')
{
alert(\'Please enter a source.\');
document.getElementById(\'source\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-employer req>') !== false)
{
$validator .= '
if (document.getElementById(\'employer\').value == \'\')
{
alert(\'Please enter your current employer.\');
document.getElementById(\'employer\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-resumeUpload req>') !== false)
{
$validator .= '
if (document.getElementById(\'resume\').value == \'\')
{
alert(\'Please upload your resume.\');
document.getElementById(\'resume\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-keySkills req>') !== false)
{
$validator .= '
Expand All @@ -1102,6 +1189,54 @@ private function _makeApplyValidator($template)
}';
}

/*
* EEO fields (if enabled and placed in the template).
*/

if (strpos($template['Content'], '<input-eeo-gender req>') !== false)
{
$validator .= '
if (document.getElementById(\'eeogender\').value == \'\')
{
alert(\'Please select your gender.\');
document.getElementById(\'eeogender\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-eeo-race req>') !== false)
{
$validator .= '
if (document.getElementById(\'eeorace\').value == \'\')
{
alert(\'Please select your race.\');
document.getElementById(\'eeorace\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-eeo-veteran req>') !== false)
{
$validator .= '
if (document.getElementById(\'eeoveteran\').value == \'\')
{
alert(\'Please select your veteran status.\');
document.getElementById(\'eeoveteran\').focus();
return false;
}';
}

if (strpos($template['Content'], '<input-eeo-disability req>') !== false)
{
$validator .= '
if (document.getElementById(\'eeodisability\').value == \'\')
{
alert(\'Please select your disability status.\');
document.getElementById(\'eeodisability\').focus();
return false;
}';
}

$validator = '<script type="text/javascript">function applyValidate() {'
. $validator . ' return true; }' . "\n" . '</script>';

Expand Down
2 changes: 1 addition & 1 deletion modules/companies/Add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<label id="addressLabel" for="address">Address:</label>
</td>
<td class="tdData">
<textarea name="address" id="address" class="inputbox" style="width: 150px"></textarea>
<input type="text" name="address" id="address" class="inputbox" style="width: 150px" />
</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion modules/companies/Edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<label id="addressLabel" for="address">Address:</label>
</td>
<td class="tdData">
<textarea name="address" id="address" class="inputbox" style="width: 150px" onkeydown="document.getElementById('changeAddress').style.display='';"/><?php $this->_($this->data['address']); ?></textarea>
<input type="text" name="address" id="address" class="inputbox" style="width: 150px" onkeydown="document.getElementById('changeAddress').style.display='';" value="<?php $this->_($this->data['address']); ?>" />
</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion modules/contacts/Add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<label id="addressLabel" for="address">Address:</label>
</td>
<td class="tdData">
<textarea name="address" id="address" class="inputbox" style="width: 150px"></textarea>
<input type="text" name="address" id="address" class="inputbox" style="width: 150px" />
</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion modules/contacts/Edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<label id="addressLabel" for="address">Address:</label>
</td>
<td class="tdData">
<textarea name="address" id="address" class="inputbox" style="width: 150px"><?php $this->_($this->data['address']); ?></textarea>
<input type="text" name="address" id="address" class="inputbox" style="width: 150px" value="<?php $this->_($this->data['address']); ?>" />
</td>
</tr>

Expand Down