Преглед на файлове

Merge branch 'master' of bn.git:plabudda/se

Piotr Labudda преди 7 години
родител
ревизия
d2bdd3c6cf
променени са 1 файла, в които са добавени 12 реда и са изтрити 11 реда
  1. 12 11
      SE/se-lib/Route/UrlAction/BiAuditGenerate.php

+ 12 - 11
SE/se-lib/Route/UrlAction/BiAuditGenerate.php

@@ -3724,16 +3724,17 @@ class BiAuditPowiazania {
 		$this->saveToDb($path);           
 	}
 
-	private static function weightCalc($n) {
-		if ($n < 21) return 1;
-		if ($n < 41) return 2;
-		if ($n < 81) return 3;
-		if ($n < 161) return 4;
-		if ($n < 321) return 5;
-		if ($n < 641) return 6;
-		if ($n < 1281) return 7;
-		if ($n < 2561) return 8;
-		if ($n < 5121) return 9;
+	private function weightCalc($n) {
+		if ($this->onlyTargets) return 1;
+		if ($n < 51) return 1;
+		if ($n < 101) return 2;
+		if ($n < 201) return 3;
+		if ($n < 401) return 4;
+		if ($n < 801) return 5;
+		if ($n < 1601) return 6;
+		if ($n < 3201) return 7;
+		if ($n < 6401) return 8;
+		if ($n < 12801) return 9;
 		return 10;
 	}
 
@@ -3794,7 +3795,7 @@ class BiAuditPowiazania {
 		}));
 
 		$count = count($nodes);
-		$weight += self::weightCalc($count);
+		$weight += $this->weightCalc($count);
 		if ($weight <= $this->maxDepth) {
 			foreach ($nodes as $i => $node) $this->findPowiazania($node['ID'], $weight, ($progress + ($i / ($count * $steps))), ($count * $steps), $node['RELATION_ID'], $node['PARAMS']);
 		}