本文整理汇总了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);
}
示例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);
}