-
+ @@ -34,6 +34,7 @@ + + account] = $user->realname; + ?> + + + $realname):?> + + + + + - + diff --git a/module/product/model.php b/module/product/model.php index 55f3702d59..c9a722276e 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -490,7 +490,7 @@ class productModel extends model $this->file->updateObjectID($this->post->uid, $productID, 'product'); $this->dao->update(TABLE_PRODUCT)->set('`order`')->eq($productID * 5)->where('id')->eq($productID)->exec(); - $this->loadModel('program')->updateUserACL($this->post->whitelist, 'product', $productID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'product', $productID); if($product->acl != 'open') $this->loadModel('user')->updateUserView($productID, 'product'); /* Create doc lib. */ @@ -534,7 +534,7 @@ class productModel extends model if(!dao::isError()) { $this->file->updateObjectID($this->post->uid, $productID, 'product'); - $this->loadModel('program')->updateUserACL($this->post->whitelist, 'product', $productID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'product', $productID); if($product->acl != 'open') $this->loadModel('user')->updateUserView($productID, 'product'); return common::createChanges($oldProduct, $product); } diff --git a/module/program/model.php b/module/program/model.php index 5682d9bc3a..47055e2df2 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -280,7 +280,7 @@ class programModel extends model $programID = $this->dao->lastInsertId(); $this->dao->update(TABLE_PROGRAM)->set('`order`')->eq($programID * 5)->where('id')->eq($programID)->exec(); // Save order. - $this->updateUserACL($this->post->whitelist, 'program', $programID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'program', $programID); if($program->acl != 'open') $this->loadModel('user')->updateUserView($programID, 'program'); $this->file->updateObjectID($this->post->uid, $programID, 'project'); @@ -373,7 +373,7 @@ class programModel extends model if(!dao::isError()) { $this->file->updateObjectID($this->post->uid, $programID, 'project'); - $this->updateUserACL($this->post->whitelist, 'program', $programID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'program', $programID); if($program->acl != 'open') $this->loadModel('user')->updateUserView($programID, 'program'); if($oldProgram->parent != $program->parent) $this->processNode($programID, $program->parent, $oldProgram->path, $oldProgram->grade); @@ -1100,7 +1100,7 @@ class programModel extends model if(!dao::isError()) { $projectID = $this->dao->lastInsertId(); - $this->updateUserACL($this->post->whitelist, 'project', $projectID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'project', $projectID); if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project'); /* Save order. */ @@ -1191,7 +1191,7 @@ class programModel extends model if(!dao::isError()) { $this->file->updateObjectID($this->post->uid, $projectID, 'project'); - $this->updateUserACL($this->post->whitelist, 'project', $projectID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'project', $projectID); if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project'); if($oldProject->parent != $project->parent) $this->processNode($projectID, $project->parent, $oldProject->path, $oldProject->grade); @@ -1373,34 +1373,4 @@ class programModel extends model } } } - - /** - * Adding users to access control lists. - * - * @param array $users - * @param string $objectType program|project|product|sprint - * @param int $objectID - * @param string $type whitelist|blacklist - * @param string $source upgrade|add - * @param string $desc - * @access public - * @return void - */ - public function updateUserACL($users = array(), $objectType = '', $objectID = 0, $type = 'whitelist', $source = 'add', $desc = '') - { - if(empty($users)) return false; - $this->dao->delete()->from(TABLE_ACL)->where('objectID')->eq($objectID)->exec(); - foreach($users as $account) - { - if(empty($account)) continue; - $acl = new stdClass(); - $acl->account = $account; - $acl->objectType = $objectType; - $acl->objectID = $objectID; - $acl->type = $type; - $acl->source = $source; - $acl->desc = $desc; - $this->dao->insert(TABLE_ACL)->data($acl)->autoCheck()->exec(); - } - } } diff --git a/module/project/model.php b/module/project/model.php index 6d5e6376b0..0d53c49438 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -393,7 +393,7 @@ class projectModel extends model $lib->acl = 'default'; $this->dao->insert(TABLE_DOCLIB)->data($lib)->exec(); - $this->loadModel('program')->updateUserACL($this->post->whitelist, 'sprint', $projectID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'sprint', $projectID); if($sprint->acl != 'open') $this->updateUserView($projectID); if(!dao::isError()) $this->loadModel('score')->create('program', 'createguide', $projectID); @@ -458,7 +458,7 @@ class projectModel extends model } } - $this->loadModel('program')->updateUserACL($this->post->whitelist, 'sprint', $projectID); + $this->loadModel('personnel')->updateWhitelist($this->post->whitelist, 'sprint', $projectID); /* Fix bug#3074, Update views for team members. */ if($project->acl != 'open') $this->updateUserView($projectID, 'sprint', $changedAccounts);
@@ -45,12 +46,29 @@
+ + + + +
diff --git a/module/personnel/view/whitelist.html.php b/module/personnel/view/whitelist.html.php index 361e3a45b8..42659dcd51 100644 --- a/module/personnel/view/whitelist.html.php +++ b/module/personnel/view/whitelist.html.php @@ -53,8 +53,8 @@ email;?> createLink('personnel', 'unlinkACL', "id=$user->id&confirm=no"), '', 'hiddenwin', "title='{$lang->delete}' class='{$deleteClass}'"); + $deleteClass = common::hasPriv('personnel', 'unbindWhielist') ? 'btn' : 'btn disabled'; + echo html::a($this->createLink('personnel', 'unbindWhielist', "id=$user->id&confirm=no"), '', 'hiddenwin', "title='{$lang->delete}' class='{$deleteClass}'"); ?>