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


PHP CRM_Case_BAO_Case::getRelatedAndGlobalContacts方法代码示例

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


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

示例1: buildQuickForm

 public function buildQuickForm()
 {
     $this->_fields['source_contact_id']['label'] = ts('Reported By');
     unset($this->_fields['status_id']['attributes']['required']);
     if ($this->_caseType) {
         $xmlProcessor = new CRM_Case_XMLProcessor_Process();
         $aTypes = array();
         foreach ($this->_caseType as $key => $val) {
             $activityTypes = $xmlProcessor->get($val, 'ActivityTypes', TRUE);
             $aTypes = $aTypes + $activityTypes;
         }
         // remove Open Case activity type since we're inside an existing case
         $openCaseID = CRM_Core_OptionGroup::getValue('activity_type', 'Open Case', 'name');
         unset($aTypes[$openCaseID]);
         asort($aTypes);
         $this->_fields['followup_activity_type_id']['attributes'] = array('' => '- select activity type -') + $aTypes;
     }
     $result = parent::buildQuickForm();
     if ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::DETACH | CRM_Core_Action::RENEW)) {
         return;
     }
     $this->assign('urlPath', 'civicrm/case/activity');
     $encounterMediums = CRM_Case_PseudoConstant::encounterMedium();
     // Fixme: what's the justification for this? It seems like it is just re-adding an option in case it is the default and disabled.
     // Is that really a big problem?
     if ($this->_activityTypeFile == 'OpenCase') {
         $this->_encounterMedium = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_activityId, 'medium_id');
         if (!array_key_exists($this->_encounterMedium, $encounterMediums)) {
             $encounterMediums[$this->_encounterMedium] = CRM_Core_OptionGroup::getLabel('encounter_medium', $this->_encounterMedium, FALSE);
         }
     }
     $this->add('select', 'medium_id', ts('Medium'), $encounterMediums, TRUE);
     $i = 0;
     foreach ($this->_caseId as $key => $val) {
         $this->_relatedContacts[] = $rgc = CRM_Case_BAO_Case::getRelatedAndGlobalContacts($val);
         $contName = CRM_Case_BAO_Case::getContactNames($val);
         foreach ($contName as $nkey => $nval) {
             array_push($this->_relatedContacts[$i][0], $this->_relatedContacts[$i][0]['managerOf'] = $nval['display_name']);
         }
         $i++;
     }
     //add case client in send a copy selector.CRM-4438.
     foreach ($this->_caseId as $key => $val) {
         $relatedContacts[] = $relCon = CRM_Case_BAO_Case::getContactNames($val);
     }
     if (!empty($relatedContacts)) {
         foreach ($relatedContacts as $relatedContact) {
             $this->_relatedContacts[] = $relatedContact;
         }
     }
     if (!empty($this->_relatedContacts)) {
         $checkBoxes = array();
         foreach ($this->_relatedContacts as $id => $row) {
             $checkBoxes[$id] = $this->addElement('checkbox', $id, NULL, NULL, array('class' => 'select-row'));
         }
         $this->addGroup($checkBoxes, 'contact_check');
         $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows'));
         $this->assign('searchRows', $this->_relatedContacts);
     }
     $this->_relatedContacts = $rgc + $relCon;
     $this->addFormRule(array('CRM_Case_Form_Activity', 'formRule'), $this);
 }
开发者ID:rajeshrhino,项目名称:civicrm-core,代码行数:62,代码来源:Activity.php

示例2: buildQuickForm

 public function buildQuickForm()
 {
     // modify core Activity fields
     $this->add('text', 'target_contact_id', ts('target'));
     //FIXME : ideally hidden element should work.
     $this->addElement('advcheckbox', "hidden_target_contact");
     $this->_fields['source_contact_id']['label'] = ts('Reported By');
     $this->_fields['status_id']['attributes'] = array('' => ts('- select -')) + CRM_Core_PseudoConstant::activityStatus();
     if ($this->_caseType) {
         $xmlProcessor = new CRM_Case_XMLProcessor_Process();
         $aTypes = $xmlProcessor->get($this->_caseType, 'ActivityTypes', TRUE);
         // remove Open Case activity type since we're inside an existing case
         $openCaseID = CRM_Core_OptionGroup::getValue('activity_type', 'Open Case', 'name');
         unset($aTypes[$openCaseID]);
         asort($aTypes);
         $this->_fields['followup_activity_type_id']['attributes'] = array('' => '- select activity type -') + $aTypes;
     }
     $result = parent::buildQuickForm();
     if ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::DETACH | CRM_Core_Action::RENEW)) {
         return;
     }
     if ($this->_cdType || $this->_addAssigneeContact || $this->_addTargetContact) {
         return $result;
     }
     $this->assign('urlPath', 'civicrm/case/activity');
     $encounterMediums = CRM_Case_PseudoConstant::encounterMedium();
     if ($this->_activityTypeFile == 'OpenCase') {
         $this->_encounterMedium = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_activityId, 'medium_id');
         if (!array_key_exists($this->_encounterMedium, $encounterMediums)) {
             $encounterMediums[$this->_encounterMedium] = CRM_Core_OptionGroup::getLabel('encounter_medium', $this->_encounterMedium, FALSE);
         }
     }
     $this->add('select', 'medium_id', ts('Medium'), $encounterMediums, TRUE);
     $this->_relatedContacts = CRM_Case_BAO_Case::getRelatedAndGlobalContacts($this->_caseId);
     //add case client in send a copy selector.CRM-4438.
     $relatedContacts = CRM_Case_BAO_Case::getContactNames($this->_caseId);
     if (!empty($relatedContacts)) {
         foreach ($relatedContacts as $relatedContact) {
             $this->_relatedContacts[] = $relatedContact;
         }
     }
     if (!empty($this->_relatedContacts)) {
         $checkBoxes = array();
         foreach ($this->_relatedContacts as $id => $row) {
             $checkBoxes[$id] = $this->addElement('checkbox', $id, NULL, '');
         }
         $this->addGroup($checkBoxes, 'contact_check');
         $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "return toggleCheckboxVals('contact_check',this);"));
         $this->assign('searchRows', $this->_relatedContacts);
     }
     $this->addFormRule(array('CRM_Case_Form_Activity', 'formRule'), $this);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:52,代码来源:Activity.php


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