* Compatible with Gantt chart page.
This commit is contained in:
@@ -38,9 +38,9 @@ $config->programplan->form->edit['milestone'] = array('required' => false, 'type
|
||||
$config->programplan->form->edit['output'] = array('required' => false, 'type' => 'array', 'default' => array(), 'filter' => 'join');
|
||||
|
||||
$config->programplan->form->ajaxCustom = array();
|
||||
$config->programplan->form->ajaxCustom['zooming'] = array('required' => false, 'type' => 'string');
|
||||
$config->programplan->form->ajaxCustom['stageCustom'] = array('required' => false, 'type' => 'array', 'filter' => 'join');
|
||||
$config->programplan->form->ajaxCustom['ganttFields'] = array('required' => false, 'type' => 'array', 'filter' => 'join');
|
||||
$config->programplan->form->ajaxCustom['zooming'] = array('required' => false, 'type' => 'string', 'default' => '');
|
||||
$config->programplan->form->ajaxCustom['stageCustom'] = array('required' => false, 'type' => 'array', 'filter' => 'join', 'default' => 'array()');
|
||||
$config->programplan->form->ajaxCustom['ganttFields'] = array('required' => false, 'type' => 'array', 'filter' => 'join', 'default' => 'array()');
|
||||
|
||||
$config->programplan->form->updateDateByGantt['id'] = array('required' => false, 'type' => 'int', 'default' => 0);
|
||||
$config->programplan->form->updateDateByGantt['startDate'] = array('required' => false, 'type' => 'string', 'default' => null);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#ajaxCustomForm .customField .checkbox-primary {width: 20%;}
|
||||
@@ -96,9 +96,8 @@ $lang->programplan->confirmDelete = 'Do you want to delete the current plan?
|
||||
$lang->programplan->confirmChangeAttr = 'The type of the sub-stage will be adjusted to "%s" synchronously according to the type of the parent stage after modification. Do you want to save?';
|
||||
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
|
||||
|
||||
$lang->programplan->stageCustom = new stdClass();
|
||||
$lang->programplan->stageCustom->date = 'Show Date';
|
||||
$lang->programplan->stageCustom->task = 'Show Task';
|
||||
$lang->programplan->stageCustom['date'] = 'Show Date';
|
||||
$lang->programplan->stageCustom['task'] = 'Show Task';
|
||||
|
||||
$lang->programplan->ganttCustom['PM'] = 'Manager';
|
||||
$lang->programplan->ganttCustom['deadline'] = 'Deadline';
|
||||
|
||||
@@ -96,9 +96,8 @@ $lang->programplan->confirmDelete = 'Do you want to delete the current plan?
|
||||
$lang->programplan->confirmChangeAttr = 'The type of the sub-stage will be adjusted to "%s" synchronously according to the type of the parent stage after modification. Do you want to save?';
|
||||
$lang->programplan->workloadTips = 'The workload of the sub stage is divided by 100%.';
|
||||
|
||||
$lang->programplan->stageCustom = new stdClass();
|
||||
$lang->programplan->stageCustom->date = 'Show Date';
|
||||
$lang->programplan->stageCustom->task = 'Show Task';
|
||||
$lang->programplan->stageCustom['date'] = 'Show Date';
|
||||
$lang->programplan->stageCustom['task'] = 'Show Task';
|
||||
|
||||
$lang->programplan->ganttCustom['PM'] = 'Manager';
|
||||
$lang->programplan->ganttCustom['deadline'] = 'Deadline';
|
||||
|
||||
@@ -96,9 +96,8 @@ $lang->programplan->confirmDelete = 'Do you want to delete the current plan?
|
||||
$lang->programplan->confirmChangeAttr = 'The type of the sub-stage will be adjusted to "%s" synchronously according to the type of the parent stage after modification. Do you want to save?';
|
||||
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
|
||||
|
||||
$lang->programplan->stageCustom = new stdClass();
|
||||
$lang->programplan->stageCustom->date = 'Show Date';
|
||||
$lang->programplan->stageCustom->task = 'Show Task';
|
||||
$lang->programplan->stageCustom['date'] = 'Show Date';
|
||||
$lang->programplan->stageCustom['task'] = 'Show Task';
|
||||
|
||||
$lang->programplan->ganttCustom['PM'] = 'Manager';
|
||||
$lang->programplan->ganttCustom['deadline'] = 'Deadline';
|
||||
|
||||
@@ -96,9 +96,8 @@ $lang->programplan->confirmDelete = '确定要删除当前计划吗?';
|
||||
$lang->programplan->confirmChangeAttr = '修改后子阶段的类型将根据父阶段类型同步调整为“%s”,是否保存?';
|
||||
$lang->programplan->workloadTips = '子阶段工作量占比按百分百的比例进行拆分';
|
||||
|
||||
$lang->programplan->stageCustom = new stdClass();
|
||||
$lang->programplan->stageCustom->date = '显示日期';
|
||||
$lang->programplan->stageCustom->task = '显示任务';
|
||||
$lang->programplan->stageCustom['date'] = '显示日期';
|
||||
$lang->programplan->stageCustom['task'] = '显示任务';
|
||||
|
||||
$lang->programplan->ganttCustom['PM'] ='负责人';
|
||||
$lang->programplan->ganttCustom['deadline'] ='计划完成';
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The ajaxCustom view file of programplan module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Shujie Tian <tianshujie@easycorp.ltd>
|
||||
* @package programplan
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
formPanel
|
||||
(
|
||||
setID('ajaxCustomForm'),
|
||||
set::title($lang->programplan->settingGantt),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->execution->gantt->format),
|
||||
radioList
|
||||
(
|
||||
set::name('zooming'),
|
||||
set::items($lang->execution->gantt->zooming),
|
||||
set::value($zooming ? $zooming : 'day'),
|
||||
set::inline(true)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->programplan->viewSetting),
|
||||
checkList
|
||||
(
|
||||
set::name('stageCustom'),
|
||||
set::items($lang->programplan->stageCustom),
|
||||
set::value($stageCustom),
|
||||
set::inline(true)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
setClass('customField'),
|
||||
set::label($lang->customField),
|
||||
checkList
|
||||
(
|
||||
set::name('ganttFields'),
|
||||
set::items($customFields),
|
||||
set::value($showFields),
|
||||
set::inline(true)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -257,7 +257,7 @@ function drawGanttToCanvas(exportType, successCallback, errorCallback)
|
||||
var $ganttDridData = $ganttView.find('.gantt_grid_data');
|
||||
|
||||
var ganttRowHeight = $ganttView.find('.gantt_row').first().outerHeight() || 25;
|
||||
var ganttHeight = $ganttView.find('.gantt_grid_scale').outerHeight() + <?php echo count($plans['data'])?> * ganttRowHeight;
|
||||
var ganttHeight = $ganttView.find('.gantt_grid_scale').outerHeight() + <?php echo count($stages['data'])?> * ganttRowHeight;
|
||||
<?php if($selectCustom == 'task'):?>
|
||||
var ganttWidth = $ganttDridData.width() - 100;
|
||||
<?php else:?>
|
||||
@@ -577,7 +577,7 @@ $(function()
|
||||
$('#ganttView').css('height', Math.max(200, Math.floor($(window).height() - $('#footer').outerHeight() - $('#header').outerHeight() - $('#mainMenu').outerHeight() - 120)));
|
||||
};
|
||||
|
||||
var ganttData = $.parseJSON(<?php echo json_encode(json_encode($plans));?>);
|
||||
var ganttData = $.parseJSON(<?php echo json_encode(json_encode($stages));?>);
|
||||
if(!ganttData.data) ganttData.data = [];
|
||||
|
||||
<?php
|
||||
|
||||
@@ -73,7 +73,7 @@ class programplanZen extends programplan
|
||||
if(in_array($this->config->edition, array('max', 'ipd')))
|
||||
{
|
||||
$plan->planDuration = $this->programplan->getDuration($plan->begin, $plan->end);
|
||||
$plan->realDuration = $this->programplan->getDuration($plan->realBegan, $plan->realEnd);
|
||||
$plan->realDuration = $this->programplan->getDuration((string)$plan->realBegan, (string)$plan->realEnd);
|
||||
}
|
||||
|
||||
/* Check duplicated names to avoid to save same names. */
|
||||
@@ -234,7 +234,7 @@ class programplanZen extends programplan
|
||||
*/
|
||||
protected function buildAjaxCustomView(string $owner, string $module, array $customFields)
|
||||
{
|
||||
$stageCustom = $this->setting->getItem("owner=$owner&module=$module§ion=browse&key=stageCustom");
|
||||
$stageCustom = $this->loadModel('setting')->getItem("owner=$owner&module=$module§ion=browse&key=stageCustom");
|
||||
$ganttFields = $this->setting->getItem("owner=$owner&module=$module§ion=ganttCustom&key=ganttFields");
|
||||
$zooming = $this->setting->getItem("owner=$owner&module=$module§ion=ganttCustom&key=zooming");
|
||||
|
||||
@@ -305,8 +305,44 @@ class programplanZen extends programplan
|
||||
$selectCustom = 0; // Display date and task settings.
|
||||
$dateDetails = 1; // Gantt chart detail date display.
|
||||
|
||||
/* Get data of type lists. */
|
||||
if($type == 'lists')
|
||||
/* Get data of type. */
|
||||
if($type == 'gantt')
|
||||
{
|
||||
$this->loadModel('setting');
|
||||
$owner = $this->app->user->account;
|
||||
$module = 'programplan';
|
||||
$section = 'browse';
|
||||
$object = 'stageCustom';
|
||||
if(!isset($this->config->programplan->browse->stageCustom)) $this->setting->setItem("$owner.$module.browse.stageCustom", 'date,task,point');
|
||||
|
||||
$selectCustom = $this->setting->getItem("owner={$owner}&module={$module}§ion={$section}&key={$object}");
|
||||
|
||||
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
|
||||
|
||||
$plans = $this->programplan->getDataForGantt($projectID, $productID, $baselineID, $selectCustom, false);
|
||||
|
||||
/* Set Custom. */
|
||||
foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field];
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $this->config->programplan->ganttCustom->ganttFields;
|
||||
}
|
||||
elseif($type == 'assignedTo')
|
||||
{
|
||||
$owner = $this->app->user->account;
|
||||
$module = 'programplan';
|
||||
$section = 'browse';
|
||||
$object = 'stageCustom';
|
||||
$selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}§ion={$section}&key={$object}");
|
||||
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
|
||||
|
||||
$plans = $this->programplan->getDataForGanttGroupByAssignedTo($projectID, $productID, $baselineID, $selectCustom, false);
|
||||
|
||||
/* Set Custom. */
|
||||
foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field];
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $this->config->programplan->ganttCustom->ganttFields;
|
||||
}
|
||||
elseif($type == 'lists')
|
||||
{
|
||||
$sort = common::appendOrder($orderBy);
|
||||
$stages = $this->programplan->getPlans($projectID, $productID, $sort);
|
||||
|
||||
Reference in New Issue
Block a user