addColumn('no', 'no'); $this->addColumn('text', 'accountTitle', ['title' => 'Title', 'orderBy' => 'accountTitle', 'defaultText' => '-']); $this->addColumn('text', 'firstName', ['orderBy' => 'firstName']); $this->addColumn('text', 'lastName', ['orderBy' => 'lastName']); $this->addColumn('text', 'login', ['orderBy' => 'login']); $this->addColumn('email', 'email', ['orderBy' => 'email', 'defaultText' => '-']); $this->addColumn('text', 'phone', ['title' => 'Phone', 'orderBy' => 'phone']); $this->addColumn('text', 'tribeTitle', ['title' => 'Tribe', 'orderBy' => 'tribeTitle']); $this->addColumn('permissions', 'permissions'); $this->_addStatusColumn(); $this->addOptionsColumn(); return $this; } public function addOptionsColumn() { $options = []; if (AclPermission::hasPermission( TribalAccountAcl::ACL_TRIBAL_ACCOUNTS_ID, App_Admin_Acl::ACL_TRIBAL_ACCOUNTS_ID) ) { $options = [ 'actions' => [ 'edit' => [], 'delete' => [], ], ]; } if (AclPermission::hasPermission( TribalAccountAcl::ACL_TRIBAL_ACCOUNTS_ACTIVITY_ID, [App_Admin_Acl::ACL_TRIBAL_ACCOUNTS_ID, App_Admin_Acl::ACL_TRIBAL_ACCOUNTS_READ_ID] ) && ($logBaseUrl = Qs_SiteMap::findFirst(null, ['type' => 'ActivityLog\\Admin\\', 'role' => 'admin'], null, 'url')) ) { $options['actions']['viewLog'] = [ 'formattedLink' => $logBaseUrl . '/admin?roleId=%d', 'linkTitle' => "View this Administrator's Log", ]; } if (!empty($options)) { $this->addColumn('options', 'options', $options); } return $this; } protected function _addStatusColumn() { $this->addColumn('status', 'status', ['orderBy' => 'status', 'values' => $this->_getStatuses()]); } protected function _getStatuses() { return (new Qs_Db_Table('AdminStatus'))->get4Select(); } }