$form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), ['create' => $profileLinks, 'api' => ['extra' => ['contact_type']]]);
// do we want to update employer for shared address
- $form->addElement('checkbox', "address[$blockId][add_relationship]", NULL, ts('Create a relationship with this contact'));
+ $employer_label = '<span class="addrel-employer">' . ts('Set this organization as current employer') . '</span>';
+ $household_label = '<span class="addrel-household">' . ts('Create a household member relationship with this contact') . '</span>';
+ $form->addElement('checkbox', "address[$blockId][add_relationship]", NULL, $employer_label . $household_label);
}
}
contactType = {/literal}{$contactType|@json_encode}{literal},
$addRelationshipSection = $('#shared-address-' + blockNo + ' .shared-address-add-relationship'),
$employerSection = $('#shared-address-' + blockNo + ' .shared-address-add-relationship .employer'),
+ $employerLabel = $('#shared-address-' + blockNo + ' .shared-address-add-relationship label .addrel-employer'),
+ $householdLabel = $('#shared-address-' + blockNo + ' .shared-address-add-relationship label .addrel-household'),
$contentArea = $('#shared-address-' + blockNo + ' .shared-address-list'),
$masterElement = $('input[name="address[' + blockNo + '][master_id]"]');
if (!sharedContactId || isNaN(sharedContactId)) {
$employerSection.hide();
$addRelationshipSection.hide();
+ $employerLabel.hide();
+ $householdLabel.hide();
return;
}
$addRelationshipSection.toggle(contactType === 'Individual' && (otherContactType === 'Organization' || otherContactType === 'Household'));
$employerSection.toggle(contactType === 'Individual' && otherContactType === 'Organization');
+ // use the appropriate label
+ $employerLabel.toggle(contactType === 'Individual' && otherContactType === 'Organization');
+ $householdLabel.toggle(contactType === 'Individual' && otherContactType === 'Household');
+
+
$.post(CRM.url('civicrm/ajax/inline'), {
'contact_id': sharedContactId,
'type': 'method',