This commit is contained in:
holan20180123
2021-02-04 15:39:43 +08:00
parent 68214fb34f
commit 2401cc2b84
3 changed files with 15 additions and 13 deletions
+5 -4
View File
@@ -92,7 +92,7 @@ class repo extends control
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$link = $this->repo->createLink('showSyncCommit', "repoID=$repoID");
$link = $this->repo->createLink('showSyncCommit', "repoID=$repoID", '', false, $this->projectID);
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
@@ -769,9 +769,10 @@ class repo extends control
$this->view->position[] = $this->lang->repo->showSyncCommit;
$latestInDB = $this->repo->getLatestCommit($repoID);
$this->view->version = $latestInDB ? (int)$latestInDB->commit : 1;
$this->view->repoID = $repoID;
$this->view->branch = $branch;
$this->view->version = $latestInDB ? (int)$latestInDB->commit : 1;
$this->view->repoID = $repoID;
$this->view->branch = $branch;
$this->view->browseLink = $this->repo->createLink('browse', "repoID=$repoID", '', false, $this->projectID);
$this->display();
}
+9 -8
View File
@@ -813,17 +813,18 @@ class repoModel extends model
/**
* Create link for repo
*
* @param string $method
* @param string $params
* @param string $viewType
* @param bool $onlybody
*
* @param string $method
* @param string $params
* @param string $viewType
* @param bool $onlybody
* @param int $PRJID
* @access public
* @return string
*/
public function createLink($method, $params = '', $viewType = '', $onlybody = false)
public function createLink($method, $params = '', $viewType = '', $onlybody = false, $PRJID = 0)
{
if($this->config->requestType == 'GET') return helper::createLink('repo', $method, $params, $viewType, $onlybody);
if($this->config->requestType == 'GET') return helper::createLink('repo', $method, $params, $viewType, $onlybody, $PRJID);
$parsedParams = array();
parse_str($params, $parsedParams);
@@ -840,7 +841,7 @@ class repoModel extends model
}
$params = http_build_query($parsedParams);
$link = helper::createLink('repo', $method, $params, $viewType, $onlybody);
$link = helper::createLink('repo', $method, $params, $viewType, $onlybody, $PRJID);
if(empty($pathParams)) return $link;
$link .= strpos($link, '?') === false ? '?' : '&';
+1 -1
View File
@@ -37,7 +37,7 @@ $(function(){
if(data == 'finish')
{
$('#caption').text('<?php echo $lang->repo->notice->syncComplete?>');
return self.location = createLink('repo', 'browse', "repoID=<?php echo $repoID;?>");
return self.location = '<?php echo $browseLink;?>';
}
$('#commits').html(parseInt($('#commits').html()) + parseInt(data));
setTimeout(syncComments, 10);