addColumn('no', 'no'); $this->addColumn('date', 'added', ['title' => 'Date Added', 'orderBy' => 'User.added']); $this->addColumn('name', 'fullName', ['title' => 'Name', 'orderBy' => 'lastName']); $this->addColumn('email', 'email', ['orderBy' => 'email']); $this->addColumn('text', 'phone', ['orderBy' => 'directPhone']); $this->addColumn('status', 'status', ['orderBy' => 'status', 'values' => $this->_getStatuses()]); $this->_addOptionsColumn(); return $this; } protected function _addOptionsColumn() { $options = []; $itemName = $this->getConfig('itemName'); $options['actions'] = [ 'edit' => [], 'delete' => [], ]; if (Qs_Config::getByClass('Qs_ViewController_Log')->enabled && ($logBaseUrl = Qs_SiteMap::findFirst(null, ['type' => 'ViewControllerLog_Admin_'], null, 'url')) ) { $options['actions']['viewLog'] = [ 'formattedLink' => $logBaseUrl . '/user?roleId=%d', 'linkTitle' => "View Log of this " . $itemName, ]; } $this->addColumn('options', 'options', $options); return $this; } protected function _getStatuses() { return (new Qs_Db_Table('UserStatus'))->get4Select(); } }