Merge branch 'sprint/max41_mayue_task#63796' into 'master'

* Finish task #63796.

See merge request easycorp/zentaopms!4895
This commit is contained in:
孙广明
2022-08-10 06:37:45 +00:00
7 changed files with 68 additions and 19 deletions
+4
View File
@@ -57,3 +57,7 @@ $config->programplan->customCreateFields = 'PM,percent,attribute,acl,milestone,r
$config->programplan->custom = new stdclass();
$config->programplan->custom->createFields = 'PM,percent,attribute,acl,milestone';
$config->programplan->custom->customGanttFields = 'PM,deadline,status,realBegan,realEnd,progress,taskProgress,estimate,consumed';
$config->programplan->ganttCustom = new stdclass();
$config->programplan->ganttCustom->ganttFields = 'PM,deadline';
+5
View File
@@ -84,6 +84,11 @@ class programplan extends control
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
$plans = $this->programplan->getDataForGantt($projectID, $this->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;
}
if($type == 'assignedTo')
+10
View File
@@ -80,6 +80,16 @@ $lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->ganttCustom['PM'] ='Manager';
$lang->programplan->ganttCustom['deadline'] ='Deadline';
$lang->programplan->ganttCustom['status'] ='Status';
$lang->programplan->ganttCustom['realBegan'] ='Actual Began';
$lang->programplan->ganttCustom['realEnd'] ='Actual End';
$lang->programplan->ganttCustom['progress'] ='Workload Ratio';
$lang->programplan->ganttCustom['taskProgress'] ='Task Progress';
$lang->programplan->ganttCustom['estimate'] ='Estimate';
$lang->programplan->ganttCustom['consumed'] ='Consumed';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
+10
View File
@@ -80,6 +80,16 @@ $lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->ganttCustom['PM'] ='Manager';
$lang->programplan->ganttCustom['deadline'] ='Deadline';
$lang->programplan->ganttCustom['status'] ='Status';
$lang->programplan->ganttCustom['realBegan'] ='Actual Began';
$lang->programplan->ganttCustom['realEnd'] ='Actual End';
$lang->programplan->ganttCustom['progress'] ='Workload Ratio';
$lang->programplan->ganttCustom['taskProgress'] ='Task Progress';
$lang->programplan->ganttCustom['estimate'] ='Estimate';
$lang->programplan->ganttCustom['consumed'] ='Consumed';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
+10
View File
@@ -80,6 +80,16 @@ $lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->ganttCustom['PM'] ='Manager';
$lang->programplan->ganttCustom['deadline'] ='Deadline';
$lang->programplan->ganttCustom['status'] ='Status';
$lang->programplan->ganttCustom['realBegan'] ='Actual Began';
$lang->programplan->ganttCustom['realEnd'] ='Actual End';
$lang->programplan->ganttCustom['progress'] ='Workload Ratio';
$lang->programplan->ganttCustom['taskProgress'] ='Task Progress';
$lang->programplan->ganttCustom['estimate'] ='Estimate';
$lang->programplan->ganttCustom['consumed'] ='Consumed';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
+10
View File
@@ -80,6 +80,16 @@ $lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = '显示日期';
$lang->programplan->stageCustom->task = '显示任务';
$lang->programplan->ganttCustom['PM'] ='负责人';
$lang->programplan->ganttCustom['deadline'] ='计划完成';
$lang->programplan->ganttCustom['status'] ='状态';
$lang->programplan->ganttCustom['realBegan'] ='实际开始';
$lang->programplan->ganttCustom['realEnd'] ='实际结束';
$lang->programplan->ganttCustom['progress'] ='工作量占比';
$lang->programplan->ganttCustom['taskProgress'] ='任务进度';
$lang->programplan->ganttCustom['estimate'] ='工时';
$lang->programplan->ganttCustom['consumed'] ='消耗工时';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"工作量比例"必须为数字';
$lang->programplan->error->planFinishSmall = '"计划完成时间"必须大于"计划开始时间"';
+19 -19
View File
@@ -70,8 +70,13 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
<?php js::set('module', $app->rawModule);?>
<?php js::set('method', $app->rawMethod);?>
<?php js::set('ganttType', $ganttType);?>
<?php js::set('showFields', $showFields);?>
<?php js::set('canGanttEdit', common::hasPriv('programplan', 'ganttEdit'));?>
<div id='mainContent' class='main-content load-indicator' data-loading='<?php echo $lang->programplan->exporting;?>'>
<div class="pull-right btn-toolbar">
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=programplan&section=ganttCustom&key=ganttFields')?>
<?php include '../../common/view/customfield.html.php';?>
</div>
<form class="main-form form-ajax not-watch">
<div class="example">
<?php echo html::commonButton($lang->programplan->full, 'id="fullScreenBtn"', 'btn btn-primary btn-sm')?>
@@ -498,24 +503,19 @@ $(function()
gantt.config.scale_height = 18 * gantt.config.scales.length;
gantt.config.duration_unit = "day";
gantt.config.columns = [
{name: 'text', width: '*', tree: true, resize: true, width:200},
{name: 'owner_id', align: 'center', resize: true, width: 80, template: function(task){return getByIdForGantt(gantt.serverList('userList'), task.owner_id)}},
{name: 'status', align: 'center', resize: true, width: 80},
{name: 'start_date', align: 'center', resize: true, width: 80},
{name: 'end_date', align: 'center', resize: true, width: 80},
{name: 'duration', align: 'center', resize: true, width: 60},
{name: 'estimate', align: 'center', resize: true, width: 60},
{name: 'percent', align: 'center', resize: true, width:70, template: function(plan)
{
if(plan.percent) return Math.round(plan.percent) + '%';
}
},
{name: 'taskProgress', align: 'center', resize: true, width: 60},
{name: 'realBegan', align: 'center', resize: true, width: 60},
{name: 'realEnd', align: 'center', resize: true, width: 60},
{name: 'consumed', align: 'center', resize: false, width: 60},
];
gantt.config.columns = [];
gantt.config.columns.push({name: 'text', width: '*', tree: true, resize: true, width:200});
if(showFields.indexOf('PM') != -1) gantt.config.columns.push({name: 'owner_id', align: 'center', resize: true, width: 80, template: function(task){return getByIdForGantt(gantt.serverList('userList'), task.owner_id)}})
if(showFields.indexOf('status') != -1) gantt.config.columns.push({name: 'status', align: 'center', resize: true, width: 80});
gantt.config.columns.push({name: 'start_date', align: 'center', resize: true, width: 80});
if(showFields.indexOf('deadline') != -1) gantt.config.columns.push({name: 'end_date', align: 'center', resize: true, width: 80});
gantt.config.columns.push({name: 'duration', align: 'center', resize: true, width: 60});
if(showFields.indexOf('estimate') != -1) gantt.config.columns.push({name: 'estimate', align: 'center', resize: true, width: 60});
if(showFields.indexOf('progress') != -1) gantt.config.columns.push({name: 'percent', align: 'center', resize: true, width:70, template: function(plan){ if(plan.percent) return Math.round(plan.percent) + '%';}});
if(showFields.indexOf('taskProgress') != -1) gantt.config.columns.push({name: 'taskProgress', align: 'center', resize: true, width: 60});
if(showFields.indexOf('realBegan') != -1) gantt.config.columns.push({name: 'realBegan', align: 'center', resize: true, width: 60});
if(showFields.indexOf('realEnd') != -1) gantt.config.columns.push({name: 'realEnd', align: 'center', resize: true, width: 60});
if(showFields.indexOf('consumed') != -1) gantt.config.columns.push({name: 'consumed', align: 'center', resize: false, width: 60});
gantt.locale.labels.column_text = <?php echo json_encode($typeHtml);?>;
gantt.locale.labels.column_owner_id = "<?php echo $lang->programplan->PMAB;?>";
@@ -684,7 +684,7 @@ $(function()
if(task) gantt[task.$open ? 'close' : 'open'](task.id);
});
$(".checkbox-primary").on('click', function()
$(".example .checkbox-primary").on('click', function()
{
var stageCustom = [];
$("input[name='stageCustom[]']:checked").each(function()