From 68fd34d7eb544b07a8230dbabe2f8dcd125599d0 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 30 May 2023 09:49:08 +0800 Subject: [PATCH] * Finish bug batchConfirm and batchAssign and batchChangeModule and batchClose function. --- module/bug/control.php | 2 +- module/bug/js/browse.ui.js | 12 +- module/bug/model.php | 3 +- module/bug/test/model/batchchangemodule.php | 157 -------------------- module/bug/test/model/batchchangeplan.php | 85 ----------- module/bug/test/model/batchconfirm.php | 24 --- module/bug/test/model/batchcreate.php | 117 --------------- module/bug/test/model/batchresolve.php | 104 ------------- module/bug/ui/browse.html.php | 10 +- 9 files changed, 18 insertions(+), 496 deletions(-) delete mode 100755 module/bug/test/model/batchchangemodule.php delete mode 100755 module/bug/test/model/batchchangeplan.php delete mode 100755 module/bug/test/model/batchconfirm.php delete mode 100755 module/bug/test/model/batchcreate.php delete mode 100755 module/bug/test/model/batchresolve.php diff --git a/module/bug/control.php b/module/bug/control.php index f58e471074..42ceb8dc2a 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1078,7 +1078,7 @@ class bug extends control } $load = true; - if($skipBugs) $load = array('confirm' => sprintf($this->lang->bug->skipClose, implode(',', $skipBugs)), 'confirmed' => 'true'); + if($skipBugs) $load = array('confirm' => sprintf($this->lang->bug->skipClose, implode(',', $skipBugs)), 'confirmed' => 'true', 'canceled' => 'true'); if($viewType) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $this->createLink($viewType, 'view', "releaseID=$releaseID&type=bug"), 'closeModal' => true)); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $load, 'closeModal' => true)); diff --git a/module/bug/js/browse.ui.js b/module/bug/js/browse.ui.js index fc4cebe2d3..00a5aba5fa 100644 --- a/module/bug/js/browse.ui.js +++ b/module/bug/js/browse.ui.js @@ -4,8 +4,16 @@ $(document).on('click', '.batch-btn', function() const checkedList = dtable.$.getChecks(); if(!checkedList.length) return; - const form = new FormData(); const url = $(this).data('url'); + const form = new FormData(); checkedList.forEach((id) => form.append('bugIdList[]', id)); - postAndLoadPage(url, form); + + if($(this).hasClass('ajax-btn')) + { + $.ajaxSubmit({url, data:form}); + } + else + { + postAndLoadPage(url, form); + } }); diff --git a/module/bug/model.php b/module/bug/model.php index 1704c9ba02..857275fa74 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -791,10 +791,11 @@ class bugModel extends model * Close a bug. * * @param object $bug + * @param array $output * @access public * @return bool */ - public function close(object $bug, array $output): bool + public function close(object $bug, array $output = array()): bool { $oldBug = $this->getById($bug->id); diff --git a/module/bug/test/model/batchchangemodule.php b/module/bug/test/model/batchchangemodule.php deleted file mode 100755 index a2e91890d1..0000000000 --- a/module/bug/test/model/batchchangemodule.php +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env php -batchChangeModule(); -timeout=0 -cid=1 - -- 修改bug1 2模块为0 - - 第0条的field属性 @module - - 第0条的old属性 @1821 - - 第0条的new属性 @0 - -- 修改bug1 2模块为8 - - 第0条的field属性 @module - - 第0条的old属性 @0 - - 第0条的new属性 @8 - -- 修改bug1 2模块为9 - - 第0条的field属性 @module - - 第0条的old属性 @8 - - 第0条的new属性 @9 - -- 修改bug1 2模块为10 - - 第0条的field属性 @module - - 第0条的old属性 @9 - - 第0条的new属性 @10 - -- 修改bug1 2模块为11 - - 第0条的field属性 @module - - 第0条的old属性 @10 - - 第0条的new属性 @11 - -- 修改bug1 2模块为11 未发生变化 @0 - -- 修改bug1 3模块为0 - - 第0条的field属性 @module - - 第0条的old属性 @11 - - 第0条的new属性 @0 - -- 修改bug1 3模块为8 - - 第0条的field属性 @module - - 第0条的old属性 @0 - - 第0条的new属性 @8 - -- 修改bug1 3模块为9 - - 第0条的field属性 @module - - 第0条的old属性 @8 - - 第0条的new属性 @9 - -- 修改bug1 3模块为10 - - 第0条的field属性 @module - - 第0条的old属性 @9 - - 第0条的new属性 @10 - -- 修改bug1 3模块为11 - - 第0条的field属性 @module - - 第0条的old属性 @10 - - 第0条的new属性 @11 - -- 修改bug1 3模块为11 未发生变化 @0 - -- 修改bug1 4模块为0 - - 第0条的field属性 @module - - 第0条的old属性 @11 - - 第0条的new属性 @0 - -- 修改bug1 4模块为8 - - 第0条的field属性 @module - - 第0条的old属性 @0 - - 第0条的new属性 @8 - -- 修改bug1 4模块为9 - - 第0条的field属性 @module - - 第0条的old属性 @8 - - 第0条的new属性 @9 - -- 修改bug1 4模块为10 - - 第0条的field属性 @module - - 第0条的old属性 @9 - - 第0条的new属性 @10 - -- 修改bug1 4模块为11 - - 第0条的field属性 @module - - 第0条的old属性 @10 - - 第0条的new属性 @11 - -- 修改bug1 4模块为11 未发生变化 @0 - -- 修改bug2 3模块为0 - - 第0条的field属性 @module - - 第0条的old属性 @11 - - 第0条的new属性 @0 - -- 修改bug2 3模块为8 - - 第0条的field属性 @module - - 第0条的old属性 @0 - - 第0条的new属性 @8 - -- 修改bug2 3模块为9 - - 第0条的field属性 @module - - 第0条的old属性 @8 - - 第0条的new属性 @9 - -- 修改bug2 3模块为10 - - 第0条的field属性 @module - - 第0条的old属性 @9 - - 第0条的new属性 @10 - -- 修改bug2 3模块为11 - - 第0条的field属性 @module - - 第0条的old属性 @10 - - 第0条的new属性 @11 - -- 修改bug2 3模块为11 未发生变化 @0 - -*/ - -zdTable('bug')->gen(10); -zdTable('module')->gen(20); - -$bugIDList1 = array('1', '2'); -$bugIDList2 = array('1', '3'); -$bugIDList3 = array('1', '4'); -$bugIDList4 = array('2', '3'); - -$moduleList = array('0', '8', '9', '10', '11'); - -$bug = new bugTest(); -r($bug->batchChangeModuleTest($bugIDList1, $moduleList[0], $bugIDList1[0])) && p('0:field,old,new') && e('module,1821,0');// 修改bug1 2模块为0 -r($bug->batchChangeModuleTest($bugIDList1, $moduleList[1], $bugIDList1[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug1 2模块为8 -r($bug->batchChangeModuleTest($bugIDList1, $moduleList[2], $bugIDList1[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug1 2模块为9 -r($bug->batchChangeModuleTest($bugIDList1, $moduleList[3], $bugIDList1[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug1 2模块为10 -r($bug->batchChangeModuleTest($bugIDList1, $moduleList[4], $bugIDList1[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug1 2模块为11 -r($bug->batchChangeModuleTest($bugIDList1, $moduleList[4], $bugIDList1[1])) && p() && e('0'); // 修改bug1 2模块为11 未发生变化 -r($bug->batchChangeModuleTest($bugIDList2, $moduleList[0], $bugIDList2[0])) && p('0:field,old,new') && e('module,11,0'); // 修改bug1 3模块为0 -r($bug->batchChangeModuleTest($bugIDList2, $moduleList[1], $bugIDList2[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug1 3模块为8 -r($bug->batchChangeModuleTest($bugIDList2, $moduleList[2], $bugIDList2[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug1 3模块为9 -r($bug->batchChangeModuleTest($bugIDList2, $moduleList[3], $bugIDList2[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug1 3模块为10 -r($bug->batchChangeModuleTest($bugIDList2, $moduleList[4], $bugIDList2[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug1 3模块为11 -r($bug->batchChangeModuleTest($bugIDList2, $moduleList[4], $bugIDList2[1])) && p() && e('0'); // 修改bug1 3模块为11 未发生变化 -r($bug->batchChangeModuleTest($bugIDList3, $moduleList[0], $bugIDList3[0])) && p('0:field,old,new') && e('module,11,0'); // 修改bug1 4模块为0 -r($bug->batchChangeModuleTest($bugIDList3, $moduleList[1], $bugIDList3[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug1 4模块为8 -r($bug->batchChangeModuleTest($bugIDList3, $moduleList[2], $bugIDList3[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug1 4模块为9 -r($bug->batchChangeModuleTest($bugIDList3, $moduleList[3], $bugIDList3[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug1 4模块为10 -r($bug->batchChangeModuleTest($bugIDList3, $moduleList[4], $bugIDList3[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug1 4模块为11 -r($bug->batchChangeModuleTest($bugIDList3, $moduleList[4], $bugIDList3[1])) && p() && e('0'); // 修改bug1 4模块为11 未发生变化 -r($bug->batchChangeModuleTest($bugIDList4, $moduleList[0], $bugIDList4[0])) && p('0:field,old,new') && e('module,11,0'); // 修改bug2 3模块为0 -r($bug->batchChangeModuleTest($bugIDList4, $moduleList[1], $bugIDList4[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug2 3模块为8 -r($bug->batchChangeModuleTest($bugIDList4, $moduleList[2], $bugIDList4[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug2 3模块为9 -r($bug->batchChangeModuleTest($bugIDList4, $moduleList[3], $bugIDList4[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug2 3模块为10 -r($bug->batchChangeModuleTest($bugIDList4, $moduleList[4], $bugIDList4[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug2 3模块为11 -r($bug->batchChangeModuleTest($bugIDList4, $moduleList[4], $bugIDList4[1])) && p() && e('0'); // 修改bug2 3模块为11 未发生变化 \ No newline at end of file diff --git a/module/bug/test/model/batchchangeplan.php b/module/bug/test/model/batchchangeplan.php deleted file mode 100755 index 757e50a554..0000000000 --- a/module/bug/test/model/batchchangeplan.php +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env php -batchChangePlan(); -timeout=0 -cid=1 - -- 修改计划为0 未发生变化 @0 - -- 修改计划为计划1 - - 第0条的field属性 @plan - - 第0条的old属性 @0 - - 第0条的new属性 @1 - -- 修改计划为计划2 - - 第0条的field属性 @plan - - 第0条的old属性 @1 - - 第0条的new属性 @2 - -- 修改计划为0 未发生变化 @0 - -- 修改计划为计划1 - - 第0条的field属性 @plan - - 第0条的old属性 @0 - - 第0条的new属性 @1 - -- 修改计划为计划2 - - 第0条的field属性 @plan - - 第0条的old属性 @1 - - 第0条的new属性 @2 - -- 修改计划为0 未发生变化 @0 - -- 修改计划为计划1 - - 第0条的field属性 @plan - - 第0条的old属性 @0 - - 第0条的new属性 @1 - -- 修改计划为计划2 - - 第0条的field属性 @plan - - 第0条的old属性 @1 - - 第0条的new属性 @2 - -- 修改计划为0 未发生变化 @0 - -- 修改计划为计划1 - - 第0条的field属性 @plan - - 第0条的old属性 @0 - - 第0条的new属性 @1 - -- 修改计划为计划2 - - 第0条的field属性 @plan - - 第0条的old属性 @1 - - 第0条的new属性 @2 - -*/ - -zdTable('bug')->gen(200); -zdTable('productplan')->gen(10); - -$bugIDList1 = array('136', '137', '138'); -$bugIDList2 = array('133', '134', '135'); -$bugIDList3 = array('130', '131', '132'); -$bugIDList4 = array('175', '176', '177'); - -$planList = array('0', '1', '2'); - -$bug = new bugTest(); -r($bug->batchChangePlanTest($bugIDList1, $planList[0], $bugIDList1[0])) && p() && e('0'); // 修改计划为0 未发生变化 -r($bug->batchChangePlanTest($bugIDList1, $planList[1], $bugIDList1[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1 -r($bug->batchChangePlanTest($bugIDList1, $planList[2], $bugIDList1[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2 -r($bug->batchChangePlanTest($bugIDList2, $planList[0], $bugIDList2[0])) && p() && e('0'); // 修改计划为0 未发生变化 -r($bug->batchChangePlanTest($bugIDList2, $planList[1], $bugIDList2[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1 -r($bug->batchChangePlanTest($bugIDList2, $planList[2], $bugIDList2[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2 -r($bug->batchChangePlanTest($bugIDList3, $planList[0], $bugIDList3[0])) && p() && e('0'); // 修改计划为0 未发生变化 -r($bug->batchChangePlanTest($bugIDList3, $planList[1], $bugIDList3[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1 -r($bug->batchChangePlanTest($bugIDList3, $planList[2], $bugIDList3[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2 -r($bug->batchChangePlanTest($bugIDList4, $planList[0], $bugIDList4[0])) && p() && e('0'); // 修改计划为0 未发生变化 -r($bug->batchChangePlanTest($bugIDList4, $planList[1], $bugIDList4[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1 -r($bug->batchChangePlanTest($bugIDList4, $planList[2], $bugIDList4[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2 \ No newline at end of file diff --git a/module/bug/test/model/batchconfirm.php b/module/bug/test/model/batchconfirm.php deleted file mode 100755 index 03c60bb3c6..0000000000 --- a/module/bug/test/model/batchconfirm.php +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env php -batchConfirm(); -cid=1 -pid=1 - -批量确认1 3 4 51 81 >> ,1,1,1,1,1 -批量确认2 7 >> ,1,1 - -*/ - -$bugIDlist1 = array('1','3','4','51','81'); - -$bugIDlist2 = array('2', '7'); - -$bug = new bugTest(); -r($bug->batchConfirmTest($bugIDlist1)) && p() && e(',1,1,1,1,1'); // 批量确认1 3 4 51 81 -r($bug->batchConfirmTest($bugIDlist2)) && p() && e(',1,1'); // 批量确认2 7 diff --git a/module/bug/test/model/batchcreate.php b/module/bug/test/model/batchcreate.php deleted file mode 100755 index e7589703b8..0000000000 --- a/module/bug/test/model/batchcreate.php +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env php -gen(1); -zdTable('product')->gen(10); -zdTable('action')->gen(1); - -zdTable('project')->config('project_batchcreate')->gen(1); -zdTable('kanbanregion')->config('kanbanregion_batchcreate')->gen(1); -zdTable('kanbanlane')->config('kanbanlane_batchcreate')->gen(1); -zdTable('kanbancolumn')->config('kanbancolumn_batchcreate')->gen(9); -zdTable('kanbancell')->config('kanbancell_batchcreate')->gen(9); - -su('admin'); - -function initImage($imagesFiles) -{ - foreach($imagesFiles as $bugImagesFile) - { - if(!empty($bugImagesFile['realpath']) and !is_file($bugImagesFile['realpath'])) - { - $theFile = fopen($bugImagesFile['realpath'], 'w'); - fclose($theFile); - } - } -} - -function dropImage($imagesFiles) -{ - foreach($imagesFiles as $bugImagesFile) - { - if(!empty($bugImagesFile['realpath']) and is_file($bugImagesFile['realpath'])) - { - $zfile->removeFile($bugImagesFile['realpath']); - } - if(!empty($bugImagesFile['pathname']) and is_file($bugImagesFile['pathname'])) - { - $zfile->removeFile($bugImagesFile['pathname']); - } - if(!empty($bugImagesFile['title']) and is_file($bugImagesFile['title'])) - { - $zfile->removeFile($bugImagesFile['title']); - } - } -} - -/** - -title=bugModel->batchCreate(); -cid=1 -pid=1 - -测试正常批量创建bug1 >> 批量bug一,trunk,3,codeerror,3,3,1,101 -测试正常批量创建bug2 >> 批量bug五,trunk,codeerror,3,3,1,101 -测试正常批量创建bug3 >> 批量bug九,1,config,3,3,1,0 -测试短时间内重复批量创建bug >> 0 -测试异常创建bug >> 『影响版本』不能为空。 - -*/ - -$productID = 1; - -$title = array('批量bug一','批量bug二','批量bug三'); -$openedBuild = array(array('3'), array('trunk'), array('1')); -$type = array('codeerror','notrepro','config'); -$severity = array('3','2','1'); -$normal_create1 = array('title' => $title, 'types' => $type, 'openedBuilds' => $openedBuild, 'severity' => $severity); - -$title = array('批量bug四','批量bug五','批量bug六'); -$normal_create2 = array('title' => $title, 'types' => $type, 'openedBuilds' => $openedBuild, 'severity' => $severity); - -$execution = array(0, 0, 0); -$title = array('批量bug七','批量bug八','批量bug九'); -$normal_create3 = array('title' => $title, 'types' => $type, 'openedBuilds' => $openedBuild, 'severity' => $severity, 'executions' => $execution); - -$laneIdList = array(1, 2, 3); - -$title = array('批量bug十','批量bug十一','批量bug十二'); -$normal_create4 = array('title' => $title, 'types' => $type, 'openedBuilds' => $openedBuild, 'severity' => $severity, 'laneID' => $laneIdList, 'executions' => $execution); - -$title = array('批量bug十三','批量bug十四','批量bug十五'); -$normal_create5 = array('title' => $title, 'types' => $type, 'openedBuilds' => $openedBuild, 'severity' => $severity, 'laneID' => $laneIdList); - -$title = array('异常一','异常二','异常三'); -$emptyBuild = array(array('trunk'), array(''), array('1')); -$empty_build_create = array('title' => $title, 'openedBuilds' => $emptyBuild); - -$emptyTitle = array('名称','','名称三'); -$empty_title_create = array('title' => $emptyTitle, 'openedBuilds' => $openedBuild); - -$output = array(array(), array('laneID' => 1, 'columnID' => 1)); - -$jpgFile = array(); -$jpgFile['realpath'] = $tester->app->tmpRoot . '1.jpg'; -$jpgFile['pathname'] = '1.jpg'; -$jpgFile['title'] = '1'; -$jpgFile['extension'] = 'jpg'; - -$bugImagesFiles = array(false, array('jpg' => $jpgFile)); -$uploadImages = array(false, array('jpg')); - -initImage($bugImagesFiles[1]); - -$bug = new bugTest(); -r($bug->batchCreateObject($productID, $normal_create1, $output[0], $uploadImages[0], $bugImagesFiles[0])) && p('0:title,openedBuild,type,severity,pri,product,execution') && e('批量bug一,3,codeerror,3,3,1,11'); // 测试正常批量创建bug1 -r($bug->batchCreateObject($productID, $normal_create2, $output[1], $uploadImages[0], $bugImagesFiles[0])) && p('1:title,openedBuild,type,severity,pri,product,execution') && e('批量bug五,trunk,notrepro,3,3,1,11'); // 测试正常批量创建bug2 有output -r($bug->batchCreateObject($productID, $normal_create3, $output[0], $uploadImages[1], $bugImagesFiles[1])) && p('2:title,openedBuild,type,severity,pri,product,execution') && e('批量bug九,1,config,3,3,1,0'); // 测试正常批量创建bug3 上传图片 -dropImage($bugImagesFiles[1]); -initImage($bugImagesFiles[1]); -r($bug->batchCreateObject($productID, $normal_create4, $output[0], $uploadImages[0], $bugImagesFiles[0])) && p('0:title,openedBuild,type,severity,pri,product,execution') && e('批量bug十,3,codeerror,3,3,1,0'); // 测试正常批量创建bug4 bug有laneID -r($bug->batchCreateObject($productID, $normal_create5, $output[1], $uploadImages[1], $bugImagesFiles[1])) && p('1:title,openedBuild,type,severity,pri,product,execution') && e('批量bug十四,trunk,notrepro,3,3,1,11'); // 测试正常批量创建bug5 有output 上传图片 bug有laneID -dropImage($bugImagesFiles[1]); - -r($bug->batchCreateObject($productID, $empty_build_create)) && p('') && e("『影响版本』不能为空。"); // 测试创建没有版本的bug -r($bug->batchCreateObject($productID, $empty_title_create)) && p('') && e("『Bug标题』不能为空。"); // 测试创建没有标题的bug diff --git a/module/bug/test/model/batchresolve.php b/module/bug/test/model/batchresolve.php deleted file mode 100755 index 753fc7d410..0000000000 --- a/module/bug/test/model/batchresolve.php +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env php -batchResolve(); -timeout=0 -cid=1 - -- 解决bug1 2 3,解决方式为bydesign - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @bydesign;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug4 5 6,解决方式为duplicate - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @duplicate;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug7 8 9,解决方式为external - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @external;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug10 11 12,解决方式为fixed - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;4:field属性 @fixed;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug13 14 15,解决方式为notrepro - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @notrepro;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug16 17 18,解决方式为postponed - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @postponed;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug19 20 21,解决方式为willnotfix - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @willnotfix;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug22 23 24,解决方式为tostory - - 第0条的field属性 @resolution - - 第0条的old属性 @~~ - - 第0条的new;3:field属性 @tostory;status - - 第0条的old属性 @active - - 第0条的new属性 @resolved - -- 解决bug状态为resolve的bug - - 第0条的field属性 @0 - - 第0条的old属性 @0 - - 第0条的new;3:field属性 @0 - - 第0条的old属性 @0 - - 第0条的new属性 @0 - -*/ - -$bug = zdTable('bug'); -$bug->execution->range('11-50'); -$bug->gen(50); - -zdTable('project')->config('execution')->gen(50); - -$bugIDList1 = array('1', '2', '3'); -$bugIDList2 = array('4', '5', '6'); -$bugIDList3 = array('7', '8', '9'); -$bugIDList4 = array('10', '11', '12'); -$bugIDList5 = array('13', '14', '15'); -$bugIDList6 = array('16', '17', '18'); -$bugIDList7 = array('19', '20', '21'); -$bugIDList8 = array('22', '23', '24'); - -$resolutionList = array('bydesign', 'duplicate', 'external', 'fixed', 'notrepro', 'postponed', 'willnotfix', 'tostory'); - -$bug = new bugTest(); -r($bug->batchResolveTest($bugIDList1, $resolutionList[0], $bugIDList1[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,bydesign;status,active,resolved'); // 解决bug1 2 3,解决方式为bydesign -r($bug->batchResolveTest($bugIDList2, $resolutionList[1], $bugIDList2[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,duplicate;status,active,resolved'); // 解决bug4 5 6,解决方式为duplicate -r($bug->batchResolveTest($bugIDList3, $resolutionList[2], $bugIDList3[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,external;status,active,resolved'); // 解决bug7 8 9,解决方式为external -r($bug->batchResolveTest($bugIDList4, $resolutionList[3], $bugIDList4[0])) && p('0:field,old,new;4:field,old,new') && e('resolution,~~,fixed;status,active,resolved'); // 解决bug10 11 12,解决方式为fixed -r($bug->batchResolveTest($bugIDList5, $resolutionList[4], $bugIDList5[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,notrepro;status,active,resolved'); // 解决bug13 14 15,解决方式为notrepro -r($bug->batchResolveTest($bugIDList6, $resolutionList[5], $bugIDList6[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,postponed;status,active,resolved'); // 解决bug16 17 18,解决方式为postponed -r($bug->batchResolveTest($bugIDList7, $resolutionList[6], $bugIDList7[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,willnotfix;status,active,resolved'); // 解决bug19 20 21,解决方式为willnotfix -r($bug->batchResolveTest($bugIDList8, $resolutionList[7], $bugIDList8[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,~~,tostory;status,active,resolved'); // 解决bug22 23 24,解决方式为tostory -r($bug->batchResolveTest($bugIDList8, $resolutionList[7], $bugIDList8[0])) && p('0:field,old,new;3:field,old,new') && e('0'); // 解决bug状态为resolve的bug diff --git a/module/bug/ui/browse.html.php b/module/bug/ui/browse.html.php index 7a9f694306..4a83cd62e1 100644 --- a/module/bug/ui/browse.html.php +++ b/module/bug/ui/browse.html.php @@ -144,9 +144,9 @@ menu set::class('dropdown-menu'), set::items(array ( - array('text' => $lang->bug->confirm, 'class' => 'batch-btn', 'data-url' => helper::createLink('bug', 'batchConfirm')), - array('text' => $lang->bug->close, 'class' => 'batch-btn', 'data-url' => helper::createLink('bug', 'batchClose')), - array('text' => $lang->bug->activate), + array('text' => $lang->bug->confirm, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('bug', 'batchConfirm')), + array('text' => $lang->bug->close, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('bug', 'batchClose')), + array('text' => $lang->bug->activate, 'class' => 'batch-btn', 'data-url' => helper::createLink('bug', 'batchActivate', "productID=$productID&branch=$branch")), array('text' => $lang->bug->resolve, 'items' => $resolveItems), )) ); @@ -167,7 +167,7 @@ menu $moduleItems = array(); foreach($modules as $moduleID => $module) { - $moduleItems[] = array('text' => $module, 'class' => 'batch-btn', 'data-url' => helper::createLink('bug', 'batchChangeModule', "moduleID=$moduleID")); + $moduleItems[] = array('text' => $module, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('bug', 'batchChangeModule', "moduleID=$moduleID")); } menu @@ -180,7 +180,7 @@ menu $assignedToItems = array(); foreach ($memberPairs as $key => $value) { - $assignedToItems[] = array('text' => $value, 'class' => 'batch-btn', 'data-url' => helper::createLink('bug', 'batchAssignTo', "assignedTo=$key&productID={$product->id}&type=product")); + $assignedToItems[] = array('text' => $value, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('bug', 'batchAssignTo', "assignedTo=$key&productID={$product->id}&type=product")); } menu