diff --git a/homepage/participo/events.php b/homepage/participo/events.php
index 39fcf27..9e31b89 100644
--- a/homepage/participo/events.php
+++ b/homepage/participo/events.php
@@ -19,12 +19,12 @@ include_once("events.inc.php");
// specify options here
});
});
- document.addEventListener('DOMContentLoaded', function() {
- var elems = document.querySelectorAll('.modal');
- var instances = M.Modal.init(elems, {
- // specify options here
- });
- });
+ // document.addEventListener('DOMContentLoaded', function() {
+ // var elems = document.querySelectorAll('.modal');
+ // var instances = M.Modal.init(elems, {
+ // // specify options here
+ // });
+ // });
// Open the given modal
document.addEventListener('DOMContentLoaded', function () {
diff --git a/homepage/participo/index.php b/homepage/participo/index.php
index 57d0b23..b589754 100644
--- a/homepage/participo/index.php
+++ b/homepage/participo/index.php
@@ -102,7 +102,7 @@ echo(
AppCard::fromArray([
'link' => '/pages/desktop/wkParticipo',
'title' => 'Event-Planer',
- 'description' => 'Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.
' . eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents()) . '',
+ 'description' => 'Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.' . eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents()),
'imgUrl' => '/ressourcen/graphiken/icons/terminKalender.svg',
'actions' => [
AppCardAction::fromArray(['caption' => 'Planer', 'link' => '/pages/desktop/wkParticipo']),
diff --git a/homepage/participo/lib/participoLib/participo.php b/homepage/participo/lib/participoLib/participo.php
index 4ea60e3..e161304 100644
--- a/homepage/participo/lib/participoLib/participo.php
+++ b/homepage/participo/lib/participoLib/participo.php
@@ -214,11 +214,11 @@ class AppCard{
return
"
";
@@ -474,4 +474,70 @@ class dbConnector{
}
+
+/**
+ * User for the Participo system
+ */
+class user{
+ private $id;
+ private $loginName;
+ private $name;
+ private $firstName;
+ private $dateOfBirth;
+ private $eMail;
+
+ public function __construct($id, $loginName, $name, $firstName, $dateOfBirth, $eMail)
+ {
+ $this->id = (int) id;
+ $this->loginName = $loginName;
+ $this->name = $name;
+ $this->firstName = $firstName;
+ $this->dateOfBirth = $dateOfBirth!=null?DateTime::createFromFormat('Y-m-d', $dateOfBirth):null;
+ $this->eMail = $eMail;
+ }
+
+ /**
+ * Create a User from an assoziative array
+ *
+ * @param array $member associative array with the UserData from the dbRequest
+ * @return User initialized user
+ */
+ public static function fromArray($member){
+ return new User(
+ $member['id']??null,
+ $member['loginName']??null,
+ $member['name']??null,
+ $member['vorname']??null,
+ $member['gebDatum']??null,
+ array_key_exist('eMail', $member)?explode(',', $member['eMail']):null
+ );
+ }
+
+ /// Setzen aller Attribute
+ /// @todo Inputvalidation
+ function set($userData){
+ $this->id = $userData["id"];
+ $this->loginName = $userData["loginName"];
+ $this->name = $userData["name"];
+ $this->vorname = $userData["vorname"];
+ $this->gebDatum = $userData["gebDatum"];
+ $this->eMail = $userData["eMail"];
+ return;
+ }
+ function toAssoc(){
+ return array(
+ "id" => $this->id,
+ "loginName"=> $this->loginName,
+ "name" => $this->name,
+ "vorname" => $this->vorname,
+ "gebDatum" => $this->gebDatum,
+ "eMail" => $this->eMail);
+ }
+ function loadFromDb($dbConn, $id){
+ $this->set(
+ loadUserDataFromDb($dbConn, $id)
+ );
+ }
+}
+
?>
\ No newline at end of file
diff --git a/homepage/participo/lib/participoLib/planer.php b/homepage/participo/lib/participoLib/planer.php
index ea7ea0c..12099af 100644
--- a/homepage/participo/lib/participoLib/planer.php
+++ b/homepage/participo/lib/participoLib/planer.php
@@ -84,8 +84,8 @@ class shiai
'Datum:' . $this->getHtmlDate() . '' .
'Altersklassen' . $this->getAgeClasses() . '' .
'Ort' . $this->getPlace() . '' .
- '';
-
+ '' .
+ '';
return $retHtml;
}
} // end class shiai
@@ -142,10 +142,13 @@ class event
public function htmlModal()
{
return
- '' .
- '
' . $this->shiai->getHtml() . '
' .
+ '
' .
+ '
' .
+ $this->shiai->getHtml() .
+ '
' . // end modal content
'' .
'
';
}
@@ -220,8 +223,18 @@ class eventPlaner
public static function getHtmlEventTable($eventList)
{
- $ret = '
';
- $ret .= '';
+ $ret = '';
+
+ // initialize the modals
+ $ret .= '';
+
+ $ret .= '';
foreach ($eventList as $event) {
$ret .= $event->htmlTableRow();
}