This commit is contained in:
daitingting
2017-05-02 17:05:56 +08:00
10 changed files with 72 additions and 54 deletions
+4 -1
View File
@@ -226,7 +226,10 @@ class baseHelper
$extModelClass = 'ext' . $modelClass;
$extTmpModelClass = 'tmpExt' . $modelClass;
$modelLines = "<?php\n";
$modelLines .= "helper::import('$mainModelFile');\n";
$modelLines .= "global \$app;\n";
$modelLines .= "helper::cd(\$app->getBasePath());\n";
$modelLines .= "helper::import('" . str_replace($app->getBasePath(), '.' . DS, $mainModelFile) . "');\n";
$modelLines .= "helper::cd();\n";
$modelLines .= "class $extTmpModelClass extends $modelClass \n{\n";
/* Cycle all the extension files. */
+1 -1
View File
@@ -9,7 +9,7 @@ $(function()
moduleID = $('#module').val();
assignedto = $('#assignedTo').val();
changeProductConfirmed = true;
oldStoryID = 0;
oldStoryID = $('#story').val() || 0;
oldProjectID = 0;
oldOpenedBuild = '';
oldTaskID = 0;
+19 -1
View File
@@ -71,7 +71,7 @@ EOT;
<td><?php echo html::radio('needReview', $lang->custom->reviewList, $needReview);?></td>
<td></td>
</tr>
<tr>
<tr <?php if($needReview and $module == 'testcase') echo "class='hidden'"?>>
<th><?php echo $lang->custom->forceReview;?></th>
<td><?php echo html::select('forceReview[]', $users, $forceReview, "class='form-control chosen' multiple");?></td>
<td class='w-180px'><?php printf($lang->custom->notice->forceReview, $lang->$module->common);?></td>
@@ -162,4 +162,22 @@ EOT;
</div>
</form>
</div>
<?php if($module == 'testcase' and $field == 'review'):?>
<script>
$(function()
{
$("input[name='needReview']").change(function()
{
if($(this).val() == 0)
{
$('#forceReview').closest('tr').removeClass('hidden');
}
else
{
$('#forceReview').closest('tr').addClass('hidden');
}
})
})
</script>
<?php endif;?>
<?php include '../../common/view/footer.html.php';?>
+1
View File
@@ -1308,6 +1308,7 @@ class storyModel extends model
*/
public function getProductStoryPairs($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $order = 'id_desc', $limit = 0)
{
if($branch) $branch = "0,$branch";//Fix bug 1059.
$stories = $this->dao->select('t1.id, t1.title, t1.module, t1.pri, t1.estimate, t2.name AS product')
->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('1=1')
+1 -11
View File
@@ -21,17 +21,7 @@
#steps.sortable-sorting > tr.drag-row + tr > td {box-shadow: inset 0 4px 2px rgba(0,0,0,.2)}
#steps.sortable-sorting > tr.drag-row > td {background-color: #edf3fe!important}
#steps.sortable > tr.drop-success > td {background-color: #cfe0ff; transition: background-color 2s;}
#steps .step-type-toggle {padding: 0}
#steps .step-type-menu-box {position: relative;}
#steps .step-type-menu {position: absolute; top: 25px; right: 0; z-index: 10; box-shadow: 0 6px 12px rgba(0,0,0,.175); background-color: #fff; display: none; border: 1px solid #bbb; min-width: 60px;}
#steps .step-step[data-type="item"] .step-type-menu > a[data-value="item"] {display: none}
#steps .step-type-current {display: block; padding: 5px 10px; position: relative; line-height: 20px;}
#steps .step-type-toggle:hover .step-type-current {background-color: #edf3fe; color: #03c}
#steps .step-type-menu:hover,
#steps .step-type-toggle:hover .step-type-menu {display: table; padding: 2px}
#steps .step-type-menu > a {display: table-cell; padding: 8px 10px; color: #666;}
#steps .step-type-menu > a:hover {color: #333; background-color: #e5e5e5;}
#steps .step-type-menu > a.active {color: #fff; background-color: #1a4f85;}
#steps .step-type-toggle {padding: 5px 11px 5px 7px;}
.table-bordered .step-actions {width: 98px;}
.table-bordered > #steps > tr > td {padding: 0; background-color: #fafafa; border: 1px solid #ddd!important; border-left-style: dotted!important; border-right-style: dotted!important;}
+38 -17
View File
@@ -142,7 +142,7 @@ function initSteps(selector)
var $stepTemplate = $('#stepTemplate').detach().removeClass('template').attr('id', null);
var initSortableCallTask = null;
var groupNameText = $steps.data('groupName');
var insertStepRow = function($row, count, type)
var insertStepRow = function($row, count, type, notFocus)
{
if(count === undefined) count = 1;
for(var i = 0; i < count; ++i)
@@ -151,25 +151,25 @@ function initSteps(selector)
if($row) $row.after($step);
else $steps.append($step);
$step.addClass('step-new');
setTimeout(function(){$step.find('.step-steps').focus();}, 10);
if(type) $step.find('step-type').val(type);
if(!notFocus) setTimeout(function(){$step.find('.step-steps').focus();}, 10);
}
};
var updateStepType = function($step, type)
{
var targetIsGroup = type =='group';
$step.attr('data-type', type).find('.step-steps').toggleClass('autosize', !targetIsGroup).attr('placeholder', targetIsGroup ? groupNameText : null).focus();
var displayType = (type =='item' && $step.hasClass('step-step')) ? 'step' : type;
var activeTypeText = $step.find('.step-type-menu > a').removeClass('active').filter('[data-value="' + displayType + '"]').addClass('active').text();
$step.find('.step-type-current > span').text(activeTypeText);
};
var getStepsElements = function()
{
return $steps.children('.step:not(.drag-shadow)');
};
var refreshSteps = function()
{
var parentId = 1, childId = 0;
$steps.children('.step:not(.drag-shadow)').each(function(idx)
getStepsElements().each(function(idx)
{
var $step = $(this);
var $step = $(this).attr('data-index', idx + 1);
var type = $step.find('.step-type').val();
var stepID;
if(type == 'group')
@@ -186,14 +186,14 @@ function initSteps(selector)
$step.find('.step-id').text(stepID);
childId = 0;
}
else
else // step type is not set
{
if(childId) // as child
if(childId) // type as child
{
stepID = (parentId - 1) + '.' + (childId++);
$step.removeClass('step-step step-group').addClass('step-item').find('.step-item-id').text(stepID);
}
else
else // type as step
{
$step.removeClass('step-item step-group').addClass('step-step');
stepID = parentId++;
@@ -229,7 +229,7 @@ function initSteps(selector)
{
if(!isMouseDown) return;
var $targetStep = $(this);
$steps.children('.step').each(function(idx)
getStepsElements().each(function(idx)
{
$(this).data('order', idx);
});
@@ -252,14 +252,35 @@ function initSteps(selector)
refreshSteps();
}).on('click', '.btn-step-delete', function()
{
if($('tbody#steps tr.step').size() == 1) return false;
if($steps.children('.step').length == 1) return;
$(this).closest('.step').remove();
refreshSteps();
}).on('click', '.step-type-menu a', function()
}).on('change', '.step-group-toggle', function()
{
var $a = $(this);
$a.closest('.step').find('.step-type').val($a.data('value'));
var $checkbox = $(this);
var $step = $checkbox.closest('.step');
var isChecked = $checkbox.is(':checked');
var suggestType = isChecked ? 'group' : 'item';
if(!isChecked)
{
var $prevStep = $step.prev('.step:not(.drag-shadow)');
var suggestChild = $prevStep.length && $prevStep.is('.step-group') && $step.next('.step:not(.drag-shadow)').length;
suggestType = suggestChild ? 'item' : 'step';
}
$step.find('.step-type').val(suggestType);
refreshSteps();
}).on('change', '.form-control', function()
{
var $control = $(this);
if($control.val())
{
var $step = $control.closest('.step');
if($step.data('index') === getStepsElements().length)
{
insertStepRow($step, 1, 'step', false);
refreshSteps();
}
}
});
initSortable();
refreshSteps();
+2 -3
View File
@@ -1352,12 +1352,11 @@ class testcaseModel extends model
* Check whether force review
*
* @access public
* @return void
* @return bool
*/
public function forceReview()
{
if(!$this->config->testcase->needReview) return false;
if(empty($this->config->testcase->forceReview)) return true;
if($this->config->testcase->needReview) return true;
if(strpos(",{$this->config->testcase->forceReview},", ",{$this->app->user->account},") !== false) return true;
return false;
}
+2 -16
View File
@@ -147,14 +147,7 @@
<textarea rows='1' class='form-control autosize step-steps' name='steps[]'></textarea>
<span class="input-group-addon step-type-toggle">
<input type='hidden' name='stepType[]' value='item' class='step-type'>
<div class='step-type-menu-box'>
<div class='step-type-current'><span></span> <i class='caret'></i></div>
<div class='step-type-menu'>
<a href='javascript:;' href='step-type-option' data-value='step'><?php echo $lang->testcase->step ?></a>
<a href='javascript:;' href='step-type-option' data-value='group'><?php echo $lang->testcase->group ?></a>
<a href='javascript:;' href='step-type-option' data-value='item'><?php echo $lang->testcase->stepChild ?></a>
</div>
</div>
<label class="checkbox-inline"><input type="checkbox" class='step-group-toggle'> <?php echo $lang->testcase->group ?></label>
</span>
</div>
</td>
@@ -177,14 +170,7 @@
<span class='input-group-addon step-type-toggle'>
<?php if(!isset($step->type)) $step->type = 'step';?>
<input type='hidden' name='stepType[]' value='<?php echo $step->type;?>' class='step-type'>
<div class='step-type-menu-box'>
<div class='step-type-current'><span></span> <i class='caret'></i></div>
<div class='step-type-menu'>
<a href='javascript:;' href='step-type-option' data-value='step'><?php echo $lang->testcase->step ?></a>
<a href='javascript:;' href='step-type-option' data-value='group'><?php echo $lang->testcase->group ?></a>
<a href='javascript:;' href='step-type-option' data-value='item'><?php echo $lang->testcase->stepChild ?></a>
</div>
</div>
<label class="checkbox-inline"><input type="checkbox" class='step-group-toggle'<?php if($step->type === 'group') echo ' checked' ?>> <?php echo $lang->testcase->group ?></label>
</span>
</div>
</td>
+2 -3
View File
@@ -919,10 +919,9 @@ class testtask extends control
$results = $this->testtask->getResults($runID);
$testtaskID = $this->dao->select('task')->from(TABLE_TESTRUN)->where('id')->eq($runID)->fetch('task');
$testtask = $this->dao->select('build, product')->from(TABLE_TESTTASK)->where('id')->eq($testtaskID)->fetch();
$testtask = $this->dao->select('build, project, product')->from(TABLE_TESTTASK)->where('id')->eq($testtaskID)->fetch();
$this->view->build = isset($builds[$testtask->build]) ? $builds[$testtask->build] : '';
$this->view->testtaskID = $testtaskID;
$this->view->testtask = $testtask;
}
else
{
+2 -1
View File
@@ -47,9 +47,10 @@
<td class='w-60px'><?php if(!empty($result->files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?></td>
<td class='w-50px text-center'><i class='collapse-handle icon-chevron-down text-muted'></i></td>
</tr>
<?php $params = isset($testtask) ? "testtask=$testtask->id,projectID=$testtask->project,buildID=$testtask->build" : '';?>
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
<td colspan='7' class='pd-0'>
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . (isset($testtaskID) ? ",testtask=$testtaskID" : ''))?>' target='_blank' method='post'>
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'>
<table class='table table-condensed borderless mg-0 resultSteps'>
<thead>
<tr>