* Finish task#7929.

This commit is contained in:
qiyu-xie
2020-09-16 15:53:15 +08:00
parent 26b376fac8
commit 89cda99a6e
2 changed files with 12 additions and 1 deletions
+7
View File
@@ -1002,6 +1002,13 @@ class actionModel extends model
$table = $this->config->objectTables[$action->objectType];
$this->dao->update($table)->set('deleted')->eq(0)->where('id')->eq($action->objectID)->exec();
/* Revert userView products when undelete project. */
if($action->objectType == 'project')
{
$products = $this->loadModel('project')->getProducts($project->id, $withBranch = false);
if(!empty($products)) $this->loadModel('user')->updateUserView(array_keys($products), 'product');
}
/* Revert doclib when undelete product or project. */
if($action->objectType == 'project' or $action->objectType == 'product')
{
+5 -1
View File
@@ -1546,7 +1546,11 @@ class userModel extends model
$linkedProjectProducts = array();
if($objectType == 'product')
{
$stmt = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('product')->in($objectIdList)->query();
$stmt = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->in($objectIdList)
->andWhere('t2.deleted')->eq(0)
->query();
while($projectProduct = $stmt->fetch())
{
$linkedProductProjects[$projectProduct->product][$projectProduct->project] = $projectProduct->project;