From aa97cbc50b33329b5d44fa10bd4b9152d0d060ee Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 24 May 2023 14:02:47 +0800 Subject: [PATCH] * Add batch operation buttons to the bug list. --- module/bug/js/browse.ui.js | 23 +++++++++++++++++++++++ module/bug/ui/browse.html.php | 11 +++++++++++ 2 files changed, 34 insertions(+) create mode 100644 module/bug/js/browse.ui.js diff --git a/module/bug/js/browse.ui.js b/module/bug/js/browse.ui.js new file mode 100644 index 0000000000..9d5a8c909e --- /dev/null +++ b/module/bug/js/browse.ui.js @@ -0,0 +1,23 @@ +$(function() +{ + var bugIdList = [1, 2]; + + $(document).on('click', '.edit-btn', function() + { + var batchEditLink = $.createLink('bug', 'batchEdit', 'productID=' + productID + '&branch=' + branch); + var tempform = document.createElement("form"); + tempform.action = batchEditLink; + tempform.method = "post"; + tempform.style.display = "none"; + + var opt = document.createElement("input"); + opt.name = 'bugIdList'; + opt.value = bugIdList; + + tempform.appendChild(opt); + document.body.appendChild(tempform); + tempform.submit(); + + return false; + }); +}) diff --git a/module/bug/ui/browse.html.php b/module/bug/ui/browse.html.php index 218e130a98..978ccfc8d2 100644 --- a/module/bug/ui/browse.html.php +++ b/module/bug/ui/browse.html.php @@ -9,6 +9,8 @@ declare(strict_types=1); * @link https://www.zentao.net */ namespace zin; +jsVar('productID', $product->id); +jsVar('branch', $branch); $this->bug->buildOperateMenu(null, 'browse'); @@ -118,11 +120,20 @@ sidebar ))) ); +$footToolbar = array('items' => array +( + array('size' => 'sm', 'text' => $lang->edit, 'btnType' => 'primary', 'className' => 'edit-btn'), + array('size' => 'sm', 'text' => $lang->bug->moduleAB, 'btnType' => 'primary', 'className' => 'module-btn'), + array('size' => 'sm', 'text' => $lang->bug->assignedTo, 'btnType' => 'primary', 'className' => 'assignto-btn'), +)); + dtable ( set::cols($cols), set::data($data), set::footPager(usePager()), + set::checkable(true), + set::footToolbar($footToolbar), set::footer(jsRaw('window.footerGenerator')) );