* Finish task#7929.
This commit is contained in:
@@ -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')
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user