diff --git a/modules/candidates/Add.tpl b/modules/candidates/Add.tpl index c56dcad6..3dab5ee9 100755 --- a/modules/candidates/Add.tpl +++ b/modules/candidates/Add.tpl @@ -224,7 +224,7 @@ - +              diff --git a/modules/candidates/Edit.tpl b/modules/candidates/Edit.tpl index aeb5c798..f2a33cb6 100755 --- a/modules/candidates/Edit.tpl +++ b/modules/candidates/Edit.tpl @@ -117,7 +117,7 @@ - + diff --git a/modules/careers/CareersUI.php b/modules/careers/CareersUI.php index f47c92fb..b842075d 100755 --- a/modules/careers/CareersUI.php +++ b/modules/careers/CareersUI.php @@ -224,7 +224,7 @@ private function careersPage() /* Replace input fields. */ $content = str_replace('', '', $content); $content = str_replace('', '', $content); - $content = str_replace('', '', $content); + $content = str_replace('', '', $content); $content = str_replace('', '', $content); $content = str_replace('', '', $content); $content = str_replace('', '', $content); @@ -581,7 +581,7 @@ private function careersPage() $template['Content'] = str_replace('', $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']); @@ -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 .= ' @@ -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 .= ' @@ -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 .= ' @@ -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 .= ' @@ -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 .= ' @@ -1080,6 +1089,117 @@ 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-phoneWork req>') !== false) + { + $validator .= ' + if (document.getElementById(\'phoneWork\').value == \'\') + { + alert(\'Please enter a work phone number.\'); + document.getElementById(\'phoneWork\').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-email1 req>') !== false) + { + $validator .= ' + if (document.getElementById(\'email1\').value == \'\') + { + alert(\'Please enter an E-Mail address.\'); + document.getElementById(\'email1\').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-currentEmployer req>') !== false) + { + $validator .= ' + if (document.getElementById(\'currentEmployer\').value == \'\') + { + alert(\'Please enter your current employer.\'); + document.getElementById(\'currentEmployer\').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 .= ' @@ -1102,6 +1222,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>'; diff --git a/modules/companies/Add.tpl b/modules/companies/Add.tpl index 9487743a..a71baaf2 100755 --- a/modules/companies/Add.tpl +++ b/modules/companies/Add.tpl @@ -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> diff --git a/modules/companies/Edit.tpl b/modules/companies/Edit.tpl index 8ca6aba1..f9f83860 100755 --- a/modules/companies/Edit.tpl +++ b/modules/companies/Edit.tpl @@ -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> diff --git a/modules/contacts/Add.tpl b/modules/contacts/Add.tpl index 6ca978de..944b9f00 100755 --- a/modules/contacts/Add.tpl +++ b/modules/contacts/Add.tpl @@ -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> diff --git a/modules/contacts/Edit.tpl b/modules/contacts/Edit.tpl index 4e396357..9c0a25c8 100755 --- a/modules/contacts/Edit.tpl +++ b/modules/contacts/Edit.tpl @@ -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>