From deddf759dc76990e2a6dab4932de0f5983b30db5 Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Fri, 31 Jan 2020 11:33:29 -0500 Subject: [PATCH] dev/core#1319 UI - different label for household and employer --- CRM/Contact/Form/Edit/Address.php | 4 +++- templates/CRM/Contact/Form/ShareAddress.tpl | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index 8d83f06a87..a1075f973f 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -170,7 +170,9 @@ class CRM_Contact_Form_Edit_Address { $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 = '' . ts('Set this organization as current employer') . ''; + $household_label = '' . ts('Create a household member relationship with this contact') . ''; + $form->addElement('checkbox', "address[$blockId][add_relationship]", NULL, $employer_label . $household_label); } } diff --git a/templates/CRM/Contact/Form/ShareAddress.tpl b/templates/CRM/Contact/Form/ShareAddress.tpl index c94e97353b..988923fd1a 100644 --- a/templates/CRM/Contact/Form/ShareAddress.tpl +++ b/templates/CRM/Contact/Form/ShareAddress.tpl @@ -57,6 +57,8 @@ 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]"]'); @@ -86,6 +88,8 @@ if (!sharedContactId || isNaN(sharedContactId)) { $employerSection.hide(); $addRelationshipSection.hide(); + $employerLabel.hide(); + $householdLabel.hide(); return; } @@ -93,6 +97,11 @@ $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', -- 2.25.1