From 541a59efdb55e469efc66f1f08842fedff351d49 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 5 Aug 2025 16:01:26 +0800 Subject: [PATCH] * [bug#64422,done,1h,0h] Fix gantt link message. --- lib/zin/wg/gantt/js/v1.js | 12 +++++------- module/programplan/tao.php | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/zin/wg/gantt/js/v1.js b/lib/zin/wg/gantt/js/v1.js index 40f4506095..ad7d54a134 100644 --- a/lib/zin/wg/gantt/js/v1.js +++ b/lib/zin/wg/gantt/js/v1.js @@ -695,20 +695,18 @@ function initGantt() /* 添加关联关系前的校验。 */ gantt.attachEvent("onBeforeLinkAdd", function(id, link) { - const source = link.source; - const target = link.target; - if(source.indexOf('-') === -1 || target.indexOf('-') === -1) + const sourceTask = gantt.getTask(link.source); + const targetTask = gantt.getTask(link.target); + if(sourceTask.type != 'task' || targetTask.type != 'task') { let message = ganttLang.wrongRelation; - if(source.indexOf('-') === -1) message += ganttLang.wrongRelationSource; - if(target.indexOf('-') === -1) message += ganttLang.wrongRelationTarget; + if(sourceTask.type != 'task') message += ganttLang.wrongRelationSource; + if(targetTask.type != 'task') message += ganttLang.wrongRelationTarget; zui.Messager.show({content: message, type: 'danger-outline', icon: 'exclamation-sign'}); return false; } - const sourceTask = gantt.getTask(link.source); - const targetTask = gantt.getTask(link.target); if(sourceTask.allowLinks === false || targetTask.allowLinks === false) { zui.Messager.show({content: ganttLang.wrongKanbanTasks, type: 'danger-outline', icon: 'exclamation-sign'}); diff --git a/module/programplan/tao.php b/module/programplan/tao.php index 37a69f87f7..1bf9d712f2 100644 --- a/module/programplan/tao.php +++ b/module/programplan/tao.php @@ -216,7 +216,7 @@ class programplanTao extends programplanModel { $this->app->loadLang('stage'); - $datas = $stageIndex = $planIdList = $reviewDeadline = array(); + $datas = $stageIndex = $planIdList = $reviewDeadline = array(); $today = helper::today(); $isMilestone = " "; foreach($plans as $plan)