Merge branch 'revert-32119ec2' into 'master'
Revert "* Add task effort report." See merge request easycorp/zentaopms!5308
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
# 禅道工时统计插件
|
||||
每日工时统计插件能够帮助您在禅道中查看各个项目的指定时间段内每一天的团队成员的工作量信息。
|
||||
|
||||
本插件是对禅道 `统计` 功能的扩展。
|
||||
|
||||

|
||||
|
||||
# 使用方法
|
||||
1. 复制 `biz/report` 文件夹到 `custom/` 文件下
|
||||
2. 访问地址:https://yourdomain.xxx/index.php?m=report&f=manhour
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
helper::importControl('report');
|
||||
class myReport extends report
|
||||
{
|
||||
public function consumed()
|
||||
{
|
||||
$this->viewType = "json";
|
||||
if (!isset($_POST['data'])) {
|
||||
$this->send(array('error' => -1, 'msg' => "bad request"));
|
||||
return;
|
||||
}
|
||||
$data = json_decode($_POST['data']);
|
||||
if (!isset($data->projects) || !isset($data->beginDate) || !isset($data->endDate) || strtotime($data->beginDate) > strtotime($data->endDate)) {
|
||||
$this->send(array('error' => -2, 'msg' => "bad request , wrong params"));
|
||||
return;
|
||||
}
|
||||
$forAll = count($data->projects) == 0; // 如果project id list 为空 则返回符合条件的所有项目
|
||||
if($forAll){
|
||||
$res = $this->report->getAllProjectConsumeInfo($data->beginDate,$data->endDate);
|
||||
}else{
|
||||
$res = $this->report->getProjectConsumeInfoByIdList($data->projects,$data->beginDate,$data->endDate);
|
||||
}
|
||||
echo json_encode($res);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
helper::importControl('report');
|
||||
class myReport extends report
|
||||
{
|
||||
public function manhour()
|
||||
{
|
||||
$this->view->title = $this->lang->manhour->tableName;
|
||||
$projectList = $this->report->getProjectPairList();;
|
||||
$this->view->projectList = $projectList;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
helper::importControl('report');
|
||||
class myReport extends report
|
||||
{
|
||||
public function projectlist()
|
||||
{
|
||||
$projectList = $this->loadModel('program')->getProjectList();
|
||||
// $projectList = $this->manhour->getProjectPairList();
|
||||
echo json_encode($projectList);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#sidebar > .cell {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.cell.noDataCell {
|
||||
/*display: none;*/
|
||||
}
|
||||
|
||||
.cell.dataTableCell {
|
||||
display: none;
|
||||
}
|
||||
.dataTable{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.myTopTH,.myLeftTH,.myMidTH{
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.myTD{
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
$(".query-btn").click(function (e) {
|
||||
$(".my-indicator").fadeIn();
|
||||
let projects = $("#selectedProjects").val(),
|
||||
beginDate = $("#beginDate").val(),
|
||||
endDate = $("#endDate").val()
|
||||
if (projects === undefined || projects === null || projects.length === 0) {
|
||||
projects = []
|
||||
}
|
||||
const postData = {
|
||||
projects,
|
||||
beginDate,
|
||||
endDate
|
||||
}
|
||||
$.ajax({
|
||||
url: './index.php?m=report&f=consumed',
|
||||
method: "post",
|
||||
data: {
|
||||
data: JSON.stringify(postData)
|
||||
},
|
||||
success: function (res) {
|
||||
res = JSON.parse(res)
|
||||
|
||||
const noDataCell = $('.cell.noDataCell'),dataTableCell = $('.cell.dataTableCell')
|
||||
console.log(res)
|
||||
if(res===undefined||res===null||res.length===0||res['error']!==undefined){
|
||||
noDataCell.show()
|
||||
dataTableCell.hide()
|
||||
if(res['error'] !== undefined){
|
||||
alert(res['msg'])
|
||||
}
|
||||
return
|
||||
}
|
||||
const html = createTable(res,beginDate,endDate)
|
||||
$('.dataTable').html(html)
|
||||
noDataCell.hide()
|
||||
dataTableCell.show()
|
||||
},
|
||||
|
||||
// contentType :'application/json'
|
||||
}).done(function (r){
|
||||
$(".my-indicator").fadeOut()
|
||||
})
|
||||
})
|
||||
Date.prototype.addDays = function (days) {
|
||||
const date = new Date(this.valueOf());
|
||||
date.setDate(date.getDate() + days);
|
||||
return date;
|
||||
}
|
||||
|
||||
function toNormalDateFormatString(MyDate) {
|
||||
return MyDate.getFullYear() + '-' + ('0' + (MyDate.getMonth() + 1)).slice(-2) + '-'
|
||||
+ ('0' + MyDate.getDate()).slice(-2)
|
||||
}
|
||||
|
||||
function calcDiffDays(date1, date2) {
|
||||
return Math.abs((date2 - date1) / 1000 / 60 / 60 / 24);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
$lang->manhour->program = 'Projects';
|
||||
$lang->manhour->index = 'Index';
|
||||
$lang->manhour->tableName = 'Daily Man-hour Table';
|
||||
$lang->manhour->projectName = 'Project Name';
|
||||
$lang->manhour->stuff = 'Stuff';
|
||||
$lang->manhour->startDate = 'Begin';
|
||||
$lang->manhour->endDate = 'End';
|
||||
|
||||
$lang->manhour->list = 'Report';
|
||||
$lang->manhour->item = 'Item';
|
||||
$lang->manhour->value = 'Value';
|
||||
$lang->manhour->percent = 'Percentage';
|
||||
$lang->manhour->undefined = 'Undefined';
|
||||
$lang->manhour->query = 'Query';
|
||||
$lang->manhour->annual = 'Annual Summary';
|
||||
$lang->manhour->project = 'Project';
|
||||
$lang->manhour->PO = 'PO';
|
||||
$lang->manhour->proVersion = '<a href="https://www.zentao.net/page/enterprise.html" target="_blank">Try ZenTao Biz for more!</a>';
|
||||
$lang->manhour->proVersionEn = '<a href="https://www.zentao.pm/" target="_blank">Try ZenTao Biz for more!</a>';
|
||||
|
||||
$lang->manhour->colors[] = 'AFD8F8';
|
||||
$lang->manhour->colors[] = 'F6BD0F';
|
||||
$lang->manhour->colors[] = '8BBA00';
|
||||
$lang->manhour->colors[] = 'FF8E46';
|
||||
$lang->manhour->colors[] = '008E8E';
|
||||
$lang->manhour->colors[] = 'D64646';
|
||||
$lang->manhour->colors[] = '8E468E';
|
||||
$lang->manhour->colors[] = '588526';
|
||||
$lang->manhour->colors[] = 'B3AA00';
|
||||
$lang->manhour->colors[] = '008ED6';
|
||||
$lang->manhour->colors[] = '9D080D';
|
||||
$lang->manhour->colors[] = 'A186BE';
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
$lang->manhour->program = '项目';
|
||||
$lang->manhour->index = '统计首页';
|
||||
$lang->manhour->tableName = '每日工时统计表';
|
||||
$lang->manhour->projectName = '所属项目';
|
||||
$lang->manhour->stuff = '投入人员';
|
||||
$lang->manhour->startDate = '起始时间';
|
||||
$lang->manhour->endDate = '截止时间';
|
||||
|
||||
$lang->manhour->list = '统计报表';
|
||||
$lang->manhour->item = '条目';
|
||||
$lang->manhour->value = '值';
|
||||
$lang->manhour->percent = '百分比';
|
||||
$lang->manhour->undefined = '未设定';
|
||||
$lang->manhour->query = '查询';
|
||||
$lang->manhour->annual = '年度总结';
|
||||
$lang->manhour->project = '项目';
|
||||
$lang->manhour->PO = 'PO';
|
||||
$lang->manhour->proVersion = '<a href="https://www.zentao.net/page/enterprise.html" target="_blank">更多精彩,尽在企业版!</a>';
|
||||
$lang->manhour->proVersionEn = '<a href="https://www.zentao.pm/" target="_blank">Try ZenTao Biz for more!</a>';
|
||||
|
||||
$lang->manhour->colors[] = 'AFD8F8';
|
||||
$lang->manhour->colors[] = 'F6BD0F';
|
||||
$lang->manhour->colors[] = '8BBA00';
|
||||
$lang->manhour->colors[] = 'FF8E46';
|
||||
$lang->manhour->colors[] = '008E8E';
|
||||
$lang->manhour->colors[] = 'D64646';
|
||||
$lang->manhour->colors[] = '8E468E';
|
||||
$lang->manhour->colors[] = '588526';
|
||||
$lang->manhour->colors[] = 'B3AA00';
|
||||
$lang->manhour->colors[] = '008ED6';
|
||||
$lang->manhour->colors[] = '9D080D';
|
||||
$lang->manhour->colors[] = 'A186BE';
|
||||
@@ -1,164 +0,0 @@
|
||||
<?php
|
||||
|
||||
class manhourReport extends reportModel
|
||||
{
|
||||
/**
|
||||
* Get project pair array [name,id]
|
||||
* @param $status
|
||||
* @param $orderBy
|
||||
* @param $pager
|
||||
* @param $involved
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectPairList($status = 'all', $orderBy = 'order_desc', $pager = null, $involved = 0)
|
||||
{
|
||||
$projects = $this->loadModel('project')->getInfoList($status, $orderBy, $pager, $involved);
|
||||
$result = array();
|
||||
foreach ($projects as $item) {
|
||||
$key = $item->id;
|
||||
$val = $item->name;
|
||||
$result[$key] = $val;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Project Consume Information by Project ID
|
||||
* @param $projectId
|
||||
* @param $beginDate
|
||||
* @param $endDate
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectConsumeInfoById($projectId, $beginDate, $endDate)
|
||||
{
|
||||
// select project,account,date,sum(consumed) as consumed from
|
||||
// zt_taskestimate as t1 left join zt_task as t2 on t1.task=t2.id
|
||||
// where project=${projectId}
|
||||
// group by account,date
|
||||
|
||||
return $this->dao->select('t2.project,t1.account,t3.realname,t3.nickname,t1.date,sum(t1.consumed) as consumed , count(t1.id) as mergedRow')
|
||||
->from(TABLE_TASKESTIMATE)->alias('t1')->leftJoin(TABLE_TASK)->alias('t2')->on('t1.task=t2.id')
|
||||
->leftJoin(TABLE_USER)->alias('t3')->on('t1.account=t3.account')
|
||||
->where('project')->eq($projectId)
|
||||
->andWhere('date')->between($beginDate, $endDate)
|
||||
->groupBy('account,date')
|
||||
->fetchGroup('date');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Project Consume Information by Project ID List
|
||||
* @param $projectIdList
|
||||
* @param $beginDate
|
||||
* @param $endDate
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectConsumeInfoByIdList($projectIdList, $beginDate, $endDate)
|
||||
{
|
||||
$result = array();
|
||||
$projectNameMap = $this->getProjectPairList();
|
||||
for ($i = 0; $i < count($projectIdList); $i++) {
|
||||
$projectInfo = new stdclass();
|
||||
$projectInfo->projectId = $projectIdList[$i];
|
||||
$projectInfo->projectName = $projectNameMap[$projectIdList[$i]];
|
||||
$projectInfo->consumeInfo = $this->getProjectConsumeInfoById($projectIdList[$i], $beginDate, $endDate);
|
||||
if (count($projectInfo->consumeInfo) > 0) {
|
||||
$projectInfo->users = $this->getUsers($projectInfo->consumeInfo);
|
||||
$result[$i] = $projectInfo;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Project Consume Information for all the Projects
|
||||
* @param $beginDate
|
||||
* @param $endDate
|
||||
* @return array
|
||||
*/
|
||||
public function getAllProjectConsumeInfo($beginDate, $endDate)
|
||||
{
|
||||
$result = array();
|
||||
$projectNameMap = $this->getProjectPairList();
|
||||
$i = 0;
|
||||
foreach ($projectNameMap as $key => $val) {
|
||||
$projectInfo = new stdclass();
|
||||
$projectInfo->projectId = $key;
|
||||
$projectInfo->projectName = $val;
|
||||
$projectInfo->consumeInfo = $this->getProjectConsumeInfoById($key, $beginDate, $endDate);
|
||||
if (count($projectInfo->consumeInfo) > 0) {
|
||||
$projectInfo->users = $this->getUsers($projectInfo->consumeInfo);
|
||||
$result[$i++] = $projectInfo;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract Users Set from Consume Information
|
||||
* @param $consumeInfo
|
||||
* @return array
|
||||
*/
|
||||
public function getUsers($consumeInfo)
|
||||
{
|
||||
$users = array();
|
||||
$i=0;
|
||||
foreach ($consumeInfo as $infos){
|
||||
foreach($infos as $val){
|
||||
$users[$i++] = $val->realname;
|
||||
}
|
||||
}
|
||||
$i = 0;
|
||||
$res = array();
|
||||
foreach (array_unique($users) as $item){
|
||||
$res[$i++] = $item;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* Get project info.
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $orderBy
|
||||
* @param int $pager
|
||||
* @param int $involved
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getInfoList($status = 'undone', $orderBy = 'order_desc', $pager = null, $involved = 0)
|
||||
{
|
||||
/* Init vars. */
|
||||
$projects = $this->loadModel('program')->getProjectList(0, $status, 0, $orderBy, $pager, 0, $involved);
|
||||
if(empty($projects)) return array();
|
||||
|
||||
$projectIdList = array_keys($projects);
|
||||
$teams = $this->dao->select('t1.root, count(t1.id) as count')->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account')
|
||||
->where('t1.root')->in($projectIdList)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->groupBy('t1.root')
|
||||
->fetchAll('root');
|
||||
|
||||
$condition = $this->config->systemMode == 'classic' ? 't2.id as project' : 't2.parent as project';
|
||||
$estimates = $this->dao->select("$condition, sum(estimate) as estimate")->from(TABLE_TASK)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id')
|
||||
->where('t1.parent')->lt(1)
|
||||
->beginIF($this->config->systemMode == 'new')->andWhere('t2.parent')->in($projectIdList)->fi()
|
||||
->beginIF($this->config->systemMode == 'classic')->andWhere('t2.id')->in($projectIdList)->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->groupBy('project')
|
||||
->fetchAll('project');
|
||||
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
foreach($projects as $projectID => $project)
|
||||
{
|
||||
$orderBy = $project->model == 'waterfall' ? 'id_asc' : 'id_desc';
|
||||
$pager = $project->model == 'waterfall' ? null : new pager(0, 1, 1);
|
||||
$project->executions = $this->loadModel('execution')->getStatData($projectID, 'undone', 0, 0, false, '', $orderBy, $pager);
|
||||
$project->teamCount = isset($teams[$projectID]) ? $teams[$projectID]->count : 0;
|
||||
$project->estimate = isset($estimates[$projectID]) ? round($estimates[$projectID]->estimate, 2) : 0;
|
||||
$project->parentName = $this->getParentProgram($project);
|
||||
}
|
||||
return $projects;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Get project pair array [name,id]
|
||||
* @param $status
|
||||
* @param $orderBy
|
||||
* @param $pager
|
||||
* @param $involved
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectPairList($status = 'all', $orderBy = 'order_desc', $pager = null, $involved = 0)
|
||||
{
|
||||
$projectList = $this->loadExtension('manhour')->getProjectPairList($status , $orderBy, $pager, $involved);
|
||||
return $projectList;
|
||||
}
|
||||
/**
|
||||
* Get Project Consume Information by Project ID
|
||||
* @param $projectId
|
||||
* @param $beginDate
|
||||
* @param $endDate
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectConsumeInfoById($projectId,$beginDate,$endDate)
|
||||
{
|
||||
$projectList = $this->loadExtension('manhour')->getProjectConsumeInfoById($projectId,$beginDate,$endDate);
|
||||
return $projectList;
|
||||
}
|
||||
/**
|
||||
* Get Project Consume Information by Project ID List
|
||||
* @param $projectIdList
|
||||
* @param $beginDate
|
||||
* @param $endDate
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectConsumeInfoByIdList($projectIdList,$beginDate,$endDate)
|
||||
{
|
||||
$projectList = $this->loadExtension('manhour')->getProjectConsumeInfoByIdList($projectIdList,$beginDate,$endDate);
|
||||
return $projectList;
|
||||
}
|
||||
/**
|
||||
* Get Project Consume Information for all the Projects
|
||||
* @param $beginDate
|
||||
* @param $endDate
|
||||
* @return array
|
||||
*/
|
||||
public function getAllProjectConsumeInfo($beginDate,$endDate)
|
||||
{
|
||||
$projectList = $this->loadExtension('manhour')->getAllProjectConsumeInfo($beginDate,$endDate);
|
||||
return $projectList;
|
||||
}
|
||||
/**
|
||||
* Extract Users Set from Consume Information
|
||||
* @param $consumeInfo
|
||||
* @return array
|
||||
*/
|
||||
public function getUsers($consumeInfo)
|
||||
{
|
||||
$projectList = $this->loadExtension('manhour')->getUsers($consumeInfo);
|
||||
return $projectList;
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
<?php include '../../../../../module/common/view/header.html.php'; ?>
|
||||
<?php include '../../../../../module/common/view/datepicker.html.php'; ?>
|
||||
<?php include '../../../../../module/common/view/chart.html.php'; ?>
|
||||
<?php if ($this->config->edition != 'open'): ?>
|
||||
<style>#mainContent > .side-col.col-lg {
|
||||
width: 235px
|
||||
}</style>
|
||||
<style>.hide-sidebar #sidebar {
|
||||
width: 0 !important
|
||||
}</style>
|
||||
<?php endif; ?>
|
||||
<?php $chartData = array('labels' => array(), 'data' => array()); ?>
|
||||
<style>
|
||||
#sidebar > .cell {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.cell.noDataCell {
|
||||
/*display: none;*/
|
||||
}
|
||||
|
||||
.cell.dataTableCell {
|
||||
display: none;
|
||||
}
|
||||
.dataTable{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.myTopTH,.myLeftTH,.myMidTH{
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.myTD{
|
||||
text-align: center;
|
||||
}
|
||||
.my-indicator{
|
||||
display: none;width: 100px; height: 100px; background:#ccc;
|
||||
border-radius: 5px;
|
||||
position: fixed;
|
||||
top: 150px;
|
||||
left: 50%;
|
||||
margin-left: -50px;
|
||||
}
|
||||
</style>
|
||||
<div class="load-indicator loading my-indicator" style=""></div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='side-col col-lg' id='sidebar'>
|
||||
<?php include 'manhourleftbar.html.php'; ?>
|
||||
</div>
|
||||
<div class='main-col'>
|
||||
<div class='cell'>
|
||||
<div class="row" id='conditions'>
|
||||
<div class='w-220px col-md-3 col-sm-6'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->manhour->program ?></span>
|
||||
<?php echo html::select('selectedProjects[]', $projectList, "", 'class="form-control chosen" multiple'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='w-220px col-md-3 col-sm-6'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->manhour->startDate ?></span>
|
||||
<div class='datepicker-wrapper datepicker-date'><?php echo html::input('beginDate', date('Y-m-d', strtotime('-7 days')), "class='form-control form-date'"); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='w-220px col-md-3 col-sm-6'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->manhour->endDate ?></span>
|
||||
<div class='datepicker-wrapper datepicker-date'><?php echo html::input('endDate', date('Y-m-d'), "class='form-control form-date'"); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='w-220px col-md-3 col-sm-6'>
|
||||
<a href="javascript:void(0)" class="query-btn btn btn-primary create-project-btn"
|
||||
data-app="project"><?php echo $lang->manhour->query ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell noDataCell">
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->error->noData; ?></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class='cell dataTableCell'>
|
||||
<div class='panel'>
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">
|
||||
<?php echo $lang->manhour->tableName; ?>
|
||||
<i class="icon icon-exclamation-sign icon-rotate-180"></i>
|
||||
<span class="hidden" id="desc"><?php echo $lang->manhour->tableName; ?></span>
|
||||
</div>
|
||||
<nav class="panel-actions btn-toolbar"></nav>
|
||||
</div>
|
||||
<div class="tableContainer" style="overflow-x: scroll">
|
||||
<table class='dataTable table table-condensed table-striped table-bordered no-margin'>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
function createTable(data, begin, end) {
|
||||
if(data===undefined) {
|
||||
console.log("fail to create table , data is undefined!")
|
||||
return
|
||||
}
|
||||
const date1 = new Date(begin), date2 = new Date(end), n = calcDiffDays(date1, date2)+1;
|
||||
let thead = '<thead>'
|
||||
thead += '<th> <div class="myTopTH"><?php echo $lang->manhour->projectName ?></div></th>'
|
||||
thead += '<th><div class="myTopTH"><?php echo $lang->manhour->stuff ?></div></th>'
|
||||
for (let i = 0; i < n; i++) {
|
||||
thead += '<th><div class="myTopTH">' + toNormalDateFormatString(date1.addDays(i)) + '</div></th>'
|
||||
}
|
||||
thead += '</thead>'
|
||||
|
||||
let tbody = '<tbody>'
|
||||
for(let i=0; i<data.length;i++){
|
||||
const project = data[i]
|
||||
console.log(project['users'])
|
||||
tbody += '<tr>'
|
||||
tbody += '<th rowspan="'+ project['users'].length +'" scope="rowgroup"> <div class="myLeftTH">' + project['projectName'] + '</div></th>'
|
||||
|
||||
tbody += '<th scope="row" class="'+project['projectName']+'-'+project['users'][0]+'"> <div class="myMidTH">' + project['users'][0] + '</div></th>'
|
||||
for (let j = 0; j < n; j++) { // 创建 该用户在该项目中的消耗
|
||||
const cellDate = toNormalDateFormatString(date1.addDays(j))
|
||||
if(project['consumeInfo'][cellDate] !== undefined){
|
||||
let t = ''
|
||||
for(let item of project['consumeInfo'][cellDate]){
|
||||
if(item['realname']===project['users'][0]){
|
||||
t = '<td> <div class="myTD">' + item['consumed'] + '</div></td>'
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(t===''){
|
||||
tbody += '<td> <div class="myTD"> - </div></td>'
|
||||
}else {
|
||||
tbody += t;
|
||||
}
|
||||
}else{
|
||||
tbody += '<td> <div class="myTD"> - </div></td>'
|
||||
}
|
||||
}
|
||||
tbody += '</tr>'
|
||||
|
||||
for(let x=1;x<project['users'].length;x++){
|
||||
tbody += '<tr>'
|
||||
tbody += '<th scope="row" class="'+project['projectName']+'-'+project['users'][x]+'"> <div class="myMidTH">' + project['users'][x] + '</div></th>'
|
||||
for (let j = 0; j < n; j++) { // 创建 该用户在该项目中的消耗
|
||||
const cellDate = toNormalDateFormatString(date1.addDays(j))
|
||||
if(project['consumeInfo'][cellDate] !== undefined){
|
||||
let t = ''
|
||||
for(let item of project['consumeInfo'][cellDate]){
|
||||
if(item['realname']===project['users'][x]){
|
||||
t = '<td> <div class="myTD">' + item['consumed'] + '</div></td>'
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(t===''){
|
||||
tbody += '<td> <div class="myTD"> - </div></td>'
|
||||
}else {
|
||||
tbody += t;
|
||||
}
|
||||
}else{
|
||||
tbody += '<td> <div class="myTD"> - </div></td>'
|
||||
}
|
||||
}
|
||||
tbody += '</tr>'
|
||||
}
|
||||
}
|
||||
tbody += '</tbody>'
|
||||
console.log(tbody)
|
||||
return thead + tbody
|
||||
}
|
||||
</script>
|
||||
<?php include '../../../../../module/common/view/footer.html.php'; ?>
|
||||
@@ -1,25 +0,0 @@
|
||||
<div class="sidebar-toggle">
|
||||
<i class="icon icon-angle-left"></i>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class='panel'>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->manhour->list;?></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<div class='list-group'>
|
||||
<?php
|
||||
$title = $lang->manhour->tableName;
|
||||
echo html::a($this->createLink("manhour", "index", ""), '<i class="icon icon-file-text"></i> ' . $lang->manhour->tableName, '', "class='selected' title='$title'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($this->config->edition == 'open'):?>
|
||||
<div class='panel panel-body' style='padding: 10px 6px'>
|
||||
<div class='text proversion'>
|
||||
<strong class='text-danger small text-latin'>BIZ</strong> <span class='text-important'><?php echo (!empty($config->isINT)) ? $lang->manhour->proVersionEn : $lang->manhour->proVersion;?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -1,8 +0,0 @@
|
||||
<table class='table table-condensed table-striped table-bordered table-fixed no-margin' id='executionList'>
|
||||
<thead>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 103 KiB |
Reference in New Issue
Block a user