_hasRoleId = $hasRole; return $this; } public function setRole($role) { $this->_role = $role; return $this; } protected function _initColumns() { $this->addColumn('no', 'no'); if (!$this->_hasRoleId) { $this->addColumn( 'link_advanced', 'roleName', [ 'title' => Qs_Array::get(Entity::$roleTitles, $this->_role) . ' Name', 'url' => Qs_Request::getBaseUrl() . '?roleId=%d', 'urlParams' => ['roleId'], 'text' => '%s', 'orderBy' => 'roleName', ] ); } $this->addColumn( 'date', 'added', [ 'title' => 'Started', 'orderBy' => 'id', 'format' => constant('DATE_TIME_FORMAT') ] ); $this->addColumn( 'date', 'lastActivity', [ 'title' => 'Last Activity', 'orderBy' => 'lastActivity', 'format' => constant('DATE_TIME_FORMAT'), 'emptyText' => '-' ] ); $this->addColumn('ipAddress', 'lastActivityIp', ['title' => 'IP Addresses', 'emptyText' => '-']); $this->addColumn('text', 'durationString', ['title' => 'Session Duration', 'orderBy' => 'duration']); $this->addColumn( 'enum', 'closed', [ 'title' => 'status', 'values' => [ 'y' => 'Closed', 'n' => 'Opened', ] ] ); $this->addColumn( 'viewLink', 'options', [ 'title' => 'Options', 'defaultText' => 'View', 'defaultTitle' => 'View this Session', 'urlPattern' => Qs_Request::getFinalBaseUrl() . '/activity/%s', 'params' => ['id'] ] ); return $this; } }