Skip to content

Commit

Permalink
Merge pull request #284 from nishant-bhorodia/autofill-related-contac…
Browse files Browse the repository at this point in the history
…ts-on-same-page

Autofill related contacts on same page
  • Loading branch information
colemanw authored Jan 10, 2020
2 parents 81943ac + a63d3c7 commit 8a4216d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions includes/contact_component.inc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function _webform_edit_civicrm_contact($component) {
'#parents' => array('extra', 'default_custom_ref'),
);
}

$case_count = isset($data['case']['number_of_case']) ? $data['case']['number_of_case'] : 0;
if ($case_count > 0) {
$form['defaults']['default']['#options']['case_roles'] = t('Case roles');
Expand Down Expand Up @@ -918,8 +918,8 @@ function wf_crm_find_relations($cid, $types = array(), $current = TRUE) {
}
$params = [
'return' => ['contact_id_a', 'contact_id_b', 'relationship_type_id', 'end_date'],
'contact_id_a' => 'user_contact_id',
'contact_id_b' => 'user_contact_id',
'contact_id_a' => $cid,
'contact_id_b' => $cid,
'options' => ['or' => [['contact_id_a', 'contact_id_b']]],
];
if ($type_ids) {
Expand Down
2 changes: 1 addition & 1 deletion includes/wf_crm_webform_ajax.inc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class wf_crm_webform_ajax extends wf_crm_webform_base {
}
}
// Populate related contacts
elseif ($c == 1 && $i > $c && $field == 'existing') {
elseif ($i > $c && $field == 'existing') {
$related_component = $this->getComponent($fid);
if (wf_crm_aval($related_component['extra'], 'default') == 'relationship') {
$old_related_cid = wf_crm_aval($this->ent, "contact:$i:id");
Expand Down

0 comments on commit 8a4216d

Please sign in to comment.