WIP: bring participo back - consistent use of bootstrap - formatting -
phpstan level 0 error free - fixes for kyu subpage - move mams into participo framework - remove legacy `lib/db.php` usage - add attributer admin function - add newsposter - fixing apiKey creation
This commit is contained in:
@@ -31,7 +31,7 @@ class Shiai
|
||||
$announcementUrl,
|
||||
$routeUrl,
|
||||
$galleryUrl = null,
|
||||
$promoImgUrl = null
|
||||
$promoImgUrl = null,
|
||||
) {
|
||||
//! @todo input validation and sanitation
|
||||
$this->id = filterId($id);
|
||||
@@ -65,7 +65,7 @@ class Shiai
|
||||
$ageclasses,
|
||||
$place,
|
||||
$announcementUrl,
|
||||
$routeUrl
|
||||
$routeUrl,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ class Shiai
|
||||
$id = filterId($id);
|
||||
|
||||
$query =
|
||||
"SELECT * FROM `cwsvjudo`.`wettkampfkalender` WHERE `lfdeNr` = :id;";
|
||||
"SELECT * FROM `cwsvjudo_main`.`wettkampfkalender` WHERE `lfdeNr` = :id;";
|
||||
$params = [":id" => ["value" => $id, "data_type" => PDO::PARAM_INT]];
|
||||
$response = dbConnector::query($query, $params);
|
||||
|
||||
@@ -159,7 +159,7 @@ class Shiai
|
||||
|
||||
public static function fromDbArray($member)
|
||||
{
|
||||
return new shiai(
|
||||
return new Shiai(
|
||||
$member["lfdeNr"] ?? null,
|
||||
$member["Datum"] ?? null,
|
||||
$member["Veranstaltung"] ?? "<fehlender Name>",
|
||||
@@ -168,7 +168,7 @@ class Shiai
|
||||
$member["Ausschreibung"] ?? null,
|
||||
$member["Routenplaner"] ?? null,
|
||||
$member["galleryLink"] ?? null,
|
||||
$member["promoPic"] ?? null
|
||||
$member["promoPic"] ?? null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,10 @@ class Shiai
|
||||
|
||||
public function getHtmlDescriptiveAgeClasses()
|
||||
{
|
||||
return join(", ", $this->ageclasses);
|
||||
if ($this->ageclasses) {
|
||||
return join(", ", $this->ageclasses);
|
||||
}
|
||||
return "<keine AK>";
|
||||
}
|
||||
|
||||
/** convert a list of age class formatted strings into a list of intervals of years
|
||||
@@ -238,10 +241,10 @@ class Shiai
|
||||
*/
|
||||
private static function akListString2jgArray(
|
||||
string $akListString,
|
||||
?int $year = null
|
||||
?int $year = null,
|
||||
) {
|
||||
$year =
|
||||
filterPosInt($year) ?? filterPosInt((new DateTime())->format("Y"));
|
||||
$now = new DateTime();
|
||||
$year = filterPosInt($year) ?? filterPosInt($now->format("Y"));
|
||||
|
||||
$ageGroups = [];
|
||||
foreach (explode(" ", $akListString) as $label) {
|
||||
@@ -260,8 +263,8 @@ class Shiai
|
||||
private static function akString2jgIntervall(string $akString, int $year)
|
||||
{
|
||||
/*= null*/ // input sanitation
|
||||
$year =
|
||||
filterPosInt($year) ?? filterPosInt((new DateTime())->format("Y"));
|
||||
$now = new DateTime();
|
||||
$year = filterPosInt($year) ?? filterPosInt($now->format("Y"));
|
||||
|
||||
$ret = [null, null];
|
||||
|
||||
@@ -339,7 +342,7 @@ class Shiai
|
||||
*/
|
||||
private static function ageClassGrouping(
|
||||
array $ageClassList,
|
||||
array $starterList
|
||||
array $starterList,
|
||||
) {
|
||||
$grouping = [];
|
||||
|
||||
@@ -352,7 +355,7 @@ class Shiai
|
||||
$startersAgeClass = $starter->yearOfBirth()
|
||||
? self::getAgeClassFromYear(
|
||||
$starter->yearOfBirth(),
|
||||
$ageClassList
|
||||
$ageClassList,
|
||||
)
|
||||
: null;
|
||||
$grouping[$startersAgeClass][$starter->getId()] = $starter;
|
||||
|
||||
Reference in New Issue
Block a user