This commit is contained in:
hufangzhou
2021-07-16 17:32:15 +08:00
34 changed files with 214 additions and 169 deletions
+12 -3
View File
@@ -519,7 +519,16 @@ class bug extends control
/* Get products and projects. */
$products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc');
$projects = array(0 => '');
if($projectID)
if($executionID)
{
$products = array();
$linkedProducts = $this->loadModel('execution')->getProducts($executionID);
foreach($linkedProducts as $product) $products[$product->id] = $product->name;
$project = $this->loadModel('project')->getByID($projectID);
$projects = array($projectID => $project->name);
}
elseif($projectID)
{
$products = array();
$productList = $this->config->CRProduct ? $this->product->getOrderedProducts('all', 40, $projectID) : $this->product->getOrderedProducts('normal', 40, $projectID);
@@ -899,7 +908,7 @@ class bug extends control
$this->view->product = $product;
$this->view->productName = $this->products[$productID];
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch);
$this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch);
$this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch, $bug->project);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch);
$this->view->currentModuleID = $currentModuleID;
$this->view->executions = array(0 => '') + $this->product->getExecutionPairsByProduct($bug->product, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID);
@@ -1563,7 +1572,7 @@ class bug extends control
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if(!empty($relation)) $this->gitlab->deleteIssue('bug', $bugID, $relation->issueID);
$this->bug->delete(TABLE_BUG, $bugID);
if($bug->toTask != 0)
{
+1
View File
@@ -210,6 +210,7 @@ $lang->my->work = 'Work';
$lang->project->list = 'Project List';
$lang->execution->executionKanban = "{$lang->execution->common} Kanban";
$lang->execution->all = "{$lang->execution->common} List";
$lang->doc->recent = 'Recent';
$lang->doc->my = 'My';
+1
View File
@@ -226,6 +226,7 @@ $lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang->
/* Execution menu. */
$lang->execution->homeMenu = new stdclass();
if($config->systemMode == 'new') $lang->execution->homeMenu->executionkanban = array('link' => "{$lang->execution->executionKanban}|execution|executionkanban|");
if($config->systemMode == 'classic') $lang->execution->homeMenu->all = array('link' => "{$lang->execution->all}|execution|all|");
$lang->execution->menu = new stdclass();
$lang->execution->menu->task = array('link' => "{$lang->task->common}|execution|task|executionID=%s", 'subModule' => 'task,tree', 'alias' => 'importtask,importbug');
+1
View File
@@ -210,6 +210,7 @@ $lang->my->work = '待处理';
$lang->project->list = '项目列表';
$lang->execution->executionKanban = "{$lang->execution->common}看板";
$lang->execution->all = "{$lang->execution->common}列表";
$lang->doc->recent = '最近文档';
$lang->doc->my = '我的文档';
+1 -2
View File
@@ -553,7 +553,7 @@ class custom extends control
if($sprintConcept == 2) $this->setting->setItem('system.custom.sprintConcept', 1);
die(js::locate($this->createLink('upgrade', 'mergeTips'), 'parent'));
}
if($mode == 'classic')
else
{
if($sprintConcept == 1) $this->setting->setItem('system.custom.sprintConcept', 2);
die(js::reload('top'));
@@ -565,7 +565,6 @@ class custom extends control
if(isset($this->config->global->upgradeStep) and $this->config->global->upgradeStep == 'mergeProgram') die(js::locate($this->createLink('upgrade', 'mergeProgram'), 'parent'));
unset($_SESSION['upgrading']);
// $this->locate(inlink('index'));
}
$this->app->loadLang('upgrade');
+2 -2
View File
@@ -3,7 +3,7 @@ $(function()
$('[name=mode]').change(function()
{
var mode = $(this).val();
if(mode == 'classic') $('#modeTips').html(newTips);
if(mode == 'new') $('#modeTips').html(classicTips);
if(mode == 'new') $('#modeTips').html(newTips);
if(mode == 'classic') $('#modeTips').html(classicTips);
})
})
+1 -1
View File
@@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Full Management of Dev';
$lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.';
$lang->custom->saveFail = 'Failed to save!';
$lang->custom->page = ' Page';
$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.';
$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.';
$lang->custom->scoreStatus[1] = 'On';
$lang->custom->scoreStatus[0] = 'Off';
+1 -1
View File
@@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Application Lifecycle Management';
$lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.';
$lang->custom->saveFail = 'Failed to save!';
$lang->custom->page = ' Page';
$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.';
$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.';
$lang->custom->scoreStatus[1] = 'On';
$lang->custom->scoreStatus[0] = 'Off';
+1 -1
View File
@@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Application Lifecycle Management';
$lang->custom->menuTip = "Cliquez pour montrer/cacher le menu. Déplacez pour changer l'ordre d'affichage.";
$lang->custom->saveFail = 'Echec de la sauvegarde !';
$lang->custom->page = ' Page';
$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.';
$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.';
$lang->custom->scoreStatus[1] = 'On';
$lang->custom->scoreStatus[0] = 'Off';
+1 -1
View File
@@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Quản lý vòng đời ứng dụng'
$lang->custom->menuTip = 'Click để hiện/ẩn menu. Kéo thả để chuyển vị trí hiển thị.';
$lang->custom->saveFail = 'Lưu thất bại!';
$lang->custom->page = '';
$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.';
$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.';
$lang->custom->scoreStatus[1] = 'On';
$lang->custom->scoreStatus[0] = 'Off';
+2 -2
View File
@@ -29,12 +29,12 @@
<label class="radio-inline"><input type="radio" name="mode" value="classic" <?php echo $mode == 'classic'? "checked='checked'" : ''; echo $isDisabled;?> id="modeclassic"><?php echo $lang->upgrade->to15Mode['classic'];?></label>
<label class="radio-inline"><input type="radio" name="mode" value="new" <?php echo $mode == 'new'? "checked='checked'" : ''; echo $isDisabled;?> id="modenew"><?php echo $lang->upgrade->to15Mode['new'];?></label>
</p>
<p class='text-info' id='modeTips'><?php echo $mode == 'new' ? $lang->custom->changeClassicTip : $lang->upgrade->selectedModeTips['new'];?></p>
<p class='text-info' id='modeTips'><?php echo $mode == 'classic' ? $lang->custom->changeClassicTip : $lang->upgrade->selectedModeTips['new'];?></p>
</td>
</tr>
<tr>
<td></td>
<td><?php echo html::submitButton($lang->custom->switch, $changedMode == 'yes' ? 'disabled' : '');?></td>
<td><?php if($changedMode != 'yes') echo html::submitButton($lang->custom->switch);?></td>
</tr>
</table>
</form>
+7 -1
View File
@@ -340,6 +340,12 @@ class executionModel extends model
$sprint = $this->loadModel('file')->processImgURL($sprint, $this->config->execution->editor->create['id'], $this->post->uid);
/* Redefines the language entries for the fields in the project table. */
foreach(explode(',', $this->config->execution->create->requiredFields) as $field)
{
if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field;
}
/* Replace required language. */
if($this->app->openApp == 'project')
{
@@ -484,7 +490,7 @@ class executionModel extends model
}
/* Redefines the language entries for the fields in the project table. */
foreach(explode(',', $this->config->execution->create->requiredFields) as $field)
foreach(explode(',', $this->config->execution->edit->requiredFields) as $field)
{
if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field;
}
+7 -7
View File
@@ -51,7 +51,7 @@
<tr>
<th class='w-50px'><?php echo $lang->idAB;?></th>
<?php if($config->systemMode == 'new' and isset($project) and $project->model == 'scrum'):?>
<th class='required' style="width:100%"><?php echo $lang->execution->project;?></th>
<th class='w-150px required' style="width:100%"><?php echo $lang->execution->project;?></th>
<?php endif;?>
<th class='required <?php echo $minWidth?>' style="width:100%"><?php echo $lang->execution->$name;?></th>
<th class='w-150px required'><?php echo $lang->execution->$code;?></th>
@@ -79,14 +79,14 @@
<tr>
<td><?php echo sprintf('%03d', $executionID) . html::hidden("executionIDList[$executionID]", $executionID);?></td>
<?php if($config->systemMode == 'new' and isset($project) and $project->model == 'scrum'):?>
<td class='text-left' style='overflow:visible'><?php echo html::select("projects[$executionID]", $allProjects, $executions[$executionID]->project, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("projects[$executionID]", $allProjects, $executions[$executionID]->project, "class='form-control picker-select'");?></td>
<?php endif;?>
<td title='<?php echo $executions[$executionID]->name?>'><?php echo html::input("names[$executionID]", $executions[$executionID]->name, "class='form-control'");?></td>
<td><?php echo html::input("codes[$executionID]", $executions[$executionID]->code, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'PM', ' hidden')?>' style='overflow:visible'><?php echo html::select("PMs[$executionID]", $pmUsers, $executions[$executionID]->PM, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'PO', ' hidden')?>' style='overflow:visible'><?php echo html::select("POs[$executionID]", $poUsers, $executions[$executionID]->PO, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'QD', ' hidden')?>' style='overflow:visible'><?php echo html::select("QDs[$executionID]", $qdUsers, $executions[$executionID]->QD, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'RD', ' hidden')?>' style='overflow:visible'><?php echo html::select("RDs[$executionID]", $rdUsers, $executions[$executionID]->RD, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'PM', ' hidden')?>' style='overflow:visible'><?php echo html::select("PMs[$executionID]", $pmUsers, $executions[$executionID]->PM, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'PO', ' hidden')?>' style='overflow:visible'><?php echo html::select("POs[$executionID]", $poUsers, $executions[$executionID]->PO, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'QD', ' hidden')?>' style='overflow:visible'><?php echo html::select("QDs[$executionID]", $qdUsers, $executions[$executionID]->QD, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'RD', ' hidden')?>' style='overflow:visible'><?php echo html::select("RDs[$executionID]", $rdUsers, $executions[$executionID]->RD, "class='form-control picker-select'");?></td>
<td class='<?php echo zget($visibleFields, 'type', 'hidden')?>'>
<?php
if($executions[$executionID]->type == 'stage')
@@ -123,7 +123,7 @@
<tr>
<td colspan='<?php echo count($visibleFields) + 6?>' class='text-center form-actions'>
<?php echo html::submitButton();?>
<?php echo html::backButton();?>
<?php echo html::linkButton($lang->goback, $this->session->executionList, 'self', '', 'btn btn-wide');;?>
</td>
</tr>
</tfoot>
+15 -7
View File
@@ -586,12 +586,20 @@ class product extends control
$rdUsers = $this->user->getPairs('nodeleted|devfirst', $appendRdUsers);
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["RD"] = $this->config->user->moreLink;
/* Get product lines by programs.*/
$programs = $this->program->getTopPairs();
$lines = array();
foreach($programs as $id => $program)
$programs = array();
if($this->config->systemMode == 'new')
{
$lines[$id] = array('') + $this->product->getLinePairs($id);
/* Get product lines by programs.*/
$programs = $this->program->getTopPairs();
$lines = array(0 => '');
foreach($programs as $id => $program)
{
$lines[$id] = array('') + $this->product->getLinePairs($id);
}
}
else
{
$lines = array('') + $this->product->getLinePairs();
}
$this->view->title = $this->lang->product->batchEdit;
@@ -603,7 +611,7 @@ class product extends control
$this->view->qdUsers = $qdUsers;
$this->view->rdUsers = $rdUsers;
$this->view->programID = $programID;
$this->view->programs = array('') + $programs;
$this->view->programs = array('' => '') + $programs;
unset($this->lang->product->typeList['']);
$this->display();
@@ -949,7 +957,7 @@ class product extends control
$lines = array();
if(empty($productID) or $programID) $lines = $this->product->getLinePairs($programID);
if($productID) die(html::select("lines[$productID]", array('' => '') + $lines, '', "class='form-control chosen'"));
if($productID) die(html::select("lines[$productID]", array('' => '') + $lines, '', "class='form-control picker-select'"));
if(!$productID) die(html::select('line', array('' => '') + $lines, '', "class='form-control chosen'"));
}
+1 -1
View File
@@ -24,6 +24,6 @@ function loadProductLines(programID, productID)
var link = createLink('product', 'ajaxGetLine', 'programID=' + programID + '&productID=' + productID);
$('#line_' + productID).load(link, function()
{
$('#lines' + productID).chosen();
$('#lines' + productID).picker();
});
}
+9 -5
View File
@@ -657,7 +657,7 @@ class productModel extends model
$productID = (int)$productID;
$products[$productID] = new stdClass();
$products[$productID]->program = $data->programs[$productID];
if($this->config->systemMode == 'new') $products[$productID]->program = $data->programs[$productID];
$products[$productID]->name = $productName;
$products[$productID]->line = (int)$data->lines[$productID];
$products[$productID]->PO = $data->POs[$productID];
@@ -874,19 +874,23 @@ class productModel extends model
*
* @param int $productID
* @param int $branch
* @param int $appendProject
* @access public
* @return array
*/
public function getProjectPairsByProduct($productID, $branch = 0)
public function getProjectPairsByProduct($productID, $branch = 0, $appendProject = 0)
{
return $this->dao->select('t2.id,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$projects = $this->dao->select('t2.id,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.type')->eq('project')
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t2.deleted')->eq('0')
->fetchPairs();
->fetchPairs('id', 'name');
if($appendProject) $projects += $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($appendProject)->fetchPairs('id', 'name');
return $projects;
}
/**
@@ -1364,7 +1368,7 @@ class productModel extends model
if(empty($products)) return array();
$productKeys = array_keys($products);
if($orderBy == 'program_asc')
if($orderBy == 'program_asc' and $this->config->systemMode == 'new')
{
$products = $this->dao->select('t1.id as id, t1.*')->from(TABLE_PRODUCT)->alias('t1')
->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id')
+3 -1
View File
@@ -69,6 +69,7 @@
</tr>
</thead>
<tbody id="productTableList">
<?php $lineNames = array();?>
<?php foreach($productStructure as $programID => $program):?>
<?php
$trAttrs = "data-id='program.$programID' data-parent='0' data-nested='true'";
@@ -86,7 +87,8 @@
<?php endif;?>
<?php foreach($program as $lineID => $line):?>
<?php if(isset($line['lineName'])):?>
<?php if(isset($line['lineName']) and !in_array($line['lineName'], $lineNames)):?>
<?php $lineNames[] = $line['lineName'];?>
<?php
if($this->config->systemMode == 'new' and $programID)
{
+5 -1
View File
@@ -52,7 +52,9 @@
$full = '';
}
?>
<?php if($this->config->systemMode == 'new'):?>
<th class='w-150px<?php echo zget($visibleFields, 'program', ' hidden') . zget($requiredFields, 'program', '', ' required');?>'><?php echo $lang->product->program;?></th>
<?php endif;?>
<th class='required <?php echo $width;?>' style="<?php echo $full;?>"><?php echo $lang->product->name;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'line', ' hidden') . zget($requiredFields, 'line', '', ' required');?>'><?php echo $lang->product->line;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'PO', ' hidden') . zget($requiredFields, 'PO', '', ' required');?>'><?php echo $lang->product->PO;?></th>
@@ -73,9 +75,11 @@
?>
<tr>
<td><?php echo sprintf('%03d', $productID) . html::hidden("productIDList[$productID]", $productID);?></td>
<?php if($this->config->systemMode == 'new'):?>
<td class='text-left<?php echo zget($visibleFields, 'program', ' hidden')?>' style='overflow:visible'><?php echo html::select("programs[$productID]", $programs, $products[$productID]->program, "class='form-control picker-select' onchange='loadProductLines(this.value, $productID)'");?></td>
<?php endif;?>
<td title='<?php echo $products[$productID]->name?>'><?php echo html::input("names[$productID]", $products[$productID]->name, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'line', ' hidden')?>' style='overflow:visible' id="line_<?php echo $productID;?>"><?php echo html::select("lines[$productID]", isset($lines[$products[$productID]->program]) ? $lines[$products[$productID]->program] : '', $products[$productID]->line, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'line', ' hidden')?>' style='overflow:visible' id="line_<?php echo $productID;?>"><?php echo html::select("lines[$productID]", $this->config->systemMode == 'new' ? $lines[$products[$productID]->program] : $lines, $products[$productID]->line, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'PO', ' hidden')?>' style='overflow:visible'><?php echo html::select("POs[$productID]", $poUsers, $products[$productID]->PO, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'QD', ' hidden')?>' style='overflow:visible'><?php echo html::select("QDs[$productID]", $qdUsers, $products[$productID]->QD, "class='form-control picker-select'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'RD', ' hidden')?>' style='overflow:visible'><?php echo html::select("RDs[$productID]", $rdUsers, $products[$productID]->RD, "class='form-control picker-select'");?></td>
+19 -15
View File
@@ -345,6 +345,7 @@ class repo extends control
public function browse($repoID = 0, $branchID = '', $objectID = 0, $path = '', $revision = 'HEAD', $refresh = 0)
{
$repoID = $this->repo->saveState($repoID, $objectID);
if($branchID) $branchID = base64_decode($branchID);
/* Get path and refresh. */
if($this->get->repoPath) $path = $this->get->repoPath;
@@ -1109,25 +1110,27 @@ class repo extends control
die($reposHtml);
}
/**
* Ajax get gitlab projects.
*
* @param int $host
* @access public
* @return void
*/
public function ajaxGetGitlabProjects($host, $token)
{
$host = helper::safe64Decode($host);
$projects = $this->repo->getGitlabProjects($host, $token);
if(!$projects) return $this->send(array('message' => array()));
$projectIdList = $projectIdList ? explode(',', $projectIdList) : null;
/**
* Ajax get gitlab projects.
*
* @param string $host
* @param string $token
* @access public
* @return void
*/
public function ajaxGetGitlabProjects($host, $token)
{
$host = helper::safe64decode($host);
$projects = $this->repo->getgitlabprojects($host, $token);
if(!$projects) $this->send(array('message' => array()));
$options = "<option value=''></option>";
foreach($projects as $project)
{
if(!empty($projectIdList) and $project and !in_array($project->id, $projectIdList)) continue;
$options .= "<option value='{$project->id}' data-name='{$project->name}'>{$project->name_with_namespace}</option>";
$options .= "<option value='{$project->id}' data-name='{$project->name}'>{$project->name}:{$project->http_url_to_repo}</option>";
}
die($options);
}
@@ -1144,6 +1147,7 @@ class repo extends control
{
$repo = $this->repo->getRepoByID($repoID);
$branches = $this->repo->getBranches($repo);
if($branchID) $branchID = base64_decode($branchID);
$branchesHtml = "<div class='table-row'><div class='table-col col-left'><div class='list-group' style='margin-bottom: 0;'>";
foreach($branches as $id => $branchName)
+9 -8
View File
@@ -6,12 +6,13 @@ $(function()
$form = $(this).closest('form');
$form.css('min-height', $form.height());
})
$('#gitlabHost').change(function()
$('#gitlabHost, #gitlabToken').change(function()
{
host = $('#gitlabHost').val();
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host);
if(host == '') return false;
host = Base64.encode($('#gitlabHost').val());
token = $('#gitlabToken').val();
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host + '&token=' + token);
if(host == '' || token == '') return false;
$.get(url, function(response)
{
@@ -19,13 +20,13 @@ $(function()
$('#gitlabProject').chosen().trigger("chosen:updated");;
});
});
$('#gitlabProject').change(function()
{
$option = $(this).find('option:selected');
$('#name').val($option.data('name'));
});
});
function scmChanged(scm)
@@ -36,7 +37,7 @@ function scmChanged(scm)
$('.tips-git').removeClass('hidden');
$('.tips-svn').addClass('hidden');
}
}
else
{
$('.account-fields').removeClass('hidden');
+6 -4
View File
@@ -7,11 +7,12 @@ $(function()
$form.css('min-height', $form.height());
})
$('#gitlabHost').change(function()
$('#gitlabHost, #gitlabToken').change(function()
{
host = $('#gitlabHost').val();
if(host == '') return false;
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host);
host = Base64.encode($('#gitlabHost').val());
token = $('#gitlabToken').val();
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host + '&token=' + token);
if(host == '' || token == '') return false;
$.get(url, function(response)
{
@@ -27,6 +28,7 @@ $(function()
$('#name').val($option.data('name'));
$(this).chosen().trigger("chosen:updated");
});
});
function scmChanged(scm)
+1 -5
View File
@@ -104,7 +104,7 @@ class repoModel extends model
$branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0];
$dropMenuLink = helper::createLink('repo', 'ajaxGetBranchDropMenu', "repID=$repoID&branchID=$branchID&objectID=$objectID");
$dropMenuLink = helper::createLink('repo', 'ajaxGetBranchDropMenu', "repID=$repoID&branchID=" . base64_encode($branchID) . "&objectID=$objectID");
$output .= "<div class='btn-group'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn btn-limit'>{$branchName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
@@ -235,9 +235,6 @@ class repoModel extends model
if($this->post->SCM == 'Gitlab')
{
$this->gitlab->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
/* create webhook for zentao */
$this->gitlab->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
}
return $repoID;
}
@@ -301,7 +298,6 @@ class repoModel extends model
{
$this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($id)->exec();
$this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($id)->exec();
if($repo->SCM == 'Gitlab') $this->gitlab->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
return false;
}
+3 -2
View File
@@ -31,14 +31,15 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$base64BranchID = base64_encode($branchID);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$paths = explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
}
echo '/' . ' ' . $fileName;
echo " <span class='label label-info'>" . $revisionName . '</span>';
+7 -5
View File
@@ -29,7 +29,8 @@
<?php
foreach($branches as $id => $branchName)
{
echo "<li>" . html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$id&objectID=$objectID"), $branchName, '', "title='{$branchName}' class='text-ellipsis' data-app='{$app->openApp}'") . "</li>";
$base64BranchID = base64_encode($id);
echo "<li>" . html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $branchName, '', "title='{$branchName}' class='text-ellipsis' data-app='{$app->openApp}'") . "</li>";
}
?>
</ul>
@@ -38,14 +39,15 @@
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$base64BranchID = base64_encode($branchID);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$paths= explode('/', $path);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
}
echo '/' . ' ' . $fileName;
?>
@@ -54,7 +56,7 @@
</div>
<div class="btn-toolbar pull-right">
<span class='last-sync-time'><?php echo $lang->repo->notice->lastSyncTime . $cacheTime?></span>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"), "<i class='icon icon-refresh'></i> " . $lang->refresh, '', "class='btn btn-primary' data-app={$app->openApp}");?>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"), "<i class='icon icon-refresh'></i> " . $lang->refresh, '', "class='btn btn-primary' data-app={$app->openApp}");?>
</div>
</div>
<div id="mainContent" class="main-row fade">
@@ -80,7 +82,7 @@
<td>
<?php
$infoPath = trim($path . '/' . $info->name, '/');
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath));
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath));
echo html::a($link, $info->name, '', "title='{$info->name}' data-app={$app->openApp}");
?>
</td>
+5 -4
View File
@@ -29,13 +29,14 @@
<div class="page-title">
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$paths = explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
$paths = explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
$base64BranchID = base64_encode($branchID);
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
}
echo '/' . ' ' . $fileName;
if(strpos($repo->SCM, 'Subversion') === false)
-1
View File
@@ -49,7 +49,6 @@
<td class='text-left c-actions'>
<?php
common::printIcon('repo', 'edit', "repoID=$repo->id&objectID=$objectID", '', 'list', 'edit');
if(strtolower($repo->SCM) == "gitlab") common::printIcon('gitlab', 'importIssue', "repo={$repo->id}", '', 'list', 'link'); // disable button instead of hiding it.
if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$repo->id&objectID=$objectID"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'");
?>
</td>
+1 -1
View File
@@ -19,7 +19,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<?php include '../../common/view/header.html.php';?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php $browseLink = $app->session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=$branchID&objectID=$objectID{$preDir}");?>
<?php $browseLink = $app->session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=" . base64_encode($branchID) . "&objectID=$objectID{$preDir}");?>
<?php echo html::a($browseLink, "<i class='icon icon-back'></i>" . $lang->goback, '', "class='btn btn-link'");?>
<div class="divider"></div>
<div class="page-title">
+3 -2
View File
@@ -25,14 +25,15 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$base64BranchID = base64_encode($branchID);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->openApp}'");
$paths= explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'), '', "data-app='{$app->openApp}'");
}
echo '/' . ' ' . $fileName;
echo $version;
+2 -1
View File
@@ -13,7 +13,8 @@
div.divider {vertical-align: middle;}
.main-row {margin-top: 20px; padding: 20px; background: #f1f1f1;}
.main-row .side-col .nav li.active div a {background: #006af1; color: #fff; border-radius: 4px;}
.main-row .side-col .nav li.active div a {background: #e3f2fd; color: #000; border-radius: 4px;}
.main-row .side-col .nav li.currentPage div a {background: #006af1; color: #fff; border-radius: 4px;}
.main-row .side-col .nav li div a {width: 80%; display: inline-block; padding: 5px 15px; margin-bottom: 5px;}
#lineBox > .cell {height: 700px;}
+83 -80
View File
@@ -32,32 +32,16 @@ $(function()
{
if($('[id^=productLines]').length > 0)
{
$("[id^='products\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked'))
{
checkedProduct = false;
}
else
{
$('[data-product=' + $(this).val() +']').prop('checked', true);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
}
})
var checkedProduct = isSelectAll(lineID, 'product');
var productID = $('[data-id=' + e.id + ']').val();
$('[data-product=' + productID +']').prop('checked', true);
if(!$("[id^='productLines\[" + lineID + "\]']").prop('checked')) $("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
}
else
{
$("[id^=products]").each(function()
{
if(!$(this).prop('checked'))
{
checkedProduct = false;
}
else
{
$('[data-product=' + $(this).val() +']').prop('checked', true);
}
})
var checkedProduct = isSelectAll(0, 'product');
var productID = $('[data-id=' + e.id + ']').val();
$('[data-product=' + productID +']').prop('checked', true);
}
$('#checkAllProducts').prop('checked', checkedProduct);
}
@@ -67,43 +51,27 @@ $(function()
{
if($('[id^=productLines]').length > 0)
{
$("[id^='sprints\[" + lineID + "\]']").each(function()
var checkedProject = isSelectAll(lineID, 'project');
var productID = $('[data-id=' + e.id + ']').attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked'))
{
if(!$(this).prop('checked'))
{
checkedProject = false;
}
else
{
var productID = $(this).attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
}
})
$('[data-productid=' + productID + ']').prop('checked', true);
if(!$("[id^='productLines\[" + lineID + "\]']").prop('checked')) $("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
}
}
else if($('[id^=products]').length > 0)
{
$("[id^=sprints]").each(function()
{
if(!$(this).prop('checked'))
{
checkedProject = false;
}
else
{
var productID = $(this).attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true);
}
})
var checkedProject = isSelectAll(0, 'project');
var productID = $('[data-id=' + e.id + ']').attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true);
}
else
{
var projectNum = $("[id^='sprints'").length;
var checkedProjectNum = $("[id^='sprints']:checked").length;
if(projectNum > checkedProjectNum) checkedProject = false;
var checkedProject = isSelectAll(0, 'project');
}
var checkedProduct = isSelectAll(lineID, 'product');
$('#checkAllProjects').prop('checked', checkedProject);
$('#checkAllProducts').prop('checked', checkedProduct);
}
/* All product lines selected. */
@@ -229,6 +197,7 @@ $(function()
}
$('[data-line=' + value + ']').prop('checked', true);
$('[lineid=' + value + ']').addClass('active');
$('#programName').val($("[lineid='" + value + "']").find('a').text());
}
else
{
@@ -240,6 +209,9 @@ $(function()
}
$('[data-line=' + value + ']').prop('checked', false);
$('[lineid=' + value + ']').removeClass('active');
$('#programName').val('');
$('#programStatus').val('wait');
$('#programStatus').trigger('chosen:updated');
}
/* Determine whether all product line buttons are selected. */
@@ -294,6 +266,7 @@ $(function()
}
var currentLine = $(this).closest('li').attr('lineid');
$(this).closest('ul').find('li').removeClass('currentPage');
$(this).closest('li').addClass('currentPage');
/* Active current li and remove active before li. */
@@ -318,7 +291,7 @@ $(function()
$(target).removeClass('hidden');
/* Replace program name. */
$('#programName').val($(this).text());
if($("[id^='productLines\[" + currentLine +"\]'").prop('checked')) $('#programName').val($(this).text());
/* Replace project name. */
var productID = $(target).find('.lineGroup .productList input[name*="product"]').val();
@@ -400,26 +373,27 @@ $(function()
$('[data-product=' + value + ']').prop('checked', true)
if(lineID && $('[data-lineid=' + lineID + ']').length > 0 && !$('[data-lineid=' + lineID + ']').prop('checked')) $('[data-lineid=' + lineID + ']').prop('checked', true);
$('#programName').val($("[lineid='" + lineID + "']").find('a').text());
$('#programStatus').val('wait');
$('#programStatus').trigger('chosen:updated');
}
else
{
$('[data-product=' + value + ']').prop('checked', false)
$('#programName').val('');
$('#programStatus').val('wait');
$('#programStatus').trigger('chosen:updated');
}
var checkedProject = true;
if($('[id^=productLines]').length > 0)
{
var projectNum = $("[id^='sprints\[" + lineID + "\]'").length;
var checkedProjectNum = $("[id^='sprints\[" + lineID + "\]']:checked").length;
if(projectNum > checkedProjectNum) checkedProject = false;
checkedProject = isSelectAll(lineID, 'project');
}
else if($('[id^=products]').length > 0)
{
var projectNum = $("[id^='sprints'").length;
var checkedProjectNum = $("[id^='sprints']:checked").length;
if(projectNum > checkedProjectNum) checkedProject = false;
checkedProject = isSelectAll(0, 'project');
}
$('#checkAllProjects').prop('checked', checkedProject);
@@ -432,6 +406,7 @@ $(function()
$('[name^=sprints]').change(function()
{
var lineID = $(this).attr('data-line');
if($(this).prop('checked'))
{
if(lineID && $('[data-lineid=' + lineID + ']').length > 0 && !$('[data-lineid=' + lineID + ']').prop('checked')) $('[data-lineid=' + lineID + ']').prop('checked', true);
@@ -439,6 +414,8 @@ $(function()
var productID = $(this).attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true);
$('#programName').val($("[lineid='" + lineID + "']").find('a').text());
setProgramByProduct($(':checkbox[data-productid=' + productID + ']'));
}
@@ -447,14 +424,9 @@ $(function()
if($('[id^=productLines]').length > 0)
{
var lineID = $(this).attr('data-line');
var projectNum = $("[id^='sprints\[" + lineID + "\]'").length;
var checkedProjectNum = $("[id^='sprints\[" + lineID + "\]']:checked").length;
if(projectNum > checkedProjectNum) checked = false;
var productNum = $("[id^='products\[" + lineID + "\]'").length;
var checkedProductNum = $("[id^='products\[" + lineID + "\]']:checked").length;
if(productNum > checkedProductNum) checkedProduct = false;
checked = isSelectAll(lineID, 'project');
checkedProduct = isSelectAll(lineID, 'product');
var checkedLine = true;
if(checkedProductNum > 0) $('[lineid=' + lineID + ']').addClass('active');
@@ -467,22 +439,12 @@ $(function()
}
else if($('[id^=products]').length > 0)
{
var projectNum = $("[id^='sprints'").length;
var checkedProjectNum = $("[id^='sprints']:checked").length;
if(projectNum > checkedProjectNum) checked = false;
var productNum = $("[id^='products'").length;
var checkedProductNum = $("[id^='products']:checked").length;
if(productNum > checkedProductNum) checkedProduct = false;
checked = isSelectAll(0, 'project');
checkedProduct = isSelectAll(0, 'product');
}
else if($('[id^=sprints]').length > 0)
{
var projectNum = $("[id^='sprints'").length;
var checkedProjectNum = $("[id^='sprints']:checked").length;
if(projectNum > checkedProjectNum) checked = false;
checkedProduct = isSelectAll(0, 'product');
}
$('#checkAllProjects').prop('checked', checked);
@@ -1062,3 +1024,44 @@ function getProgramStatus(objectType, objectID)
if(objectType == 'project') $('#projectStatus').val(data).trigger("chosen:updated");
})
}
/**
* Checked all objects.
*
* @param int lineID
* @param string type
* @access public
* @return void
*/
function isSelectAll(lineID = 0, type = 'product')
{
var checked = true;
if(lineID)
{
if(type == 'project')
{
var objectNum = $("[id^='sprints\[" + lineID + "\]']").length;
var checkedObjectNum = $("[id^='sprints\[" + lineID + "\]']:checked").length;
}
else if(type == 'product')
{
var objectNum = $("[id^='products\[" + lineID + "\]']").length;
var checkedObjectNum = $("[id^='products\[" + lineID + "\]']:checked").length;
}
}
else
{
if(type == 'project')
{
var objectNum = $("[id^='sprints']").length;
var checkedObjectNum = $("[id^='sprints']:checked").length;
}
else if(type == 'product')
{
var objectNum = $("[id^='products']").length;
var checkedObjectNum = $("[id^='products']:checked").length;
}
}
if(objectNum > checkedObjectNum) checked = false;
return checked;
}
+2 -2
View File
@@ -86,8 +86,8 @@ $lang->upgrade->mergeProgramDesc = <<<EOD
<p>You can set {$lang->projectCommon}s as one new project.</p>
EOD;
$lang->upgrade->to15Mode['classic'] = 'Keep the old version';
$lang->upgrade->to15Mode['new'] = 'New program management mode';
$lang->upgrade->to15Mode['classic'] = 'Keep the classic mode';
$lang->upgrade->to15Mode['new'] = 'Use the program mode';
$lang->upgrade->selectedModeTips['classic'] = 'You can also switch to the new program set management mode in the background-Customize in the future.';
$lang->upgrade->selectedModeTips['new'] = 'Switching to the program management mode requires merging the previous data, and the system will guide you to complete this operation.';
+1 -1
View File
@@ -14,7 +14,7 @@
<td class='required'>
<div class='input-group'>
<?php echo html::select("programs", $programs, $programID, "class='form-control hidden pgm-exist' onchange='getProjectByProgram(this)'");?>
<?php echo html::input("programName", isset($programName) ? $programName : '', "class='form-control pgm-no-exist'");?>
<?php echo html::input("programName", '', "class='form-control pgm-no-exist'");?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
+1 -1
View File
@@ -16,7 +16,7 @@
<div class="detail-content article-content">
<ul class='nav scrollbar-hover' id='lineList'>
<?php foreach($productlines as $line):?>
<li <?php if($line->id == $selected) echo "class='active' id='activeLine'";?> lineID='<?php echo $line->id;?>'>
<li <?php if($line->id == $selected) echo "class='currentPage' id='activeLine'";?> lineID='<?php echo $line->id;?>'>
<div>
<?php echo html::checkbox("productLines[$line->id]", array($line->id => ''), '' ,"class='tile'") . html::a("###", $line->name, '', "data-target=#line{$line->id}");?>
</div>
-1
View File
@@ -46,7 +46,6 @@
<hr/>
<div class='panel-footer text-center'>
<?php echo html::submitButton($lang->upgrade->start . $lang->upgrade->common);?>
<?php echo html::backButton();?>
</div>
</form>
</div>