* Fix bug that the general module has no priv.

This commit is contained in:
hufangzhou
2023-03-24 01:13:10 +00:00
parent 45123c526a
commit 4ab8d29bc2
+9 -3
View File
@@ -419,10 +419,16 @@ class group extends control
}
else
{
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$privList = $browseType != 'bysearch' ? $this->group->getPrivsListByView($view) : $this->group->getPrivsListBySearch($paramID);
$privList = $browseType != 'bysearch' ? $this->group->getPrivsListByView($view, $pager) : $this->group->getPrivsListBySearch($paramID, $pager);
foreach($privList as $privID => $priv) if(!$this->group->checkMenuModule($view, $priv->module)) unset($privList[$privID]);
/* Pager. */
$this->app->loadClass('pager', $static = true);
$recTotal = count($privList);
$pager = new pager($recTotal, $recPerPage, $pageID);
$privList = array_chunk($privList, $pager->recPerPage, true);
$privList = empty($privList) ? $privList : $privList[$pageID - 1];
/* Build the search form. */
$queryID = ($browseType == 'bysearch') ? (int)$paramID : 0;