diff --git a/Makefile b/Makefile index 6add55dc17..1305157607 100644 --- a/Makefile +++ b/Makefile @@ -143,6 +143,7 @@ zentaoxx: sed -i "s#\$this->app->getModuleRoot() . 'im/apischeme.json'#\$this->app->getExtensionRoot() . 'xuan/im/apischeme.json'#g" zentaoxx/extension/xuan/im/model.php sed -i "s/'..\/..\/common\/view\/header.html.php'/\$$app->getModuleRoot() . 'common\/view\/header.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php sed -i "s/'..\/..\/common\/view\/footer.html.php'/\$$app->getModuleRoot() . 'common\/view\/footer.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php + sed -i "s/\$$this->im->userGetChangedPassword()/array()/" zentaoxx/extension/xuan/im/control.php echo "ALTER TABLE \`zt_user\` ADD \`pinyin\` varchar(255) NOT NULL DEFAULT '' AFTER \`realname\`;" >> zentaoxx/db/xuanxuan.sql mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php cp tools/en2other.php zentaoxx/tools; cd zentaoxx/tools; php en2other.php ../ diff --git a/lib/scm/gitea.class.php b/lib/scm/gitea.class.php index d64adf54d9..3e8709bd70 100644 --- a/lib/scm/gitea.class.php +++ b/lib/scm/gitea.class.php @@ -12,15 +12,26 @@ class Gitea * @param string $username * @param string $password * @param string $encoding + * @param object $repo * @access public * @return void */ - public function __construct($client, $root, $username, $password, $encoding = 'UTF-8') + public function __construct($client, $root, $username, $password, $encoding = 'UTF-8', $repo = null) { putenv('LC_CTYPE=en_US.UTF-8'); $this->client = $client; $this->root = rtrim($root, DIRECTORY_SEPARATOR); + if(!realpath($this->root) and !empty($repo)) + { + global $app; + $project = $app->control->loadModel('gitea')->apiGetSingleProject($repo->serviceHost, $repo->serviceProject); + if(isset($project->tokenCloneUrl)) + { + $cmd = 'git clone --progress -v "' . $project->tokenCloneUrl . '" "' . $this->root . '"'; + exec($cmd); + } + } $branch = isset($_COOKIE['repoBranch']) ? $_COOKIE['repoBranch'] : ''; if($branch) @@ -51,6 +62,7 @@ class Gitea chdir($this->root); if(!empty($path)) $sub = ":$path"; if(!empty($this->branch))$revision = $this->branch; + execCmd(escapeCmd("$this->client pull")); $cmd = escapeCmd("$this->client ls-tree -l $revision$sub"); $list = execCmd($cmd . ' 2>&1', 'array', $result); if($result) return array(); diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 583b0b1475..a27cb2259d 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -7,15 +7,16 @@ class gitlab /** * Construct * - * @param string $client gitlab api url. - * @param string $root id of gitlab project. - * @param string $username null - * @param string $password token of gitlab api. - * @param string $encoding + * @param string $client gitlab api url. + * @param string $root id of gitlab project. + * @param string $username null + * @param string $password token of gitlab api. + * @param string $encoding + * @param object $repo * @access public * @return void */ - public function __construct($client, $root, $username, $password, $encoding = 'UTF-8') + public function __construct($client, $root, $username, $password, $encoding = 'UTF-8', $repo = null) { $this->client = $client; $this->root = rtrim($root, '/') . '/'; diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index bb39bcb417..aaafee2639 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -12,10 +12,11 @@ class GitRepo * @param string $username * @param string $password * @param string $encoding + * @param object $repo * @access public * @return void */ - public function __construct($client, $root, $username, $password, $encoding = 'UTF-8') + public function __construct($client, $root, $username, $password, $encoding = 'UTF-8', $repo = null) { putenv('LC_CTYPE=en_US.UTF-8'); diff --git a/lib/scm/scm.class.php b/lib/scm/scm.class.php index 4389aa26ab..950c6b740a 100644 --- a/lib/scm/scm.class.php +++ b/lib/scm/scm.class.php @@ -15,7 +15,7 @@ class scm $className = $repo->SCM; if($className == 'Git') $className = 'GitRepo'; if(!class_exists($className)) require(strtolower($className) . '.class.php'); - $this->engine = new $className($repo->client, $repo->path, $repo->account, $repo->password, $repo->encoding); + $this->engine = new $className($repo->client, $repo->path, $repo->account, $repo->password, $repo->encoding, $repo); } /** diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php index 1bddd6baa1..120e5d4a88 100644 --- a/lib/scm/subversion.class.php +++ b/lib/scm/subversion.class.php @@ -18,10 +18,11 @@ class Subversion * @param string $account * @param string $password * @param string $encoding + * @param object $repo * @access public * @return void */ - public function __construct($client, $root, $account, $password, $encoding = 'UTF-8') + public function __construct($client, $root, $account, $password, $encoding = 'UTF-8', $repo = null) { putenv('LC_CTYPE=en_US.UTF-8'); $this->root = str_replace(array('%3A', '%2F', '+'), array(':', '/', ' '), urlencode(rtrim($root, '/'))); diff --git a/module/admin/view/safe.html.php b/module/admin/view/safe.html.php index 57fdd98ef6..bffeeff81c 100644 --- a/module/admin/view/safe.html.php +++ b/module/admin/view/safe.html.php @@ -53,7 +53,7 @@
| bug->allBugs;?> : | -totalBugs) ? 0 : html::a($this->createLink('execution', 'bug', "executionID={$execution->id}&productID=0&orderBy=status,id_desc&build=0&type=all"), $execution->totalBugs);?> | +totalBugs) ? 0 : html::a($this->createLink('execution', 'bug', "executionID={$execution->id}&productID=0&branch=0&orderBy=status,id_desc&build=0&type=all"), $execution->totalBugs);?> |
| bug->unResolved;?> : | -activeBugs) ? 0 : html::a($this->createLink('execution', 'bug', "executionID={$execution->id}&productID=0&orderBy=status,id_desc&build=0&type=unresolved"), $execution->activeBugs);?> | +activeBugs) ? 0 : html::a($this->createLink('execution', 'bug', "executionID={$execution->id}&productID=0&branch=0&orderBy=status,id_desc&build=0&type=unresolved"), $execution->activeBugs);?> |