diff --git a/module/personnel/control.php b/module/personnel/control.php index 77b3bb7c35..e7759d4096 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -226,6 +226,8 @@ class personnel extends control if($acl->objectType == 'product') $this->personnel->deleteProgramWhitelist($acl->objectID, $acl->account); if($acl->objectType == 'sprint') $this->personnel->deleteProjectWhitelist($acl->objectID, $acl->account); + $this->loadModel('user')->updateUserView($acl->objectID, $acl->objectType, array($acl->account)); + $this->loadModel('action')->create('whitelist', $acl->objectID, 'managedWhitelist', '', $acl->objectType); die(js::reload('parent')); diff --git a/module/personnel/model.php b/module/personnel/model.php index 74233e628d..4d7535b0b7 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -628,6 +628,7 @@ class personnelModel extends model { $program = $this->dao->select('id,program,whitelist')->from(TABLE_PRODUCT)->where('id')->eq($objectID)->fetch(); if(empty($program)) return false; + $programID = $program->program; $products = $this->dao->select('id')->from(TABLE_PRODUCT)->where('program')->eq($programID)->andWhere('deleted')->eq('0')->fetchPairs('id'); $whitelist = $this->dao->select('*')->from(TABLE_ACL)->where('objectID')->in($products)->andWhere('account')->eq($account)->andWhere('objectType')->eq('product')->fetch(); @@ -639,6 +640,7 @@ class personnelModel extends model $this->dao->update(TABLE_PROGRAM)->set('whitelist')->eq($newWhitelist)->where('id')->eq($programID)->exec(); $this->dao->delete()->from(TABLE_ACL)->where('objectID')->eq($programID)->andWhere('account')->eq($account)->andWhere('objectType')->eq('program')->exec(); } + $this->loadModel('user')->updateUserView($programID, 'program', array($account)); } /** @@ -653,6 +655,7 @@ class personnelModel extends model { $project = $this->dao->select('id,project,whitelist')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch(); if(empty($project)) return false; + $projectID = $project->project; $sprints = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($projectID)->andWhere('deleted')->eq('0')->fetchPairs('id'); $whitelist = $this->dao->select('*')->from(TABLE_ACL)->where('objectID')->in($sprints)->andWhere('account')->eq($account)->andWhere('objectType')->eq('sprint')->fetch(); @@ -664,6 +667,7 @@ class personnelModel extends model $this->dao->update(TABLE_PROJECT)->set('whitelist')->eq($newWhitelist)->where('id')->eq($projectID)->exec(); $this->dao->delete()->from(TABLE_ACL)->where('objectID')->eq($projectID)->andWhere('account')->eq($account)->andWhere('objectType')->eq('project')->exec(); } + $this->loadModel('user')->updateUserView($projectID, 'project', array($account)); } /**