private function home() { if (!eval(Hooks::get('HOME'))) { return; } NewVersionCheck::getNews(); $dashboard = new Dashboard($this->_siteID); $placedRS = $dashboard->getPlacements(); $calendar = new Calendar($this->_siteID); $upcomingEventsHTML = $calendar->getUpcomingEventsHTML(7, UPCOMING_FOR_DASHBOARD); $calendar = new Calendar($this->_siteID); $upcomingEventsFupHTML = $calendar->getUpcomingEventsHTML(7, UPCOMING_FOR_DASHBOARD_FUP); /* Important cand datagrid */ $dataGridProperties = array('rangeStart' => 0, 'maxResults' => 15, 'filterVisible' => false); $dataGrid = DataGrid::get("home:ImportantPipelineDashboard", $dataGridProperties); $this->_template->assign('dataGrid', $dataGrid); $dataGridProperties = array('rangeStart' => 0, 'maxResults' => 15, 'filterVisible' => false); /* Only show a month of activities. */ $dataGridProperties['startDate'] = ''; $dataGridProperties['endDate'] = ''; $dataGridProperties['period'] = 'DATE_SUB(CURDATE(), INTERVAL 1 MONTH)'; $dataGrid2 = DataGrid::get("home:CallsDataGrid", $dataGridProperties); $this->_template->assign('dataGrid2', $dataGrid2); $this->_template->assign('active', $this); $this->_template->assign('placedRS', $placedRS); $this->_template->assign('upcomingEventsHTML', $upcomingEventsHTML); $this->_template->assign('upcomingEventsFupHTML', $upcomingEventsFupHTML); $this->_template->assign('wildCardQuickSearch', ''); $this->_template->display('./modules/home/Home.tpl'); }
private function administration() { /* Bail out if the user doesn't have SA permissions. */ if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO && !$_SESSION['CATS']->hasUserCategory('careerportal')) { CommonErrors::fatal(COMMONERROR_PERMISSION, $this); } $systemInfo = new SystemInfo(); $systemInfoData = $systemInfo->getSystemInfo(); if (isset($systemInfoData['available_version']) && $systemInfoData['available_version'] > CATSUtility::getVersionAsInteger()) { $newVersion = true; } else { $newVersion = false; } if (isset($systemInfoData['disable_version_check']) && $systemInfoData['disable_version_check']) { $versionCheckPref = false; } else { $versionCheckPref = true; } if ($this->_realAccessLevel >= ACCESS_LEVEL_ROOT || $this->_realAccessLevel == ACCESS_LEVEL_DEMO) { $systemAdministration = true; } else { $systemAdministration = false; } // FIXME: 's' isn't a good variable name. if (isset($_GET['s'])) { switch ($_GET['s']) { case 'siteName': $templateFile = './modules/settings/SiteName.tpl'; break; case 'newVersionCheck': if (!$systemAdministration) { CommonErrors::fatal(COMMONERROR_PERMISSION, $this); return; //$this->fatal(ERROR_NO_PERMISSION); } $this->_template->assign('versionCheckPref', $versionCheckPref); $this->_template->assign('availableVersion', $systemInfoData['available_version']); $this->_template->assign('newVersion', $newVersion); $this->_template->assign('newVersionNews', NewVersionCheck::getNews()); $templateFile = './modules/settings/NewVersionCheck.tpl'; break; case 'passwords': if (!$systemAdministration) { CommonErrors::fatal(COMMONERROR_PERMISSION, $this); return; //$this->fatal(ERROR_NO_PERMISSION); } $templateFile = './modules/settings/Passwords.tpl'; break; case 'localization': if ($this->_realAccessLevel < ACCESS_LEVEL_SA) { CommonErrors::fatal(COMMONERROR_PERMISSION, $this); return; //$this->fatal(ERROR_NO_PERMISSION); } $this->_template->assign('timeZone', $_SESSION['CATS']->getTimeZone()); $this->_template->assign('isDateDMY', $_SESSION['CATS']->isDateDMY()); $templateFile = './modules/settings/Localization.tpl'; break; case 'systemInformation': if ($this->_realAccessLevel < ACCESS_LEVEL_SA) { CommonErrors::fatal(COMMONERROR_PERMISSION, $this); return; //$this->fatal(ERROR_NO_PERMISSION); } $db = DatabaseConnection::getInstance(); $databaseVersion = $db->getRDBMSVersion(); $installationDirectory = realpath('./'); if (SystemUtility::isWindows()) { $OSType = 'Windows'; } else { if (SystemUtility::isMacOSX()) { $OSType = 'Mac OS X'; } else { $OSType = 'UNIX'; } } $schemaVersions = ModuleUtility::getModuleSchemaVersions(); $this->_template->assign('databaseVersion', $databaseVersion); $this->_template->assign('installationDirectory', $installationDirectory); $this->_template->assign('OSType', $OSType); $this->_template->assign('schemaVersions', $schemaVersions); $templateFile = './modules/settings/SystemInformation.tpl'; break; default: $templateFile = './modules/settings/Administration.tpl'; break; } } else { $templateFile = './modules/settings/Administration.tpl'; /* Load extra settings. */ $extraSettings = array(); $modules = ModuleUtility::getModules(); foreach ($modules as $moduleName => $parameters) { $extraSettingsModule = $parameters[MODULE_SETTINGS_ENTRIES]; if ($extraSettingsModule != false) { foreach ($extraSettingsModule as $extraSettingsModuleData) { if ($extraSettingsModuleData[2] <= $this->_realAccessLevel) { $extraSettings[] = $extraSettingsModuleData; } } } } $this->_template->assign('extraSettings', $extraSettings); } if (!strcmp($templateFile, './modules/settings/Administration.tpl')) { // Highlight certain rows of importance based on criteria $candidates = new Candidates($this->_siteID); $this->_template->assign('totalCandidates', $candidates->getCount()); } if (!eval(Hooks::get('SETTINGS_DISPLAY_ADMINISTRATION'))) { return; } /* Check if careers website is enabled or can be enabled */ $careerPortalUnlock = false; $careerPortalSettings = new CareerPortalSettings($this->_siteID); $cpData = $careerPortalSettings->getAll(); if (intval($cpData['enabled']) || file_exists('modules/asp') && !$_SESSION['CATS']->isFree() || LicenseUtility::isProfessional()) { $careerPortalUnlock = true; } $this->_template->assign('careerPortalUnlock', $careerPortalUnlock); $this->_template->assign('subActive', 'Administration'); $this->_template->assign('systemAdministration', $systemAdministration); $this->_template->assign('active', $this); $this->_template->display($templateFile); }