Korrekturen der Einbindung von wettkampfkalenderlosen Events
zum Commit vorgemerkte Änderungen: geändert: wkParticipo/admin/adminAddStarter.php geändert: wkParticipo/admin/listEvents.php geändert: wkParticipo/admin/newsLetter.php geändert: wkParticipo/admin/showEvent.php geändert: wkParticipo/admin/showFahrt.php geändert: wkParticipo/index.php geändert: wkParticipo/lib/wkParticipoLib.inc.php
This commit is contained in:
@@ -269,6 +269,7 @@ function getFahrtData($anMysqlConn, $anFahrtId){
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/*
|
||||
function getEventData($anMysqlConn, $anEventId){
|
||||
$ret = array();
|
||||
if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
@@ -276,6 +277,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
$query = sprintf(
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.date, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
@@ -286,7 +288,8 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"LEFT JOIN wettkampfkalender ".
|
||||
"ON wkParticipo_Events.wkId = wettkampfkalender.lfdeNr ".
|
||||
"WHERE wkParticipo_Events.id = '%s';",
|
||||
$anMysqlConn->real_escape_string($anEventId) );
|
||||
$results = $anMysqlConn->query($query);
|
||||
@@ -294,7 +297,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
/// @ToDo: Anzahl Ergebnise auf ==1 testen
|
||||
$ret = $results->fetch_assoc();
|
||||
return $ret;
|
||||
}
|
||||
}*/
|
||||
|
||||
/// Daten eines einzelnen wkEvents via eventId abfragen
|
||||
///
|
||||
@@ -306,6 +309,8 @@ return $ret;
|
||||
///
|
||||
function getWkEventData($anMysqlConn, $anEventId, $someOptions = array()){
|
||||
|
||||
//var_dump($anMysqlConn, $anEventId, $someOptions);
|
||||
|
||||
if( empty($someOptions['dbCharset']) ) $someOptions['dbCharset'] = "ISO-8859-1";
|
||||
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
||||
|
||||
@@ -326,7 +331,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"LEFT JOIN wettkampfkalender ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"WHERE wkParticipo_Events.id = '%s';",
|
||||
$anMysqlConn->real_escape_string($anEventId)
|
||||
);
|
||||
@@ -338,6 +343,21 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
// Bei einem leeren Ergebnis (NULL oder leeres Array) soll ein leeres Array zurückgeliefert werden
|
||||
if( empty($ret) ) return array();
|
||||
|
||||
// @todo: nur temporär: fehlende Wettkampdaten aus den Metadaten ergänzen
|
||||
if( empty($ret['wkId']) ){
|
||||
$tmpWkEvent = json_decode($ret['bemerkungen'], true);
|
||||
if(!empty($tmpWkEvent)){
|
||||
// var_dump( $tmpWkEvent );
|
||||
// var_dump( json_decode($aWkEvent['bemerkungen'], true) );
|
||||
$ret['Datum'] = $tmpWkEvent['Datum'];
|
||||
$ret['Veranstaltung'] = $tmpWkEvent['Veranstaltung'];
|
||||
$ret['Altersklassen'] = $tmpWkEvent['Altersklassen'];
|
||||
$ret['bemerkungen'] = $tmpWkEvent['bemerkungen'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Zeichensatzkonvertierung
|
||||
array_walk(
|
||||
$ret,
|
||||
@@ -347,6 +367,7 @@ if( (string)(int)$anEventId != $anEventId ) return $ret;
|
||||
$someOptions
|
||||
);
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -375,6 +396,7 @@ $ret = array();
|
||||
$query = sprintf(
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.date, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
@@ -386,10 +408,11 @@ $ret = array();
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"JOIN wettkampfkalender ".
|
||||
"LEFT JOIN wettkampfkalender ".
|
||||
"ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"WHERE wettkampfkalender.Datum >= CURDATE() ".
|
||||
"ORDER BY wettkampfkalender.Datum;"
|
||||
"WHERE wettkampfkalender.Datum IS NULL OR wettkampfkalender.Datum >= CURDATE() ".
|
||||
// "ORDER BY wettkampfkalender.Datum;"
|
||||
"ORDER BY wkParticipo_Events.date;"
|
||||
);
|
||||
// echo($query);die();
|
||||
$results = $anMysqlConn->query($query);
|
||||
@@ -412,7 +435,6 @@ $ret = array();
|
||||
);
|
||||
array_push( $ret, $result);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -479,6 +501,8 @@ return $ret;
|
||||
|
||||
|
||||
/// Zukünftige Wettkämpfe abfragen
|
||||
///
|
||||
/// - Fragt in der Zukunft liegende Wettkämpfe aus dem Wettkampfkalender ab
|
||||
function getCommingWk($anMysqlConn){
|
||||
$ret = array();
|
||||
$anMysqlConn->query("USE cwsvjudo;");
|
||||
@@ -927,7 +951,7 @@ $retMessage = array();
|
||||
return $retMessage;
|
||||
}
|
||||
|
||||
$event = getEventData($anMysqlConn, $anEventId);
|
||||
$event = getWkEventData($anMysqlConn, $anEventId);
|
||||
if( empty($event) ){
|
||||
$retMessage['error'] .= "eventId ".$anEventId." nicht gefunden<br />";
|
||||
return $retMessage;
|
||||
@@ -969,7 +993,7 @@ $retMessage = array();
|
||||
return $retMessage;
|
||||
}
|
||||
|
||||
$event = getEventData($anMysqlConn, $anEventId);
|
||||
$event = getWkEventData($anMysqlConn, $anEventId);
|
||||
if( empty($event) ){
|
||||
$retMessage['error'] .= "eventId ".$anEventId." nicht gefunden<br />";
|
||||
return $retMessage;
|
||||
@@ -1204,6 +1228,16 @@ function htmlWkEvent($aWkEvent, $starters, $fahrten){
|
||||
|
||||
$retHtml = "";
|
||||
|
||||
if( empty($aWkEvent['wkId']) ){
|
||||
$tmpWkEvent = json_decode($aWkEvent['bemerkungen'], true);
|
||||
// var_dump( $tmpWkEvent );
|
||||
// var_dump( json_decode($aWkEvent['bemerkungen'], true) );
|
||||
$aWkEvent['Datum'] = $tmpWkEvent['Datum'];
|
||||
$aWkEvent['Veranstaltung'] = $tmpWkEvent['Veranstaltung'];
|
||||
$aWkEvent['Altersklassen'] = $tmpWkEvent['Altersklassen'];
|
||||
$aWkEvent['bemerkungen'] = $tmpWkEvent['bemerkungen'];
|
||||
}
|
||||
|
||||
if( empty($aWkEvent['Datum']) )
|
||||
$aWkEvent['Datum'] = "0000-00-00";
|
||||
$anzPlätze = 0;
|
||||
|
||||
Reference in New Issue
Block a user