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)