expose User Contact in standaloneusers UI
authorbenjamin <benjamin>
Tue, 5 Dec 2023 12:09:26 +0000 (12:09 +0000)
committerbenjamin <benjamin>
Tue, 12 Dec 2023 19:09:11 +0000 (19:09 +0000)
ext/standaloneusers/CRM/Standaloneusers/DAO/User.php
ext/standaloneusers/ang/afformEditUserAccount.aff.html
ext/standaloneusers/managed/SavedSearch_Administer_UserAccounts.mgd.php
ext/standaloneusers/xml/schema/CRM/Standaloneusers/User.xml

index 67331d4a2ec52bc3099c1b37b5833c218a5d634e..f86de447751fcbcf977a5204a7caf6f2acef5a7b 100644 (file)
@@ -318,6 +318,7 @@ class CRM_Standaloneusers_DAO_User extends CRM_Core_DAO {
           'localizable' => 0,
           'FKClassName' => 'CRM_Contact_DAO_Contact',
           'html' => [
+            'type' => 'EntityRef',
             'label' => E::ts("Contact"),
           ],
           'add' => '1.1',
index ef1eb4be1935fffb7a4d26dbb9027e4231214610..ebac52c497ba20c68110552e15a5b89d6244f91b 100644 (file)
@@ -3,6 +3,7 @@
   <fieldset af-fieldset="User1" class="af-container" af-title="User">
     <af-field name="roles" />
     <af-field name="username" />
+    <af-field name="contact_id" />
     <af-field name="uf_name" />
     <af-field name="is_active" />
     <af-field name="timezone" defn="{help_pre: ts('Set the timezone of the user. Date and times will be shown in this timezone. You can also leave it empty to use the default system timezone (which is a server setting).'), input_attrs: {placeholder: ts('Server default timezone')}}" />
index 4d88d453c1879b6797dc7710811d98e79886d586..db05087cf7d0aea0985d5fae984bef99be3faf77 100644 (file)
@@ -19,6 +19,8 @@ return [
             'id',
             'username',
             'uf_name',
+            'contact_id',
+            'contact_id.display_name',
             'is_active',
             'when_created',
             'when_last_accessed',
@@ -87,6 +89,19 @@ return [
               'label' => E::ts('Roles'),
               'sortable' => TRUE,
             ],
+            [
+              'type' => 'field',
+              'key' => 'contact_id.display_name',
+              'dataType' => 'String',
+              'label' => E::ts('Linked Contact'),
+              'sortable' => TRUE,
+              'link' => [
+                'entity' => 'Contact',
+                'action' => 'view',
+                'join' => 'contact_id',
+                'target' => '_blank',
+              ],
+            ],
             [
               'type' => 'field',
               'key' => 'is_active',
index 9e704f89ee2cc5437ee2f15fee14f2580a257d52..df41fc03e9f1a187dadd11d85940f79c06e18a10 100644 (file)
@@ -82,6 +82,7 @@
     <comment>FK to Contact ID</comment>
     <html>
       <label>Contact</label>
+      <type>EntityRef</type>
     </html>
     <add>1.1</add>
   </field>