This commit is contained in:
Yagami
2022-11-10 15:25:51 +08:00
5 changed files with 56 additions and 28 deletions
+1 -1
View File
@@ -384,7 +384,7 @@ class actionModel extends model
$name = $execution->name;
$method = $execution->type == 'kanban' ? 'kanban' : 'view';
$action->extra = (!common::hasPriv('execution', $method) or ($method == 'kanban' and isonlybody())) ? $name : html::a(helper::createLink('execution', $method, "executionID=$action->execution"), $name);
$action->extra = (!common::hasPriv('execution', $method) or ($method == 'kanban' and isonlybody())) ? $name : html::a(helper::createLink('execution', $method, "executionID=$action->execution"), $name, '', "data-app='execution'");
}
}
elseif($actionName == 'linked2project')
+1 -1
View File
@@ -644,7 +644,7 @@ class custom extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'top'));
}
$disabledFeatures = array('program', 'productLine', 'scrum' => array());
$disabledFeatures = array('program', 'productLine', 'scrum' => array('scrumMeasrecord'));
foreach($this->config->custom->features as $feature)
{
$function = 'has' . ucfirst($feature) . 'Data';
+1
View File
@@ -1,5 +1,6 @@
#releaseList {font-size: 13px;}
td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.main-table tbody>tr>td:first-child{padding: 2px 8px!important;}
.c-id {width: 60px}
.c-branch {width: 100px}
+29 -8
View File
@@ -53,19 +53,38 @@ class releaseModel extends model
*/
public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.name as productName, t3.id as buildID, t3.name as buildName, t3.project, t4.name as projectName')
$releases = $this->dao->select('t1.*, t2.name as productName')
->from(TABLE_RELEASE)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project = t4.id')
->where('t1.deleted')->eq(0)
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($branch !== 'all')->andWhere('t1.branch')->like(",{$branch},")->fi()
->beginIF($type != 'all' && $type != 'review')->andWhere('t1.status')->eq($type)->fi()
->beginIF($type == 'review')->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)")->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll();
$builds = $this->dao->select("t1.id, t1.name, IF(t2.name IS NOT NULL, t2.name, '') AS projectName, IF(t3.name IS NOT NULL, t3.name, '{$this->lang->trunk}') AS branchName")
->from(TABLE_BUILD)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->leftJoin(TABLE_BRANCH)->alias('t3')->on('t1.branch = t3.id')
->fetchAll('id');
foreach($releases as $release)
{
$releaseBuilds = array();
foreach(explode(',', $release->build) as $buildID)
{
if(!$buildID or !isset($builds[$buildID])) continue;
$releaseBuilds[] = $builds[$buildID];
}
$release->builds = $releaseBuilds;
}
return $releases;
}
/**
@@ -219,8 +238,9 @@ class releaseModel extends model
}
}
$release->branch = implode(',', $branches);
$release->project = implode(',', $projects);
$release->build = ',' . trim($release->build, ',') . ',';
$release->branch = ',' . trim(implode(',', $branches), ',') . ',';
$release->project = ',' . trim(implode(',', $projects), ',') . ',';
}
$release = $this->loadModel('file')->processImgURL($release, $this->config->release->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_RELEASE)->data($release)
@@ -304,8 +324,9 @@ class releaseModel extends model
$branches[$build->branch] = $build->branch;
$projects[$build->project] = $build->project;
}
$release->branch = implode(',', $branches);
$release->project = implode(',', $projects);
$release->build = ',' . trim($release->build, ',') . ',';
$release->branch = ',' . trim(implode(',', $branches), ',') . ',';
$release->project = ',' . trim(implode(',', $projects), ',') . ',';
}
$this->dao->update(TABLE_RELEASE)->data($release, 'deleteFiles')
+24 -18
View File
@@ -46,16 +46,13 @@
</p>
</div>
<?php else:?>
<table class="table" id='releaseList'>
<table class="table table-bordered" id='releaseList'>
<thead>
<tr>
<th class='c-id'><?php echo $lang->release->id;?></th>
<th class="c-name"><?php echo $lang->release->name;?></th>
<th class="c-build"><?php echo $lang->release->build;?></th>
<?php if($product->type != 'normal'):?>
<th class='text-center c-branch'><?php echo $lang->product->branch;?></th>
<?php endif;?>
<th class="c-project"><?php echo $lang->release->project;?></th>
<th class='text-center c-build'><?php echo $lang->release->build;?></th>
<th class='text-center c-build'><?php echo $lang->release->project;?></th>
<th class='text-center c-status'><?php echo $lang->release->status;?></th>
<th class='c-date text-center'><?php echo $lang->release->date;?></th>
<?php
@@ -68,29 +65,38 @@
<tbody>
<?php foreach($releases as $release):?>
<?php $canBeChanged = common::canBeChanged('release', $release);?>
<?php $buildCount = count($release->builds);?>
<?php $i = 1;?>
<?php foreach($release->builds as $build):?>
<tr data-type='<?php echo $release->status;?>'>
<td><?php echo html::a(inlink('view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td>
<?php if($i == 1):?>
<td rowspan="<?php echo $buildCount;?>"><?php echo html::a(inlink('view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td rowspan="<?php echo $buildCount;?>">
<?php
$flagIcon = $release->marker ? "<icon class='icon icon-flag red' title='{$lang->release->marker}'></icon> " : '';
echo html::a(inlink('view', "release=$release->id"), $release->name, '', "title='$release->name'") . $flagIcon;
?>
</td>
<td title='<?php echo $release->buildName?>'><?php echo empty($release->execution) ? $release->buildName : html::a($this->createLink('build', 'view', "buildID=$release->buildID"), $release->buildName);?></td>
<?php if($product->type != 'normal'):?>
<td class='text-center' title='<?php echo zget($branches, $release->branch, '');?>'><?php echo $branches[$release->branch];?></td>
<?php endif;?>
<td title='<?php echo $release->projectName?>'><?php echo $release->projectName;?></td>
<td>
<?php if($product->type != 'normal'):?>
<span class='label label-outline label-badge'><?php echo $build->branchName;?></span>
<?php endif;?>
<?php echo html::a($this->createLink('build', 'view', "buildID=$build->id"), $build->name);?>
</td>
<td><?php echo $build->projectName;?></td>
<?php if($i == 1):?>
<?php $status = $this->processStatus('release', $release);?>
<td class='c-status text-center' title='<?php echo $status;?>'>
<td class='c-status text-center' title='<?php echo $status;?>' rowspan="<?php echo $buildCount;?>">
<span class="status-release status-<?php echo $release->status?>"><?php echo $status;?></span>
</td>
<td class='text-center'><?php echo $release->date;?></td>
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $release) . "</td>";?>
<td class='c-actions'>
<?php echo $this->release->buildOperateMenu($release, 'browse');?>
</td>
<td class='text-center' rowspan="<?php echo $buildCount;?>"><?php echo $release->date;?></td>
<?php foreach($extendFields as $extendField) echo "<td rowspan='{$buildCount}'>" . $this->loadModel('flow')->getFieldValue($extendField, $release) . "</td>";?>
<td class='c-actions' rowspan="<?php echo $buildCount;?>"><?php echo $this->release->buildOperateMenu($release, 'browse');?></td>
<?php endif;?>
</tr>
<?php $i++;?>
<?php endforeach;?>
<?php endforeach;?>
</tbody>
</table>