mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
Funktion Spielbericht löschen hinzugefügt.
This commit is contained in:
@@ -10410,6 +10410,10 @@ function adminRemoveBegegnung(): void
|
||||
|
||||
function adminEditBegegnungSpielplan($bestaetigen): void
|
||||
{
|
||||
//$bestaetigen = 0: Eingabe Moderator
|
||||
//$bestaetigen = 1: Bestätigung Ergebnis
|
||||
//$bestaetigen = 2: Pineingabe
|
||||
|
||||
$db = getDatabase();
|
||||
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
|
||||
|
||||
@@ -10593,6 +10597,13 @@ function adminSaveBegegnungSpielplan(): void
|
||||
|
||||
$benutzer_ist_moderator = benutzerZugriff("mannschaftswettbewerb_aendern") || benutzerVeranstaltungModerator($veranstaltungId); // Abfrage muss vor LOCK erfolgen, da sonst die Abfrage mangels Lock auf Moderator-Tabelle scheitert
|
||||
|
||||
//Spielbericht komplett loeschen
|
||||
if ($benutzer_ist_moderator && $jInput->get('loeschen', false, 'BOOL')) {
|
||||
adminDeleteMatchReportBegegnung($id);
|
||||
redirectSportsManagerURL('&task=admin_begegnungen&veranstaltungid=' . $veranstaltungId . '#id' . $id, Text::_('COM_SPORTSMANAGER_MATCH_REPORT_WAS_DELETED'));
|
||||
}
|
||||
|
||||
|
||||
$query = "SELECT #__sportsmanager_begegnung.*, unbestaetigtes_ergebnis_id, zwischenergebnis,"
|
||||
. " (SELECT COUNT(*) FROM #__sportsmanager_begegnung_historie WHERE #__sportsmanager_begegnung_historie.begegnung_id = #__sportsmanager_begegnung.begegnung_id) AS verlegen_aktionen"
|
||||
. "\n FROM #__sportsmanager_begegnung"
|
||||
@@ -11030,6 +11041,54 @@ function adminSaveBegegnungSpielplan(): void
|
||||
}
|
||||
}
|
||||
|
||||
function adminDeleteMatchReportBegegnung($id): void
|
||||
{
|
||||
$db = getDatabase();
|
||||
$user_id = isExternalDatabase() ? 0 : (isJson() ? getUserID() : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id);
|
||||
|
||||
$query = "DELETE FROM #__sportsmanager_teamspiel WHERE begegnung_id = $id;";
|
||||
$db->setQuery($query);
|
||||
if (!$db->execute()) {
|
||||
abortWithError($db->stderr(true));
|
||||
}
|
||||
|
||||
$query = "UPDATE #__sportsmanager_begegnung"
|
||||
. "\n SET heim_punkte = NULL,"
|
||||
. "\n gast_punkte = NULL,"
|
||||
. "\n heim_spielpunkte = NULL,"
|
||||
. "\n gast_spielpunkte = NULL"
|
||||
. "\n WHERE begegnung_id = $id";
|
||||
$db->setQuery($query);
|
||||
if (!$db->execute()) {
|
||||
abortWithError($db->stderr(true));
|
||||
}
|
||||
|
||||
$query = "DELETE FROM #__sportsmanager_unbestaetigtes_ergebnis WHERE begegnung_id = $id;";
|
||||
$db->setQuery($query);
|
||||
if (!$db->execute()) {
|
||||
abortWithError($db->stderr(true));
|
||||
}
|
||||
|
||||
$query = "DELETE FROM #__sportsmanager_begegnung_historie WHERE begegnung_id = $id AND aktion IN (6,7,8,9,10);";
|
||||
$db->setQuery($query);
|
||||
if (!$db->execute()) {
|
||||
abortWithError($db->stderr(true));
|
||||
}
|
||||
|
||||
spielerstatistikAktualisieren(0, $veranstaltungId);
|
||||
teamstatistikAktualisieren($veranstaltungId);
|
||||
|
||||
$query = "INSERT INTO #__sportsmanager_begegnung_historie"
|
||||
. "\n (begegnung_historie_id,begegnung_id,aktion,user_id,eingetragen)"
|
||||
. "\n VALUES (NULL,$id,12,$user_id,NOW());";
|
||||
$db->setQuery($query);
|
||||
if (!$db->execute()) {
|
||||
abortWithError($db->stderr(true));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#[NoReturn] function adminBegegnungSpielplanHeimtausch(): void
|
||||
{
|
||||
$db = getDatabase();
|
||||
|
||||
@@ -11475,6 +11475,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
|
||||
9 => Text::_('COM_SPORTSMANAGER_LIVE_RESULTS'),
|
||||
10 => Text::_('COM_SPORTSMANAGER_REJECTED_SHIFT'),
|
||||
11 => Text::_('COM_SPORTSMANAGER_SWAP_MATCH'),
|
||||
12 => Text::_('COM_SPORTSMANAGER_MATCH_REPORT_DELETED'),
|
||||
default => Text::_('COM_SPORTSMANAGER_PROPOSED_APPOINTMENT'),
|
||||
};
|
||||
?>
|
||||
@@ -12009,12 +12010,13 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
|
||||
$js_pruefung .= "if (!spieler_eingetragen()) { if (!confirm('" . ($spielernamen == 1 ? Text::_('COM_SPORTSMANAGER_NO_PLAYERS_FOR_DOUBLES') : Text::_('COM_SPORTSMANAGER_NOT_ALL_PLAYERS_FROM_REGISTERED')) . " " . Text::_('COM_SPORTSMANAGER_WANT_TO_SAVE_RESULT') . "')) return false; } ";
|
||||
?>
|
||||
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>"
|
||||
class="button"<?php if (!empty($js_pruefung)) echo " onclick=\"" . $js_pruefung . "return true;\""; ?> />
|
||||
class="button"<?php if (!empty($js_pruefung)) echo " onclick=\"" . $js_pruefung . "return true;\""; ?> />
|
||||
<input type="submit" name="loeschen" value="<?php echo Text::_('COM_SPORTSMANAGER_DELETE'); ?>"
|
||||
class="button" onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_DELETE_MATCH_REPORT'); ?>');" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>"
|
||||
class="button"/>
|
||||
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>" class="button"/>
|
||||
<input type="hidden" name="task" value="admin_begegnung_spielplan_save"/>
|
||||
<input type="hidden" name="id" value="<?php echo($begegnung != null ? $begegnung->begegnung_id : "0"); ?>"/>
|
||||
<input type="hidden" name="veranstaltungid" value="<?php echo $veranstaltung->veranstaltung_id; ?>"/>
|
||||
@@ -12034,7 +12036,6 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
|
||||
|
||||
static function adminBegegnungenGenerieren($veranstaltung, $rows): void
|
||||
{
|
||||
//geändert am 07.03.2025 von Jürgen Meyer
|
||||
global $params;
|
||||
$anzahlteams = count($rows);
|
||||
if ($anzahlteams % 2)
|
||||
|
||||
@@ -1094,4 +1094,7 @@ COM_SPORTSMANAGER_YEARS="Jahre"
|
||||
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Hall of Fame Jahr hinzufügen"
|
||||
COM_SPORTSMANAGER_NO_ENTRY="kein Eintrag"
|
||||
COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Willst Du wirklich das Heimrecht tauschen?"
|
||||
COM_SPORTSMANAGER_SWAP_MATCH="Heimrechttausch"
|
||||
COM_SPORTSMANAGER_SWAP_MATCH="Heimrechttausch"
|
||||
COM_SPORTSMANAGER_REALLY_DELETE_MATCH_REPORT="Der Spielbericht wird zusammen mit allen historischen Einträgen gelöscht. Willst du den Spielbericht wirklich löschen?"
|
||||
COM_SPORTSMANAGER_MATCH_REPORT_DELETED="Spielbericht gelöscht"
|
||||
COM_SPORTSMANAGER_MATCH_REPORT_WAS_DELETED="Der Spielbericht wurde erfolgreich gelöscht!"
|
||||
@@ -1094,4 +1094,7 @@ COM_SPORTSMANAGER_YEARS="Years"
|
||||
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Add Hall of Fame Year"
|
||||
COM_SPORTSMANAGER_NO_ENTRY="no entry"
|
||||
COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Do you really want to swap the home advantage?"
|
||||
COM_SPORTSMANAGER_SWAP_MATCH="Swap home advantage"
|
||||
COM_SPORTSMANAGER_SWAP_MATCH="Swap home advantage"
|
||||
COM_SPORTSMANAGER_REALLY_DELETE_MATCH_REPORT="The match report and all its history will be deleted. Are you sure you want to delete the match report?"
|
||||
COM_SPORTSMANAGER_MATCH_REPORT_DELETED="Match report deleted"
|
||||
COM_SPORTSMANAGER_MATCH_REPORT_WAS_DELETED="The match report has been successfully deleted!"
|
||||
Reference in New Issue
Block a user