Details
-
Type: Sub-task
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Do
-
Affects Version/s: HR-1.0
-
Fix Version/s: HR-1.0
-
Component/s: None
-
Labels:None
Description
When displaying email addresses (directory listings, etc), include either (a) mailto: link or (b) a link into CiviCRM's email screen. The site-admin would choose the policy.
Proposed arrangement:
- In the core PHP controller for the profile-listing screen, the exported "columnHeaders" should include a "field_name" property. The value of the "field_name" should match the civicrm_uf_field.field_name. (Note: A couple columns like "action" may not have field_names.)
- In the core Smarty template for the profile-listing screen, each table cell should include a CSS class based on the field name – e.g. "crm-email", "crm-display_name", etc
- In the hrstaffdir module, use hook_civicrm_pageRun or hook_civirm_buildForm to inject some Javascript code. (Example: https://github.com/civicrm/civihr/blob/47f3263ad760570f22fa9eb27c2b1cadc511eeb9/hrui/hrui.php#L10 ) The Javascript should use jQuery to identify the "crm-email" tags and turn them into hyperlinks (eg <a href="mailto:$email">$email</a>)
Comments:
- Ideally, we'd only load the JS on the staff-directory profile, but (for now) it's OK if we load it on all profile listings. We can tighten this later with
CRM-12906. - One way to make emails clickable is with "mailto:" – another is to use CiviCRM's email screen. We only need "mailto:" for now.