private function show() { /* Bail out if we don't have a valid contact ID. */ if (!$this->isRequiredIDValid('contactID', $_GET)) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid contact ID.'); } $contactID = $_GET['contactID']; $contacts = new Contacts($this->_siteID); $data = $contacts->get($contactID); /* Bail out if we got an empty result set. */ if (empty($data)) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified contact ID could not be found.'); } /* We want to handle formatting the city and state here instead * of in the template. */ $data['cityAndState'] = StringUtility::makeCityStateString($data['city'], $data['state']); /* * Replace newlines with <br />, fix HTML "special" characters, and * strip leading empty lines and spaces. */ $data['notes'] = trim(nl2br(htmlspecialchars($data['notes'], ENT_QUOTES))); /* Chop $data['notes'] to make $data['shortNotes']. */ if (strlen($data['notes']) > self::NOTES_MAXLEN) { $data['shortNotes'] = substr($data['notes'], 0, self::NOTES_MAXLEN); $isShortNotes = true; } else { $data['shortNotes'] = $data['notes']; $isShortNotes = false; } /* Hot contacts [can] have different title styles than normal contacts. */ if ($data['isHotContact'] == 1) { $data['titleClassContact'] = 'jobTitleHot'; } else { $data['titleClassContact'] = 'jobTitleCold'; } /* Hot companies [can] also have different title styles than normal companies. */ if ($data['isHotCompany'] == 1) { $data['titleClassCompany'] = 'jobTitleHot'; } else { $data['titleClassCompany'] = 'jobTitleCold'; } $jobOrders = new JobOrders($this->_siteID); $jobOrdersRS = $jobOrders->getAll(JOBORDERS_STATUS_ALL, -1, -1, $contactID); if (!empty($jobOrdersRS)) { foreach ($jobOrdersRS as $rowIndex => $row) { /* Convert '00-00-00' dates to empty strings. */ $jobOrdersRS[$rowIndex]['startDate'] = DateUtility::fixZeroDate($jobOrdersRS[$rowIndex]['startDate']); /* Hot jobs [can] have different title styles than normal * jobs. */ if ($jobOrdersRS[$rowIndex]['isHot'] == 1) { $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkCold'; } $jobOrdersRS[$rowIndex]['recruiterAbbrName'] = StringUtility::makeInitialName($jobOrdersRS[$rowIndex]['recruiterFirstName'], $jobOrdersRS[$rowIndex]['recruiterLastName'], false, LAST_NAME_MAXLEN); $jobOrdersRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($jobOrdersRS[$rowIndex]['ownerFirstName'], $jobOrdersRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); } } $activityEntries = new ActivityEntries($this->_siteID); $activityRS = $activityEntries->getAllByDataItem($contactID, DATA_ITEM_CONTACT); if (!empty($activityRS)) { foreach ($activityRS as $rowIndex => $row) { if (empty($activityRS[$rowIndex]['notes'])) { $activityRS[$rowIndex]['notes'] = '(No Notes)'; } if (empty($activityRS[$rowIndex]['jobOrderID']) || empty($activityRS[$rowIndex]['regarding'])) { $activityRS[$rowIndex]['regarding'] = 'General'; } $activityRS[$rowIndex]['enteredByAbbrName'] = StringUtility::makeInitialName($activityRS[$rowIndex]['enteredByFirstName'], $activityRS[$rowIndex]['enteredByLastName'], false, LAST_NAME_MAXLEN); } } /* Get upcoming calendar entries. */ $calendarRS = $contacts->getUpcomingEvents($contactID); if (!empty($calendarRS)) { foreach ($calendarRS as $rowIndex => $row) { $calendarRS[$rowIndex]['enteredByAbbrName'] = StringUtility::makeInitialName($calendarRS[$rowIndex]['enteredByFirstName'], $calendarRS[$rowIndex]['enteredByLastName'], false, LAST_NAME_MAXLEN); } } /* Add an MRU entry. */ $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_CONTACT, $contactID, $data['firstName'] . ' ' . $data['lastName']); /* Get extra fields. */ $extraFieldRS = $contacts->extraFields->getValuesForShow($contactID); /* Is the user an admin - can user see history? */ if ($this->_accessLevel < ACCESS_LEVEL_DEMO) { $privledgedUser = false; } else { $privledgedUser = true; } $this->_template->assign('active', $this); $this->_template->assign('data', $data); $this->_template->assign('isShortNotes', $isShortNotes); $this->_template->assign('jobOrdersRS', $jobOrdersRS); $this->_template->assign('extraFieldRS', $extraFieldRS); $this->_template->assign('calendarRS', $calendarRS); $this->_template->assign('activityRS', $activityRS); $this->_template->assign('contactID', $contactID); $this->_template->assign('privledgedUser', $privledgedUser); $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie()); if (!eval(Hooks::get('CONTACTS_SHOW'))) { return; } $this->_template->display('./modules/contacts/Show.tpl'); }
private function show() { /* Bail out if we don't have a valid company ID. */ if (!$this->isRequiredIDValid('companyID', $_GET)) { $this->listByView('Invalid company ID.'); return; } $companyID = $_GET['companyID']; $companies = new Companies($this->_siteID); $data = $companies->get($companyID); /* Bail out if we got an empty result set. */ if (empty($data)) { $this->listByView('The specified company ID could not be found.'); return; } /* We want to handle formatting the city and state here instead * of in the template. */ $data['cityAndState'] = StringUtility::makeCityStateString($data['city'], $data['state']); /* * Replace newlines with <br />, fix HTML "special" characters, and * strip leading empty lines and spaces. */ $data['notes'] = trim(nl2br(htmlspecialchars($data['notes'], ENT_QUOTES))); /* Chop $data['notes'] to make $data['shortNotes']. */ if (strlen($data['notes']) > self::NOTES_MAXLEN) { $data['shortNotes'] = substr($data['notes'], 0, self::NOTES_MAXLEN); $isShortNotes = true; } else { $data['shortNotes'] = $data['notes']; $isShortNotes = false; } /* Hot companies [can] have different title styles than normal companies. */ if ($data['isHot'] == 1) { $data['titleClass'] = 'jobTitleHot'; } else { $data['titleClass'] = 'jobTitleCold'; } /* Link to Google Maps for this address */ if (!empty($data['address']) && !empty($data['city']) && !empty($data['state'])) { $data['googleMaps'] = '<a href="http://maps.google.com/maps?q=' . urlencode($data['address']) . '+' . urlencode($data['city']) . '+' . urlencode($data['state']); /* Google Maps will find an address without Zip. */ if (!empty($data['zip'])) { $data['googleMaps'] .= '+' . $data['zip']; } $data['googleMaps'] .= '" target=_blank><img src="images/google_maps.gif" style="border: none;" class="absmiddle" /></a>'; } else { $data['googleMaps'] = ''; } /* Attachments */ $attachments = new Attachments($this->_siteID); $attachmentsRS = $attachments->getAll(DATA_ITEM_COMPANY, $companyID); foreach ($attachmentsRS as $rowNumber => $attachmentsData) { /* Show an attachment icon based on the document's file type. */ $attachmentIcon = strtolower(FileUtility::getAttachmentIcon($attachmentsRS[$rowNumber]['originalFilename'])); $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon; } /* Job Orders for this company */ $jobOrders = new JobOrders($this->_siteID); $jobOrdersRS = $jobOrders->getAll(JOBORDERS_STATUS_ALL, -1, $companyID, -1); if (!empty($jobOrdersRS)) { foreach ($jobOrdersRS as $rowIndex => $row) { /* Convert '00-00-00' dates to empty strings. */ $jobOrdersRS[$rowIndex]['startDate'] = DateUtility::fixZeroDate($jobOrdersRS[$rowIndex]['startDate']); /* Hot jobs [can] have different title styles than normal * jobs. */ if ($jobOrdersRS[$rowIndex]['isHot'] == 1) { $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkCold'; } $jobOrdersRS[$rowIndex]['recruiterAbbrName'] = StringUtility::makeInitialName($jobOrdersRS[$rowIndex]['recruiterFirstName'], $jobOrdersRS[$rowIndex]['recruiterLastName'], false, LAST_NAME_MAXLEN); $jobOrdersRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($jobOrdersRS[$rowIndex]['ownerFirstName'], $jobOrdersRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); } } /* Contacts for this company */ $contacts = new Contacts($this->_siteID); $contactsRS = $contacts->getAll(-1, $companyID); $contactsRSWC = null; if (!empty($contactsRS)) { foreach ($contactsRS as $rowIndex => $row) { /* Hot contacts [can] have different title styles than normal contacts. */ if ($contactsRS[$rowIndex]['isHot'] == 1) { $contactsRS[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $contactsRS[$rowIndex]['linkClass'] = 'jobLinkCold'; } if (!empty($contactsRS[$rowIndex]['ownerFirstName'])) { $contactsRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($contactsRS[$rowIndex]['ownerFirstName'], $contactsRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); } else { $contactsRS[$rowIndex]['ownerAbbrName'] = 'None'; } if ($contactsRS[$rowIndex]['leftCompany'] == 0) { $contactsRSWC[] = $contactsRS[$rowIndex]; } else { $contactsRS[$rowIndex]['linkClass'] = 'jobLinkDead'; } } } /* Add an MRU entry. */ $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_COMPANY, $companyID, $data['name']); /* Get extra fields. */ $extraFieldRS = $companies->extraFields->getValuesForShow($companyID); /* Get departments. */ $departmentsRS = $companies->getDepartments($companyID); /* Is the user an admin - can user see history? */ if ($this->_accessLevel < ACCESS_LEVEL_DEMO) { $privledgedUser = false; } else { $privledgedUser = true; } $this->_template->assign('active', $this); $this->_template->assign('data', $data); $this->_template->assign('attachmentsRS', $attachmentsRS); $this->_template->assign('departmentsRS', $departmentsRS); $this->_template->assign('extraFieldRS', $extraFieldRS); $this->_template->assign('isShortNotes', $isShortNotes); $this->_template->assign('jobOrdersRS', $jobOrdersRS); $this->_template->assign('contactsRS', $contactsRS); $this->_template->assign('contactsRSWC', $contactsRSWC); $this->_template->assign('privledgedUser', $privledgedUser); $this->_template->assign('companyID', $companyID); if (!eval(Hooks::get('CLIENTS_SHOW'))) { return; } $this->_template->display('./modules/companies/Show.tpl'); }
private function displayPublicJobOrders() { $site = new Site(-1); $careerPortalSiteID = $site->getFirstSiteID(); if (!eval(Hooks::get('RSS_SITEID'))) { return; } $jobOrders = new JobOrders($careerPortalSiteID); $rs = $jobOrders->getAll(JOBORDERS_STATUS_ACTIVE, -1, -1, -1, false, true); /* XML Headers */ header('Content-type: text/xml'); $indexName = CATSUtility::getIndexName(); $stream = sprintf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<rss version=\"2.0\">\n" . "<channel>\n" . "<title>New Job Orders</title>\n" . "<description>CATS RSS Feed</description>\n" . "<link>%s</link>\n" . "<pubDate>%s</pubDate>\n", CATSUtility::getAbsoluteURI(), DateUtility::getRSSDate()); foreach ($rs as $rowIndex => $row) { $uri = sprintf("%scareers/?p=showJob&ID=%d", CATSUtility::getAbsoluteURI(), $row['jobOrderID']); // Fix URL if viewing from /rss without using globals or dirup '../' if (strpos($_SERVER['PHP_SELF'], '/rss/') !== false) { $uri = str_replace('/rss/', '/', $uri); } $stream .= sprintf("<item>\n" . "<title>%s (%s)</title>\n" . "<description>Located in %s.</description>\n" . "<link>%s</link>\n" . "</item>\n", $row['title'], $jobOrders->typeCodeToString($row['type']), StringUtility::makeCityStateString($row['city'], $row['state']), $uri); } $stream .= "</channel>\n</rss>\n"; echo $stream; }
private function show() { /* Is this a popup? */ if (isset($_GET['display']) && $_GET['display'] == 'popup') { $isPopup = true; } else { $isPopup = false; } /* Bail out if we don't have a valid candidate ID. */ if (!$this->isRequiredIDValid('jobOrderID', $_GET)) { /* FIXME: fatalPopup()? */ CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.'); } $jobOrderID = $_GET['jobOrderID']; $jobOrders = new JobOrders($this->_siteID); $data = $jobOrders->get($jobOrderID); /* Bail out if we got an empty result set. */ if (empty($data)) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified job order ID could not be found.'); } if ($data['isAdminHidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA) { $this->listByView('This Job Order is hidden - only a CATS Administrator can unlock the Job Order.'); return; } /* We want to handle formatting the city and state here instead of in * the template. */ $data['cityAndState'] = StringUtility::makeCityStateString($data['city'], $data['state']); $data['description'] = trim($data['description']); $data['notes'] = trim($data['notes']); /* Determine the Job Type Description */ $data['typeDescription'] = $jobOrders->typeCodeToString($data['type']); /* Convert '00-00-00' dates to empty strings. */ $data['startDate'] = DateUtility::fixZeroDate($data['startDate']); /* Hot jobs [can] have different title styles than normal jobs. */ if ($data['isHot'] == 1) { $data['titleClass'] = 'jobTitleHot'; } else { $data['titleClass'] = 'jobTitleCold'; } if ($data['public'] == 1) { $data['public'] = '<img src="images/public.gif" height="16" ' . 'width="16" title="This Job Order is marked as Public." />'; } else { $data['public'] = ''; } $attachments = new Attachments($this->_siteID); $attachmentsRS = $attachments->getAll(DATA_ITEM_JOBORDER, $jobOrderID); foreach ($attachmentsRS as $rowNumber => $attachmentsData) { /* Show an attachment icon based on the document's file type. */ $attachmentIcon = strtolower(FileUtility::getAttachmentIcon($attachmentsRS[$rowNumber]['originalFilename'])); $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon; } $careerPortalSettings = new CareerPortalSettings($this->_siteID); $careerPortalSettingsRS = $careerPortalSettings->getAll(); if ($careerPortalSettingsRS['enabled'] == 1) { $careerPortalEnabled = true; } else { $careerPortalEnabled = false; } /* Add an MRU entry. */ $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_JOBORDER, $jobOrderID, $data['title']); if ($this->_accessLevel < ACCESS_LEVEL_DEMO) { $privledgedUser = false; } else { $privledgedUser = true; } /* Get extra fields. */ $extraFieldRS = $jobOrders->extraFields->getValuesForShow($jobOrderID); $pipelineEntriesPerPage = $_SESSION['CATS']->getPipelineEntriesPerPage(); $sessionCookie = $_SESSION['CATS']->getCookie(); /* Get pipeline graph. */ $graphs = new graphs(); $pipelineGraph = $graphs->miniJobOrderPipeline(450, 250, array($jobOrderID)); /* Get questionnaire information (if exists) */ $questionnaireID = false; $questionnaireData = false; $careerPortalURL = false; $isPublic = false; if ($careerPortalEnabled && $data['public']) { $isPublic = true; if ($data['questionnaireID']) { $questionnaire = new Questionnaire($this->_siteID); $q = $questionnaire->get($data['questionnaireID']); if (is_array($q) && !empty($q)) { $questionnaireID = $q['questionnaireID']; $questionnaireData = $q; } } } $careerPortalSettings = new CareerPortalSettings($this->_siteID); $cpSettings = $careerPortalSettings->getAll(); if (intval($cpSettings['enabled'])) { $careerPortalURL = CATSUtility::getAbsoluteURI() . 'careers/'; } $this->_template->assign('active', $this); $this->_template->assign('isPublic', $isPublic); $this->_template->assign('questionnaireID', $questionnaireID); $this->_template->assign('questionnaireData', $questionnaireData); $this->_template->assign('careerPortalURL', $careerPortalURL); $this->_template->assign('data', $data); $this->_template->assign('extraFieldRS', $extraFieldRS); $this->_template->assign('attachmentsRS', $attachmentsRS); $this->_template->assign('pipelineEntriesPerPage', $pipelineEntriesPerPage); $this->_template->assign('pipelineGraph', $pipelineGraph); $this->_template->assign('jobOrderID', $jobOrderID); $this->_template->assign('isPopup', $isPopup); $this->_template->assign('careerPortalEnabled', $careerPortalEnabled); $this->_template->assign('privledgedUser', $privledgedUser); $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie()); if (!eval(Hooks::get('JO_SHOW'))) { return; } $this->_template->display('./modules/joborders/Show.tpl'); }
public function show() { /* Bail out if we don't have a valid candidate ID. */ if (!$this->isRequiredIDValid('jobOrderID', $_GET)) { /* FIXME: fatalPopup()? */ CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.'); } $jobOrderID = $_GET['jobOrderID']; $jobOrders = new JobOrders($this->_siteID); $data = $jobOrders->get($jobOrderID); /* Bail out if we got an empty result set. */ if (empty($data)) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified job order ID could not be found.'); } if ($data['is_admin_hidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA) { $this->listByView('This Job Order is hidden - only a CATS Administrator can unlock the Job Order.'); return; } /* We want to handle formatting the city and state here instead of in * the template. */ $data['cityAndState'] = StringUtility::makeCityStateString( $data['city'], $data['state'] ); /** * if ownertype is group, override the user full name */ if($data['ownertype']>0) { $sql="select * from auieo_groups where id={$data['owner']}"; $objDB=DatabaseConnection::getInstance(); $row=$objDB->getAssoc($sql); if($row) { $data["ownerFullName"]=$row["groupname"]; } } $data['description'] = trim($data['description']); $data['notes'] = trim($data['notes']); /* Determine the Job Type Description */ $data['typeDescription'] = $jobOrders->typeCodeToString($data['type']); /* Convert '00-00-00' dates to empty strings. */ $data['startDate'] = DateUtility::fixZeroDate( $data['startDate'] ); /* Hot jobs [can] have different title styles than normal jobs. */ if ($data['is_hot'] == 1) { $data['titleClass'] = 'jobTitleHot'; } else { $data['titleClass'] = 'jobTitleCold'; } if ($data['public'] == 1) { $data['public'] = '<img src="images/public.gif" height="16" ' . 'width="16" title="This Job Order is marked as Public." />'; } else { $data['public'] = ''; } $attachments = new Attachments($this->_siteID); $attachmentsRS = $attachments->getAll( DATA_ITEM_JOBORDER, $jobOrderID ); foreach ($attachmentsRS as $rowNumber => $attachmentsData) { /* Show an attachment icon based on the document's file type. */ $attachmentIcon = strtolower( FileUtility::getAttachmentIcon( $attachmentsRS[$rowNumber]['originalFilename'] ) ); $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon; } $careerPortalSettings = new CareerPortalSettings($this->_siteID); $careerPortalSettingsRS = $careerPortalSettings->getAll(); if ($careerPortalSettingsRS['enabled'] == 1) { $careerPortalEnabled = true; } else { $careerPortalEnabled = false; } /* Add an MRU entry. */ $_SESSION['CATS']->getMRU()->addEntry( DATA_ITEM_JOBORDER, $jobOrderID, $data['title'] ); if ($this->_accessLevel < ACCESS_LEVEL_DEMO) { $privledgedUser = false; } else { $privledgedUser = true; } /* Get extra fields. */ $extraFieldRS = $jobOrders->extraFields->getValuesForShow($jobOrderID); $pipelineEntriesPerPage = $_SESSION['CATS']->getPipelineEntriesPerPage(); $sessionCookie = $_SESSION['CATS']->getCookie(); /* Get pipeline graph. */ $graphs = new graphs(); $pipelineGraph = $graphs->miniJobOrderPipeline(450, 250, array($jobOrderID)); /* Get questionnaire information (if exists) */ $questionnaireID = false; $questionnaireData = false; $careerPortalURL = false; $isPublic = false; if ($careerPortalEnabled && $data['public']) { $isPublic = true; if ($data['questionnaire_id']) { $questionnaire = new Questionnaire($this->_siteID); $q = $questionnaire->get($data['questionnaire_id']); if (is_array($q) && !empty($q)) { $questionnaireID = $q['questionnaireID']; $questionnaireData = $q; } } } $careerPortalSettings = new CareerPortalSettings($this->_siteID); $cpSettings = $careerPortalSettings->getAll(); if (intval($cpSettings['enabled'])) { $careerPortalURL = CATSUtility::getAbsoluteURI() . 'careers/'; } //$sql="select * from auieo_fields where site_id={$this->_siteID} and tablename='joborder' and presence!=1"; //$db=DatabaseConnection::getInstance(); //$arrAssoc=$db->getAllAssoc($sql); $adminHidden=""; if ($data['is_admin_hidden'] == 1) { $adminHidden = "<p class='warning'>This Job Order is hidden. Only CATS Administrators can view it or search for it. To make it visible by the site users, click <a href='index.php?m=joborders&a=administrativeHideShow&jobOrderID={$jobOrderID}&state=0' style='font-weight:bold;'>Here.</a></p>"; } $strFrozen=""; if (isset($frozen)) { $strFrozen = "<table style='font-weight:bold; border: 1px solid #000; background-color: #ffed1a; padding:5px; margin-bottom:7px;' width='100%' id='candidateAlreadyInSystemTable'> <tr> <td class='tdVertical' style='width:100%;'> This Job Order is {$this->data['status']} and can not be modified. "; if ($this->accessLevel >= ACCESS_LEVEL_EDIT) { $strFrozen = $strFrozen . " <a id='edit_link' href='index.php?m=joborders&a=edit&jobOrderID={$this->jobOrderID}'> <img src='images/actions/edit.gif' width='16' height='16' class='absmiddle' alt='edit' border='0' /> Edit </a> the Job Order to make it Active. "; } $strFrozen = $strFrozen . " </td> </tr> </table> "; } $public=""; if ($isPublic) { $public = "<div style='background-color: #E6EEFE; padding: 10px; margin: 5px 0 12px 0; border: 1px solid #728CC8;'> <b>This job order is public"; if ($careerPortalURL === false) { $public = $public . ".</b>"; } else { $public = $public . " and will be shown on your "; if ($_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA){ $public = $public . " <a style='font-weight: bold;' href='{$careerPortalURL}'>Careers Website</a>. "; } else { $public = $public . " Careers Website. "; } $public = $public . "</b> "; } if ($questionnaireID !== false) { $public = $public . "<br />Applicants must complete the '<i>{$questionnaireData['title']}</i>' (<a href='index.php?m=settings&a=careerPortalQuestionnaire&questionnaireID={$questionnaireID}'>edit</a>) questionnaire when applying."; } else { $public = $public . "<br />You have not attached any "; if ($_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA) { $public = $public . "<a href='index.php?m=settings&a=careerPortalSettings'>Questionnaires</a>."; } else { $public = $public . "Questionnaires."; } } $public = $public . "</div>"; } $ACCESS_LEVEL_EDIT_BUTTON=""; if ($this->_accessLevel >= ACCESS_LEVEL_EDIT) { $ACCESS_LEVEL_EDIT_BUTTON = "<a id='edit_link' href='index.php?m=joborders&a=edit&jobOrderID={$jobOrderID}'> <img src='images/actions/edit.gif' width='16' height='16' class='absmiddle' alt='edit' border='0' /> Edit </a>"; } $ACCESS_LEVEL_DELETE_BUTTON=""; if ($this->_accessLevel >= ACCESS_LEVEL_DELETE) { $ACCESS_LEVEL_DELETE_BUTTON = "<a id='delete_link' href='index.php?m=joborders&a=delete&jobOrderID={$jobOrderID}' onclick=\"javascript:return confirm('Delete this job order?');\"> <img src='images/actions/delete.gif' width='16' height='16' class='absmiddle' alt='delete' border='0' /> Delete </a>"; } $ACCESS_LEVEL_MULTI_SA_BUTTON=""; if ($this->_accessLevel >= ACCESS_LEVEL_MULTI_SA) { if ($data['is_admin_hidden'] == 1) { $ACCESS_LEVEL_MULTI_SA_BUTTON = "<a href='index.php?m=joborders&a=administrativeHideShow&jobOrderID={$jobOrderID}&state=0'> <img src='images/resume_preview_inline.gif' width='16' height='16' class='absmiddle' alt='delete' border='0' /> Administrative Show </a>"; } else { $ACCESS_LEVEL_MULTI_SA_BUTTON = "<a href='index.php?m=joborders&a=administrativeHideShow&jobOrderID={$jobOrderID}&state=1'> <img src='images/resume_preview_inline.gif' width='16' height='16' class='absmiddle' alt='delete' border='0' /> Administrative Hide </a>"; } } $ACCESS_LEVEL_EDIT_CONSIDER=""; if ($this->_accessLevel >= ACCESS_LEVEL_EDIT) { $ACCESS_LEVEL_EDIT_CONSIDER = "<a href='#' onclick=\"showPopWin('index.php?m=joborders&a=considerCandidateSearch&jobOrderID={$jobOrderID}', 820, 550, null); return false;\"> <img src='images/consider.gif' width='16' height='16' class='absmiddle' alt='add candidate' border='0' /> Add Candidate to This Job Order Pipeline </a>"; } $this->_template->assign('active', $this); $this->_template->assign('public', $public); $this->_template->assign('ACCESS_LEVEL_EDIT_BUTTON', $ACCESS_LEVEL_EDIT_BUTTON); $this->_template->assign('ACCESS_LEVEL_DELETE_BUTTON', $ACCESS_LEVEL_DELETE_BUTTON); $this->_template->assign('ACCESS_LEVEL_MULTI_SA_BUTTON', $ACCESS_LEVEL_MULTI_SA_BUTTON); $this->_template->assign('ACCESS_LEVEL_EDIT_CONSIDER', $ACCESS_LEVEL_EDIT_CONSIDER); $this->_template->assign('questionnaireID', $questionnaireID); $this->_template->assign('questionnaireData', $questionnaireData); $this->_template->assign('careerPortalURL', $careerPortalURL); $this->_template->assign('data', $data); $this->_template->assign('frozen', $strFrozen); $this->_template->assign('adminHidden',$adminHidden); $this->_template->assign('extraFieldRS', $extraFieldRS); $this->_template->assign('attachmentsRS', $attachmentsRS); $this->_template->assign('pipelineEntriesPerPage', $pipelineEntriesPerPage); $this->_template->assign('pipelineGraph', $pipelineGraph); $this->_template->assign('jobOrderID', $jobOrderID); $this->_template->assign('careerPortalEnabled', $careerPortalEnabled); $this->_template->assign('privledgedUser', $privledgedUser); $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie()); //$this->_template->assign('fields_detail',$arrAssoc); if (!eval(Hooks::get('JO_SHOW'))) return; /* Is this a popup? */ if (isset($_GET['display']) && $_GET['display'] == 'popup') { $this->_template->display('./modules/joborders/show_popup.php'); $isPopup = true; } else { $this->_template->display('./modules/joborders/Show.php'); $isPopup = false; } }
private function show() { /* Is this a popup? */ if (isset($_GET['display']) && $_GET['display'] == 'popup') { $isPopup = true; } else { $isPopup = false; } /* Bail out if we don't have a valid candidate ID. */ if (!$this->isRequiredIDValid('candidateID', $_GET) && !isset($_GET['email'])) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.'); } $candidates = new Candidates($this->_siteID); if (isset($_GET['candidateID'])) { $candidateID = $_GET['candidateID']; } else { $candidateID = $candidates->getIDByEmail($_GET['email']); } $data = $candidates->get($candidateID); /* Bail out if we got an empty result set. */ if (empty($data)) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified candidate ID could not be found.'); return; } if ($data['isAdminHidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA) { $this->listByView('This candidate is hidden - only a CATS Administrator can unlock the candidate.'); return; } /* We want to handle formatting the city and state here instead * of in the template. */ $data['cityAndState'] = StringUtility::makeCityStateString($data['city'], $data['state']); /* * Replace newlines with <br />, fix HTML "special" characters, and * strip leading empty lines and spaces. */ $data['notes'] = trim(nl2br(htmlspecialchars($data['notes'], ENT_QUOTES))); /* Chop $data['notes'] to make $data['shortNotes']. */ if (strlen($data['notes']) > self::NOTES_MAXLEN) { $data['shortNotes'] = substr($data['notes'], 0, self::NOTES_MAXLEN); $isShortNotes = true; } else { $data['shortNotes'] = $data['notes']; $isShortNotes = false; } /* Format "can relocate" status. */ if ($data['canRelocate'] == 1) { $data['canRelocate'] = 'Yes'; } else { $data['canRelocate'] = 'No'; } if ($data['isHot'] == 1) { $data['titleClass'] = 'jobTitleHot'; } else { $data['titleClass'] = 'jobTitleCold'; } $attachments = new Attachments($this->_siteID); $attachmentsRS = $attachments->getAll(DATA_ITEM_CANDIDATE, $candidateID); foreach ($attachmentsRS as $rowNumber => $attachmentsData) { /* If profile image is not local, force it to be local. */ if ($attachmentsData['isProfileImage'] == 1) { $attachments->forceAttachmentLocal($attachmentsData['attachmentID']); } /* Show an attachment icon based on the document's file type. */ $attachmentIcon = strtolower(FileUtility::getAttachmentIcon($attachmentsRS[$rowNumber]['originalFilename'])); $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon; /* If the text field has any text, show a preview icon. */ if ($attachmentsRS[$rowNumber]['hasText']) { $attachmentsRS[$rowNumber]['previewLink'] = sprintf('<a href="#" onclick="window.open(\'%s?m=candidates&a=viewResume&attachmentID=%s\', \'viewResume\', \'scrollbars=1,width=800,height=760\')"><img width="15" height="15" style="border: none;" src="images/search.gif" alt="(Preview)" /></a>', CATSUtility::getIndexName(), $attachmentsRS[$rowNumber]['attachmentID']); } else { $attachmentsRS[$rowNumber]['previewLink'] = ' '; } } $pipelines = new Pipelines($this->_siteID); $pipelinesRS = $pipelines->getCandidatePipeline($candidateID); $sessionCookie = $_SESSION['CATS']->getCookie(); /* Format pipeline data. */ foreach ($pipelinesRS as $rowIndex => $row) { /* Hot jobs [can] have different title styles than normal * jobs. */ if ($row['isHot'] == 1) { $pipelinesRS[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $pipelinesRS[$rowIndex]['linkClass'] = 'jobLinkCold'; } $pipelinesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($pipelinesRS[$rowIndex]['ownerFirstName'], $pipelinesRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); $pipelinesRS[$rowIndex]['addedByAbbrName'] = StringUtility::makeInitialName($pipelinesRS[$rowIndex]['addedByFirstName'], $pipelinesRS[$rowIndex]['addedByLastName'], false, LAST_NAME_MAXLEN); $pipelinesRS[$rowIndex]['ratingLine'] = TemplateUtility::getRatingObject($pipelinesRS[$rowIndex]['ratingValue'], $pipelinesRS[$rowIndex]['candidateJobOrderID'], $sessionCookie); } $activityEntries = new ActivityEntries($this->_siteID); $activityRS = $activityEntries->getAllByDataItem($candidateID, DATA_ITEM_CANDIDATE); if (!empty($activityRS)) { foreach ($activityRS as $rowIndex => $row) { if (empty($activityRS[$rowIndex]['notes'])) { $activityRS[$rowIndex]['notes'] = '(No Notes)'; } if (empty($activityRS[$rowIndex]['jobOrderID']) || empty($activityRS[$rowIndex]['regarding'])) { $activityRS[$rowIndex]['regarding'] = 'General'; } $activityRS[$rowIndex]['enteredByAbbrName'] = StringUtility::makeInitialName($activityRS[$rowIndex]['enteredByFirstName'], $activityRS[$rowIndex]['enteredByLastName'], false, LAST_NAME_MAXLEN); } } /* Get upcoming calendar entries. */ $calendarRS = $candidates->getUpcomingEvents($candidateID); if (!empty($calendarRS)) { foreach ($calendarRS as $rowIndex => $row) { $calendarRS[$rowIndex]['enteredByAbbrName'] = StringUtility::makeInitialName($calendarRS[$rowIndex]['enteredByFirstName'], $calendarRS[$rowIndex]['enteredByLastName'], false, LAST_NAME_MAXLEN); } } /* Get extra fields. */ $extraFieldRS = $candidates->extraFields->getValuesForShow($candidateID); /* Add an MRU entry. */ $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_CANDIDATE, $candidateID, $data['firstName'] . ' ' . $data['lastName']); /* Is the user an admin - can user see history? */ if ($this->_accessLevel < ACCESS_LEVEL_DEMO) { $privledgedUser = false; } else { $privledgedUser = true; } $EEOSettings = new EEOSettings($this->_siteID); $EEOSettingsRS = $EEOSettings->getAll(); $EEOValues = array(); /* Make a list of all EEO related values so they can be positioned by index * rather than static positioning (like extra fields). */ if ($EEOSettingsRS['enabled'] == 1) { if ($EEOSettingsRS['genderTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Gender', 'fieldValue' => $data['eeoGenderText']); } if ($EEOSettingsRS['ethnicTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Ethnicity', 'fieldValue' => $data['eeoEthnicType']); } if ($EEOSettingsRS['veteranTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Veteran Status', 'fieldValue' => $data['eeoVeteranType']); } if ($EEOSettingsRS['disabilityTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Disability Status', 'fieldValue' => $data['eeoDisabilityStatus']); } } $questionnaire = new Questionnaire($this->_siteID); $questionnaires = $questionnaire->getCandidateQuestionnaires($candidateID); $this->_template->assign('active', $this); $this->_template->assign('questionnaires', $questionnaires); $this->_template->assign('data', $data); $this->_template->assign('isShortNotes', $isShortNotes); $this->_template->assign('attachmentsRS', $attachmentsRS); $this->_template->assign('pipelinesRS', $pipelinesRS); $this->_template->assign('activityRS', $activityRS); $this->_template->assign('calendarRS', $calendarRS); $this->_template->assign('extraFieldRS', $extraFieldRS); $this->_template->assign('candidateID', $candidateID); $this->_template->assign('isPopup', $isPopup); $this->_template->assign('EEOSettingsRS', $EEOSettingsRS); $this->_template->assign('EEOValues', $EEOValues); $this->_template->assign('privledgedUser', $privledgedUser); $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie()); if (!eval(Hooks::get('CANDIDATE_SHOW'))) { return; } $this->_template->display('./modules/candidates/Show.tpl'); }
public function show() { /* Is this a popup? */ if (isset($_GET['display']) && $_GET['display'] == 'popup') { $isPopup = true; } else { $isPopup = false; } /* Bail out if we don't have a valid candidate ID. */ if (!$this->isRequiredIDValid('candidateID', $_GET) && !isset($_GET['email'])) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.'); } $candidates = new Candidates($this->_siteID); if (isset($_GET['candidateID'])) { $candidateID = $_GET['candidateID']; } else { $candidateID = $candidates->getIDByEmail($_GET['email']); } $data = $candidates->get($candidateID); $emailList=array(); $sql="select * from email_history where for_id={$candidateID} and for_module='candidates'"; $db = DatabaseConnection::getInstance(); $emailList=$db->getAllAssoc($sql); /* Bail out if we got an empty result set. */ if (empty($data)) { CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified candidate ID could not be found.'); return; } if ($data['is_admin_hidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA) { $this->listByView('This candidate is hidden - only a CATS Administrator can unlock the candidate.'); return; } /* We want to handle formatting the city and state here instead * of in the template. */ $data['cityAndState'] = StringUtility::makeCityStateString( $data['city'], $data['state'] ); /* * Replace newlines with <br />, fix HTML "special" characters, and * strip leading empty lines and spaces. */ $data['notes'] = trim( nl2br(htmlspecialchars($data['notes'], ENT_QUOTES)) ); /* Chop $data['notes'] to make $data['shortNotes']. */ if (strlen($data['notes']) > self::NOTES_MAXLEN) { $data['shortNotes'] = substr( $data['notes'], 0, self::NOTES_MAXLEN ); $isShortNotes = true; } else { $data['shortNotes'] = $data['notes']; $isShortNotes = false; } /** * if ownertype is group, override the user full name */ if($data['ownertype']>0) { $sql="select * from auieo_groups where id={$data['owner']}"; $objDB=DatabaseConnection::getInstance(); $row=$objDB->getAssoc($sql); if($row) { $data["ownerFullName"]=$row["groupname"]; } } /* Format "can relocate" status. */ if ($data['can_relocate'] == 1) { $data['can_relocate'] = 'Yes'; } else { $data['can_relocate'] = 'No'; } if ($data['is_hot'] == 1) { $data['titleClass'] = 'jobTitleHot'; } else { $data['titleClass'] = 'jobTitleCold'; } $attachments = new Attachments($this->_siteID); $attachmentsRS = $attachments->getAll( DATA_ITEM_CANDIDATE, $candidateID ); foreach ($attachmentsRS as $rowNumber => $attachmentsData) { /* If profile image is not local, force it to be local. */ if ($attachmentsData['isProfileImage'] == 1) { $attachments->forceAttachmentLocal($attachmentsData['attachmentID']); } /* Show an attachment icon based on the document's file type. */ $attachmentIcon = strtolower( FileUtility::getAttachmentIcon( $attachmentsRS[$rowNumber]['originalFilename'] ) ); $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon; /* If the text field has any text, show a preview icon. */ if ($attachmentsRS[$rowNumber]['hasText']) { $attachmentsRS[$rowNumber]['previewLink'] = sprintf( '<a href="#" onclick="window.open(\'%s?m=candidates&a=viewResume&attachmentID=%s\', \'viewResume\', \'scrollbars=1,width=800,height=760\')"><img width="15" height="15" style="border: none;" src="images/search.gif" alt="(Preview)" /></a>', CATSUtility::getIndexName(), $attachmentsRS[$rowNumber]['attachmentID'] ); } else { $attachmentsRS[$rowNumber]['previewLink'] = ' '; } } $pipelines = new Pipelines($this->_siteID); $pipelinesRS = $pipelines->getCandidatePipeline($candidateID); $sessionCookie = $_SESSION['CATS']->getCookie(); /* Format pipeline data. */ foreach ($pipelinesRS as $rowIndex => $row) { /* Hot jobs [can] have different title styles than normal * jobs. */ if ($row['isHot'] == 1) { $pipelinesRS[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $pipelinesRS[$rowIndex]['linkClass'] = 'jobLinkCold'; } $pipelinesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName( $pipelinesRS[$rowIndex]['ownerFirstName'], $pipelinesRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN ); $pipelinesRS[$rowIndex]['addedByAbbrName'] = StringUtility::makeInitialName( $pipelinesRS[$rowIndex]['addedByFirstName'], $pipelinesRS[$rowIndex]['addedByLastName'], false, LAST_NAME_MAXLEN ); $pipelinesRS[$rowIndex]['ratingLine'] = TemplateUtility::getRatingObject( $pipelinesRS[$rowIndex]['ratingValue'], $pipelinesRS[$rowIndex]['candidateJobOrderID'], $sessionCookie ); } $activityEntries = new ActivityEntries($this->_siteID); $activityRS = $activityEntries->getAllByDataItem($candidateID, DATA_ITEM_CANDIDATE); if (!empty($activityRS)) { foreach ($activityRS as $rowIndex => $row) { if (empty($activityRS[$rowIndex]['notes'])) { $activityRS[$rowIndex]['notes'] = '(No Notes)'; } if (empty($activityRS[$rowIndex]['jobOrderID']) || empty($activityRS[$rowIndex]['regarding'])) { $activityRS[$rowIndex]['regarding'] = 'General'; } $activityRS[$rowIndex]['enteredByAbbrName'] = StringUtility::makeInitialName( $activityRS[$rowIndex]['enteredByFirstName'], $activityRS[$rowIndex]['enteredByLastName'], false, LAST_NAME_MAXLEN ); } } /* Get upcoming calendar entries. */ $calendarRS = $candidates->getUpcomingEvents($candidateID); if (!empty($calendarRS)) { foreach ($calendarRS as $rowIndex => $row) { $calendarRS[$rowIndex]['enteredByAbbrName'] = StringUtility::makeInitialName( $calendarRS[$rowIndex]['enteredByFirstName'], $calendarRS[$rowIndex]['enteredByLastName'], false, LAST_NAME_MAXLEN ); } } /* Get extra fields. */ $extraFieldRS = $candidates->extraFields->getValuesForShow($candidateID); /* Add an MRU entry. */ $_SESSION['CATS']->getMRU()->addEntry( DATA_ITEM_CANDIDATE, $candidateID, $data['first_name'] . ' ' . $data['last_name'] ); /* Is the user an admin - can user see history? */ if ($this->_accessLevel < ACCESS_LEVEL_DEMO) { $privledgedUser = false; } else { $privledgedUser = true; } $EEOSettings = new EEOSettings($this->_siteID); $EEOSettingsRS = $EEOSettings->getAll(); $EEOValues = array(); /* Make a list of all EEO related values so they can be positioned by index * rather than static positioning (like extra fields). */ if ($EEOSettingsRS['enabled'] == 1) { if ($EEOSettingsRS['genderTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Gender', 'fieldValue' => $data['eeoGenderText']); } if ($EEOSettingsRS['ethnicTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Ethnicity', 'fieldValue' => $data['eeoEthnicType']); } if ($EEOSettingsRS['veteranTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Veteran Status', 'fieldValue' => $data['eeoVeteranType']); } if ($EEOSettingsRS['disabilityTracking'] == 1) { $EEOValues[] = array('fieldName' => 'Disability Status', 'fieldValue' => $data['eeoDisabilityStatus']); } } $questionnaire = new Questionnaire($this->_siteID); $questionnaires = $questionnaire->getCandidateQuestionnaires($candidateID); $indexName=CATSUtility::getIndexName(); $adminHidden=""; if ($data['is_admin_hidden'] == 1) { $adminHidden = "<p class='warning'>This Candidate is hidden. Only CATS Administrators can view it or search for it. To make it visible by the site users, click <a href='{$indexName}?m=candidates&a=administrativeHideShow&candidateID={$candidateID}&state=0' style='font-weight:bold;'>Here.</a></p>"; } $profileImage = false; foreach ($attachmentsRS as $rowNumber => $attachmentsData) { if ($attachmentsData['isProfileImage'] == '1') { $profileImage = true; } } $candidateShowClass="cprofileshow"; if ($profileImage) { $candidateShowClass="cshow"; //echo "<td width='390' height='100%'>"; } else { //echo "</td><td width='50%' height='100%'>"; } $recordInActive=""; if ($data['is_active'] != 1){ $recordInActive = " <span style='color:orange;'>(INACTIVE)</span> "; } $accessLevelEdit=""; if ($this->_accessLevel >= ACCESS_LEVEL_EDIT) { $accessLevelEdit= "<a href='#' id='addActivityLink' onclick=\"showPopWin('{$indexName}?m=candidates&a=addActivityChangeStatus&candidateID={$candidateID}&jobOrderID=-1', 600, 480, null); return false;\"> <img src='images/new_activity_inline.gif' width='16' height='16' class='absmiddle' title='Log an Activity / Change Status' alt='Log an Activity / Change Status' border='0' /> Log an Activity </a>"; } $this->_template->assign('active', $this); $this->_template->assign('email_list', $emailList); $this->_template->assign('candidateID', $candidateID); $this->_template->assign('questionnaires', $questionnaires); $this->_template->assign('accessLevelEdit', $accessLevelEdit); $this->_template->assign('data', $data); $this->_template->assign('candidateShowClass', $candidateShowClass); $this->_template->assign('recordInActive', $recordInActive); $this->_template->assign('isShortNotes', $isShortNotes); $this->_template->assign('adminHidden',$adminHidden); $this->_template->assign('attachmentsRS', $attachmentsRS); $this->_template->assign('pipelinesRS', $pipelinesRS); $this->_template->assign('activityRS', $activityRS); $this->_template->assign('calendarRS', $calendarRS); $this->_template->assign('extraFieldRS', $extraFieldRS); $this->_template->assign('candidateID', $candidateID); $this->_template->assign('isPopup', $isPopup); $this->_template->assign('EEOSettingsRS', $EEOSettingsRS); $this->_template->assign('EEOValues', $EEOValues); $this->_template->assign('privledgedUser', $privledgedUser); $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie()); if (!eval(Hooks::get('CANDIDATE_SHOW'))) return; //$this->_template->display('./modules/candidates/show.php'); //return true; if (isset($_GET['display']) && $_GET['display'] == 'popup') { $this->_template->display('./modules/candidates/show_popup.php'); $isPopup = true; } else { $this->_template->display('./modules/candidates/show.php'); $isPopup = false; } }