Permalink
Browse files

Merge branch 'master' into paypal-rework

  • Loading branch information...
M4LuZ committed Jun 8, 2018
2 parents 10ee400 + b7daf5b commit 72768e4dae1257fee3ac827f641a8dc09b2edbf8
Showing with 3,420 additions and 2,395 deletions.
  1. +1 −0 .travis.yml
  2. +19 −0 composer.json
  3. +68 −22 modules/tournament2/{sp_tree.class.php → Classes/LanSuiteTree.php}
  4. +61 −0 modules/tournament2/Classes/RankingData.php
  5. +295 −139 modules/tournament2/{class_team.php → Classes/Team.php}
  6. +541 −392 modules/tournament2/{class_tournament.php → Classes/TournamentFunction.php}
  7. +549 −0 modules/tournament2/Classes/TournamentLeagueExport.php
  8. +173 −53 modules/tournament2/{tree.class.php → Classes/TourneyTree.php}
  9. +31 −0 modules/tournament2/Functions/ArrayToTable.php
  10. +16 −0 modules/tournament2/Functions/CheckDateInFuture.php
  11. +22 −0 modules/tournament2/Functions/CheckModeChangeAllowed.php
  12. +14 −0 modules/tournament2/Functions/CheckModeForLeague.php
  13. +14 −0 modules/tournament2/Functions/CheckModeForWWCLLeague.php
  14. +16 −0 modules/tournament2/Functions/CheckStateChangeAllowed.php
  15. +36 −0 modules/tournament2/Functions/GetTournamentName.php
  16. +16 −0 modules/tournament2/Functions/GetTournamentStatus.php
  17. +11 −0 modules/tournament2/Functions/GetTournamentTeamAnz.php
  18. +16 −0 modules/tournament2/Functions/GetTournamentUserIcon.php
  19. +16 −0 modules/tournament2/Functions/IfFinished.php
  20. +16 −0 modules/tournament2/Functions/IfGenerated.php
  21. +16 −0 modules/tournament2/Functions/IfNotGenerated.php
  22. +58 −0 modules/tournament2/Functions/WriteGame.php
  23. +46 −0 modules/tournament2/Functions/WritePairs.php
  24. +150 −0 modules/tournament2/Functions/WritePairs2.php
  25. +164 −0 modules/tournament2/Functions/WritePairs3.php
  26. +18 −0 modules/tournament2/Functions/WriteRoundHeadline.php
  27. +0 −4 modules/tournament2/boxes/wwcl.php
  28. +24 −22 modules/tournament2/change_status.php
  29. +0 −429 modules/tournament2/class_t_league_export.php
  30. +102 −74 modules/tournament2/details.php
  31. +0 −73 modules/tournament2/disqualify.php
  32. +0 −2 modules/tournament2/docu/de_help.php
  33. +8 −5 modules/tournament2/export.php
  34. +115 −179 modules/tournament2/games.php
  35. +138 −108 modules/tournament2/generate_pairs.php
  36. +35 −12 modules/tournament2/join.php
  37. +58 −39 modules/tournament2/plugins/home.php
  38. +52 −35 modules/tournament2/plugins/usrmgr_details_tab.php
  39. +16 −8 modules/tournament2/rangliste.php
  40. +0 −92 modules/tournament2/search.inc.php
  41. +2 −1 modules/tournament2/show.php
  42. +44 −58 modules/tournament2/show_games.php
  43. +70 −45 modules/tournament2/submit_result.php
  44. +38 −16 modules/tournament2/team_details.php
  45. +89 −42 modules/tournament2/teammgr.php
  46. +46 −23 modules/tournament2/teammgr_admin.php
  47. +22 −9 modules/tournament2/timetable.php
  48. +0 −63 modules/tournament2/tournaments.php
  49. +19 −38 modules/tournament2/tree.php
  50. +95 −233 modules/tournament2/tree_frame.php
  51. +64 −179 modules/tournament2/tree_img.php
