本文整理汇总了PHP中Attachments::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::getAll方法的具体用法?PHP Attachments::getAll怎么用?PHP Attachments::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachments
的用法示例。
在下文中一共展示了Attachments::getAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Removes a candidate and all associated records from the system.
*
* @param integer Candidate ID to delete.
* @return void
*/
public function delete($candidateID)
{
/* Delete the candidate from candidate. */
$sql = sprintf("DELETE FROM\n candidate\n WHERE\n candidate_id = %s\n AND\n site_id = %s", $this->_db->makeQueryInteger($candidateID), $this->_siteID);
$this->_db->query($sql);
$history = new History($this->_siteID);
$history->storeHistoryDeleted(DATA_ITEM_CANDIDATE, $candidateID);
/* Delete pipeline entries from candidate_joborder. */
$sql = sprintf("DELETE FROM\n candidate_joborder\n WHERE\n candidate_id = %s\n AND\n site_id = %s", $this->_db->makeQueryInteger($candidateID), $this->_siteID);
$this->_db->query($sql);
/* Delete pipeline history from candidate_joborder_status_history. */
$sql = sprintf("DELETE FROM\n candidate_joborder_status_history\n WHERE\n candidate_id = %s\n AND\n site_id = %s", $this->_db->makeQueryInteger($candidateID), $this->_siteID);
$this->_db->query($sql);
/* Delete from saved lists. */
$sql = sprintf("DELETE FROM\n saved_list_entry\n WHERE\n data_item_id = %s\n AND\n site_id = %s\n AND\n data_item_type = %s", $this->_db->makeQueryInteger($candidateID), $this->_siteID, DATA_ITEM_CANDIDATE);
$this->_db->query($sql);
/* Delete attachments. */
$attachments = new Attachments($this->_siteID);
$attachmentsRS = $attachments->getAll(DATA_ITEM_CANDIDATE, $candidateID);
foreach ($attachmentsRS as $rowNumber => $row) {
$attachments->delete($row['attachmentID']);
}
/* Delete extra fields. */
$this->extraFields->deleteValueByDataItemID($candidateID);
}
示例2: createBackup
private function createBackup()
{
if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
return;
//$this->fatal(ERROR_NO_PERMISSION);
}
/* Attachments */
$attachments = new Attachments(CATS_ADMIN_SITE);
$attachmentsRS = $attachments->getAll(DATA_ITEM_COMPANY, $_SESSION['CATS']->getSiteCompanyID());
foreach ($attachmentsRS as $index => $data) {
$attachmentsRS[$index]['fileSize'] = fileUtility::sizeToHuman(filesize($data['retrievalURLLocal']), 2, 1);
}
$this->_template->assign('active', $this);
$this->_template->assign('subActive', 'Administration');
$this->_template->assign('attachmentsRS', $attachmentsRS);
$this->_template->display('./modules/settings/Backup.tpl');
}
示例3: show
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';
}
}
}
//.........这里部分代码省略.........
示例4: delete
/**
* Removes a company and all associated records from the system.
*
* @param integer Company ID
* @return void
*/
public function delete($companyID)
{
/* Delete the company. */
$sql = sprintf("DELETE FROM\n company\n WHERE\n company_id = %s\n AND\n site_id = %s", $companyID, $this->_siteID);
$this->_db->query($sql);
$history = new History($this->_siteID);
$history->storeHistoryDeleted(DATA_ITEM_COMPANY, $companyID);
/* Find associated contacts. */
$sql = sprintf("SELECT\n contact_id AS contactID\n FROM\n contact\n WHERE\n company_id = %s\n AND\n site_id = %s", $companyID, $this->_siteID);
$contactsRS = $this->_db->getAllAssoc($sql);
/* Find associated job orders. */
$sql = sprintf("SELECT\n joborder_id AS jobOrderID\n FROM\n joborder\n WHERE\n company_id = %s\n AND\n site_id = %s", $companyID, $this->_siteID);
$jobOrdersRS = $this->_db->getAllAssoc($sql);
/* Find associated attachments. */
$attachments = new Attachments($this->_siteID);
$attachmentsRS = $attachments->getAll(DATA_ITEM_COMPANY, $companyID);
/* Delete associated contacts. */
$contacts = new Contacts($this->_siteID);
foreach ($contactsRS as $rowIndex => $row) {
$contacts->delete($row['contactID']);
}
/* Delete associated job orders. */
$jobOrders = new JobOrders($this->_siteID);
foreach ($jobOrdersRS as $rowIndex => $row) {
$jobOrders->delete($row['jobOrderID']);
}
/* Delete associated attachments. */
foreach ($attachmentsRS as $rowNumber => $row) {
$attachments->delete($row['attachmentID']);
}
/* Delete from saved lists. */
$sql = sprintf("DELETE FROM\n saved_list_entry\n WHERE\n data_item_id = %s\n AND\n site_id = %s\n AND\n data_item_type = %s", $this->_db->makeQueryInteger($companyID), $this->_siteID, DATA_ITEM_COMPANY);
$this->_db->query($sql);
/* Delete extra fields. */
$this->extraFields->deleteValueByDataItemID($companyID);
}
示例5: careersPage
public function careersPage()
{
global $careerPage;
/* Get information on what site we are in, our environment, etc. */
$site = new Site(-1);
$siteID = $site->getFirstSiteID();
if (!eval(Hooks::get('CAREERS_SITEID'))) return;
/*
if (!eval(Hooks::get('CAREERS_IS_ENABLED'))) return;
if (!file_exists('modules/asp') && !LicenseUtility::isProfessional())
{
CommonErrors::fatal(COMMONERROR_INVALIDMODULE, $this, 'Career Portal');
}
*/
$siteRS = $site->getSiteBySiteID($siteID);
if (!isset($siteRS['name']))
{
die('An error has occurred: No site exists with this site name.');
}
$siteName = $siteRS['name'];
/* Get information on the current template. */
$careerPortalSettings = new CareerPortalSettings($siteID);
$careerPortalSettingsRS = $careerPortalSettings->getAll();
$templateName = $careerPortalSettingsRS['activeBoard'];
$enabled = $careerPortalSettingsRS['enabled'];
if ($enabled == 0)
{
// FIXME: Generate valid XHTML error pages. Create an error/fatal method!
die('<html><body>Job Board Not Active</body></html>');
}
if (isset($_GET['templateName']))
{
$templateName = $_GET['templateName'];
}
$template = $careerPortalSettings->getTemplate($templateName);
/* At this point the entire template is loaded, we just need to add data to the
template for the specific page. */
/* Get all public job orders for this site. */
$jobOrders = new JobOrders($siteID);
$rs = $jobOrders->getAll(JOBORDERS_STATUS_ACTIVE, -1, -1, -1, false, true);
$useCookie = true;
// Get the get or post page request
$p = isset($_GET['p']) ? $_GET['p'] : '';
$p = isset($_POST['p']) ? $_POST['p'] : $p;
// Get the get or post sub-page request
$pa = isset($_GET['pa']) ? $_GET['pa'] : '';
$pa = isset($_POST['pa']) ? $_POST['pa'] : $pa;
$isRegistrationEnabled = $careerPortalSettingsRS['candidateRegistration'];
switch ($pa)
{
case 'logout':
if ($isRegistrationEnabled)
{
// Remove the saved information cookie
setcookie($this->getCareerPortalCookieName($siteID), '');
$useCookie = false;
}
break;
case 'updateProfile':
if ($isRegistrationEnabled)
{
$p = 'registeredCandidateProfile';
}
break;
}
if ($p == 'showAll')
{
$template['Content'] = $template['Content - Search Results'];
$template['Content'] = str_replace('<numberOfSearchResults>', count($rs), $template['Content']);
$template['Content'] = str_replace('<registeredCandidate>', $useCookie && $isRegistrationEnabled ? $this->getRegisteredCandidateBlock($siteID, $template['Content - Candidate Registration']) : '', $template['Content']);
if ($careerPortalSettingsRS['allowBrowse'] == 1)
{
/* Legacy. */
$template['Content'] = str_replace('<searchResultsTableUnformatted>', $this->getResultsTable($rs, $careerPortalSettingsRS, true), $template['Content']);
//.........这里部分代码省略.........
示例6: show
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);
//.........这里部分代码省略.........
示例7: show
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)
{
//.........这里部分代码省略.........
示例8: onShowQuestionnaire
private function onShowQuestionnaire()
{
$candidateID = isset($_GET[$id = 'candidateID']) ? $_GET[$id] : false;
$title = isset($_GET[$id = 'questionnaireTitle']) ? urldecode($_GET[$id]) : false;
$printOption = isset($_GET[$id = 'print']) ? $_GET[$id] : '';
$printValue = !strcasecmp($printOption, 'yes') ? true : false;
if (!$candidateID || !$title) {
CommonErrors::fatal(COMMONERROR_BADINDEX);
}
$candidates = new Candidates($this->_siteID);
$cData = $candidates->get($candidateID);
$questionnaire = new Questionnaire($this->_siteID);
$qData = $questionnaire->getCandidateQuestionnaire($candidateID, $title);
$attachment = new Attachments($this->_siteID);
$attachments = $attachment->getAll(DATA_ITEM_CANDIDATE, $candidateID);
if (!empty($attachments)) {
$resume = $candidates->getResume($attachments[0]['attachmentID']);
$this->_template->assign('resumeText', str_replace("\n", "<br \\>\n", htmlentities(DatabaseSearch::fulltextDecode($resume['text']))));
$this->_template->assign('resumeTitle', htmlentities($resume['title']));
}
$this->_template->assign('active', $this);
$this->_template->assign('candidateID', $candidateID);
$this->_template->assign('title', $title);
$this->_template->assign('cData', $cData);
$this->_template->assign('qData', $qData);
$this->_template->assign('print', $printValue);
$this->_template->display('./modules/candidates/Questionnaire.tpl');
}