_role = $role; return $this; } protected function _initColumns() { $this->addColumn('date', 'logAdded', [ 'title' => 'Login date and time', 'orderBy' => 'logAdded', 'format' => '%m/%d/%Y %I:%M %p' ]); $this->addColumn('date', 'sessionClosedDate', [ 'title' => 'Logout date and time', 'orderBy' => 'sessionClosedDate', 'format' => '%m/%d/%Y %I:%M %p', 'emptyText' => '-' ]); if ($this->_role == App_ViewControllerLog_Admin_Obj::ROLE_USER) { $this->addColumn('text', 'ipTitle', [ 'title' => 'Login IP', 'orderBy' => 'ipTitle' ]); $url = UserView::getPage('url'); } else { $this->addColumn('text', 'phone', ['title' => 'Phone Number', 'defaultText' => '-']); $this->addColumn('email', 'email', ['title' => 'Email', 'defaultText' => '-']); $url = App_Admin_View::getPage('url'); } $this->addColumn( 'link_advanced', 'roleName', [ 'title' => 'Name', 'url' => $url . '?action=edit&id=%d', 'tribalUrl' => \App\TribalAccount\Admin\View::getPage('url') . '?action=edit&id=%d', 'urlParams' => ['roleId'], 'text' => '%s', 'orderBy' => 'roleName' ] ); return $this; } }