Example #1
0
 private function edit()
 {
     /* 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->getForEditing($companyID);
     /* Bail out if we got an empty result set. */
     if (empty($data)) {
         $this->listByView('The specified company ID could not be found.');
         return;
     }
     /* Get the company's contacts data. */
     $contactsRS = $companies->getContactsArray($companyID);
     $users = new Users($this->_siteID);
     $usersRS = $users->getSelectList();
     /* Add an MRU entry. */
     $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_COMPANY, $companyID, $data['name']);
     /* Get extra fields. */
     $extraFieldRS = $companies->extraFields->getValuesForEdit($companyID);
     /* Get departments. */
     $departmentsRS = $companies->getDepartments($companyID);
     $departmentsString = ListEditor::getStringFromList($departmentsRS, 'name');
     $emailTemplates = new EmailTemplates($this->_siteID);
     $statusChangeTemplateRS = $emailTemplates->getByTag('EMAIL_TEMPLATE_OWNERSHIPASSIGNCLIENT');
     if (!isset($statusChangeTemplateRS['disabled']) || $statusChangeTemplateRS['disabled'] == 1) {
         $emailTemplateDisabled = true;
     } else {
         $emailTemplateDisabled = false;
     }
     if ($this->_accessLevel == ACCESS_LEVEL_DEMO) {
         $canEmail = false;
     } else {
         $canEmail = true;
     }
     if (!eval(Hooks::get('CLIENTS_EDIT'))) {
         return;
     }
     $this->_template->assign('canEmail', $canEmail);
     $this->_template->assign('active', $this);
     $this->_template->assign('data', $data);
     $this->_template->assign('usersRS', $usersRS);
     $this->_template->assign('extraFieldRS', $extraFieldRS);
     $this->_template->assign('contactsRS', $contactsRS);
     $this->_template->assign('departmentsRS', $departmentsRS);
     $this->_template->assign('departmentsString', $departmentsString);
     $this->_template->assign('emailTemplateDisabled', $emailTemplateDisabled);
     $this->_template->assign('companyID', $companyID);
     $this->_template->display('./modules/companies/Edit.tpl');
 }
Example #2
0
 private function edit()
 {
     /* 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->getForEditing($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.');
     }
     $companies = new Companies($this->_siteID);
     $companiesRS = $companies->getSelectList();
     $users = new Users($this->_siteID);
     $usersRS = $users->getSelectList();
     /* Add an MRU entry. */
     $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_CONTACT, $contactID, $data['firstName'] . ' ' . $data['lastName']);
     /* Get extra fields. */
     $extraFieldRS = $contacts->extraFields->getValuesForEdit($contactID);
     /* Get departments. */
     $departmentsRS = $companies->getDepartments($data['companyID']);
     $departmentsString = ListEditor::getStringFromList($departmentsRS, 'name');
     $emailTemplates = new EmailTemplates($this->_siteID);
     $statusChangeTemplateRS = $emailTemplates->getByTag('EMAIL_TEMPLATE_OWNERSHIPASSIGNCONTACT');
     if (!isset($statusChangeTemplateRS['disabled']) || $statusChangeTemplateRS['disabled'] == 1) {
         $emailTemplateDisabled = true;
     } else {
         $emailTemplateDisabled = false;
     }
     $reportsToRS = $contacts->getAll(-1, $data['companyID']);
     if ($this->_accessLevel == ACCESS_LEVEL_DEMO) {
         $canEmail = false;
     } else {
         $canEmail = true;
     }
     $companies = new Companies($this->_siteID);
     $defaultCompanyID = $companies->getDefaultCompany();
     if ($defaultCompanyID !== false) {
         $defaultCompanyRS = $companies->get($defaultCompanyID);
     } else {
         $defaultCompanyRS = array();
     }
     if (!eval(Hooks::get('CONTACTS_EDIT'))) {
         return;
     }
     $this->_template->assign('defaultCompanyID', $defaultCompanyID);
     $this->_template->assign('defaultCompanyRS', $defaultCompanyRS);
     $this->_template->assign('canEmail', $canEmail);
     $this->_template->assign('emailTemplateDisabled', $emailTemplateDisabled);
     $this->_template->assign('active', $this);
     $this->_template->assign('data', $data);
     $this->_template->assign('companiesRS', $companiesRS);
     $this->_template->assign('extraFieldRS', $extraFieldRS);
     $this->_template->assign('departmentsRS', $departmentsRS);
     $this->_template->assign('departmentsString', $departmentsString);
     $this->_template->assign('usersRS', $usersRS);
     $this->_template->assign('reportsToRS', $reportsToRS);
     $this->_template->assign('contactID', $contactID);
     $this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie());
     $this->_template->display('./modules/contacts/Edit.tpl');
 }
