本文整理汇总了PHP中Companies::getDefaultCompany方法的典型用法代码示例。如果您正苦于以下问题:PHP Companies::getDefaultCompany方法的具体用法?PHP Companies::getDefaultCompany怎么用?PHP Companies::getDefaultCompany使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Companies
的用法示例。
在下文中一共展示了Companies::getDefaultCompany方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: internalPostings
private function internalPostings()
{
$companies = new Companies($this->_siteID);
$companyID = $companies->getDefaultCompany();
CATSUtility::transferRelativeURI('m=companies&a=show&companyID=' . $companyID);
}
示例2: printTabs
//.........这里部分代码省略.........
$className = 'inactive';
}
$alPosition = strpos($tabText, "*al=");
if ($alPosition === false) {
echo '<li><a class="', $className, '" href="', $indexName, '?m=', $moduleName, '">', $tabText, '</a></li>', "\n";
} else {
$al = substr($tabText, $alPosition + 4);
if ($_SESSION['CATS']->getAccessLevel() >= $al || $_SESSION['CATS']->isDemo()) {
echo '<li><a class="', $className, '" href="', $indexName, '?m=', $moduleName, '">', substr($tabText, 0, $alPosition), '</a></li>', "\n";
}
}
continue;
}
$alPosition = strpos($tabText, "*al=");
if ($alPosition !== false) {
$tabText = substr($tabText, 0, $alPosition);
}
/* Start the <li> block for the active tab. The secondary <ul>
* for subtabs MUST be contained within this block. It is
* closed after subtabs are printed. */
echo '<li>';
echo '<a class="active" href="', $indexName, '?m=', $moduleName, '">', $tabText, '</a>', "\n";
$subTabs = $active->getSubTabs($modules);
if ($subTabs) {
echo '<ul id="secondary">';
foreach ($subTabs as $subTabText => $link) {
if ($subTabText == $subActive) {
$style = "color:#cccccc;";
} else {
$style = "";
}
/* Check HR mode for displaying tab. */
$hrmodePosition = strpos($link, "*hrmode=");
if ($hrmodePosition !== false) {
/* Access level restricted subtab. */
$hrmode = substr($link, $hrmodePosition + 8);
if (!$_SESSION['CATS']->isHrMode() && $hrmode == 0 || $_SESSION['CATS']->isHrMode() && $hrmode == 1) {
$link = substr($link, 0, $hrmodePosition);
} else {
$link = '';
}
}
/* Check access level for displaying tab. */
$alPosition = strpos($link, "*al=");
if ($alPosition !== false) {
/* Access level restricted subtab. */
$al = substr($link, $alPosition + 4);
if ($_SESSION['CATS']->getAccessLevel() >= $al || $_SESSION['CATS']->isDemo()) {
$link = substr($link, 0, $alPosition);
} else {
$link = '';
}
}
$jsPosition = strpos($link, "*js=");
if ($jsPosition !== false) {
/* Javascript subtab. */
echo '<li><a href="', substr($link, 0, $jsPosition), '" onclick="', substr($link, $jsPosition + 4), '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
} else {
if (strpos($link, 'a=internalPostings') !== false) {
/* Default company subtab. */
include_once './lib/Companies.php';
$companies = new Companies($_SESSION['CATS']->getSiteID());
$defaultCompanyID = $companies->getDefaultCompany();
if ($defaultCompanyID !== false) {
echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
}
} else {
if (strpos($link, 'a=administration') !== false) {
/* Administration subtab. */
if ($_SESSION['CATS']->getRealAccessLevel() >= ACCESS_LEVEL_DEMO) {
echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
}
} else {
if (strpos($link, 'a=customizeEEOReport') !== false) {
/* EEO Report subtab. Shouldn't be visible if EEO tracking is disabled. */
$EEOSettings = new EEOSettings($_SESSION['CATS']->getSiteID());
$EEOSettingsRS = $EEOSettings->getAll();
if ($EEOSettingsRS['enabled'] == 1) {
echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
}
} else {
if ($link != '') {
/* Normal subtab. */
echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
}
}
}
}
}
}
if (!eval(Hooks::get('TEMPLATE_UTILITY_DRAW_SUBTABS'))) {
return;
}
echo '</ul>';
}
echo '</li>';
}
echo '</ul>', "\n";
echo '</div>', "\n";
}
示例3: edit
private function edit()
{
/* Bail out if we don't have a valid candidate ID. */
if (!$this->isRequiredIDValid('jobOrderID', $_GET)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.');
}
$jobOrderID = $_GET['jobOrderID'];
$jobOrders = new JobOrders($this->_siteID);
$data = $jobOrders->getForEditing($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.');
}
$users = new Users($this->_siteID);
$usersRS = $users->getSelectList();
$companies = new Companies($this->_siteID);
$companiesRS = $companies->getSelectList();
$contactsRS = $companies->getContactsArray($data['companyID']);
/* Add an MRU entry. */
$_SESSION['CATS']->getMRU()->addEntry(DATA_ITEM_JOBORDER, $jobOrderID, $data['title']);
$emailTemplates = new EmailTemplates($this->_siteID);
$statusChangeTemplateRS = $emailTemplates->getByTag('EMAIL_TEMPLATE_OWNERSHIPASSIGNJOBORDER');
if ($statusChangeTemplateRS['disabled'] == 1) {
$emailTemplateDisabled = true;
} else {
$emailTemplateDisabled = false;
}
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();
}
/* Get departments. */
$departmentsRS = $companies->getDepartments($data['companyID']);
$departmentsString = ListEditor::getStringFromList($departmentsRS, 'name');
/* Date format for DateInput()s. */
if ($_SESSION['CATS']->isDateDMY()) {
$data['startDateMDY'] = DateUtility::convert('-', $data['startDate'], DATE_FORMAT_DDMMYY, DATE_FORMAT_MMDDYY);
} else {
$data['startDateMDY'] = $data['startDate'];
}
/* Get extra fields. */
$extraFieldRS = $jobOrders->extraFields->getValuesForEdit($jobOrderID);
/* Check if career portal is enabled */
$careerPortalSettings = new CareerPortalSettings($this->_siteID);
$careerPortalSettingsRS = $careerPortalSettings->getAll();
$careerPortalEnabled = intval($careerPortalSettingsRS['enabled']) ? true : false;
/* Get questionnaire information (if exists) */
$questionnaireID = false;
$questionnaireData = false;
$isPublic = false;
$questionnaire = new Questionnaire($this->_siteID);
$questionnaires = $questionnaire->getAll(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;
}
}
}
$this->_template->assign('extraFieldRS', $extraFieldRS);
$this->_template->assign('careerPortalEnabled', $careerPortalEnabled);
$this->_template->assign('questionnaireID', $questionnaireID);
$this->_template->assign('questionnaireData', $questionnaireData);
$this->_template->assign('questionnaires', $questionnaires);
$this->_template->assign('isPublic', $isPublic);
$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('usersRS', $usersRS);
$this->_template->assign('companiesRS', $companiesRS);
$this->_template->assign('departmentsRS', $departmentsRS);
$this->_template->assign('departmentsString', $departmentsString);
$this->_template->assign('contactsRS', $contactsRS);
$this->_template->assign('jobOrderID', $jobOrderID);
$this->_template->assign('isHrMode', $_SESSION['CATS']->isHrMode());
$this->_template->assign('sessionCookie', $_SESSION['CATS']->getCookie());
if (!eval(Hooks::get('JO_EDIT'))) {
return;
}
$this->_template->display('./modules/joborders/Edit.tpl');
}
示例4: edit
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');
}
示例5: loadTheme
//.........这里部分代码省略.........
if ($alPosition !== false)
{
/* Access level restricted subtab. */
$al = substr($link, $alPosition + 4);
if ($_SESSION['CATS']->getAccessLevel() >= $al ||
$_SESSION['CATS']->isDemo())
{
$link = substr($link, 0, $alPosition);
}
else
{
$link = '';
}
}
$jsPosition = strpos($link, "*js=");
if ($jsPosition !== false)
{
/* Javascript subtab. */
echo '<li><a href="', substr($link, 0, $jsPosition), '" onclick="',
substr($link, $jsPosition + 4), '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
}
/* A few subtabs have special logic to decide if they display or not. */
/* FIXME: Put the logic for these somewhere else. Perhaps the definitions of the subtabs
themselves should have an eval()uatable rule?
Brian 6-14-07: Second. */
else if (strpos($link, 'a=internalPostings') !== false)
{
/* Default company subtab. */
include_once('./lib/Companies.php');
$companies = new Companies($_SESSION['CATS']->getSiteID());
$defaultCompanyID = $companies->getDefaultCompany();
if ($defaultCompanyID !== false)
{
echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
}
}
else if (strpos($link, 'a=administration') !== false)
{
/* Administration subtab. */
if ($_SESSION['CATS']->getRealAccessLevel() >= ACCESS_LEVEL_DEMO)
{
echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
}
}
else if (strpos($link, 'a=customizeEEOReport') !== false)
{
/* EEO Report subtab. Shouldn't be visible if EEO tracking is disabled. */
$EEOSettings = new EEOSettings($_SESSION['CATS']->getSiteID());
$EEOSettingsRS = $EEOSettings->getAll();
if ($EEOSettingsRS['enabled'] == 1)
{
echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
}
}
/* Tab is ok to draw. */
else if ($link != '')
{
/* Normal subtab. */
echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
}