From 305aae7540033f1e8b2ebc448fdae24e51fd822b Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 23 Jun 2025 16:33:30 +0800 Subject: [PATCH] * [task#145383,done,2h] Check execution priviledge for task list in document block. --- module/doc/control.php | 14 ++++++++++++-- module/doc/js/zentaolist.ui.js | 12 ++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 5dce560170..fc1d1f63ec 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -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; diff --git a/module/doc/js/zentaolist.ui.js b/module/doc/js/zentaolist.ui.js index 8d2468d163..aa4fb31f32 100644 --- a/module/doc/js/zentaolist.ui.js +++ b/module/doc/js/zentaolist.ui.js @@ -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; };