Skip to content

Commit

Permalink
minor(InternalNotification) Swapped field used for displaying Context
Browse files Browse the repository at this point in the history
  • Loading branch information
nyeholt committed Apr 9, 2019
1 parent 035a101 commit be0b2f9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Model/InternalNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
use Symbiote\MultiValueField\ORM\FieldType\MultiValueField;

use Symbiote\MultiValueField\Fields\KeyValueField;

class InternalNotification extends DataObject {
private static $table_name = 'InternalNotification';
Expand All @@ -31,6 +31,14 @@ class InternalNotification extends DataObject {

private static $default_sort = 'ID DESC';

public function getCMSFields()
{
$fields = parent::getCMSFields();

$fields->replaceField('Context', KeyValueField::create('Context'));
return $fields;
}

public function canView($member = null) {
$member = $member ?: Security::getCurrentUser();
if (!$member) {
Expand Down

0 comments on commit be0b2f9

Please sign in to comment.