Example #3
0
 private function addCandidateModal($contents = '', $fields = array())
 {
     /* Bail out if we don't have a valid job order ID. */
     if (!$this->isRequiredIDValid('jobOrderID', $_GET)) {
         CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.');
     }
     $jobOrderID = $_GET['jobOrderID'];
     $candidates = new Candidates($this->_siteID);
     /* Get possible sources. */
     $sourcesRS = $candidates->getPossibleSources();
     $sourcesString = ListEditor::getStringFromList($sourcesRS, 'name');
     /* Get extra fields. */
     $extraFieldRS = $candidates->extraFields->getValuesForAdd();
     $associatedAttachment = 0;
     $associatedAttachmentRS = array();
     $EEOSettings = new EEOSettings($this->_siteID);
     $EEOSettingsRS = $EEOSettings->getAll();
     if (is_array($parsingStatus = LicenseUtility::getParsingStatus()) && isset($parsingStatus['parseLimit'])) {
         $parsingStatus['parseLimit'] = $parsingStatus['parseLimit'] - 1;
     }
     $careerPortalSettings = new CareerPortalSettings($this->_siteID);
     $careerPortalSettingsRS = $careerPortalSettings->getAll();
     $careerPortalEnabled = intval($careerPortalSettingsRS['enabled']) ? true : false;
     /* Get questionnaires to attach (if public) */
     $questionnaire = new Questionnaire($this->_siteID);
     $questionnaires = $questionnaire->getAll(false);
     $this->_template->assign('careerPortalEnabled', $careerPortalEnabled);
     $this->_template->assign('questionnaires', $questionnaires);
     $this->_template->assign('contents', $contents);
     $this->_template->assign('isParsingEnabled', $tmp = LicenseUtility::isParsingEnabled());
     $this->_template->assign('parsingStatus', $parsingStatus);
     $this->_template->assign('extraFieldRS', $extraFieldRS);
     $this->_template->assign('sourcesRS', $sourcesRS);
     $this->_template->assign('isModal', true);
     $this->_template->assign('jobOrderID', $jobOrderID);
     $this->_template->assign('sourcesString', $sourcesString);
     $this->_template->assign('preassignedFields', $fields);
     $this->_template->assign('associatedAttachment', $associatedAttachment);
     $this->_template->assign('associatedAttachmentRS', $associatedAttachmentRS);
     $this->_template->assign('associatedTextResume', false);
     $this->_template->assign('associatedFileResume', false);
     $this->_template->assign('EEOSettingsRS', $EEOSettingsRS);
     if (!eval(Hooks::get('JO_ADD_CANDIDATE_MODAL'))) {
         return;
     }
     /* REMEMBER TO ALSO UPDATE CandidatesUI::add() IF APPLICABLE. */
     $this->_template->display('./modules/candidates/Add.tpl');
 }
 *
 * The Original Code is "CATS Standard Edition".
 *
 * The Initial Developer of the Original Code is Cognizo Technologies, Inc.
 * Portions created by the Initial Developer are Copyright (C) 2005 - 2007
 * (or from the year in which this file was created to the year 2007) by
 * Cognizo Technologies, Inc. All Rights Reserved.
 *
 *
 * $Id: getCompanyLocationAndDepartments.php 2359 2007-04-21 22:49:17Z will $
 */
