* Fix bug #12627.
This commit is contained in:
+15
-21
@@ -599,23 +599,6 @@ class personnelModel extends model
|
||||
$this->updateWhitelist($users, $objectType, $objectID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete product whitelist.
|
||||
*
|
||||
* @param int $objectID
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteProductWhitelist($objectID, $account = '')
|
||||
{
|
||||
$product = $this->dao->select('id,whitelist')->from(TABLE_PRODUCT)->where('id')->eq($objectID)->fetch('whitelist');
|
||||
if(empty($product)) return false;
|
||||
|
||||
$newWhitelist = str_replace(',' . $acl->account, '', $product->whitelist);
|
||||
$this->dao->update(TABLE_PRODUCT)->set('whitelist')->eq($newWhitelist)->where('id')->eq($objectID)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user exists in the white list of multiple products.
|
||||
*
|
||||
@@ -682,11 +665,22 @@ class personnelModel extends model
|
||||
->andWhere('account')->in($users)
|
||||
->exec();
|
||||
|
||||
foreach($users as $account)
|
||||
$table = $objectType == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$object = $this->dao->select('id,whitelist')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
if(empty($object)) return false;
|
||||
|
||||
$newWhitelist = $object->whitelist;
|
||||
foreach($users as $account) $newWhitelist = str_replace(',' . $account, '', $newWhitelist);
|
||||
$this->dao->update($table)->set('whitelist')->eq($newWhitelist)->where('id')->eq($objectID)->exec();
|
||||
|
||||
/* Update user view. */
|
||||
$fieldName = $objectType . 's';
|
||||
$userViews = $this->dao->select("account, $fieldName")->from(TABLE_USERVIEW)->where('account')->in($users)->fetchAll();
|
||||
foreach($userViews as $userView)
|
||||
{
|
||||
if($objectType == 'program') $this->deleteProgramWhitelist($objectID, $account);
|
||||
if($objectType == 'project') $this->deleteProjectWhitelist($objectID, $account);
|
||||
if($objectType == 'product') $this->deleteProductWhitelist($objectID, $account);
|
||||
$newUserView = str_replace(',' . $objectID . ',', ',', $userView->$fieldName . ',');
|
||||
$newUserView = substr($newUserView, 0, strlen($newUserView) - 1);
|
||||
$this->dao->update(TABLE_USERVIEW)->set($fieldName)->eq($newUserView)->where('account')->eq($userView->account)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,17 @@ $lang->xuanxuan = new stdclass();
|
||||
$lang->admin->menu->xuanxuan = array('link' => 'Desktop|admin|xuanxuan', 'subModule' => 'client,setting');
|
||||
$lang->admin->menuOrder[6] = 'xuanxuan';
|
||||
|
||||
$lang->admin->subMenu->xuanxuan = new stdclass();
|
||||
$lang->admin->subMenu->xuanxuan->index = array('link' => 'Home|admin|xuanxuan');
|
||||
$lang->admin->subMenu->xuanxuan->setting = array('link' => 'Parameter|setting|xuanxuan');
|
||||
$lang->admin->subMenu->xuanxuan->update = array('link' => 'Update|client|browse', 'subModule' => 'client');
|
||||
$lang->admin->subMenuOrder->xuanxuan[0] = 'index';
|
||||
$lang->admin->subMenuOrder->xuanxuan[5] = 'setting';
|
||||
$lang->admin->subMenuOrder->xuanxuan[10] = 'update';
|
||||
$lang->admin->menu->xuanxuan['subMenu'] = new stdclass();
|
||||
$lang->admin->menu->xuanxuan['subMenu']->index = array('link' => 'Home|admin|xuanxuan');
|
||||
$lang->admin->menu->xuanxuan['subMenu']->setting = array('link' => 'Parameter|setting|xuanxuan');
|
||||
$lang->admin->menu->xuanxuan['subMenu']->update = array('link' => 'Update|client|browse', 'subModule' => 'client');
|
||||
|
||||
$lang->menugroup->client = 'admin';
|
||||
$lang->admin->menu->xuanxuan['menuOrder'][0] = 'index';
|
||||
$lang->admin->menu->xuanxuan['menuOrder'][5] = 'setting';
|
||||
$lang->admin->menu->xuanxuan['menuOrder'][10] = 'update';
|
||||
|
||||
$lang->navGroup->im = 'admin';
|
||||
$lang->navGroup->setting = 'admin';
|
||||
$lang->navGroup->client = 'admin';
|
||||
|
||||
$lang->confirmDelete = 'Do you want to delete it?';
|
||||
|
||||
Reference in New Issue
Block a user