From f1c73eba0a94fc9554da601868e4a1b1852378d8 Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 12 May 2023 16:24:14 +0800 Subject: [PATCH] * Add locate logic in gantt view. --- module/programplan/model.php | 3 ++- module/programplan/view/gantt.html.php | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/programplan/model.php b/module/programplan/model.php index 04a3c5408d..641639a575 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -368,7 +368,7 @@ class programplanModel extends model if($project->model == 'ipd' and $datas) { $this->loadModel('review'); - $reviewPoints = $this->dao->select('t1.*, t2.status, t2.lastReviewedDate')->from(TABLE_OBJECT)->alias('t1') + $reviewPoints = $this->dao->select('t1.*, t2.status, t2.lastReviewedDate,t2.id as reviewID')->from(TABLE_OBJECT)->alias('t1') ->leftJoin(TABLE_REVIEW)->alias('t2')->on('t1.id = t2.object') ->where('t1.deleted')->eq('0') ->andWhere('t1.project')->eq($projectID) @@ -413,6 +413,7 @@ class programplanModel extends model $data = new stdclass(); $data->id = $plan->id . '-' . $point->category . '-' . $point->id; + $data->reviewID = $point->reviewID; $data->type = 'point'; $data->text = " " . $point->title; $data->name = $point->title; diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index 649ed45680..50a4906ad8 100755 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -50,7 +50,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} .gantt_grid_head_owner_id {text-align: left} .gantt_critical_task{background:#e63030 !important; border-color:#9d3a3a !important;} .gantt_marker .gantt_marker_content {left: -15px; background-color: #f51e1e;} -.gantt_row.task-item{cursor: pointer;} +.gantt_row{cursor: pointer;} #ganttDownload, #ganttHeader {display: none;} #ganttContainer {margin-top: 40px;} @@ -682,11 +682,6 @@ $(function() return getByIdForGantt(gantt.serverList('userList'), task.owner_id); }; - gantt.templates.grid_row_class = function (start, end, task) - { - if(task.type == 'task') return 'task-item'; - }; - gantt.templates.link_class = function(link) { var types = gantt.config.links; @@ -770,6 +765,10 @@ $(function() var taskModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '95%'}); gantt.attachEvent('onTaskClick', function(id, e) { + var task = gantt.getTask(id); + if(task.type == 'point' && task.rawStatus) location.href = createLink('review', 'view', 'reviewID=' + task.reviewID); + if(task.type == 'plan') window.parent.$.apps.open(createLink('execution', 'task', 'id=' + task.id), 'execution'); + if($(e.srcElement).hasClass('gantt_close') || $(e.srcElement).hasClass('gantt_open')) return false; if($(e.srcElement).hasClass('icon-confirm')) {