From 49cc2f448157b14fc8504ed477bb01a84e1fac24 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Mon, 13 Nov 2023 05:34:32 +0000 Subject: [PATCH] * Finish productplan kanban. --- module/kanban/model.php | 5 --- module/productplan/js/browse.ui.js | 34 ++++--------------- module/productplan/ui/browse.html.php | 13 ++++++- module/productplan/ui/browsebykanban.html.php | 12 ------- 4 files changed, 18 insertions(+), 46 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index 6d8230eddb..e4226c7966 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -939,11 +939,6 @@ class kanbanModel extends model $item['actionList'] = array(); foreach($cardActions as $action) { - if($action == 'createExecution') - { - if(common::hasPriv('execution', 'create')) $item['actionList'][] = $action; - continue; - } if($this->productplan->isClickable($plan, $action)) $item['actionList'][] = $action; } $planList[$id][$plan->status][] = $item; diff --git a/module/productplan/js/browse.ui.js b/module/productplan/js/browse.ui.js index 14cb4d0fca..6bcebf526f 100644 --- a/module/productplan/js/browse.ui.js +++ b/module/productplan/js/browse.ui.js @@ -145,34 +145,6 @@ $(document).on('click', '#createExecutionButton', function() zui.Modal.hide('#createExecutionModal'); }); -window.getPlanID = function(event) -{ - const planID = $(event.target).closest('a').data('plan'); - const branch = $(event.target).closest('a').data('branch'); - $('[name=planID]').val(planID); - - const link = $.createLink('productplan', 'ajaxGetProjects', 'productID=' + productID + '&branch=' + (branch ? branch : 0)); - $.getJSON(link, function(projects) - { - $('[name=project]').zui('picker').render({items: projects}); - - var projectList = $("[name=project]").val(); - if(!projectList) - { - $("#programs").zui('picker').render({disabled: true}); - $(".tips").removeClass('hidden'); - - var locateLink = $.createLink('product', 'project', 'status=all&productID=' + productID + '&branch=' + branch); - var locateButton = "" + enterProjectList + ""; - $("#projects .btn-primary").replaceWith(locateButton); - } - else - { - $(".tips").addClass('hidden'); - } - }); -} - /** * 对部分列进行重定义。 * Redefine the partial column. @@ -337,3 +309,9 @@ window.buildCardActions = function(item) return actions; } + +window.getPlanID = function(event) +{ + const planID = $(event.target).closest('a').data('plan'); + $('[name=planID]').val(planID); +} diff --git a/module/productplan/ui/browse.html.php b/module/productplan/ui/browse.html.php index 1362a14713..970ebafcb7 100644 --- a/module/productplan/ui/browse.html.php +++ b/module/productplan/ui/browse.html.php @@ -9,6 +9,17 @@ declare(strict_types=1); * @link https://www.zentao.net */ namespace zin; +$privs = array +( + 'canViewPlan' => common::hasPriv($app->rawModule, 'view'), + 'canStartPlan' => common::hasPriv($app->rawModule, 'start'), + 'canClosePlan' => common::hasPriv($app->rawModule, 'close'), + 'canFinishPlan' => common::hasPriv($app->rawModule, 'finish'), + 'canActivatePlan' => common::hasPriv($app->rawModule, 'activate') +); -jsVar('productID', $productID); +jsVar('productID', $productID); +jsVar('productplanLang', $lang->productplan); +jsVar('privs', $privs); +jsVar('rawModule', $app->rawModule); include("browseby{$viewType}.html.php"); diff --git a/module/productplan/ui/browsebykanban.html.php b/module/productplan/ui/browsebykanban.html.php index b95314322c..23aad60282 100644 --- a/module/productplan/ui/browsebykanban.html.php +++ b/module/productplan/ui/browsebykanban.html.php @@ -9,15 +9,6 @@ declare(strict_types=1); * @link https://www.zentao.net */ namespace zin; -$privs = array -( - 'canViewPlan' => common::hasPriv($app->rawModule, 'view'), - 'canStartPlan' => common::hasPriv($app->rawModule, 'start'), - 'canClosePlan' => common::hasPriv($app->rawModule, 'close'), - 'canFinishPlan' => common::hasPriv($app->rawModule, 'finish'), - 'canActivatePlan' => common::hasPriv($app->rawModule, 'activate') -); - foreach($kanbanList as $current => $region) { foreach($region['items'] as $index => $group) @@ -39,9 +30,6 @@ foreach($lang->productplan->orderList as $order => $label) $orderItems[] = array('text' => $label, 'active' => $orderBy == $order, 'url' => $this->createLink($app->rawModule, 'browse', "productID=$productID&branch=$branchID&browseType=$browseType&queryID=$queryID&orderBy=$order")); } -jsVar('privs', $privs); -jsVar('productplanLang', $lang->productplan); -jsVar('rawModule', $app->rawModule); toolbar ( set::className('w-full justify-end'),