mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
Heimrechttausch: Sicherheitsabfrage und speichern in Historie
This commit is contained in:
@@ -10340,6 +10340,7 @@ function adminRemoveBegegnung(): void
|
|||||||
$db = getDatabase();
|
$db = getDatabase();
|
||||||
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
|
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
|
||||||
|
|
||||||
|
$user_id = isExternalDatabase() ? 0 : (isJson() ? getUserID() : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id);
|
||||||
$id = $jInput->get('id', 0, 'INT');
|
$id = $jInput->get('id', 0, 'INT');
|
||||||
$veranstaltungId = $jInput->get('veranstaltungid', 0, 'INT');
|
$veranstaltungId = $jInput->get('veranstaltungid', 0, 'INT');
|
||||||
if ($veranstaltungId == 0) die("Missing id!");
|
if ($veranstaltungId == 0) die("Missing id!");
|
||||||
@@ -10388,6 +10389,14 @@ function adminRemoveBegegnung(): void
|
|||||||
die($db->stderr(true));
|
die($db->stderr(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$query = "INSERT INTO #__sportsmanager_begegnung_historie"
|
||||||
|
. "\n (begegnung_historie_id,begegnung_id,aktion,user_id,eingetragen)"
|
||||||
|
. "\n VALUES (NULL,$id,11,$user_id,NOW());";
|
||||||
|
$db->setQuery($query);
|
||||||
|
if (!$db->execute()) {
|
||||||
|
die($db->stderr(true));
|
||||||
|
}
|
||||||
|
|
||||||
termin_aktualisieren($id);
|
termin_aktualisieren($id);
|
||||||
|
|
||||||
redirectSportsManagerURL('&task=admin_begegnungen&veranstaltungid=' . $veranstaltungId . '#id' . $id);
|
redirectSportsManagerURL('&task=admin_begegnungen&veranstaltungid=' . $veranstaltungId . '#id' . $id);
|
||||||
@@ -10525,7 +10534,6 @@ function adminEditBegegnungSpielplan($bestaetigen): void
|
|||||||
: $begegnung->spielort_id) . "\"";
|
: $begegnung->spielort_id) . "\"";
|
||||||
$begegnung->spielort_name = loadResult($db, $spielortQuery);
|
$begegnung->spielort_name = loadResult($db, $spielortQuery);
|
||||||
|
|
||||||
|
|
||||||
if (isJson()) {
|
if (isJson()) {
|
||||||
$response = JSON_sportsmanager::adminEditBegegnungSpielplan($bestaetigen, $veranstaltung, $begegnung, $heim_team, $gast_team, $spiele, $heim_spieler, $gast_spieler, $teamspiel_modus);
|
$response = JSON_sportsmanager::adminEditBegegnungSpielplan($bestaetigen, $veranstaltung, $begegnung, $heim_team, $gast_team, $spiele, $heim_spieler, $gast_spieler, $teamspiel_modus);
|
||||||
JSON_sportsmanager::JSON($response);
|
JSON_sportsmanager::JSON($response);
|
||||||
@@ -11122,6 +11130,21 @@ function adminSaveBegegnungSpielplan(): void
|
|||||||
if (!$db->execute()) {
|
if (!$db->execute()) {
|
||||||
die($db->stderr(true));
|
die($db->stderr(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$encrypted_pin = $db->escape($jInput->get('pin', '', 'RAW'));
|
||||||
|
$pin = decrypt($encrypted_pin, "a9cZ" . $veranstaltungId . "oDS7" . $id . "2eA");
|
||||||
|
|
||||||
|
$query = "SELECT team_id FROM #__sportsmanager_team"
|
||||||
|
. "\n WHERE pin = '$pin' AND veranstaltung_id = $veranstaltungId;";
|
||||||
|
$team_id = loadResult($db, $query);
|
||||||
|
|
||||||
|
$query = "INSERT INTO #__sportsmanager_begegnung_historie"
|
||||||
|
. "\n (begegnung_historie_id,begegnung_id,aktion,team_id,eingetragen)"
|
||||||
|
. "\n VALUES (NULL,$id,11,$team_id,NOW());";
|
||||||
|
$db->setQuery($query);
|
||||||
|
if (!$db->execute()) {
|
||||||
|
die($db->stderr(true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectSportsManagerURL('&task=' . ($bestaetigen != 0 ? ($bestaetigen == 1 ? 'admin_begegnung_spielplan_edit_bestaetigen' : 'pineingabe') : 'admin_begegnung_spielplan_edit') . '&id=' . $id . '&veranstaltungid=' . $veranstaltungId . ($bestaetigen != 0 ? '_bestaetigen' : '') . '&veranstaltungid=' . $veranstaltungId . '&id=' . $id . '&erneut_oeffnen=1' . (!empty($encrypted_pin) ? ('&epin=' . $encrypted_pin) : "") . ($aus_uebersicht ? '&aus_uebersicht=1' : ''));
|
redirectSportsManagerURL('&task=' . ($bestaetigen != 0 ? ($bestaetigen == 1 ? 'admin_begegnung_spielplan_edit_bestaetigen' : 'pineingabe') : 'admin_begegnung_spielplan_edit') . '&id=' . $id . '&veranstaltungid=' . $veranstaltungId . ($bestaetigen != 0 ? '_bestaetigen' : '') . '&veranstaltungid=' . $veranstaltungId . '&id=' . $id . '&erneut_oeffnen=1' . (!empty($encrypted_pin) ? ('&epin=' . $encrypted_pin) : "") . ($aus_uebersicht ? '&aus_uebersicht=1' : ''));
|
||||||
|
|||||||
@@ -11103,7 +11103,9 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
|
|||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap><small><a
|
<td nowrap><small><a
|
||||||
href="<?php echo SportsManagerURL('&task=admin_begegnung_heimtausch&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HOME_EXCHANGE'); ?></a></small>
|
href="<?php echo SportsManagerURL('&task=admin_begegnung_heimtausch&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"
|
||||||
|
onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_SWAP_MATCH'); ?>');">
|
||||||
|
<?php echo Text::_('COM_SPORTSMANAGER_HOME_EXCHANGE'); ?></a></small>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap><small><a
|
<td nowrap><small><a
|
||||||
href="<?php echo SportsManagerURL('&task=admin_begegnung_remove&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"
|
href="<?php echo SportsManagerURL('&task=admin_begegnung_remove&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"
|
||||||
@@ -11472,6 +11474,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
|
|||||||
8 => Text::_('COM_SPORTSMANAGER_MODIFIED_RESULTS'),
|
8 => Text::_('COM_SPORTSMANAGER_MODIFIED_RESULTS'),
|
||||||
9 => Text::_('COM_SPORTSMANAGER_LIVE_RESULTS'),
|
9 => Text::_('COM_SPORTSMANAGER_LIVE_RESULTS'),
|
||||||
10 => Text::_('COM_SPORTSMANAGER_REJECTED_SHIFT'),
|
10 => Text::_('COM_SPORTSMANAGER_REJECTED_SHIFT'),
|
||||||
|
11 => Text::_('COM_SPORTSMANAGER_SWAP_MATCH'),
|
||||||
default => Text::_('COM_SPORTSMANAGER_PROPOSED_APPOINTMENT'),
|
default => Text::_('COM_SPORTSMANAGER_PROPOSED_APPOINTMENT'),
|
||||||
};
|
};
|
||||||
?>
|
?>
|
||||||
@@ -11572,6 +11575,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
|
|||||||
?>
|
?>
|
||||||
<input type="submit" name="heimrecht_tauschen"
|
<input type="submit" name="heimrecht_tauschen"
|
||||||
value="<?php echo Text::_('COM_SPORTSMANAGER_ADVANTAGE_HOME'); ?>"
|
value="<?php echo Text::_('COM_SPORTSMANAGER_ADVANTAGE_HOME'); ?>"
|
||||||
|
onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_SWAP_MATCH'); ?>');"
|
||||||
class="button"/>
|
class="button"/>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1092,4 +1092,6 @@ COM_SPORTSMANAGER_MATCH_TYPE="Spielform"
|
|||||||
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Willst Du wirklich dieses Hall of Fame Jahr löschen?"
|
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Willst Du wirklich dieses Hall of Fame Jahr löschen?"
|
||||||
COM_SPORTSMANAGER_YEARS="Jahre"
|
COM_SPORTSMANAGER_YEARS="Jahre"
|
||||||
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Hall of Fame Jahr hinzufügen"
|
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Hall of Fame Jahr hinzufügen"
|
||||||
COM_SPORTSMANAGER_NO_ENTRY="kein Eintrag"
|
COM_SPORTSMANAGER_NO_ENTRY="kein Eintrag"
|
||||||
|
COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Willst Du wirklich das Heimrecht tauschen?"
|
||||||
|
COM_SPORTSMANAGER_SWAP_MATCH="Heimrechttausch"
|
||||||
@@ -1092,4 +1092,6 @@ COM_SPORTSMANAGER_MATCH_TYPE="Game Type"
|
|||||||
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Are you sure you want to delete this Hall of Fame year?"
|
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Are you sure you want to delete this Hall of Fame year?"
|
||||||
COM_SPORTSMANAGER_YEARS="Years"
|
COM_SPORTSMANAGER_YEARS="Years"
|
||||||
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Add Hall of Fame Year"
|
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Add Hall of Fame Year"
|
||||||
COM_SPORTSMANAGER_NO_ENTRY="no entry"
|
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"
|
||||||
Reference in New Issue
Block a user