function testMakeFirstInitialName() { $this->assertIdentical(StringUtility::makeInitialName('Michael', 'Zimmermann', true), 'Zimmermann, M.'); $this->assertIdentical(StringUtility::makeInitialName('Michael', 'Zimmermann', true, 50), 'Zimmermann, M.'); $this->assertIdentical(StringUtility::makeInitialName('Michael', 'Zimmermann', true, 10), 'Zimmermann, M.'); $this->assertIdentical(StringUtility::makeInitialName('Michael', 'Zimmermann', true, 9), 'Zimmerman, M.'); $this->assertIdentical(StringUtility::makeInitialName('Michael', 'Zimmermann', true, 1), 'Z, M.'); }
$indexFile = $_REQUEST['indexFile']; $isPopup = $_REQUEST['isPopup'] == 1 ? true : false; $_SESSION['CATS']->setPipelineEntriesPerPage($entriesPerPage); $jobOrders = new JobOrders($siteID); $jobOrdersData = $jobOrders->get($jobOrderID); /* Get an array of the pipeline data. */ $pipelines = new Pipelines($siteID); $pipelinesRS = $pipelines->getJobOrderPipeline($jobOrderID); /* Format pipeline data. */ foreach ($pipelinesRS as $rowIndex => $row) { if ($row['submitted'] == '1') { $pipelinesRS[$rowIndex]['highlightStyle'] = 'jobLinkSubmitted'; } else { $pipelinesRS[$rowIndex]['highlightStyle'] = 'jobLinkCold'; } $pipelinesRS[$rowIndex]['addedByAbbrName'] = StringUtility::makeInitialName($pipelinesRS[$rowIndex]['addedByFirstName'], $pipelinesRS[$rowIndex]['addedByLastName'], LAST_NAME_MAXLEN); if ($row['attachmentPresent'] == 1) { $pipelinesRS[$rowIndex]['iconTag'] = '<img src="images/paperclip.gif" alt="" width="16" height="16" />'; } else { $pipelinesRS[$rowIndex]['iconTag'] = ' '; } $pipelinesRS[$rowIndex]['ratingLine'] = TemplateUtility::getRatingObject($pipelinesRS[$rowIndex]['ratingValue'], $pipelinesRS[$rowIndex]['candidateJobOrderID'], $_SESSION['CATS']->getCookie()); } /* Sort the data. */ if ($sortBy !== '' && $sortBy !== 'undefined') { $sorting = array(); foreach ($pipelinesRS as $p) { $sorting[] = $p[$sortBy]; } if ($sortBy == 'ratingValue') { array_multisort($sorting, $sortDirection == 'desc' ? SORT_DESC : SORT_ASC, SORT_NUMERIC, $pipelinesRS);
/** * Formats SQL result set for display. This is factored out for code * clarity. * * @param array result set from listByView() * @return array formatted result set */ private function _formatListByViewResults($resultSet) { if (empty($resultSet)) { return $resultSet; } foreach ($resultSet as $rowIndex => $row) { /* Hot companies [can] have different title styles than normal * companies. */ if ($resultSet[$rowIndex]['isHot'] == 1) { $resultSet[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $resultSet[$rowIndex]['linkClass'] = 'jobLinkCold'; } if (!empty($resultSet[$rowIndex]['ownerFirstName'])) { $resultSet[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($resultSet[$rowIndex]['ownerFirstName'], $resultSet[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); } else { $resultSet[$rowIndex]['ownerAbbrName'] = 'None'; } if ($resultSet[$rowIndex]['attachmentPresent'] == 1) { $resultSet[$rowIndex]['iconTag'] = '<img src="images/paperclip.gif" alt="" width="16" height="16" />'; } else { $resultSet[$rowIndex]['iconTag'] = ' '; } /* Display nothing instead of zero's for Job Order Count on Companies * display page. */ if ($resultSet[$rowIndex]['jobOrdersCount'] == 0) { $resultSet[$rowIndex]['jobOrdersCount'] = ' '; } } return $resultSet; }
/** * Formats SQL result set for display. This is factored out for code * clarity. * * @param array result set from listByView() * @return array formatted result set */ private function _formatListByViewResults($resultSet) { if (empty($resultSet)) { return $resultSet; } foreach ($resultSet as $rowIndex => $row) { if (!empty($resultSet[$rowIndex]['ownerFirstName'])) { $resultSet[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($resultSet[$rowIndex]['ownerFirstName'], $resultSet[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); } else { $resultSet[$rowIndex]['ownerAbbrName'] = 'None'; } /* Hot contacts [can] have different title styles than normal * companies. */ if ($resultSet[$rowIndex]['isHotContact'] == 1) { $resultSet[$rowIndex]['linkClassContact'] = 'jobLinkHot'; } else { $resultSet[$rowIndex]['linkClassContact'] = 'jobLinkCold'; } /* Strikethrough on no longer associated companies takes priority * over hot companies. */ if ($resultSet[$rowIndex]['leftCompany'] == 1) { $resultSet[$rowIndex]['linkClassCompany'] = 'jobLinkDead'; } else { if ($resultSet[$rowIndex]['isHotCompany'] == 1) { $resultSet[$rowIndex]['linkClassCompany'] = 'jobLinkHot'; } else { $resultSet[$rowIndex]['linkClassCompany'] = 'jobLinkCold'; } } /* Truncate Company Name column */ if (strlen($resultSet[$rowIndex]['companyName']) > self::TRUNCATE_CLIENT_NAME) { $resultSet[$rowIndex]['companyName'] = substr($resultSet[$rowIndex]['companyName'], 0, self::TRUNCATE_CLIENT_NAME) . "..."; } /* Truncate Title column */ if (strlen($resultSet[$rowIndex]['title']) > self::TRUNCATE_TITLE) { $resultSet[$rowIndex]['title'] = substr($resultSet[$rowIndex]['title'], 0, self::TRUNCATE_TITLE) . "..."; } } if (!eval(Hooks::get('CONTACTS_FORMAT_LIST_BY_VIEW'))) { return; } return $resultSet; }
/** * Formats SQL result set for display. This is factored out for code * clarity. * * @param array result set from listByView() * @return array formatted result set */ private function _formatListByViewResults($resultSet) { if (empty($resultSet)) { return $resultSet; } foreach ($resultSet as $rowIndex => $row) { /* Get info strings for popup titles */ $resultSet[$rowIndex]['jobOrderInfo'] = InfoString::make(DATA_ITEM_JOBORDER, $resultSet[$rowIndex]['jobOrderID'], $this->_siteID); $resultSet[$rowIndex]['companyInfo'] = InfoString::make(DATA_ITEM_COMPANY, $resultSet[$rowIndex]['companyID'], $this->_siteID); /* Truncate job order title. */ if (strlen($resultSet[$rowIndex]['title']) > self::TRUNCATE_JOBORDER_TITLE) { $resultSet[$rowIndex]['title'] = substr($resultSet[$rowIndex]['title'], 0, self::TRUNCATE_JOBORDER_TITLE) . "..."; } /* Truncate company name. */ if (strlen($resultSet[$rowIndex]['companyName']) > self::TRUNCATE_CLIENT_NAME) { $resultSet[$rowIndex]['companyName'] = substr($resultSet[$rowIndex]['companyName'], 0, self::TRUNCATE_CLIENT_NAME) . "..."; } /* Convert '00-00-00' dates to empty strings. */ $resultSet[$rowIndex]['startDate'] = DateUtility::fixZeroDate($resultSet[$rowIndex]['startDate']); /* Hot jobs [can] have different title styles than normal * jobs. */ if ($resultSet[$rowIndex]['isHot'] == 1) { $resultSet[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $resultSet[$rowIndex]['linkClass'] = 'jobLinkCold'; } $resultSet[$rowIndex]['recruiterAbbrName'] = StringUtility::makeInitialName($resultSet[$rowIndex]['recruiterFirstName'], $resultSet[$rowIndex]['recruiterLastName'], false, LAST_NAME_MAXLEN); $resultSet[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($resultSet[$rowIndex]['ownerFirstName'], $resultSet[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); if ($resultSet[$rowIndex]['attachmentPresent'] == 1) { $resultSet[$rowIndex]['iconTag'] = '<img src="images/paperclip.gif" alt="" width="16" height="16" />'; } else { $resultSet[$rowIndex]['iconTag'] = ' '; } } if (!eval(Hooks::get('JO_FORMAT_LIST_BY_VIEW_RESULTS'))) { return; } return $resultSet; }
<tr> <td align="left" valign="top" style="text-align: left; width: 50%; height: 240px;"> <div class="noteUnsizedSpan" style="width:410px;">Recent Hires</div> <table class="sortable" width="410" style="margin: 0 0 4px 0;"> <tr> <th align="left" style="font-size:11px;">Name</th> <th align="left" style="font-size:11px;">Company</th> <th align="left" style="font-size:11px;">Recruiter</th> <th align="left" style="font-size:11px;">Date</th> </tr> <?php foreach($this->placedRS as $index => $data): ?> <tr class="<?php TemplateUtility::printAlternatingRowClass($index); ?>"> <td style="font-size:11px;"><a href="<?php echo(CATSUtility::getIndexName()); ?>?m=candidates&a=show&candidateID=<?php echo($data['candidateID']); ?>"style="font-size:11px;" class="<?php echo($data['candidateClassName']); ?>"><?php $this->_($data['firstName']); ?> <?php $this->_($data['lastName']); ?></a></td> <td style="font-size:11px;"><a href="<?php echo(CATSUtility::getIndexName()); ?>?m=companies&a=show&companyID=<?php echo($data['companyID']); ?>" style="font-size:11px;" class="<?php echo($data['companyClassName']); ?>"><?php $this->_($data['companyName']); ?></td> <td style="font-size:11px;"><?php $this->_(StringUtility::makeInitialName($data['userFirstName'], $data['userLastName'], false, LAST_NAME_MAXLEN)); ?></td> <td style="font-size:11px;"><?php $this->_($data['date']); ?></td> </tr> <?php endforeach; ?> </table> <?php if (!count($this->placedRS)): ?> <div style="width: 411px; height: 207px; border: 1px solid #c0c0c0; background: #E7EEFF url(images/nodata/dashboardNoHiresWhite.jpg);"> </div> <?php endif; ?> </td> <td align="center" valign="top" style="text-align: left; width: 50%; height: 240px;"> <div class="noteUnsizedSpan" style="width:495px;">Hiring Overview</div> <map name="dashboardmap" id="dashboardmap">
/** * Formats SQL result set for display. This is factored out for code * clarity. * * @param array result set from listByView() * @return array formatted result set */ private function _formatListByViewResults($resultSet) { if (empty($resultSet)) { return $resultSet; } foreach ($resultSet as $rowIndex => $row) { if ($resultSet[$rowIndex]['isHot'] == 1) { $resultSet[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $resultSet[$rowIndex]['linkClass'] = 'jobLinkCold'; } if (!empty($resultSet[$rowIndex]['ownerFirstName'])) { $resultSet[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($resultSet[$rowIndex]['ownerFirstName'], $resultSet[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN); } else { $resultSet[$rowIndex]['ownerAbbrName'] = 'None'; } if ($resultSet[$rowIndex]['submitted'] == 1) { $resultSet[$rowIndex]['iconTag'] = '<img src="images/job_orders.gif" alt="" width="16" height="16" title="Submitted for a Job Order" />'; } else { $resultSet[$rowIndex]['iconTag'] = '<img src="images/mru/blank.gif" alt="" width="16" height="16" />'; } if ($resultSet[$rowIndex]['attachmentPresent'] == 1) { $resultSet[$rowIndex]['iconTag'] .= '<img src="images/paperclip.gif" alt="" width="16" height="16" title="Attachment Present" />'; } else { $resultSet[$rowIndex]['iconTag'] .= '<img src="images/mru/blank.gif" alt="" width="16" height="16" />'; } if (empty($resultSet[$rowIndex]['keySkills'])) { $resultSet[$rowIndex]['keySkills'] = ' '; } else { $resultSet[$rowIndex]['keySkills'] = htmlspecialchars($resultSet[$rowIndex]['keySkills']); } /* Truncate Key Skills to fit the column width */ if (strlen($resultSet[$rowIndex]['keySkills']) > self::TRUNCATE_KEYSKILLS) { $resultSet[$rowIndex]['keySkills'] = substr($resultSet[$rowIndex]['keySkills'], 0, self::TRUNCATE_KEYSKILLS) . "..."; } } return $resultSet; }
public function quickSearch() { /* Bail out to prevent an error if the GET string doesn't even contain * a field named 'quickSearchFor' at all. */ if (!isset($_GET['quickSearchFor'])) { CommonErrors::fatal(COMMONERROR_BADFIELDS, $this, 'No query string specified.'); } $query = trim($_GET['quickSearchFor']); $wildCardQuickSearch = $query; $search = new QuickSearch($this->_siteID); $candidatesRS = $search->candidates($query); $companiesRS = $search->companies($query); $contactsRS = $search->contacts($query); $jobOrdersRS = $search->jobOrders($query); //$listsRS = $search->lists($query); if (!empty($candidatesRS)) { foreach ($candidatesRS as $rowIndex => $row) { if (!empty($candidatesRS[$rowIndex]['ownerFirstName'])) { $candidatesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName( $candidatesRS[$rowIndex]['ownerFirstName'], $candidatesRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN ); } else { $candidatesRS[$rowIndex]['ownerAbbrName'] = 'None'; } if (empty($candidatesRS[$rowIndex]['phoneHome'])) { $candidatesRS[$rowIndex]['phoneHome'] = 'None'; } if (empty($candidatesRS[$rowIndex]['phoneCell'])) { $candidatesRS[$rowIndex]['phoneCell'] = 'None'; } } } if (!empty($companiesRS)) { foreach ($companiesRS as $rowIndex => $row) { if (!empty($companiesRS[$rowIndex]['ownerFirstName'])) { $companiesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName( $companiesRS[$rowIndex]['ownerFirstName'], $companiesRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN ); } else { $companiesRS[$rowIndex]['ownerAbbrName'] = 'None'; } if (empty($companiesRS[$rowIndex]['phone1'])) { $companiesRS[$rowIndex]['phone1'] = 'None'; } } } if (!empty($contactsRS)) { foreach ($contactsRS as $rowIndex => $row) { if ($contactsRS[$rowIndex]['isHotContact'] == 1) { $contactsRS[$rowIndex]['linkClassContact'] = 'jobLinkHot'; } else { $contactsRS[$rowIndex]['linkClassContact'] = 'jobLinkCold'; } if ($contactsRS[$rowIndex]['leftCompany'] == 1) { $contactsRS[$rowIndex]['linkClassCompany'] = 'jobLinkDead'; } else if ($contactsRS[$rowIndex]['isHotCompany'] == 1) { $contactsRS[$rowIndex]['linkClassCompany'] = 'jobLinkHot'; } else { $contactsRS[$rowIndex]['linkClassCompany'] = '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 (empty($contactsRS[$rowIndex]['phoneWork'])) { $contactsRS[$rowIndex]['phoneWork'] = 'None'; } if (empty($contactsRS[$rowIndex]['phoneCell'])) { $contactsRS[$rowIndex]['phoneCell'] = 'None'; } } } if (!empty($jobOrdersRS)) { foreach ($jobOrdersRS as $rowIndex => $row) { if ($jobOrdersRS[$rowIndex]['startDate'] == '00-00-00') { $jobOrdersRS[$rowIndex]['startDate'] = ''; } if ($jobOrdersRS[$rowIndex]['isHot'] == 1) { $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkHot'; } else { $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkCold'; } if (!empty($jobOrdersRS[$rowIndex]['recruiterAbbrName'])) { $jobOrdersRS[$rowIndex]['recruiterAbbrName'] = StringUtility::makeInitialName( $jobOrdersRS[$rowIndex]['recruiterFirstName'], $jobOrdersRS[$rowIndex]['recruiterLastName'], false, LAST_NAME_MAXLEN ); } else { $jobOrdersRS[$rowIndex]['recruiterAbbrName'] = 'None'; } if (!empty($jobOrdersRS[$rowIndex]['ownerFirstName'])) { $jobOrdersRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName( $jobOrdersRS[$rowIndex]['ownerFirstName'], $jobOrdersRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN ); } else { $jobOrdersRS[$rowIndex]['ownerAbbrName'] = 'None'; } } } $this->_template->assign('active', $this); $this->_template->assign('jobOrdersRS', $jobOrdersRS); $this->_template->assign('candidatesRS', $candidatesRS); $this->_template->assign('companiesRS', $companiesRS); $this->_template->assign('contactsRS', $contactsRS); //$this->_template->assign('listsRS', $listsRS); $this->_template->assign('wildCardQuickSearch', $wildCardQuickSearch); if (!eval(Hooks::get('HOME_QUICK_SEARCH'))) return; $this->_template->display('./modules/home/SearchEverything.php'); }