当前位置: 首页>>代码示例>>PHP>>正文


PHP Companies::getSelectList方法代码示例

本文整理汇总了PHP中Companies::getSelectList方法的典型用法代码示例。如果您正苦于以下问题:PHP Companies::getSelectList方法的具体用法?PHP Companies::getSelectList怎么用?PHP Companies::getSelectList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Companies的用法示例。


在下文中一共展示了Companies::getSelectList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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');
 }
开发者ID:rankinp,项目名称:OpenCATS,代码行数:63,代码来源:ContactsUI.php

示例2: 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');
 }
开发者ID:PublicityPort,项目名称:OpenCATS,代码行数:96,代码来源:JobOrdersUI.php


注:本文中的Companies::getSelectList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。