include_once './lib/Companies.php';
$interface = new SecureAJAXInterface();
if (!$interface->isRequiredIDValid('companyID', false)) {
    $interface->outputXMLErrorPage(-1, 'Invalid company ID.');
    die;
}
$siteID = $interface->getSiteID();
$companyID = $_REQUEST['companyID'];
/* Get an array of the company's location data. */
$companies = new Companies($siteID);
$locationArray = $companies->getLocationArray($companyID);
if (empty($locationArray)) {
    $interface->outputXMLErrorPage(-2, 'No location data.');
    die;
}
/* Get departments. */
$departmentsRS = $companies->getDepartments($companyID);
$departmentsString = htmlspecialchars(ListEditor::getStringFromList($departmentsRS, 'name'));
/* Send back the XML data. */
$interface->outputXMLPage("<data>\n" . "    <errorcode>0</errorcode>\n" . "    <errormessage></errormessage>\n" . "    <address>" . $locationArray['address'] . "</address>\n" . "    <city>" . $locationArray['city'] . "</city>\n" . "    <state>" . $locationArray['state'] . "</state>\n" . "    <zip>" . $locationArray['zip'] . "</zip>\n" . "    <departments>" . $departmentsString . "</departments>\n" . "</data>\n");
Example #5
0
 private function edit()
 {
     /* Bail out if we don't have a valid candidate ID. */
     if (!$this->isRequiredIDValid('candidateID', $_GET)) {
         CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
     }
     $candidateID = $_GET['candidateID'];
     $candidates = new Candidates($this->_siteID);
     $data = $candidates->getForEditing($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.');
     }
     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;
     }
     $users = new Users($this->_siteID);
     $usersRS = $users->getSelectList();
     /* Add an MRU entry. */
     $_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_CANDIDATE, $candidateID, $data['firstName'] . ' ' . $data['lastName']);
     /* Get extra fields. */
     $extraFieldRS = $candidates->extraFields->getValuesForEdit($candidateID);
     /* Get possible sources. */
     $sourcesRS = $candidates->getPossibleSources();
     $sourcesString = ListEditor::getStringFromList($sourcesRS, 'name');
     /* Is current source a possible source? */
     // FIXME: Use array search functions!
     $sourceInRS = false;
     foreach ($sourcesRS as $sourceData) {
         if ($sourceData['name'] == $data['source']) {
             $sourceInRS = true;
         }
     }
     if ($this->_accessLevel == ACCESS_LEVEL_DEMO) {
         $canEmail = false;
     } else {
         $canEmail = true;
     }
     $emailTemplates = new EmailTemplates($this->_siteID);
     $statusChangeTemplateRS = $emailTemplates->getByTag('EMAIL_TEMPLATE_OWNERSHIPASSIGNCANDIDATE');
     if ($statusChangeTemplateRS['disabled'] == 1) {
         $emailTemplateDisabled = true;
     } else {
         $emailTemplateDisabled = false;
     }
     /* Date format for DateInput()s. */
     if ($_SESSION['CATS']->isDateDMY()) {
         $data['dateAvailableMDY'] = DateUtility::convert('-', $data['dateAvailable'], DATE_FORMAT_DDMMYY, DATE_FORMAT_MMDDYY);
     } else {
         $data['dateAvailableMDY'] = $data['dateAvailable'];
     }
     if (!eval(Hooks::get('CANDIDATE_EDIT'))) {
         return;
     }
     $EEOSettings = new EEOSettings($this->_siteID);
     $EEOSettingsRS = $EEOSettings->getAll();
     $this->_template->assign('active', $this);
     $this->_template->assign('data', $data);
     $this->_template->assign('usersRS', $usersRS);
     $this->_template->assign('extraFieldRS', $extraFieldRS);
     $this->_template->assign('sourcesRS', $sourcesRS);
     $this->_template->assign('sourcesString', $sourcesString);
     $this->_template->assign('sourceInRS', $sourceInRS);
     $this->_template->assign('candidateID', $candidateID);
     $this->_template->assign('canEmail', $canEmail);
     $this->_template->assign('EEOSettingsRS', $EEOSettingsRS);
     $this->_template->assign('emailTemplateDisabled', $emailTemplateDisabled);
     $this->_template->display('./modules/candidates/Edit.tpl');
 }