View
@@ -62,6 +62,7 @@ script:
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength modules/sponsor
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength modules/stats
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength,PSR2.Methods.MethodDeclaration,PSR1.Classes.ClassDeclaration modules/teamspeak2
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength,PSR1.Methods.CamelCapsMethodName modules/tournament2
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength modules/troubleticket
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength,PSR1.Methods.CamelCapsMethodName modules/usrmgr
- phpcs --standard=PSR1,PSR2 --extensions=php -s --exclude=Generic.Files.LineLength modules/wiki
View
@@ -54,6 +54,7 @@
"LanSuite\\Module\\Poll\\": "modules/poll/Classes/",
"LanSuite\\Module\\Seating\\": "modules/seating/Classes/",
"LanSuite\\Module\\Stats\\": "modules/stats/Classes/",
"LanSuite\\Module\\Tournament2\\": "modules/tournament2/Classes/",
"LanSuite\\Module\\UsrMgr\\": "modules/usrmgr/Classes/",
"LanSuite\\": "inc/Classes"
},
@@ -159,6 +160,24 @@
"modules/server/Functions/ServerType.php",
"modules/sponsor/Functions/RewriteFields.php",
"modules/sponsor/Functions/UploadFiles.php",
"modules/tournament2/Functions/ArrayToTable.php",
"modules/tournament2/Functions/CheckDateInFuture.php",
"modules/tournament2/Functions/CheckModeChangeAllowed.php",
"modules/tournament2/Functions/CheckModeForLeague.php",
"modules/tournament2/Functions/CheckModeForWWCLLeague.php",
"modules/tournament2/Functions/CheckStateChangeAllowed.php",
"modules/tournament2/Functions/GetTournamentName.php",
"modules/tournament2/Functions/GetTournamentStatus.php",
"modules/tournament2/Functions/GetTournamentTeamAnz.php",
"modules/tournament2/Functions/GetTournamentUserIcon.php",
"modules/tournament2/Functions/IfFinished.php",
"modules/tournament2/Functions/IfGenerated.php",
"modules/tournament2/Functions/IfNotGenerated.php",
"modules/tournament2/Functions/WriteGame.php",
"modules/tournament2/Functions/WritePairs.php",
"modules/tournament2/Functions/WritePairs2.php",
"modules/tournament2/Functions/WritePairs3.php",
"modules/tournament2/Functions/WriteRoundHeadline.php",
"modules/troubleticket/Functions/OptionRow.php",
"modules/troubleticket/Functions/TTStatus.php",
"modules/usrmgr/Functions/Addr1Input.php",
@@ -1,33 +1,67 @@
<?php
/**
* lansuite tourney tree class
*
* author: sparkY <sparky@splatterworld.de>
* description: special wrapper class fo lansuite tourney module. Actually uses TourneyTree class
*
*/
class lansuiteTree extends TourneyTree
namespace LanSuite\Module\Tournament2;
class LanSuiteTree extends TourneyTree
{
public $wb_teams = array();
public $lb_teams = array();
public $size = null;
public $st = null;
public $tree = null;
public $db = null;
/**
* @var array
*/
private $wb_teams = [];
/**
* @var array
*/
private $lb_teams = [];
/**
* @var int
*/
private $size = null;
/**
* @var string
*/
private $st = null;
/**
* @var TourneyTree
*/
private $tree = null;
/**
* @var \LanSuite\DB
*/
private $db = null;
public function __construct($id, $size, &$db)
{
$this->size = $size;
$this->st = "SELECT games.round, teams.name, teams.teamid, games.leaderid, games.gameid, games.score, games.position
FROM %prefix%t2_games AS games
LEFT JOIN %prefix%t2_teams AS teams ON ( games.tournamentid = teams.tournamentid )
AND ( games.leaderid = teams.leaderid)
WHERE (games.tournamentid = '".(int)$id."')
AND (games.group_nr = 0) AND (games.round = %s) GROUP BY games.gameid ORDER BY games.position DESC";
$this->st = "
SELECT
games.round,
teams.name,
teams.teamid,
games.leaderid,
games.gameid,
games.score,
games.position
FROM %prefix%t2_games AS games
LEFT JOIN %prefix%t2_teams AS teams ON
(games.tournamentid = teams.tournamentid)
AND ( games.leaderid = teams.leaderid)
WHERE
(games.tournamentid = '".(int)$id."')
AND (games.group_nr = 0)
AND (games.round = %s)
GROUP BY games.gameid
ORDER BY games.position DESC";
$this->db = $db;
}
/**
* @return void
*/
public function prepareWB()
{
for ($i=0; $i <= TourneyTree::numWBRounds($this->size); $i++) {
@@ -37,7 +71,7 @@ public function prepareWB()
}
}
// determine winner of each match
// Determine winner of each match
foreach ($this->wb_teams as $round => $teams) {
for ($i=0; $i<count($teams); $i++) {
$t1 = $this->wb_teams[$round][$i];
@@ -66,6 +100,9 @@ public function prepareWB()
}
}
/**
* @return void
*/
public function prepareLB()
{
$x=0;
@@ -112,6 +149,9 @@ public function prepareLB()
}
}
/**
* @return void
*/
public function mkTree()
{
if ($this->tree) {
@@ -120,6 +160,9 @@ public function mkTree()
$this->tree = new TourneyTree($this->size, $this->wb_teams, $this->lb_teams);
}
/**
* @return string
*/
public function getWBString()
{
if (!$this->tree) {
@@ -128,6 +171,9 @@ public function getWBString()
return $this->tree->printWB();
}
/**
* @return string
*/
public function getLBString()
{
if (!$this->tree) {
@@ -0,0 +1,61 @@
<?php
namespace LanSuite\Module\Tournament2;
class RankingData
{
/**
* @var array
*/
public $id = [];
/**
* @var array
*/
public $pos = [];
/**
* @var array
*/
public $tid = [];
/**
* @var array
*/
public $name = [];
/**
* @var array
*/
public $win = [];
/**
* @var array
*/
public $score = [];
/**
* @var array
*/
public $score_en = [];
/**
* @var array
*/
public $score_dif = [];
/**
* @var array
*/
public $games = [];
/**
* @var array
*/
public $disqualified = [];
/**
* @var array
*/
public $reached_finales = [];
}
Oops, something went wrong.

0 comments on commit 72768e4

Please sign in to comment.