CRM-21008 - Checkbox to explicitly change employer when sharing address
[civicrm-core.git] / CRM / Contact / Form / Edit / Address.php
index 9dad5533f51bed7e78718929920f22141cb91982..2e91480071694539a1d8adc6e6fa5c68a6a3fabe 100644 (file)
@@ -166,7 +166,10 @@ class CRM_Contact_Form_Edit_Address {
 
       // Override the default profile links to add address form
       $profileLinks = CRM_Contact_BAO_Contact::getEntityRefCreateLinks('shared_address');
-      $form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks));
+      $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][update_current_employer]", NULL, ts('Set this organization as current employer'));
     }
   }