Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -1084,9 +1084,12 @@ class block extends control
|
||||
if($product->status == 'closed') $closed++;
|
||||
}
|
||||
|
||||
$this->view->total = $normal + $closed;
|
||||
$this->view->normal = $normal;
|
||||
$this->view->closed = $closed;
|
||||
$total = $normal + $closed;
|
||||
|
||||
$this->view->total = $total;
|
||||
$this->view->normal = $normal;
|
||||
$this->view->closed = $closed;
|
||||
$this->view->normalPercent = $total ? round(($normal / $total), 2) * 100 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</style>
|
||||
<div class="panel-body table-row">
|
||||
<div class="col-6 text-middle text-center">
|
||||
<div class="progress-pie inline-block" data-value="<?php echo 100 * $normal/($closed + $normal);?>" data-doughnut-size="80">
|
||||
<div class="progress-pie inline-block" data-value="<?php echo $normalPercent;?>" data-doughnut-size="80">
|
||||
<canvas width="100" height="100" style="width: 100px; height: 100px;"></canvas>
|
||||
<div class="progress-info">
|
||||
<small><?php echo $lang->product->all;?></small>
|
||||
|
||||
@@ -129,6 +129,7 @@ class datatableModel extends model
|
||||
$fixed = $col->fixed == 'no' ? 'true': 'false';
|
||||
$width = is_numeric($col->width) ? "{$col->width}px" : $col->width;
|
||||
$title = isset($col->title) ? "title='$col->title'" : '';
|
||||
$title = (isset($col->name) and $col->name) ? "title='$col->name'" : $title;
|
||||
if($id == 'id' and (int)$width < 90) $width = '90px';
|
||||
$width = "data-width='$width' style='width:$width'";
|
||||
$align = $id == 'actions' ? 'text-center' : '';
|
||||
|
||||
+12
-12
@@ -248,16 +248,15 @@ class reportModel extends model
|
||||
*/
|
||||
public function getWorkload($dept = 0, $assign = 'assign')
|
||||
{
|
||||
$depts = array();
|
||||
if($dept) $depts = $this->loadModel('dept')->getAllChildId($dept);
|
||||
$deptUsers = array();
|
||||
if($dept) $deptUsers = $this->loadModel('dept')->getDeptUserPairs($dept);
|
||||
|
||||
if($assign == 'noassign')
|
||||
{
|
||||
$members = $this->dao->select('t1.account,t2.name,t1.root')->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t2.id = t1.root')
|
||||
->leftJoin(TABLE_USER)->alias('t3')->on('t3.account = t1.account')
|
||||
->where('t2.status')->notin('cancel, closed, done, suspended')
|
||||
->beginIF($dept)->andWhere('t3.dept')->in($depts)->fi()
|
||||
->beginIF($dept)->andWhere('t1.account')->in(array_keys($deptUsers))->fi()
|
||||
->andWhere('t1.type')->eq('project')
|
||||
->andWhere("t1.account NOT IN(SELECT `assignedTo` FROM " . TABLE_TASK . " WHERE `project` = t1.`root` AND `status` NOT IN('cancel, closed, done, pause') AND assignedTo != '' GROUP BY assignedTo)")
|
||||
->fetchGroup('account', 'name');
|
||||
@@ -283,18 +282,18 @@ class reportModel extends model
|
||||
return $workload;
|
||||
}
|
||||
|
||||
$tasks = $this->dao->select('t1.*, t2.name as projectName')->from(TABLE_TASK)->alias('t1')
|
||||
$stmt = $this->dao->select('t1.*, t2.name as projectName')->from(TABLE_TASK)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t1.status')->notin('cancel, closed, done, pause')
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->andWhere('t2.status')->notin('cancel, closed, done, suspended')
|
||||
->andWhere('assignedTo')->ne('')
|
||||
->beginIF($dept)->andWhere('t3.dept')->in($depts)->fi()
|
||||
->fetchAll('id');
|
||||
->andWhere('assignedTo')->ne('');
|
||||
|
||||
if(empty($tasks)) return array();
|
||||
$allTasks = $stmt->fetchAll('id');
|
||||
$tasks = $stmt->beginIF($dept)->andWhere('t1.assignedTo')->in(array_keys($deptUsers))->fi()->fetchAll('id');
|
||||
|
||||
if(empty($allTasks)) return array();
|
||||
|
||||
/* Fix bug for children. */
|
||||
$parents = array();
|
||||
@@ -307,13 +306,14 @@ class reportModel extends model
|
||||
}
|
||||
|
||||
$multiTaskTeams = $this->dao->select('*')->from(TABLE_TEAM)->where('type')->eq('task')
|
||||
->andWhere('root')->in(array_keys($tasks))
|
||||
->andWhere('root')->in(array_keys($allTasks))
|
||||
->beginIF($dept)->andWhere('account')->in(array_keys($deptUsers))->fi()
|
||||
->fetchGroup('account', 'root');
|
||||
foreach($multiTaskTeams as $assignedTo => $multiTasks)
|
||||
{
|
||||
foreach($multiTasks as $task)
|
||||
{
|
||||
$userTask = $tasks[$task->root];
|
||||
$userTask = $allTasks[$task->root];
|
||||
$userTask->estimate = $task->estimate;
|
||||
$userTask->consumed = $task->consumed;
|
||||
$userTask->left = $task->left;
|
||||
|
||||
Reference in New Issue
Block a user