Index: /changelog
===================================================================
--- /changelog	(revision 7968)
+++ /changelog	(revision 7969)
@@ -494,2 +494,3 @@
 - Bugfix: Korrekte Filterung nach ZustÃ€nden in Gutscheinverwaltung #775
 - Bugfix: Fehler bei PayPal Plus und Selbstabholung korrigiert
+- Bugfix: Pager/Filter nach Status bei Gutscheinen
Index: /mods/mod_gutschein/wpsg_voucher.php
===================================================================
--- /mods/mod_gutschein/wpsg_voucher.php	(revision 7968)
+++ /mods/mod_gutschein/wpsg_voucher.php	(revision 7969)
@@ -252,30 +252,8 @@
         /* Statische Funktionen */
 
-		public static function count($arFilter = array())
-		{
-
-			list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = self::getQueryParts($arFilter);
-
-			$strQuery = "
-				SELECT
-					COUNT(*)
-				FROM
-					(
-						SELECT
-						  	DISTINCT V.`id`
-						FROM
-							`".WPSG_TBL_GUTSCHEIN."` AS V
-							".$strQueryJOIN."
-						WHERE
-							1
-							".$strQueryWHERE." 
-						HAVING
-							1
-							".$strQueryHAVING."											
-					) AS innerSelect
-			";
-
-			return $GLOBALS['wpsg_db']->fetchOne($strQuery);
-
+		public static function count($arFilter = array()) {
+
+			return sizeof(self::find($arFilter));
+			 
 		} // public static function count($arFilter = array())
 
@@ -302,6 +280,5 @@
 					".$strQueryHAVING."
 				ORDER BY
-					".$strQueryORDER."		
-				
+					".$strQueryORDER."						
 			";
 			
@@ -310,5 +287,5 @@
 
 			$cnt = array();
-			
+			 
 			$cnt[0] = 0;	// Alle
 			$cnt[1] = 0;	// Aktiv
@@ -316,38 +293,32 @@
 			$cnt[3] = 0;	// Verbraucht
 			$cnt[4] = 0;	// Wartend
-			
-			$start = 0;		// Vergleich mit $arFilter['limit'][0]
-			$cntx = 0;		// Vergleich mit $arFilter['limit'][1]
-			
+			 
 			foreach ($arID as $id) {
 
-				$vv = self::getInstance($id);
-				$st = $vv->getStatus();
-				
-				if (isset($arFilter['status'])) {
-					
-					$cnt[0] ++;
-					$cnt[$st] ++;
-					
-					if (($arFilter['status'] == $st) || ($arFilter['status'] == 0)) {
+				$oVoucher = self::getInstance($id);
+				$state = intval($oVoucher->getStatus());
+				
+				$cnt[0] ++;
+				
+				$cnt[$state] ++;
+				
+				if (intval($arFilter['status']??0) > 0) {
+					
+					if ($state === intval($arFilter['status'])) {
 						
-						if ($start >= $arFilter['limit'][0]) {
-							
-							if ($cntx >= $arFilter['limit'][1]) continue;
-							
-							$arReturn[$id] = self::getInstance($id);
-							
-							$cntx++;
-							
-						}
-						
-						$start++;
+						$arReturn[$id] = $oVoucher;
 						
 					}
 					
-				}
-				
-			}
-
+				} else $arReturn[$id] = $oVoucher;
+				 				
+			}
+
+			if (isset($arFilter['limit'])) {
+				
+				$arReturn = array_slice($arReturn, $arFilter['limit'][0], $arFilter['limit'][1]);
+				
+			}
+			
 			$arReturn['counts'] = $cnt;
 			
@@ -357,6 +328,5 @@
 		} // public static function find($arFilter = array())
 
-		public static function getQueryParts($arFilter = array())
-		{
+		public static function getQueryParts($arFilter = array()) {
 
 			$strQuerySELECT = "";
Index: /mods/wpsg_mod_customergroup.class.php
===================================================================
--- /mods/wpsg_mod_customergroup.class.php	(revision 7968)
+++ /mods/wpsg_mod_customergroup.class.php	(revision 7969)
@@ -54,7 +54,9 @@
 		} // public function install()
 		
-		public function init()
-		{
-				
+		public function init() {
+				
+			$role_object = get_role('administrator');
+		    $role_object->add_cap('wpsg_customergroup');
+			
 			// Modell einbinden
 			require_once(WPSG_PATH_MOD.'mod_customergroup/wpsg_customergroup.php');
@@ -299,3 +301,2 @@
 	} // class wpsg_mod_customergroup extends wpsg_mod_basic
 	
-?>
