diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 469a9bef5d..e825ba7d04 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -498,7 +498,7 @@ class gitlab if(!scm::checkRevision($version)) return array(); $api = "commits"; - $count = 500; + if(empty($count)) $count = 100; $params = array(); $params['ref_name'] = $branch; $params['per_page'] = $count; diff --git a/module/project/model.php b/module/project/model.php index 8c36a86886..bea9bd3cf2 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1476,6 +1476,29 @@ class projectModel extends model ->fetchAll('account'); } + /** + * Get team member pairs by projectID. + * + * @param int $projectID + * @access public + * @return array + */ + public function getTeamMemberPairs($projectID) + { + if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembers(); + + $project = $this->getByID($projectID); + $type = $this->config->systemMode == 'new' ? $project->type : 'project'; + if(empty($project)) return array(); + + return $this->dao->select("t1.account, if(t2.deleted='0', t2.realname, t1.account) as realname")->from(TABLE_TEAM)->alias('t1') + ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account') + ->where('t1.root')->eq((int)$projectID) + ->andWhere('t1.type')->eq($type) + ->andWhere('t2.deleted')->eq('0') + ->fetchPairs('account', 'realname'); + } + /** * Get project stats. *