mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #273 from creative-commoners/pulls/3.1/name-that-member
FIX show name of members in summary tables
This commit is contained in:
commit
20c6a50f12
@ -125,8 +125,8 @@ class Comment extends DataObject
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
private static $summary_fields = array(
|
||||
'Name' => 'Submitted By',
|
||||
'Email' => 'Email',
|
||||
'getAuthorName' => 'Submitted By',
|
||||
'getAuthorEmail' => 'Email',
|
||||
'Comment.LimitWordCount' => 'Comment',
|
||||
'Created' => 'Date Posted',
|
||||
'Parent.Title' => 'Post',
|
||||
@ -450,6 +450,20 @@ class Comment extends DataObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the comment authors email address
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthorEmail()
|
||||
{
|
||||
if ($this->Email) {
|
||||
return $this->Email;
|
||||
} elseif ($author = $this->Author()) {
|
||||
return $author->Email;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a secure admin-action link authorised for the specified member
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user