Output email if no fname lname is found.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 11 Jan 2017 20:48:41 +0000 (15:48 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 11 Jan 2017 20:49:48 +0000 (15:49 -0500)
If there's no name for contact need to output the email.

classes/data/dataLeadEntry.php
views/admin/leads/index.html

index 560685b..ec363d1 100644 (file)
@@ -139,6 +139,16 @@ class GlmDataLeadEntry extends GlmDataAbstract
                 'use'        => 'a'
             ),
 
+            'email' => array(
+                'field'      => 'lead_id',
+                'as'         => 'email',
+                'type'       => 'pointer',
+                'p_table'    => GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'leads',
+                'p_field'    => 'email',
+                'p_orderby'  => 'email',
+                'use'        => 'l'
+            ),
+
             'fname' => array(
                 'field'     => 'fname',
                 'type'      => 'text',
@@ -297,6 +307,7 @@ class GlmDataLeadEntry extends GlmDataAbstract
         // Remove what we don't want from the copy and get the list
         $this->fields = array(
             'id'             => $fSave['id'],
+            'email'          => $fSave['email'],
             'fname'          => $fSave['fname'],
             'lname'          => $fSave['lname'],
             'org'            => $fSave['org'],
index 2f505b2..5901c53 100644 (file)
                         {if $user_can_edit_leads}
                         <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&entry={$lead.id}&prevStart={$prev}&nextStart={$next}&pageSelect={$page}">
                         {/if}
+                        {if $lead.fname}
                             {$lead.fname} {$lead.lname}
+                        {else}
+                            {$lead.email}
+                        {/if}
                         {if $user_can_edit_leads}</a>{/if}
                     </td>
                 {if $user_can_edit_leads}