From 66ce378726d8bc4a76b7b11c49a78926b4f9171d Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 25 Jan 2019 10:36:56 +0800 Subject: [PATCH] * Fix bug #5248, #5260, #5263, #5266. --- module/group/css/browse.css | 2 + module/project/view/kanban.html.php | 2 +- module/testcase/view/create.html.php | 2 +- module/testtask/control.php | 2 +- module/testtask/js/runcase.js | 68 +++++++++++++++------------- module/todo/view/view.html.php | 2 +- 6 files changed, 43 insertions(+), 35 deletions(-) diff --git a/module/group/css/browse.css b/module/group/css/browse.css index 1cb346bdb58..fd03a05ba47 100644 --- a/module/group/css/browse.css +++ b/module/group/css/browse.css @@ -1 +1,3 @@ .user {display:block; width:80px; float:left; overflow:hidden} + +#groupList tbody tr.even td{word-wrap:break-word;} diff --git a/module/project/view/kanban.html.php b/module/project/view/kanban.html.php index ecb6bf0ad95..2806e366be5 100644 --- a/module/project/view/kanban.html.php +++ b/module/project/view/kanban.html.php @@ -159,7 +159,7 @@
" . zget($realnames, $bug->assignedTo) . ""; - if(empty($task->assignedTo)) $assignedToRealName = "{$lang->task->noAssigned}"; + if(empty($bug->assignedTo)) $assignedToRealName = "{$lang->task->noAssigned}"; echo html::a($this->createLink('bug', 'assignTo', "bugID={$bug->id}", '', true), ' ' . $assignedToRealName, '', 'class="btn btn-icon-left kanbaniframe bug-assignedTo"');?> bug->statusList, $bug->status);?>
diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 06770287302..b300f596854 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -70,7 +70,7 @@ searchMore . '"');?> - + createLink('story', 'view', "storyID=$storyID", '', true), $lang->preview, '', "class='btn' id='preview'");?> diff --git a/module/testtask/control.php b/module/testtask/control.php index 8a18e5c1090..fb6e695005d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -831,7 +831,7 @@ public function runCase($runID, $caseID = 0, $version = 0) $caseResult = $this->testtask->createResult($runID); if(dao::isError()) die(js::error(dao::getError())); - if('fail' == $caseResult) { + if($caseResult == 'fail') { $response['result'] = 'success'; $response['locate'] = $this->createLink('testtask', 'results',"runID=$runID&caseID=$caseID&version=$version"); diff --git a/module/testtask/js/runcase.js b/module/testtask/js/runcase.js index 27843e6918d..ca33d440ee3 100644 --- a/module/testtask/js/runcase.js +++ b/module/testtask/js/runcase.js @@ -52,46 +52,52 @@ function loadFilesName() $(document).ready(function() { // First unbind ajaxForm for form. - $("form[data-type='ajax']").unbind('submit'); + $("#dataform").unbind('submit'); // Bind ajaxForm for form again. - $.ajaxForm("form[data-type='ajax']", function(response) - { - if(response.locate) + $('#dataform').ajaxForm( + { + finish:function(response) { - if(response.locate == 'reload' && response.target == 'parent') + if(response.locate) { - parent.$.cookie('selfClose', 1); - parent.$.closeModal(null, 'this'); - } else if(response.next) { - location.href = response.locate; - } else { - - // Get cases result - $('#resultsContainer').load(response.locate + " #casesResults", function() + if(response.locate == 'reload' && response.target == 'parent') { - $('tr:first').addClass("show-detail"); - $('#tr-detail_1').removeClass("hide"); - - $('.result-item').click(function() + parent.$.cookie('selfClose', 1); + parent.$.closeModal(null, 'this'); + } + else if(response.next) + { + location.href = response.locate; + } + else + { + // Get cases result + $('#resultsContainer').load(response.locate + " #casesResults", function() { - var $this = $(this); - $this.toggleClass('show-detail'); - var show = $this.hasClass('show-detail'); - $this.next('.result-detail').toggleClass('hide', !show); - $this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show); - }); + $('tr:first').addClass("show-detail"); + $('#tr-detail_1').removeClass("hide"); - $('#casesResults table caption .result-tip').html($('#resultTip').html()); + $('.result-item').click(function() + { + var $this = $(this); + $this.toggleClass('show-detail'); + var show = $this.hasClass('show-detail'); + $this.next('.result-detail').toggleClass('hide', !show); + $this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show); + }); - $("#submit").text(caseResultSave); - $("#submit").attr({"disabled":"disabled"}); - }); - } + $('#casesResults table caption .result-tip').html($('#resultTip').html()); + + $("#submit").text(caseResultSave); + $("#submit").attr({"disabled":"disabled"}); + }); + } + } + + return false; } - - return false; - }); + }); $(document).on('click', ".step-group input[type='checkbox']", function() { diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index 72240e1a13c..6c55be83c75 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -45,7 +45,7 @@ common::printLink('todo', 'edit', "todoID=$todo->id", "", '', "title='{$lang->todo->edit}' class='btn showinonlybody'"); common::printLink('todo', 'delete', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'"); - echo html::a('#commentModal', '', '', "title='{$lang->comment}' data-toggle='modal' class='btn'"); + if(common::hasPriv('action', 'comment', $todo)) echo html::a('#commentModal', '', '', "title='{$lang->comment}' data-toggle='modal' class='btn'"); if($this->session->todoList) {