Merge branch 'master' into 'sprint213_zg'
# Conflicts: # module/execution/css/cfd.css # module/execution/js/cfd.js
This commit is contained in:
@@ -22,6 +22,7 @@ $(function()
|
||||
var link = createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=batchCreateFields');
|
||||
$.post(link, {'fields' : fields}, function()
|
||||
{
|
||||
showFields = fields;
|
||||
showCheckedFields(fields);
|
||||
$('#formSetting').parent().removeClass('open');
|
||||
|
||||
@@ -55,8 +56,6 @@ $(function()
|
||||
*/
|
||||
function showCheckedFields(fields)
|
||||
{
|
||||
showFields = fields;
|
||||
|
||||
var fieldList = ',' + fields + ',';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
@@ -77,22 +76,6 @@ function showCheckedFields(fields)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Hidden require field.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function hiddenRequireFields()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var required = ',' + requiredFields + ',';
|
||||
if(required.indexOf(field) >= 0) $(this).closest('div').addClass('hidden');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set opened builds.
|
||||
*
|
||||
|
||||
@@ -72,4 +72,9 @@ $(document).on('change', 'select', function()
|
||||
$(function()
|
||||
{
|
||||
$('#subNavbar li[data-id="bug"]').addClass('active');
|
||||
|
||||
$('#customField').click(function()
|
||||
{
|
||||
hiddenRequireFields();
|
||||
});
|
||||
});
|
||||
|
||||
+12
-14
@@ -887,20 +887,18 @@ function setBranchRelated(branchID, productID, num)
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
/**
|
||||
* Hidden require field.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function hiddenRequireFields()
|
||||
{
|
||||
$('#customField').click(function()
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var required = ',' + requiredFields + ',';
|
||||
if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled');
|
||||
});
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var required = ',' + requiredFields + ',';
|
||||
if(required.indexOf(field) >= 0) $(this).closest('div').addClass('hidden');
|
||||
});
|
||||
|
||||
$('#formSettingForm .btn-primary').click(function()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php js::set('dittoNotice', $this->lang->bug->dittoNotice);?>
|
||||
<?php js::set('showFields', $showFields);?>
|
||||
<?php js::set('requiredFields', $config->bug->edit->requiredFields);?>
|
||||
<div id='mainContent' class='main-content fade'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->bug->common . $lang->colon . $lang->bug->batchEdit;?></h2>
|
||||
|
||||
@@ -28,6 +28,7 @@ js::set('blockID', $blockID);
|
||||
js::set('moduleID', $moduleID);
|
||||
js::set('tab', $this->app->tab);
|
||||
js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
js::set('showFields', $showFields);
|
||||
if($this->app->tab == 'execution') js::set('objectID', $executionID);
|
||||
if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
?>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
var $formSetting = $('#formSetting');
|
||||
$formSetting.on('click', '.close-dropdown', function()
|
||||
{
|
||||
if(showFields != undefined)
|
||||
if(typeof showFields != 'undefined')
|
||||
{
|
||||
var fieldList = ',' + showFields + ',';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input:visible').each(function()
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
.main-content > h2 {font-size: 16px;}
|
||||
#cfdWrapper {max-width: 1400px; margin: 0 auto; padding: 25px 0px 10px; position: relative;}
|
||||
#cfdYUnit {position: absolute; color: #CBD0DB; top: 27px; left: 130px;}
|
||||
#cfdXUnit {position: absolute; color: #CBD0DB; bottom: 35px; right: 60px;}
|
||||
|
||||
.pull-left .input-control {margin-right: 10px;}
|
||||
|
||||
@media screen and (max-width: 1920px)
|
||||
{
|
||||
#cfdWrapper {max-width: 1400px; margin: 0 auto; padding: 25px 0px 10px; position: relative}
|
||||
#cfdChart {width:1400px !important; height:600px !important}
|
||||
#cfdYUnit {position: absolute; color: #CBD0DB; top: 40px; left: 30px}
|
||||
#cfdXUnit {position: absolute; color: #CBD0DB; bottom: 20px; right: 0px}
|
||||
}
|
||||
@media screen and (max-width: 1366px)
|
||||
{
|
||||
#cfdChart {width:1150px !important; height:400px !important};
|
||||
}
|
||||
|
||||
#mainContent {min-width: 1400px;}
|
||||
#burnStatistics {position: absolute; left: 1200px; width: 180px; height: 200px; top: 20%; margin-top: -30px; line-height: 30px; color: #838A9D; font-size: 12px; border: 1px solid #dcdcdc; background-color: #F8F8F8; padding: 15px 20px; color: #3c4353; border-radius: 8px;}
|
||||
#burnStatistics .bg-primary {margin-right: 5px;}
|
||||
#burnStatistics .icon-help {color: black;}
|
||||
#burnStatistics h3 {margin-top: 10px; text-indent: 10px; margin-bottom: 30px;}
|
||||
|
||||
#burnStatistics h3 {margin-top: 10px; text-indent: 10px; margin-bottom: 30px;}
|
||||
@@ -1,4 +1,95 @@
|
||||
$(function()
|
||||
{
|
||||
$('[data-toggle=tooltip]').tooltip();
|
||||
|
||||
if(chartData)
|
||||
{
|
||||
var i = 0;
|
||||
var series = [];
|
||||
var colors = ['#33B4DB', '#7ECF69', '#FFC73A', '#FF5A61', '#50C8D0', '#AF5AFF', '#4EA3FF', '#FF8C5A', '#6C73FF'];
|
||||
//var background = ['#E1F4FA', '#ECF8E9', '#FFF7E2', '#FFE7E8', '#E5F7F8', '#F3E7FF', '#E5F1FF', '#FFEEE7', '#E9EAFF'];
|
||||
|
||||
$.each(chartData['line'], function(label, set)
|
||||
{
|
||||
series.push({
|
||||
name: label,
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
color: colors[i],
|
||||
areaStyle: {
|
||||
color: colors[i],
|
||||
opacity: 0.2
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: eval(set)
|
||||
})
|
||||
i ++;
|
||||
})
|
||||
|
||||
var chartDom = document.getElementById('cfdChart');
|
||||
var CFD = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: Object.keys(chartData['line'])
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: chartData['labels'],
|
||||
axisLine:
|
||||
{
|
||||
show: true,
|
||||
lineStyle:
|
||||
{
|
||||
color: '#999',
|
||||
width:1
|
||||
}
|
||||
}
|
||||
}],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
minInterval: 1,
|
||||
axisLine:
|
||||
{
|
||||
show: true,
|
||||
lineStyle:
|
||||
{
|
||||
color: ['#999'],
|
||||
width: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series: series,
|
||||
};
|
||||
|
||||
option && CFD.setOption(option);
|
||||
window.addEventListener('resize', CFD.resize);
|
||||
}
|
||||
|
||||
$('#type').change(function()
|
||||
{
|
||||
location.href = createLink('execution', 'cfd', 'executionID=' + executionID + '&type=' + $(this).val());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<?php js::import($jsRoot . 'echarts/echarts.common.min.js'); ?>
|
||||
<?php js::import($jsRoot . 'html2canvas/min.js'); ?>
|
||||
<?php js::set('executionID', $executionID); ?>
|
||||
<?php js::set('chartData', $chartData); ?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php
|
||||
@@ -42,94 +43,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!empty($chartData)):?>
|
||||
<script>
|
||||
var i = 0;
|
||||
var series = [];
|
||||
var colors = ['#33B4DB', '#7ECF69', '#FFC73A', '#FF5A61', '#50C8D0', '#AF5AFF', '#4EA3FF', '#FF8C5A', '#6C73FF'];
|
||||
//var background = ['#E1F4FA', '#ECF8E9', '#FFF7E2', '#FFE7E8', '#E5F7F8', '#F3E7FF', '#E5F1FF', '#FFEEE7', '#E9EAFF'];
|
||||
|
||||
<?php foreach($chartData['line'] as $label => $set):?>
|
||||
series.push({
|
||||
name: '<?php echo $label;?>',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
color: colors[i],
|
||||
areaStyle: {
|
||||
color: colors[i],
|
||||
opacity: 0.2
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: <?php echo $set;?>
|
||||
})
|
||||
i ++;
|
||||
<?php endforeach;?>
|
||||
|
||||
var chartDom = document.getElementById('cfdChart');
|
||||
var CFD = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: <?php echo json_encode(array_keys($chartData['line']));?>
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: <?php echo json_encode($chartData['labels'])?>,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle:
|
||||
{
|
||||
color: '#999',
|
||||
width:1,
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle:
|
||||
{
|
||||
color: '#999',
|
||||
width:1,
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series: series,
|
||||
};
|
||||
|
||||
option && CFD.setOption(option);
|
||||
window.addEventListener('resize', CFD.resize);
|
||||
</script>
|
||||
<?php endif;?>
|
||||
|
||||
<script>
|
||||
$('#type').change(function()
|
||||
{
|
||||
location.href = createLink('execution', 'cfd', 'executionID=' + executionID + '&type=' + $(this).val());
|
||||
});
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -60,7 +60,7 @@ class search extends control
|
||||
$this->view->searchFields = $fields;
|
||||
$this->view->actionURL = $actionURL;
|
||||
$this->view->fieldParams = $this->search->setDefaultParams($fields, $params);
|
||||
$this->view->queries = $this->search->getQueryPairs($module);
|
||||
$this->view->queries = $this->search->getQueryList($module);
|
||||
$this->view->queryID = $queryID;
|
||||
$this->view->style = empty($style) ? 'full' : $style;
|
||||
$this->view->onMenuBar = empty($onMenuBar) ? 'no' : $onMenuBar;
|
||||
@@ -148,13 +148,13 @@ class search extends control
|
||||
{
|
||||
$query = $queryID ? $queryID : '';
|
||||
$module = empty($module) ? $this->session->searchParams['module'] : $module;
|
||||
$queries = $this->search->getQueryPairs($module);
|
||||
|
||||
$queries = $this->search->getQueryList($module);
|
||||
$html = '';
|
||||
foreach($queries as $queryID => $queryName)
|
||||
foreach($queries as $query)
|
||||
{
|
||||
if(empty($queryID)) continue;
|
||||
$html .= '<li>' . html::a("javascript:executeQuery({$queryID})", $queryName . (common::hasPriv('search', 'deleteQuery') ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$queryID'") . '</li>';
|
||||
if(empty($query->id)) continue;
|
||||
|
||||
$html .= '<li>' . html::a("javascript:executeQuery({$query->id})", $query->title . ((common::hasPriv('search', 'deleteQuery') and $this->app->user->account == $query->account) ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$query->id' title='{$query->title}'") . '</li>';
|
||||
}
|
||||
echo $html;
|
||||
}
|
||||
|
||||
@@ -439,6 +439,30 @@ class searchModel extends model
|
||||
return $queries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query list.
|
||||
*
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryList($module)
|
||||
{
|
||||
$queries = $this->dao->select('id, account, title')
|
||||
->from(TABLE_USERQUERY)
|
||||
->where()
|
||||
->markLeft(1)
|
||||
->where('account')->eq($this->app->user->account)
|
||||
->orWhere('common')->eq(1)
|
||||
->markRight(1)
|
||||
->andWhere('module')->eq($module)
|
||||
->orderBy('id_desc')
|
||||
->fetchAll();
|
||||
if(!$queries) return array('' => $this->lang->search->myQuery);
|
||||
$queries = array('' => $this->lang->search->myQuery) + $queries;
|
||||
return $queries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get records by the condition.
|
||||
*
|
||||
|
||||
@@ -227,10 +227,9 @@ foreach($fieldParams as $fieldName => $param)
|
||||
<td class='w-160px hidden' rowspan='2' id='userQueries'>
|
||||
<h4><?php echo $lang->search->savedQuery;?></h4>
|
||||
<ul>
|
||||
<?php foreach($queries as $queryID => $queryName):?>
|
||||
<?php if(empty($queryID)) continue;?>
|
||||
<?php $query = $this->search->getByID($queryID);?>
|
||||
<li><?php echo html::a("javascript:executeQuery($queryID)", $queryName . ((common::hasPriv('search', 'deleteQuery') and $this->app->user->account == $query->account) ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$queryID' title='{$queryName}'");?></li>
|
||||
<?php foreach($queries as $query):?>
|
||||
<?php if(empty($query->id)) continue;?>
|
||||
<li><?php echo html::a("javascript:executeQuery($query->id)", $query->title . ((common::hasPriv('search', 'deleteQuery') and $this->app->user->account == $query->account) ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$query->id' title='{$query->title}'");?></li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
@@ -23,6 +23,7 @@ $(function()
|
||||
var link = createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields');
|
||||
$.post(link, {'fields' : fields}, function()
|
||||
{
|
||||
showFields = fields;
|
||||
showCheckedFields(fields);
|
||||
$('#formSetting').parent().removeClass('open');
|
||||
|
||||
|
||||
@@ -49,4 +49,9 @@ $(document).on('change', 'select', function()
|
||||
$(function()
|
||||
{
|
||||
$('#subNavbar li[data-id="task"]').addClass('active');
|
||||
|
||||
$('#customField').click(function()
|
||||
{
|
||||
hiddenRequireFields();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,8 +29,6 @@ function setStoryModule()
|
||||
*/
|
||||
function showCheckedFields(fields)
|
||||
{
|
||||
showFields = fields;
|
||||
|
||||
var fieldList = ',' + fields + ',';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
<?php
|
||||
$dittoNotice = sprintf($this->lang->task->dittoNotice, $lang->executionCommon);
|
||||
js::set('dittoNotice', $dittoNotice);
|
||||
js::set('showFields', $showFields);
|
||||
js::set('requiredFields', $config->task->edit->requiredFields);
|
||||
?>
|
||||
<div id='mainContent' class='main-content fade'>
|
||||
<div class='main-header'>
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
#batchCreateForm .input-group .colorpicker.open {z-index: 5;}
|
||||
|
||||
.c-id {width: 50px;}
|
||||
.c-pri, .c-keywords, .c-review {width: 100px;}
|
||||
.c-pri, .c-keywords {width: 100px;}
|
||||
.c-branch, .c-type {width: 120px;}
|
||||
.c-stage {width: 140px;}
|
||||
.c-precondition {width: 150px;}
|
||||
.c-story {width: 180px;}
|
||||
.c-review{width: 105px;}
|
||||
|
||||
@@ -40,5 +40,6 @@
|
||||
.title-group.required > .required:after {display: block; right: 29px; top: 5px;}
|
||||
.pri-selector > .btn {padding: 5px 8px !important; width: 100%;}
|
||||
.pri-selector > .dropdown-menu {padding: 10px;}
|
||||
.stageBox {padding-left: 15px !important;}
|
||||
|
||||
#refresh {margin-left: 7px;}
|
||||
#refresh {margin-left: 7px;}
|
||||
@@ -29,16 +29,41 @@ $(document).ready(function()
|
||||
|
||||
$('#customField').click(function()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var required = ',' + requiredFields + ',';
|
||||
if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled');
|
||||
});
|
||||
hiddenRequireFields();
|
||||
});
|
||||
|
||||
/* Implement a custom form without feeling refresh. */
|
||||
$('#formSettingForm .btn-primary').click(function()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled');
|
||||
var fields = '';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function()
|
||||
{
|
||||
fields += ',' + $(this).val();
|
||||
});
|
||||
|
||||
var link = createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=batchCreateFields');
|
||||
$.post(link, {'fields' : fields}, function()
|
||||
{
|
||||
showCheckedFields(fields);
|
||||
$('#formSetting').parent().removeClass('open');
|
||||
|
||||
var fieldCount = $('#batchCreateForm .table thead>tr>th:visible').length;
|
||||
$('.form-actions').attr('colspan', fieldCount);
|
||||
|
||||
if(fieldCount > 8)
|
||||
{
|
||||
$('#batchCreateForm > .table-responsive').removeClass('scroll-none');
|
||||
$('#batchCreateForm > .table-responsive').css('overflow', 'auto');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#batchCreateForm > .table-responsive').addClass('scroll-none');
|
||||
$('#batchCreateForm > .table-responsive').css('overflow', 'visible');
|
||||
}
|
||||
|
||||
if($('#batchCreateForm table thead tr th.c-title').width() < 170) $('#batchCreateForm table thead tr th.c-title').width('170');
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -116,17 +116,7 @@ $(function()
|
||||
|
||||
$('#customField').click(function()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var required = ',' + requiredFields + ',';
|
||||
if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled');
|
||||
});
|
||||
});
|
||||
|
||||
$('#formSettingForm .btn-primary').click(function()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled');
|
||||
hiddenRequireFields();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ function loadStories(productID, moduleID, num)
|
||||
if(!stories) stories = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
|
||||
if(config.currentMethod == 'batchcreate')
|
||||
{
|
||||
for(var i = num; i < 10 ; i ++)
|
||||
for(var i = num; i <= itemIndex ; i ++)
|
||||
{
|
||||
if(i != num && $('#module' + i).val() != 'ditto') break;
|
||||
var nowStories = stories.replaceAll('story' + num, 'story' + i);
|
||||
@@ -426,3 +426,50 @@ function setModules(branchID, productID, num)
|
||||
$('#plan' + (num + 1)).trigger("chosen:updated");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show checked fields.
|
||||
*
|
||||
* @param string fields
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function showCheckedFields(fields)
|
||||
{
|
||||
showFields = fields;
|
||||
|
||||
var fieldList = ',' + fields + ',';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var $field = config.currentMethod == 'create' ? $('#' + $(this).val()) : $('[name^=' + $(this).val() + ']');
|
||||
var required = ',' + requiredFields + ',';
|
||||
var $fieldBox = $('.' + $(this).val() + 'Box' );
|
||||
if(fieldList.indexOf(field) >= 0 || required.indexOf(field) >= 0)
|
||||
{
|
||||
$fieldBox.removeClass('hidden');
|
||||
$field.removeAttr('disabled');
|
||||
}
|
||||
else if(!$fieldBox.hasClass('hidden'))
|
||||
{
|
||||
$fieldBox.addClass('hidden');
|
||||
$field.attr('disabled', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Hidden require field.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function hiddenRequireFields()
|
||||
{
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
|
||||
{
|
||||
var field = ',' + $(this).val() + ',';
|
||||
var required = ',' + requiredFields + ',';
|
||||
if(required.indexOf(field) >= 0) $(this).closest('div').addClass('hidden');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -156,4 +156,28 @@ $(function()
|
||||
});
|
||||
|
||||
$('#subNavbar li[data-id="testcase"]').addClass('active');
|
||||
|
||||
$('#customField').click(function()
|
||||
{
|
||||
hiddenRequireFields();
|
||||
});
|
||||
|
||||
/* Implement a custom form without feeling refresh. */
|
||||
$('#formSettingForm .btn-primary').click(function()
|
||||
{
|
||||
var fields = '';
|
||||
$('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function()
|
||||
{
|
||||
fields += ',' + $(this).val();
|
||||
});
|
||||
|
||||
var link = createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=createFields');
|
||||
$.post(link, {'fields' : fields}, function()
|
||||
{
|
||||
showCheckedFields(fields);
|
||||
$('#formSetting').parent().removeClass('open');
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<?php js::set('productID', $productID);?>
|
||||
<?php js::set('branch', $branch);?>
|
||||
<?php js::set('requiredFields', $config->testcase->create->requiredFields)?>
|
||||
<?php js::set('showFields', $showFields);?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="main-header">
|
||||
<h2>
|
||||
@@ -54,16 +55,16 @@
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='c-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='c-branch<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo $lang->product->branch;?></th>
|
||||
<th class='c-module<?php echo zget($visibleFields, 'module', ' hidden') . zget($requiredFields, 'module', '', ' required');?>'><?php echo $lang->testcase->module;?></th>
|
||||
<th class='c-story<?php echo zget($visibleFields, 'story', ' hidden') . zget($requiredFields, 'story', '', ' required'); echo $hiddenStory;?>'> <?php echo $lang->testcase->story;?></th>
|
||||
<th class='c-branch<?php echo zget($visibleFields, $product->type, ' hidden')?> branchBox'><?php echo $lang->product->branch;?></th>
|
||||
<th class='c-module<?php echo zget($visibleFields, 'module', ' hidden') . zget($requiredFields, 'module', '', ' required');?> moduleBox'><?php echo $lang->testcase->module;?></th>
|
||||
<th class='c-story<?php echo zget($visibleFields, 'story', ' hidden') . zget($requiredFields, 'story', '', ' required'); echo $hiddenStory;?> storyBox'> <?php echo $lang->testcase->story;?></th>
|
||||
<th class='text-left required has-btn c-title'><?php echo $lang->testcase->title;?></th>
|
||||
<th class='c-type text-left required'><?php echo $lang->testcase->type;?></th>
|
||||
<th class='c-pri<?php echo zget($visibleFields, 'pri', ' hidden') . zget($requiredFields, 'pri', '', ' required')?>'><?php echo $lang->testcase->pri;?></th>
|
||||
<th class='c-precondition<?php echo zget($visibleFields, 'precondition', ' hidden') . zget($requiredFields, 'precondition', '', ' required')?>'><?php echo $lang->testcase->precondition;?></th>
|
||||
<th class='c-keywords<?php echo zget($visibleFields, 'keywords', ' hidden') . zget($requiredFields, 'keywords', '', ' required')?>'><?php echo $lang->testcase->keywords;?></th>
|
||||
<th class='c-stage<?php echo zget($visibleFields, 'stage', ' hidden') . zget($requiredFields, 'stage', '', ' required')?>'><?php echo $lang->testcase->stage;?></th>
|
||||
<th class='c-review<?php echo zget($visibleFields, 'review', ' hidden') . zget($requiredFields, 'review', '', ' required')?>'><?php echo $lang->testcase->review;?></th>
|
||||
<th class='c-pri<?php echo zget($visibleFields, 'pri', ' hidden') . zget($requiredFields, 'pri', '', ' required')?> priBox'><?php echo $lang->testcase->pri;?></th>
|
||||
<th class='c-precondition<?php echo zget($visibleFields, 'precondition', ' hidden') . zget($requiredFields, 'precondition', '', ' required')?> preconditionBox'><?php echo $lang->testcase->precondition;?></th>
|
||||
<th class='c-keywords<?php echo zget($visibleFields, 'keywords', ' hidden') . zget($requiredFields, 'keywords', '', ' required')?> keywordsBox'><?php echo $lang->testcase->keywords;?></th>
|
||||
<th class='c-stage<?php echo zget($visibleFields, 'stage', ' hidden') . zget($requiredFields, 'stage', '', ' required')?> stageBox'><?php echo $lang->testcase->stage;?></th>
|
||||
<th class='c-review<?php echo zget($visibleFields, 'review', ' hidden') . zget($requiredFields, 'review', '', ' required')?> reviewBox'><?php echo $lang->testcase->review;?></th>
|
||||
<?php
|
||||
$extendFields = $this->testcase->getFlowExtendFields();
|
||||
foreach($extendFields as $extendField)
|
||||
@@ -86,9 +87,9 @@
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $i+1;?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[$i]", $branches, $branch, "class='form-control' onchange='setModules(this.value, $productID, $i)'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen' onchange='loadStories($productID, this.value, $i)' data-drop_direction='down'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>' style='overflow:visible'> <?php echo html::select("story[$i]", $storyPairs, $story ? $story->id : '', 'class="form-control chosen"');?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?> branchBox'><?php echo html::select("branch[$i]", $branches, $branch, "class='form-control' onchange='setModules(this.value, $productID, $i)'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?> moduleBox' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen' onchange='loadStories($productID, this.value, $i)' data-drop_direction='down'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?> storyBox' style='overflow:visible'> <?php echo html::select("story[$i]", $storyPairs, $story ? $story->id : '', 'class="form-control chosen"');?></td>
|
||||
<td style='overflow:visible'>
|
||||
<div class="input-control has-icon-right">
|
||||
<?php echo html::input("title[$i]", '', "class='form-control title-import'");?>
|
||||
@@ -102,11 +103,11 @@
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::select("type[$i]", $lang->testcase->typeList, $type, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pri[$i]", $lang->testcase->priList, $pri, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'precondition', 'hidden')?>'><?php echo html::textarea("precondition[$i]", '', "rows='1' class='form-control autosize'")?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?>'> <?php echo html::input("keywords[$i]", '', "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'stage', ' hidden')?>' style='overflow:visible'><?php echo html::select("stage[$i][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?>'><?php echo html::select("needReview[$i]", $lang->testcase->reviewList, $needReview, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?> priBox'><?php echo html::select("pri[$i]", $lang->testcase->priList, $pri, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'precondition', 'hidden')?> preconditionBox'><?php echo html::textarea("precondition[$i]", '', "rows='1' class='form-control autosize'")?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?> keywordsBox'><?php echo html::input("keywords[$i]", '', "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'stage', ' hidden')?> stageBox' style='overflow:visible'><?php echo html::select("stage[$i][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?> reviewBox'><?php echo html::select("needReview[$i]", $lang->testcase->reviewList, $needReview, "class='form-control'");?></td>
|
||||
<?php
|
||||
$this->loadModel('flow');
|
||||
foreach($extendFields as $extendField) echo "<td" . (($extendField->control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . "</td>";
|
||||
@@ -126,13 +127,14 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php js::set('itemIndex', -- $i);?>
|
||||
<table class='template' id='trTemp'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center">%s</td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[%s]", $branches, $branch, "class='form-control chosen' onchange='setModules(this.value, $productID, \"%s\")'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[%s]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen' onchange='loadStories($productID, this.value, \"%s\")' data-drop_direction='down'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>' style='overflow:visible'> <?php echo html::select("story[%s]", '', '', 'class="form-control chosen"');?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?> branchBox'><?php echo html::select("branch[%s]", $branches, $branch, "class='form-control chosen' onchange='setModules(this.value, $productID, \"%s\")'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?> moduleBox' style='overflow:visible'><?php echo html::select("module[%s]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen' onchange='loadStories($productID, this.value, \"%s\")' data-drop_direction='down'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?> storyBox' style='overflow:visible'> <?php echo html::select("story[%s]", $storyPairs, '', 'class="form-control chosen"');?></td>
|
||||
<td style='overflow:visible'>
|
||||
<div class="input-control has-icon-right">
|
||||
<?php echo html::input("title[%s]", '', "class='form-control title-import'");?>
|
||||
@@ -146,11 +148,11 @@
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::select("type[%s]", $lang->testcase->typeList, $type, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pri[%s]", $lang->testcase->priList, $pri, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'precondition', 'hidden')?>'><?php echo html::textarea("precondition[%s]", '', "rows='1' class='form-control'")?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?>'> <?php echo html::input("keywords[%s]", '', "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'stage', ' hidden')?>' style='overflow:visible'><?php echo html::select("stage[%s][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?>'><?php echo html::select("needReview[%s]", $lang->testcase->reviewList, $needReview, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?> priBox'><?php echo html::select("pri[%s]", $lang->testcase->priList, $pri, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'precondition', 'hidden')?> preconditionBox'><?php echo html::textarea("precondition[%s]", '', "rows='1' class='form-control'")?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?> keywordsBox'><?php echo html::input("keywords[%s]", '', "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'stage', ' hidden')?> stageBox' style='overflow:visible'><?php echo html::select("stage[%s][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?> reviewBox'><?php echo html::select("needReview[%s]", $lang->testcase->reviewList, $needReview, "class='form-control chosen'");?></td>
|
||||
<?php
|
||||
$this->loadModel('flow');
|
||||
foreach($extendFields as $extendField) echo "<td" . (($extendField->control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[%s]") . "</td>";
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<?php js::set('confirmUnlinkTesttask', $lang->testcase->confirmUnlinkTesttask);?>
|
||||
<?php js::set('isLibCase', $isLibCase);?>
|
||||
<?php js::set('requiredFields', $config->testcase->edit->requiredFields)?>
|
||||
<?php js::set('showFields', $showFields);?>
|
||||
<div id="mainContent" class="main-content">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->testcase->common . $lang->colon . $lang->testcase->batchEdit;?></h2>
|
||||
|
||||
@@ -21,6 +21,14 @@
|
||||
<?php js::set('tab', $this->app->tab);?>
|
||||
<?php if($this->app->tab == 'execution') js::set('objectID', $executionID);?>
|
||||
<?php if($this->app->tab == 'project') js::set('objectID', $projectID);?>
|
||||
<?php
|
||||
foreach(explode(',', $config->testcase->create->requiredFields) as $field)
|
||||
{
|
||||
if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field;
|
||||
}
|
||||
?>
|
||||
<?php js::set('requiredFields', $config->testcase->create->requiredFields);?>
|
||||
<?php js::set('showFields', $showFields);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
@@ -30,12 +38,6 @@
|
||||
<?php include '../../common/view/customfield.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
foreach(explode(',', $config->testcase->create->requiredFields) as $field)
|
||||
{
|
||||
if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field;
|
||||
}
|
||||
?>
|
||||
<form class='load-indicator main-form form-ajax' method='post' enctype='multipart/form-data' id='dataform' data-type='ajax'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
@@ -68,7 +70,8 @@
|
||||
<?php unset($lang->testcase->typeList['unit']);?>
|
||||
<td><?php echo html::select('type', $lang->testcase->typeList, $type, "class='form-control chosen'");?></td>
|
||||
<?php if(strpos(",$showFields,", 'stage') !== false):?>
|
||||
<td style='padding-left:15px'>
|
||||
<?php $hiddenStage = strpos(",$showFields,", 'stage') !== false ? '' : 'hidden';?>
|
||||
<td class="<?php echo $hiddenStage?> stageBox">
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon w-80px'><?php echo $lang->testcase->stage?></span>
|
||||
<?php echo html::select('stage[]', $lang->testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
|
||||
@@ -76,8 +79,8 @@
|
||||
</td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php if(strpos(",$showFields,", ',story,') !== false):?>
|
||||
<tr>
|
||||
<?php $hiddenStory = strpos(",$showFields,", ',story,') !== false ? '' : 'hidden';?>
|
||||
<tr class="<?php echo $hiddenStory?> storyBox">
|
||||
<th><?php echo $lang->testcase->lblStory;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group' id='storyIdBox'>
|
||||
@@ -93,7 +96,6 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->title;?></th>
|
||||
<td colspan='2'>
|
||||
@@ -108,8 +110,8 @@
|
||||
<input type="hidden" class="colorpicker" id="color" name="color" value="" data-icon="color" data-wrapper="input-control-icon-right" data-update-color="#title" data-provide="colorpicker">
|
||||
</div>
|
||||
</div>
|
||||
<?php if(strpos(",$showFields,", ',pri,') !== false): // begin print pri selector?>
|
||||
<span class="input-group-addon fix-border br-0"><?php echo $lang->testcase->pri;?></span>
|
||||
<?php $hiddenPri = strpos(",$showFields,", ',pri,') !== false ? '' : 'hidden';?>
|
||||
<span class="input-group-addon fix-border br-0 <?php echo $hiddenPri;?> priBox"><?php echo $lang->testcase->pri;?></span>
|
||||
<?php
|
||||
$hasCustomPri = false;
|
||||
foreach($lang->testcase->priList as $priKey => $priValue)
|
||||
@@ -129,10 +131,10 @@
|
||||
}
|
||||
?>
|
||||
<?php if($hasCustomPri):?>
|
||||
<?php echo html::select('pri', (array)$priList, $pri, "class='form-control'");?>
|
||||
<?php echo html::select('pri', (array)$priList, $pri, "class='form-control priBox $hiddenPri'");?>
|
||||
<?php else: ?>
|
||||
<?php ksort($priList);?>
|
||||
<div class="input-group-btn pri-selector" data-type="pri">
|
||||
<div class="input-group-btn pri-selector priBox <?php echo $hiddenPri;?>" data-type="pri">
|
||||
<button type="button" class="btn dropdown-toggle br-0" data-toggle="dropdown">
|
||||
<span class="pri-text"><span class="label-pri label-pri-<?php echo empty($pri) ? '0' : $pri?>" title="<?php echo $pri?>"><?php echo $pri?></span></span> <span class="caret"></span>
|
||||
</button>
|
||||
@@ -141,7 +143,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; // end print pri selector ?>
|
||||
<?php if(!$this->testcase->forceNotReview()):?>
|
||||
<span class="input-group-addon"><?php echo html::checkbox('forceNotReview', $lang->testcase->forceNotReview, '', "id='forceNotReview0'");?></span>
|
||||
<?php endif;?>
|
||||
@@ -220,12 +221,11 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(strpos(",$showFields,", ',keywords,') !== false):?>
|
||||
<tr>
|
||||
<?php $hiddenKeywords = strpos(",$showFields,", ',keywords,') !== false ? '' : 'hidden';?>
|
||||
<tr class="<?php echo $hiddenKeywords?> keywordsBox">
|
||||
<th><?php echo $lang->testcase->keywords;?></th>
|
||||
<td colspan='2'><?php echo html::input('keywords', $keywords, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='hide'>
|
||||
<th><?php echo $lang->testcase->status;?></th>
|
||||
<td><?php echo html::hidden('status', 'normal');?></td>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user