-
diff --git a/module/gitlab/view/browseproject.html.php b/module/gitlab/view/browseproject.html.php
index 286ff6c9a7..93fddbd2f7 100644
--- a/module/gitlab/view/browseproject.html.php
+++ b/module/gitlab/view/browseproject.html.php
@@ -16,7 +16,7 @@
gitlab->getGitlabMenu($gitlabID, 'project');?>
-
@@ -45,7 +45,7 @@
gitlab->project->name);?>
gitlab->lastUpdate;?>
- actions;?>
+ actions;?>
diff --git a/module/gitlab/view/browseuser.html.php b/module/gitlab/view/browseuser.html.php
index 12ba265311..66da47013d 100644
--- a/module/gitlab/view/browseuser.html.php
+++ b/module/gitlab/view/browseuser.html.php
@@ -14,20 +14,20 @@
diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php
index ba67f94a53..d23fcfc023 100644
--- a/module/group/lang/resource.php
+++ b/module/group/lang/resource.php
@@ -1146,6 +1146,7 @@ $lang->resource->repo->download = 'downloadAction';
$lang->resource->repo->maintain = 'maintain';
$lang->resource->repo->setRules = 'setRules';
$lang->resource->repo->apiGetRepoByUrl = 'apiGetRepoByUrl';
+$lang->resource->repo->downloadCode = 'downloadCode';
$lang->repo->methodOrder[5] = 'create';
$lang->repo->methodOrder[10] = 'edit';
@@ -1161,6 +1162,7 @@ $lang->repo->methodOrder[55] = 'blame';
$lang->repo->methodOrder[60] = 'download';
$lang->repo->methodOrder[65] = 'setRules';
$lang->repo->methodOrder[70] = 'apiGetRepoByUrl';
+$lang->repo->methodOrder[75] = 'downloadCode';
$lang->resource->ci = new stdclass();
$lang->resource->ci->commitResult = 'commitResult';
diff --git a/module/pipeline/model.php b/module/pipeline/model.php
index 59bb07e11a..c740085398 100644
--- a/module/pipeline/model.php
+++ b/module/pipeline/model.php
@@ -86,6 +86,7 @@ class pipelineModel extends model
$this->dao->insert(TABLE_PIPELINE)->data($pipeline)
->batchCheck($this->config->pipeline->create->requiredFields, 'notempty')
->batchCheck("url", 'URL')
+ ->check('name', 'unique', "`type` = '$type'")
->autoCheck()
->exec();
if(dao::isError()) return false;
@@ -116,6 +117,7 @@ class pipelineModel extends model
$this->dao->update(TABLE_PIPELINE)->data($pipeline)
->batchCheck($this->config->pipeline->edit->requiredFields, 'notempty')
->batchCheck("url", 'URL')
+ ->check('name', 'unique', "`type` = '$type' and id <> $id")
->autoCheck()
->where('id')->eq($id)
->exec();
diff --git a/module/repo/control.php b/module/repo/control.php
index 7942fe6a84..fee4f2957b 100644
--- a/module/repo/control.php
+++ b/module/repo/control.php
@@ -497,6 +497,7 @@ class repo extends control
$this->view->pager = $pager;
$this->view->path = urldecode($path);
$this->view->logType = $logType;
+ $this->view->cloneUrl = $this->repo->getCloneUrl($repo);
$this->view->cacheTime = date('m-d H:i', filemtime($cacheFile));
$this->view->branchOrTag = $branchOrTag;
@@ -1293,4 +1294,21 @@ class repo extends control
$executions = $this->repo->getExecutionPairs($productID, $branch);
echo html::select('execution', array('' => '') + $executions, '', 'class="form-control chosen"');
}
+
+ /**
+ * Download zip code.
+ *
+ * @param int $repoID
+ * @param string $branch
+ * @access public
+ * @return void
+ */
+ public function downloadCode($repoID = 0, $branch = '')
+ {
+ $repo = $this->repo->getRepoByID($repoID);
+ if($repo->SCM == 'Gitlab')
+ {
+ return '';
+ }
+ }
}
diff --git a/module/repo/css/browse.css b/module/repo/css/browse.css
index 5a0a4b0799..9ecc8cca58 100644
--- a/module/repo/css/browse.css
+++ b/module/repo/css/browse.css
@@ -26,3 +26,8 @@
/* Fix bug #21893. */
.in #sidebar>.sidebar-toggle>.icon-angle-left:before {content: "\e315";}
.hide-sidebar #sidebar>.sidebar-toggle>.icon-angle-left:before {content: "\e314";}
+
+.download-popover {width: 400px; max-width: none;}
+.popover-content {padding: 0;}
+.download-popover .table {margin-bottom: 0;}
+.download-popover .table td {padding-right: 0;}
diff --git a/module/repo/js/browse.js b/module/repo/js/browse.js
new file mode 100644
index 0000000000..4439789721
--- /dev/null
+++ b/module/repo/js/browse.js
@@ -0,0 +1,82 @@
+function getDownload()
+{
+ var content = "
gitlab->getGitlabMenu($gitlabID, 'user');?>
-
- " . $lang->gitlab->user->create, '', "class='btn btn-primary'");?>
+ " . $lang->gitlab->user->create, '', "class='btn btn-primary'");?>
noData;?> - createLink('gitlab', 'createProject', "gitlabID=$gitlabID"), " " . $lang->gitlab->user->create, '', "class='btn btn-info'");?> + createLink('gitlab', 'createProject', "gitlabID=$gitlabID"), " " . $lang->gitlab->user->create, '', "class='btn btn-info'");?>
";
+ content += "
";
+ return content;
+}
+
+$(function()
+{
+ /* Init popover. */
+ var options = {
+ container: 'body',
+ content: getDownload(),
+ html: true,
+ placement: 'bottom',
+ template: '";
+ content += "";
+ if(cloneUrl.ssh)
+ {
+ content += "
";
+ content += "
";
+ content += "| " + lang.sshClone + " | "; + content += "|
|---|---|
| "; + content += " | "; + content += " |
| " + lang.httpClone + " | "; + content += "|
| "; + content += " | "; + content += " |
| "; + content += " | "; + content += " | "; + content += "
repo->create = 'Create';
$lang->repo->maintain = 'Repo List';
$lang->repo->edit = 'Edit';
$lang->repo->delete = 'Delete Repo';
-$lang->repo->showSyncCommit = 'Display Synchronization';
+$lang->repo->showSyncCommit = 'Display Sync';
$lang->repo->ajaxSyncCommit = 'Interface: Ajax Sync Note';
-$lang->repo->setRules = 'Set rules';
+$lang->repo->setRules = 'Set Rules';
$lang->repo->download = 'Download File';
$lang->repo->downloadDiff = 'Download Diff';
$lang->repo->addBug = 'Add Review';
@@ -30,16 +30,22 @@ $lang->repo->apiGetRepoByUrl = 'API: Get repo by URL';
$lang->repo->browseAction = 'Browse Repo';
$lang->repo->createAction = 'Create Repo';
$lang->repo->editAction = 'Edit Repo';
-$lang->repo->diffAction = 'Revision Diff';
+$lang->repo->diffAction = 'Diff Revision';
$lang->repo->downloadAction = 'Download File';
$lang->repo->revisionAction = 'Revision Detail';
-$lang->repo->blameAction = 'Repo Blame';
+$lang->repo->blameAction = 'Blame';
$lang->repo->reviewAction = 'Review List';
+$lang->repo->downloadCode = 'Download Code';
+$lang->repo->downloadZip = 'Download Zip file';
+$lang->repo->sshClone = 'Clone by SSH';
+$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->submit = 'Submit';
$lang->repo->cancel = 'Cancel';
$lang->repo->addComment = 'Add Comment';
+$lang->repo->copy = 'Click to copy';
+$lang->repo->copied = 'Copy successful';
$lang->repo->module = 'Module';
$lang->repo->type = 'Type';
$lang->repo->assign = 'AssignTo';
@@ -106,7 +112,7 @@ $lang->repo->openedDate = 'CreatedDate';
$lang->repo->latestRevision = 'Latest Revision';
$lang->repo->actionInfo = "Add by %s in %s";
$lang->repo->changes = "Change Log";
-$lang->repo->reviewLocation = "File: %s@%s, line:%s - %s";
+$lang->repo->reviewLocation = "File: %s@%s, Line: %s - %s";
$lang->repo->commentEdit = '';
$lang->repo->commentDelete = '';
$lang->repo->allChanges = "Other Changes";
@@ -119,7 +125,7 @@ $lang->repo->objectIdRule = 'Object ID Rule';
$lang->repo->actionRule = 'Action Rule';
$lang->repo->manHourRule = 'Man-hour Rule';
$lang->repo->ruleUnit = "Unit";
-$lang->repo->ruleSplit = "Multiple keywords are divided by ';'. For example: task multiple keywords: Task;task";
+$lang->repo->ruleSplit = "Multiple keywords are divided by ';', e.g. task multiple keywords: Task;task";
$lang->repo->viewDiffList['inline'] = 'Inline';
$lang->repo->viewDiffList['appose'] = 'Parallel';
@@ -136,7 +142,7 @@ $lang->repo->encodingList['gbk'] = 'GBK';
$lang->repo->scmList['Gitlab'] = 'GitLab';
$lang->repo->scmList['Git'] = 'Git';
-$lang->repo->scmList['Subversion'] = 'Subversion';
+$lang->repo->scmList['Subversion'] = 'SVN';
$lang->repo->gitlabHost = 'GitLab Host';
$lang->repo->gitlabToken = 'GitLab Token';
@@ -149,12 +155,12 @@ $lang->repo->notice = new stdclass();
$lang->repo->notice->syncing = 'Synchronizing. Please wait ...';
$lang->repo->notice->syncComplete = 'Synchronized. Now redirecting ...';
$lang->repo->notice->syncedCount = 'The number of records synchronized is ';
-$lang->repo->notice->delete = 'Are you sure delete this repo?';
+$lang->repo->notice->delete = 'Do you want to delete this repo?';
$lang->repo->notice->successDelete = 'Repository is removed.';
$lang->repo->notice->commentContent = 'Comment';
$lang->repo->notice->deleteReview = 'Do you want to delete this review?';
-$lang->repo->notice->deleteBug = 'Are you sure to delete this bug?';
-$lang->repo->notice->deleteComment = 'Are you sure to delete this comment?';
+$lang->repo->notice->deleteBug = 'Do you want to delete this bug?';
+$lang->repo->notice->deleteComment = 'Do you want to delete this comment?';
$lang->repo->notice->lastSyncTime = 'Last Sync:';
$lang->repo->rules = new stdclass();
@@ -182,14 +188,14 @@ $lang->repo->error->noFile = '%s does not exist.';
$lang->repo->error->noPriv = 'The program does not have the privilege to switch to %s';
$lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n";
$lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client";
-$lang->repo->error->encoding = "The encoding maybe wrong. Please change the encoding and try again.";
+$lang->repo->error->encoding = "The encoding might be wrong. Please change the encoding and try again.";
$lang->repo->error->deleted = "Deletion of the repository failed. The current repository has a commit record associated with the design.";
$lang->repo->error->linkedJob = "Deletion of the repository failed. The current repository has associated with the Compile.";
$lang->repo->error->clientPath = "The client installation directory cannot have spaces!";
$lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server.";
$lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.';
-$lang->repo->encodingsTips = "The encodings of commit comments, can be comma separated values,e.g. utf-8";
+$lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8.";
$lang->repo->pathTipsForGitlab = "GitLab Project URL";
$lang->repo->example = new stdclass();
diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php
index bbbdd4996f..7e6dabca74 100644
--- a/module/repo/lang/en.php
+++ b/module/repo/lang/en.php
@@ -35,11 +35,17 @@ $lang->repo->downloadAction = 'Download File';
$lang->repo->revisionAction = 'Revision Detail';
$lang->repo->blameAction = 'Blame';
$lang->repo->reviewAction = 'Review List';
+$lang->repo->downloadCode = 'Download Code';
+$lang->repo->downloadZip = 'Download compressed package';
+$lang->repo->sshClone = 'Clone by SSH';
+$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->submit = 'Submit';
$lang->repo->cancel = 'Cancel';
$lang->repo->addComment = 'Add Comment';
+$lang->repo->copy = 'Click to copy';
+$lang->repo->copied = 'Copy successful';
$lang->repo->module = 'Module';
$lang->repo->type = 'Type';
$lang->repo->assign = 'AssignTo';
diff --git a/module/repo/lang/fr.php b/module/repo/lang/fr.php
index 0be6154245..4c0dd7754a 100644
--- a/module/repo/lang/fr.php
+++ b/module/repo/lang/fr.php
@@ -35,11 +35,17 @@ $lang->repo->downloadAction = 'Download File';
$lang->repo->revisionAction = 'Détail Révision';
$lang->repo->blameAction = 'Blâme du Référentiel';
$lang->repo->reviewAction = 'Review List';
+$lang->repo->downloadCode = 'Download Code';
+$lang->repo->downloadZip = 'Download compressed package';
+$lang->repo->sshClone = 'Clone by SSH';
+$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->submit = 'Soumettre';
$lang->repo->cancel = 'Annuler';
$lang->repo->addComment = 'Ajout Comment.';
+$lang->repo->copy = 'Click to copy';
+$lang->repo->copied = 'Copy successful';
$lang->repo->module = 'Module';
$lang->repo->type = 'Type';
$lang->repo->assign = 'Assigner à';
diff --git a/module/repo/lang/vi.php b/module/repo/lang/vi.php
index 18f8986521..d950a23f27 100644
--- a/module/repo/lang/vi.php
+++ b/module/repo/lang/vi.php
@@ -27,10 +27,25 @@ $lang->repo->tag = 'Tag';
$lang->repo->addWebHook = 'Add Webhook';
$lang->repo->apiGetRepoByUrl = 'API: Get repo by URL';
+$lang->repo->browseAction = 'Browse Repo';
+$lang->repo->createAction = 'Create Repo';
+$lang->repo->editAction = 'Edit Repo';
+$lang->repo->diffAction = 'Diff Revision';
+$lang->repo->downloadAction = 'Download File';
+$lang->repo->revisionAction = 'Revision Detail';
+$lang->repo->blameAction = 'Blame';
+$lang->repo->reviewAction = 'Review List';
+$lang->repo->downloadCode = 'Download Code';
+$lang->repo->downloadZip = 'Download compressed package';
+$lang->repo->sshClone = 'Clone by SSH';
+$lang->repo->httpClone = 'Clone by HTTP';
+
$lang->repo->submit = 'Gửi';
$lang->repo->cancel = 'Hủy';
$lang->repo->addComment = 'Thêm nhận xét';
+$lang->repo->copy = 'Click to copy';
+$lang->repo->copied = 'Copy successful';
$lang->repo->module = 'Module';
$lang->repo->type = 'Loại';
$lang->repo->assign = 'Giao cho';
diff --git a/module/repo/lang/zh-cn.php b/module/repo/lang/zh-cn.php
index c59dcf047b..9b23233d17 100644
--- a/module/repo/lang/zh-cn.php
+++ b/module/repo/lang/zh-cn.php
@@ -35,11 +35,17 @@ $lang->repo->downloadAction = '下载代码库文件';
$lang->repo->revisionAction = '版本详情';
$lang->repo->blameAction = '版本追溯';
$lang->repo->reviewAction = '评审列表';
+$lang->repo->downloadCode = '下载代码';
+$lang->repo->downloadZip = '下载压缩包';
+$lang->repo->sshClone = '使用SSH克隆';
+$lang->repo->httpClone = '使用HTTP克隆';
$lang->repo->submit = '提交';
$lang->repo->cancel = '取消';
$lang->repo->addComment = '添加评论';
+$lang->repo->copy = '点击复制';
+$lang->repo->copied = '复制成功';
$lang->repo->module = '模块';
$lang->repo->type = '类型';
$lang->repo->assign = '指派';
diff --git a/module/repo/model.php b/module/repo/model.php
index 390d4a8414..3e9ca0c39f 100644
--- a/module/repo/model.php
+++ b/module/repo/model.php
@@ -2131,4 +2131,29 @@ class repoModel extends model
foreach($executions as $execution) $pairs[$execution->id] = $execution->name;
return $pairs;
}
+
+ /**
+ * Get clone url.
+ *
+ * @param object $repo
+ * @access public
+ * @return object
+ */
+ public function getCloneUrl($repo)
+ {
+ if(empty($repo)) return null;
+
+ $url = new stdClass();
+ if($repo->SCM == 'Gitlab')
+ {
+ $project = $this->loadModel('gitlab')->apiGetSingleProject($repo->gitlab, $repo->project);
+ if(isset($project->id))
+ {
+ $url->http = $project->http_url_to_repo;
+ $url->ssh = $project->ssh_url_to_repo;
+ }
+ }
+
+ return $url;
+ }
}
diff --git a/module/repo/view/browse.html.php b/module/repo/view/browse.html.php
index 853959ab83..9553bfc7b7 100644
--- a/module/repo/view/browse.html.php
+++ b/module/repo/view/browse.html.php
@@ -9,6 +9,10 @@
*/
?>
+
+
+repo);?>
+
@@ -82,7 +86,9 @@
repo->notice->lastSyncTime . $cacheTime?>
repo->createLink('browse', "repoID=$repoID&branchID=" . $base64BranchID . "&objectID=$objectID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"), " " . $lang->refresh, '', "class='btn btn-primary' data-app={$app->tab}");?>
- SCM == 'Gitlab' and common::hasPriv('gitlab', 'createBranch')) echo html::a($this->createLink('gitlab', 'createBranch', "gitlabID={$repo->gitlab}&projectID={$repo->project}"), " " . $lang->gitlab->createBranch, '', "class='btn btn-primary'");?>
+
+
+