From 2f91b01a490000ec90b1db7b0befc107ac165c70 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 2 May 2017 09:24:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?Finish=20task#2986=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E7=9A=84=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD,cost:1=20left:0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/custom/view/set.html.php | 20 +++++++++++++++++++- module/testcase/model.php | 5 ++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index 24de73e42d..9f5b0ce39b 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -69,7 +69,7 @@ EOT; custom->reviewList, $needReview);?> - + > custom->forceReview;?> custom->notice->forceReview, $lang->$module->common);?> @@ -160,4 +160,22 @@ EOT; + + + diff --git a/module/testcase/model.php b/module/testcase/model.php index 87eab58da7..1523ff5da7 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -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; } From 53653b057287aa17ef7fd392ce21bf6e91cd8ba5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 2 May 2017 10:05:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?Finish=20task#3002=20=E7=A6=85=E9=81=93?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E7=9B=AE=E5=BD=95=E4=B9=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?model=E4=B8=B4=E6=97=B6=E6=96=87=E4=BB=B6=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90=E3=80=82?= =?UTF-8?q?,cost:1=20left:0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/base/helper.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index df9946f0cb..c6bdcd99ff 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -226,7 +226,10 @@ class baseHelper $extModelClass = 'ext' . $modelClass; $extTmpModelClass = 'tmpExt' . $modelClass; $modelLines = "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. */ From a453c5fdef7f286cea037845d4aa254e98fe1ea9 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Tue, 2 May 2017 10:50:28 +0800 Subject: [PATCH 3/5] * finish task #3017. --- module/bug/js/common.js | 2 +- module/testtask/control.php | 5 ++--- module/testtask/view/results.html.php | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 4a2d943243..7734e9f505 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -9,7 +9,7 @@ $(function() moduleID = $('#module').val(); assignedto = $('#assignedTo').val(); changeProductConfirmed = true; - oldStoryID = 0; + oldStoryID = $('#story').val() || 0; oldProjectID = 0; oldOpenedBuild = ''; oldTaskID = 0; diff --git a/module/testtask/control.php b/module/testtask/control.php index 385d18573e..0aa4ab1550 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -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 { diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index 0628aeeede..e760c6bc2a 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -47,9 +47,10 @@ files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?> + id,projectID=$testtask->project,buildID=$testtask->build" : '';?> -
product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . (isset($testtaskID) ? ",testtask=$testtaskID" : ''))?>' target='_blank' method='post'> + product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'> From c4b150c4beeb5e2e65873bee51d856825a084b04 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Tue, 2 May 2017 11:00:22 +0800 Subject: [PATCH 4/5] * finish task #3011. --- module/story/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/model.php b/module/story/model.php index 0aa6279f77..a9d1a13304 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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') From 1f5f2256837e4de90731cc39792f98c628d92a50 Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 2 May 2017 15:24:54 +0800 Subject: [PATCH 5/5] * change steps form UI, finish task #2989. --- module/testcase/css/common.css | 12 +----- module/testcase/js/common.js | 55 +++++++++++++++++++--------- module/testcase/view/create.html.php | 18 +-------- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/module/testcase/css/common.css b/module/testcase/css/common.css index d2fbcc157c..fedbdded50 100644 --- a/module/testcase/css/common.css +++ b/module/testcase/css/common.css @@ -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;} diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index 38cec1f3af..4c32979869 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -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(); diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 47c2782b3d..7cb8a42c9e 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -147,14 +147,7 @@ - + @@ -177,14 +170,7 @@ type)) $step->type = 'step';?> - +