diff --git a/module/programplan/tao.php b/module/programplan/tao.php index 649b6e5687..b4f2d30d34 100644 --- a/module/programplan/tao.php +++ b/module/programplan/tao.php @@ -284,7 +284,7 @@ class programplanTao extends programplanModel $dateLimit = $this->getTaskDateLimit($task, $plan); $data = $this->buildTaskDataForGantt($task, $dateLimit); $data->id = $task->execution . '-' . $task->id; - $data->parent = $task->parent > 0 ? $task->execution . '-' . $task->parent : $task->execution; + $data->parent = $task->parent > 0 && isset($tasks[$task->parent]) ? $task->execution . '-' . $task->parent : $task->execution; if(!isset($executions[$task->execution])) $executions[$task->execution] = $this->dao->select('status')->from(TABLE_EXECUTION)->where('id')->eq($task->execution)->fetch('status'); /* Determines if the object is delay. */ diff --git a/module/programplan/ui/browse.html.php b/module/programplan/ui/browse.html.php index b6560dfcbf..f3513f15f2 100644 --- a/module/programplan/ui/browse.html.php +++ b/module/programplan/ui/browse.html.php @@ -13,6 +13,7 @@ declare(strict_types=1); namespace zin; jsVar('browseType', $type); +jsVar('isSearch', $browseType == 'bysearch'); if(empty($plans)) { diff --git a/module/programplan/ui/gantt.html.php b/module/programplan/ui/gantt.html.php index bcba24ae75..8e3fcccf36 100644 --- a/module/programplan/ui/gantt.html.php +++ b/module/programplan/ui/gantt.html.php @@ -15,6 +15,7 @@ namespace zin; data('fileName', 'gantt-export-' . $projectID); include './ganttfields.html.php'; + if($app->rawModule == 'programplan') { if($project->stageBy == 'product') @@ -33,7 +34,11 @@ if($app->rawModule == 'programplan') } else { - featureBar(span(setClass('text font-bold'), $lang->programplan->gantt)); + featureBar + ( + btn(setClass('ghost mr-2', ($browseType != 'bysearch' ? 'active' : '')), $lang->programplan->gantt, set::url($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"))), + $hasSearch ? li(searchToggle(set::module('projectTask'), set::open($browseType == 'bysearch'))) : null + ); } toolbar ( diff --git a/module/programplan/ui/ganttfields.html.php b/module/programplan/ui/ganttfields.html.php index 2c594d348e..4d727dd8e9 100644 --- a/module/programplan/ui/ganttfields.html.php +++ b/module/programplan/ui/ganttfields.html.php @@ -31,12 +31,12 @@ $ganttLang->today = $lang->programplan->today; $typeHtml = '' . $lang->programplan->ganttBrowseType[$ganttType] . ''; $typeHtml .= ''; -foreach($lang->programplan->ganttBrowseType as $browseType => $typeName) +foreach($lang->programplan->ganttBrowseType as $ganttBrowseType => $typeName) { - $link = $this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=$browseType"); - if($app->rawModule == 'review' and $app->rawMethod == 'assess') $this->createLink('review', 'assess', "reivewID=$reviewID&from=&type=$browseType"); + $link = $this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=$ganttBrowseType"); + if($app->rawModule == 'review' and $app->rawMethod == 'assess') $this->createLink('review', 'assess', "reivewID=$reviewID&from=&type=$ganttBrowseType"); - $typeHtml .= ''; + $typeHtml .= ''; } $typeHtml .= '';