addColumn('no', 'no');
$this->addColumn('date', 'startDate', ['title' => 'Date', 'orderBy' => 'startDate']);
$this->addColumn('image', 'image');
$this->addColumn('name', 'title', ['title' => 'Event Name', 'orderBy' => 'title']);
$this->addColumn('link_enum', 'enabled', ['title' => 'Show', 'orderBy' => 'enabled']);
$this->addColumn('options', 'options', [
'initCallback' => function (&$params, &$column, &$row) {
if (EventEntity::TYPE_COMMITTEE == $row['type']) {
unset($column['actions']['attendee'], $column['actions']['addAttendee']);
}
},
'actions' => [
'edit' => [],
'copy' => ['formattedLink' => View::getPage('url'). '?action=new&sourceId=%d',],
'delete' => ['confirmMessage' => $this->getConfigArray('messages')['deleteConfirmation'],
'separator' => '
'],
'addAttendee' => ['formattedLink' => $this->getAttendeeBaseUrl(). '/%d?action=new',
'separator' => '
',
'linkTitle' => 'Add New Event Attendee'],
'attendee' => ['formattedLink' => $this->getAttendeeBaseUrl() . '/%d',
'title' => 'Attendees & Reports',
'linkTitle' => 'Show Event Attendees & Reports'],
]
]);
return $this;
}
protected function getAttendeeBaseUrl()
{
static $url;
if (null === $url) {
$url = AttendeeAdminView::getPage('url');
}
return $url;
}
public function toArray()
{
$item = parent::toArray();
$item['attendeeBaseUrl'] = $this->getAttendeeBaseUrl();
return $item;
}
}