* Add block for program statistic.

This commit is contained in:
holan20180123
2020-08-25 09:37:08 +08:00
parent 82f771c4af
commit 6abb1f2aae
6 changed files with 168 additions and 46 deletions
+10 -4
View File
@@ -1377,13 +1377,14 @@ class block extends control
*/
public function printAssignToMeBlock($longBlock = true)
{
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true;
if(common::hasPriv('bug', 'view')) $hasViewPriv['bug'] = true;
if(common::hasPriv('risk', 'view')) $hasViewPriv['risk'] = true;
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true;
if(common::hasPriv('bug', 'view')) $hasViewPriv['bug'] = true;
if(common::hasPriv('risk', 'view')) $hasViewPriv['risk'] = true;
$params = $this->get->param;
$params = json_decode(base64_decode($params));
$count = array();
if(isset($hasViewPriv['todo']))
{
@@ -1407,6 +1408,7 @@ class block extends control
$todo->begin = date::formatTime($todo->begin);
$todo->end = date::formatTime($todo->end);
}
$count['todo'] = count($todos);
$this->view->todos = $todos;
}
if(isset($hasViewPriv['task']))
@@ -1420,6 +1422,7 @@ class block extends control
if(isset($params->taskNum)) $stmt->limit($params->taskNum);
$tasks = $stmt->fetchAll();
$count['task'] = count($tasks);
$this->view->tasks = $tasks;
}
if(isset($hasViewPriv['bug']))
@@ -1433,6 +1436,7 @@ class block extends control
if(isset($params->bugNum)) $stmt->limit($params->bugNum);
$bugs = $stmt->fetchAll();
$count['bug'] = count($bugs);
$this->view->bugs = $bugs;
}
if(isset($hasViewPriv['risk']))
@@ -1446,11 +1450,13 @@ class block extends control
if(isset($params->riskNum)) $stmt->limit($params->riskNum);
$risks = $stmt->fetchAll();
$count['risk'] = count($risks);
$this->view->risks = $risks;
}
$this->view->selfCall = $this->selfCall;
$this->view->hasViewPriv = $hasViewPriv;
$this->view->count = $count;
$this->view->longBlock = $longBlock;
$this->display();
}