* [task#145383,done,2h] Check execution priviledge for task list in document block.
This commit is contained in:
committed by
zhangjialiang
parent
a4165e1b90
commit
305aae7540
+12
-2
@@ -202,12 +202,22 @@ class doc extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = (array)zget($blockData->content, 'data', array());
|
||||
if($type == 'task')
|
||||
{
|
||||
foreach($data as $taskID => $task)
|
||||
{
|
||||
$task->canView = $this->execution->checkPriv($task->execution);
|
||||
$data[$taskID] = $task;
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->loadClass('pager', true);
|
||||
|
||||
$this->view->idList = (array)zget($blockData->content, 'idList', array());
|
||||
$this->view->cols = (array)zget($blockData->content, 'cols', array());
|
||||
$this->view->data = (array)zget($blockData->content, 'data', array());
|
||||
$this->view->pager = new pager(count($this->view->data), 10);
|
||||
$this->view->data = $data;
|
||||
$this->view->pager = new pager(count($data), 10);
|
||||
}
|
||||
|
||||
$this->view->type = $type;
|
||||
|
||||
@@ -280,6 +280,18 @@ window.renderCell = function(result, info)
|
||||
if(info.row.data.reviewedDate == '0000-00-00') info.row.data.reviewedDate = '';
|
||||
}
|
||||
|
||||
if(blockType == 'task')
|
||||
{
|
||||
if(result)
|
||||
{
|
||||
if(info.col.name == 'name' && !info.row.data.canView)
|
||||
{
|
||||
result.shift();
|
||||
result.push({html: info.row.data.name});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user