From fc1e657c5e0a677ae7c2beb01e530a2fb0d265f2 Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Tue, 8 Apr 2025 06:04:21 +0000 Subject: [PATCH] [bug] add priv to doc object. --- module/doc/control.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index a497c39f43..c11e94f027 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1925,17 +1925,19 @@ class doc extends control $doc->editors = $this->doc->getEditors($docID); $doc->draft = $this->doc->getDraft($docID); + $lib = $this->doc->getLibByID((int)$doc->lib); + $objectType = $lib->type; + if(empty($objectType)) + { + if($lib->execution) $objectType = 'execution'; + elseif($lib->project) $objectType = 'project'; + elseif($lib->product) $objectType = 'product'; + } + + $this->doc->setDocPriv($doc, $objectType); + if($details == 'yes') { - $lib = $this->doc->getLibByID((int)$doc->lib); - $objectType = $lib->type; - if(empty($objectType)) - { - if($lib->execution) $objectType = 'execution'; - elseif($lib->project) $objectType = 'project'; - elseif($lib->product) $objectType = 'product'; - } - $objectID = $this->doc->getObjectIDByLib($lib, $objectType); $object = in_array($objectType, array('product', 'project', 'execution')) ? $this->doc->getObjectByID($objectType, $objectID) : $this->doc->getLibByID((int)$objectID);