* [task#120732] delete artifactrepo code for build.
This commit is contained in:
@@ -3,22 +3,21 @@ global $lang, $app;
|
||||
$config->build->form = new stdclass();
|
||||
|
||||
$now = helper::now();
|
||||
$config->build->form->create['project'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
$config->build->form->create['execution'] = array('type' => 'int', 'required' => $app->tab == 'execution', 'default' => 0);
|
||||
$config->build->form->create['artifactRepoID'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
$config->build->form->create['product'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
$config->build->form->create['scmPath'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['filePath'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['desc'] = array('type' => 'string', 'required' => false, 'default' => '', 'control' => 'editor');
|
||||
$config->build->form->create['builder'] = array('type' => 'string', 'required' => true, 'default' => '');
|
||||
$config->build->form->create['name'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->build->form->create['branch'] = array('type' => 'array', 'required' => false, 'default' => array(), 'filter' => 'join');
|
||||
$config->build->form->create['builds'] = array('type' => 'array', 'required' => false, 'default' => array(), 'filter' => 'join');
|
||||
$config->build->form->create['bugs'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['stories'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['date'] = array('type' => 'date', 'required' => true, 'default' => helper::today());
|
||||
$config->build->form->create['createdBy'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['createdDate'] = array('type' => 'datetime ', 'required' => false, 'default' => $now);
|
||||
$config->build->form->create['project'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
$config->build->form->create['execution'] = array('type' => 'int', 'required' => $app->tab == 'execution', 'default' => 0);
|
||||
$config->build->form->create['product'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
$config->build->form->create['scmPath'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['filePath'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['desc'] = array('type' => 'string', 'required' => false, 'default' => '', 'control' => 'editor');
|
||||
$config->build->form->create['builder'] = array('type' => 'string', 'required' => true, 'default' => '');
|
||||
$config->build->form->create['name'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->build->form->create['branch'] = array('type' => 'array', 'required' => false, 'default' => array(), 'filter' => 'join');
|
||||
$config->build->form->create['builds'] = array('type' => 'array', 'required' => false, 'default' => array(), 'filter' => 'join');
|
||||
$config->build->form->create['bugs'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['stories'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['date'] = array('type' => 'date', 'required' => true, 'default' => helper::today());
|
||||
$config->build->form->create['createdBy'] = array('type' => 'string', 'required' => false, 'default' => '');
|
||||
$config->build->form->create['createdDate'] = array('type' => 'datetime ', 'required' => false, 'default' => $now);
|
||||
|
||||
$config->build->form->edit['execution'] = array('type' => 'int', 'required' => $app->tab == 'execution', 'default' => 0);
|
||||
$config->build->form->edit['product'] = array('type' => 'int', 'required' => false, 'default' => 0);
|
||||
|
||||
@@ -67,7 +67,6 @@ class build extends control
|
||||
$status = empty($this->config->CRProduct) ? 'noclosed' : '';
|
||||
$this->loadModel('execution');
|
||||
$this->loadModel('project');
|
||||
$this->app->loadLang('artifactrepo');
|
||||
|
||||
/* Set menu. */
|
||||
if($this->app->tab == 'project')
|
||||
|
||||
@@ -128,102 +128,3 @@ function loadLastBuild()
|
||||
$('#lastBuildBox').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品改变时更新制品库显示。
|
||||
* When change product load artifactrepo.
|
||||
*
|
||||
* @param event $event
|
||||
* @access public
|
||||
* @return viod
|
||||
*/
|
||||
function loadArtifactrepo(event)
|
||||
{
|
||||
const productID = $(event.target).val();
|
||||
|
||||
var data = Object.values(artifactRepos[productID]);
|
||||
if(data.length > 0)
|
||||
{
|
||||
$('.artifactrepo').removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.artifactrepo').addClass('hidden');
|
||||
$('#filePath').val('');
|
||||
var datePicker = $('#date').datePicker().zui();
|
||||
datePicker.$.setValue(today);
|
||||
}
|
||||
|
||||
onShowArtifactRepo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本库显示改变事件。
|
||||
* Artifact repo show change event.
|
||||
*
|
||||
* @access public
|
||||
* @return viod
|
||||
*/
|
||||
function onShowArtifactRepo()
|
||||
{
|
||||
var isArtifactRepo = $('input[name=isArtifactRepo]:checked').val();
|
||||
if(isArtifactRepo == 'yes')
|
||||
{
|
||||
var productID = $('[name=product]').val();
|
||||
|
||||
var data = Object.values(artifactRepos[productID]);
|
||||
if(data.length > 0)
|
||||
{
|
||||
$('.artifactrepo-id').removeClass('hidden');
|
||||
var items = [];
|
||||
for(i in artifactRepos[productID])
|
||||
{
|
||||
items.push({'text': artifactRepos[productID][i].name, 'value': artifactRepos[productID][i].id});
|
||||
}
|
||||
$artifactRepo = $('#artifactRepoID').zui('picker');
|
||||
$artifactRepo.render({items: items});
|
||||
$artifactRepo.$.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.artifactrepo-id').addClass('hidden');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.artifactrepo-id').addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本库改变事件。
|
||||
* Artifact repo change event.
|
||||
*
|
||||
* @access public
|
||||
* @return viod
|
||||
*/
|
||||
function onChangeArtifactRepo(event)
|
||||
{
|
||||
const repoID = $(event.target).val();
|
||||
const datePicker = $('#date').datePicker().zui();
|
||||
|
||||
var productID = $('[name=product]').val();
|
||||
var data = Object.values(artifactRepos[productID]);
|
||||
if(data.length == 0 || !repoID)
|
||||
{
|
||||
$('#filePath').val('');
|
||||
datePicker.$.setValue(today);
|
||||
return;
|
||||
}
|
||||
|
||||
for(i in artifactRepos[productID])
|
||||
{
|
||||
if(artifactRepos[productID][i].id == repoID)
|
||||
{
|
||||
var url = productArtifactRepos[productID][i].url;
|
||||
if(url[url.length - 1] != '/') url = url + '/';
|
||||
$('#filePath').val(url);
|
||||
datePicker.$.setValue(artifactRepos[productID][i].createdDate.substr(0, 10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ $lang->build->batchUnlinkStory = "Batch {$lang->SRCommon} Unlink";
|
||||
$lang->build->batchUnlinkBug = 'Batch Bug Unlink';
|
||||
$lang->build->viewBug = 'Bugs';
|
||||
$lang->build->bugList = 'Bug List';
|
||||
$lang->build->linkArtifactRepo = 'Link Artifact Repo';
|
||||
|
||||
$lang->build->confirmDelete = "Möchten Sie dieses Build löschen?";
|
||||
$lang->build->confirmUnlinkStory = "Möchten Sie diese {$lang->SRCommon} löschen?";
|
||||
|
||||
@@ -22,7 +22,6 @@ $lang->build->batchUnlinkStory = "Batch Unlink {$lang->SRCommon}";
|
||||
$lang->build->batchUnlinkBug = 'Batch Unlink Bugs';
|
||||
$lang->build->viewBug = 'Bugs';
|
||||
$lang->build->bugList = 'Bug List';
|
||||
$lang->build->linkArtifactRepo = 'Link Artifact Repo';
|
||||
|
||||
$lang->build->confirmDelete = "Do you want to delete this build?";
|
||||
$lang->build->confirmUnlinkStory = "Do you want to unlink this {$lang->SRCommon}?";
|
||||
|
||||
@@ -22,7 +22,6 @@ $lang->build->batchUnlinkStory = "Retirer {$lang->SRCommon} par Lot";
|
||||
$lang->build->batchUnlinkBug = 'Retirer Bugs par Lot';
|
||||
$lang->build->viewBug = 'Bugs';
|
||||
$lang->build->bugList = 'Bug List';
|
||||
$lang->build->linkArtifactRepo = 'Link Artifact Repo';
|
||||
|
||||
$lang->build->confirmDelete = "Voulez-vous supprimer ce build ?";
|
||||
$lang->build->confirmUnlinkStory = "Voulez-vous retirer cette {$lang->SRCommon} du Build ?";
|
||||
|
||||
@@ -22,7 +22,6 @@ $lang->build->batchUnlinkStory = "批量移除{$lang->SRCommon}";
|
||||
$lang->build->batchUnlinkBug = '批量移除Bug';
|
||||
$lang->build->viewBug = '查看Bug';
|
||||
$lang->build->bugList = 'Bug列表';
|
||||
$lang->build->linkArtifactRepo = '关联制品库';
|
||||
|
||||
$lang->build->confirmDelete = "您确认删除该版本吗?";
|
||||
$lang->build->confirmUnlinkStory = "您确认移除该{$lang->SRCommon}吗?";
|
||||
|
||||
@@ -16,7 +16,6 @@ jsVar('multipleSelect', $lang->build->placeholder->multipleSelect);
|
||||
jsVar('autoRelationTip', $lang->build->notice->autoRelation);
|
||||
jsVar('projectID', $projectID);
|
||||
jsVar('executionID', $executionID);
|
||||
jsVar('artifactRepos', !empty($artifactRepos) ? $artifactRepos : '');
|
||||
jsVar('today', helper::today());
|
||||
jsVar('projectModel', isset($project->model) ? $project->model : '');
|
||||
|
||||
@@ -130,7 +129,6 @@ formPanel
|
||||
)
|
||||
)
|
||||
),
|
||||
!empty($artifactRepoRow) ? $artifactRepoRow : null,
|
||||
formRow
|
||||
(
|
||||
setClass('hidden'),
|
||||
|
||||
+10
-17
@@ -48,24 +48,17 @@ class buildZen extends build
|
||||
}
|
||||
}
|
||||
|
||||
$artifactRepos = array();
|
||||
if(!$this->view->hidden && $productGroups) $this->loadModel('artifactrepo');
|
||||
foreach($productGroups as $product)
|
||||
{
|
||||
$products[$product->id] = $product->name;
|
||||
if(!$this->view->hidden) $artifactRepos[$product->id] = $this->artifactrepo->getReposByProduct($product->id);
|
||||
}
|
||||
foreach($productGroups as $product) $products[$product->id] = $product->name;
|
||||
|
||||
$this->view->title = $this->lang->build->create;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
|
||||
$this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : '';
|
||||
$this->view->branches = $branches;
|
||||
$this->view->products = $products;
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->executions = $executions;
|
||||
$this->view->lastBuild = $this->build->getLast($executionID, $projectID);
|
||||
$this->view->project = $this->project->getByID($projectID);
|
||||
$this->view->artifactRepos = $artifactRepos;
|
||||
$this->view->title = $this->lang->build->create;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
|
||||
$this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : '';
|
||||
$this->view->branches = $branches;
|
||||
$this->view->products = $products;
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->executions = $executions;
|
||||
$this->view->lastBuild = $this->build->getLast($executionID, $projectID);
|
||||
$this->view->project = $this->project->getByID($projectID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user