RomanL 8 年之前
父節點
當前提交
4ef2b84bb8

+ 6 - 2
modules/boonex/organizations/classes/BxOrgsGridAdministration.php

@@ -23,7 +23,7 @@ class BxOrgsGridAdministration extends BxBaseModGroupsGridAdministration
 		$CNF = &$this->_oModule->_oConfig->CNF;
         $this->_sFilter2Name = 'filter2';
         $aTmp = array();
-        BxDolAclQuery::getInstance()->getLevels(array('type' => 'all_active_pair'), $aTmp);
+        BxDolAclQuery::getInstance()->getLevels(array('type' => 'all_active_not_automatic_pair'), $aTmp);
         foreach ($aTmp as $sKey => $sValue) {
             $this->_aFilter2Values["level" . $sKey] = $sValue;
         }
@@ -44,7 +44,11 @@ class BxOrgsGridAdministration extends BxBaseModGroupsGridAdministration
         	$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`status`=?", $this->_sFilter1Value);
         
         if(!empty($this->_sFilter2Value))
-        	$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` IN (SELECT `IDMember` FROM `sys_acl_levels_members` WHERE IDLevel = ?) ", str_replace("level", "", $this->_sFilter2Value));
+        	$iLevel = intval(str_replace("level", "", $this->_sFilter2Value));
+			if ($iLevel <> 3)
+        		$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` IN (SELECT `IDMember` FROM `sys_acl_levels_members` WHERE IDLevel = ?) ", $iLevel);
+			else
+				$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` NOT IN (SELECT `IDMember` FROM `sys_acl_levels_members`) ", '');
 
         return parent::_getDataSqlInner($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
     }

+ 8 - 4
modules/boonex/persons/classes/BxPersonsGridAdministration.php

@@ -23,7 +23,7 @@ class BxPersonsGridAdministration extends BxBaseModProfileGridAdministration
         $CNF = &$this->_oModule->_oConfig->CNF;
         $this->_sFilter2Name = 'filter2';
         $aTmp = array();
-        BxDolAclQuery::getInstance()->getLevels(array('type' => 'all_active_pair'), $aTmp);
+        BxDolAclQuery::getInstance()->getLevels(array('type' => 'all_active_not_automatic_pair'), $aTmp);
         foreach ($aTmp as $sKey => $sValue) {
             $this->_aFilter2Values["level" . $sKey] = $sValue;
         }
@@ -42,9 +42,13 @@ class BxPersonsGridAdministration extends BxBaseModProfileGridAdministration
 
     	if(!empty($this->_sFilter1Value))
         	$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`status`=?", $this->_sFilter1Value);
-        
-        if(!empty($this->_sFilter2Value))
-        	$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` IN (SELECT `IDMember` FROM `sys_acl_levels_members` WHERE IDLevel = ?) ", str_replace("level", "", $this->_sFilter2Value));
+        if(!empty($this->_sFilter2Value)){
+			$iLevel = intval(str_replace("level", "", $this->_sFilter2Value));
+			if ($iLevel <> 3)
+        		$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` IN (SELECT `IDMember` FROM `sys_acl_levels_members` WHERE IDLevel = ?) ", $iLevel);
+			else
+				$this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`id` NOT IN (SELECT `IDMember` FROM `sys_acl_levels_members`) ", '');
+		}
 
         return parent::_getDataSqlInner($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
     }