diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-19 14:05:07 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-19 14:05:07 +0100 |
| commit | 5d3e672dd7f35c348a98fd149c02c5c9d79cb520 (patch) | |
| tree | aeb54fdb20f2e5c60cf2ee1f1952f6f604248909 /templates | |
| parent | 53bb19704b1e99245b755caf2d573a4406066902 (diff) | |
| download | contact-5d3e672dd7f35c348a98fd149c02c5c9d79cb520.tar.gz contact-5d3e672dd7f35c348a98fd149c02c5c9d79cb520.tar.bz2 contact-5d3e672dd7f35c348a98fd149c02c5c9d79cb520.zip | |
Map contact persons to registered users via contact.role_id
contact.role_id stores the user_id of the linked registered user (NULL = no
account). load() joins users_users on role_id to expose linked_user_login and
linked_user_name. verify() accepts user_id from the edit form and writes it to
contact_store['role_id']. getList() now filters by user_id key (was role_id).
Edit form shows the user_id field to admins with current login shown inline;
display template shows the linked user when set.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
| -rwxr-xr-x | templates/display_contact.tpl | 9 | ||||
| -rwxr-xr-x | templates/edit_contact.tpl | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/templates/display_contact.tpl b/templates/display_contact.tpl index 2a3ba39..aa4bf93 100755 --- a/templates/display_contact.tpl +++ b/templates/display_contact.tpl @@ -44,6 +44,15 @@ <div class="clear"></div> </div> {/if} + {if $gContent->mInfo.linked_user_login} + <div class="form-group"> + {formlabel label="Registered User"} + {forminput} + {$gContent->mInfo.linked_user_name|escape} ({$gContent->mInfo.linked_user_login|escape}) + {/forminput} + <div class="clear"></div> + </div> + {/if} {if $gContent->mInfo.data} <div class="form-group"> {formlabel label="Note"} diff --git a/templates/edit_contact.tpl b/templates/edit_contact.tpl index 80a468b..611a43e 100755 --- a/templates/edit_contact.tpl +++ b/templates/edit_contact.tpl @@ -80,6 +80,18 @@ <div class="clear"></div> </div> *} + {if $gBitUser->hasPermission('p_contact_admin')} + <div class="form-group"> + {formlabel label="Linked User ID" for="user_id"} + {forminput} + <input size="10" type="text" name="user_id" id="user_id" value="{$gContent->mInfo.role_id|escape}" /> + {if $gContent->mInfo.linked_user_login} + <span class="help-block">{$gContent->mInfo.linked_user_name|escape} ({$gContent->mInfo.linked_user_login|escape})</span> + {/if} + {/forminput} + <div class="clear"></div> + </div> + {/if} <div class="form-group"> {formlabel label="Note" for="description"} {forminput} |
