Add modifications for show_table of matches and bet_type for leagues in ACP.

This commit is contained in:
2018-06-03 13:57:34 +02:00
parent 66dceff9f2
commit 90172d076b
6 changed files with 64 additions and 9 deletions

View File

@@ -416,7 +416,7 @@ class leagues_module
break;
case 'add':
if ($league > 0 AND $league <= 99)
if ($league > 0 AND $league <= 101)
{
if ($league_info)
{
@@ -494,6 +494,7 @@ class leagues_module
$league_info['join_in_season'] = $this->request->variable('league_join_in_season', $league_info['join_in_season'], true);
$league_info['bet_in_time'] = $this->request->variable('league_bet_in_time', $league_info['bet_in_time'], true);
$league_info['rules_post_id'] = $this->request->variable('league_rules_post_id', $league_info['rules_post_id'], true);
$league_info['bet_type'] = $this->request->variable('bet_type', false);
if (!$league_info['rules_post_id'] and $league_info['join_by_user'] == 1)
{
@@ -509,6 +510,15 @@ class leagues_module
{
$error[] = $user->lang['CHECK_HITS02_WINS'];
}
if ($league_info['bet_type'] == true)
{
$bet_type = '0';
}
else
{
$bet_type = '1';
}
$matchday_wins = explode(';',$league_info['win_matchday']);
foreach ($matchday_wins as $matchday_win)
@@ -555,6 +565,7 @@ class leagues_module
'bet_in_time' => $league_info['bet_in_time'],
'rules_post_id' => (is_numeric($league_info['rules_post_id'])) ? $league_info['rules_post_id'] : 0,
'bet_points' => $league_info['bet_points'],
'bet_type' => (int) $bet_type,
);
$data['league'] = $league;
@@ -564,8 +575,8 @@ class leagues_module
$data['league_matches'] = ($league_info['league_type'] == LEAGUE_KO) ? 0 : $league_info['matches_on_matchday'];
$var_ary = array(
'league' => array('num', false, 1, 99),
'league_name' => array('string', false, 2, 20),
'league' => array('num', false, 1, 101),
'league_name' => array('string', false, 2, 25),
'league_short' => array('string', false, 1, 3),
'league_matchdays' => array('num', false, 0, 99),
'league_matches' => array('num', false, 0, 99),
@@ -620,6 +631,15 @@ class leagues_module
// check if matches created
$existing_matches_on_league = count_existing_matches($season, $league, 0);
if ($league_info['bet_type'] == true)
{
$bet_type = '0';
}
else
{
$bet_type = '1';
}
$u_back = $this->u_action . "&amp;s=$season";
$template->assign_vars(array(
@@ -661,7 +681,8 @@ class leagues_module
'LEAGUE_WIN_MATCHDAYS' => $league_info['win_matchday'],
'LEAGUE_WIN_SEASON' => $league_info['win_season'],
'POINTS_LAST_YES' => ($league_info['points_last'] == 1) ? ' checked="checked"' : '',
'POINTS_LAST_NO' => ($league_info['points_last'] == 0) ? ' checked="checked"' : '',
'POINTS_LAST_NO' => ($league_info['points_last'] == 0) ? ' checked="checked"' : '',
'S_BET_TYPE' => $bet_type,
'U_BACK' => $u_back,
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;s=$season",
)

View File

@@ -398,6 +398,7 @@ class matches_module
$match_row['formula_guest'] = utf8_normalize_nfc($this->request->variable('formula_guest', '', true));
$match_row['ko_match'] = $this->request->variable('match_ko', false);
$match_row['group_id'] = ($this->request->variable('group_match', false)) ? utf8_normalize_nfc($this->request->variable('match_group', '', true)) : '';
$match_row['show_table'] = $this->request->variable('show_table', false);
if ($match_row['team_id_home'] <> '')
{
@@ -436,6 +437,15 @@ class matches_module
{
$error[] = $user->lang['NO_MATCH_BEGIN'];
}
if ($match_row['show_table'] == true)
{
$show_table = '0';
}
else
{
$show_table = '1';
}
if (!sizeof($error))
{
@@ -459,7 +469,8 @@ class matches_module
'formula_guest' => strlen($match_row['formula_guest']) ? $match_row['formula_guest'] : '',
'ko_match' => $match_row['ko_match'] ? $match_row['ko_match'] : 0,
'goals_overtime_home' => (is_numeric($match_row['goals_overtime_home'])) ? $match_row['goals_overtime_home'] : '',
'goals_overtime_guest' => (is_numeric($match_row['goals_overtime_guest'])) ? $match_row['goals_overtime_guest'] : '',
'goals_overtime_guest' => (is_numeric($match_row['goals_overtime_guest'])) ? $match_row['goals_overtime_guest'] : '',
'show_table' => (int) $show_table,
);
@@ -628,6 +639,16 @@ class matches_module
$team_home_options .= '<option value="' . $row['group_id'] . ';' . $row['team_id'] .'"' . $selected_home . '>' . $row['team_name'] . '</option>';
}
$db->sql_freeresult($result);
if($match_row['show_table'] == 1)
{
$show_table = false;
}
else
{
$show_table = true;
}
$u_back = $this->u_action . "&amp;s=$season&amp;l=$league&amp;m=$matchday";
$template->assign_vars(array(
@@ -648,7 +669,8 @@ class matches_module
'MATCH_STATUS' => $match_row['status'],
'STATUS_OPTIONS' => $status_options,
'S_GROUP_CHECKED' => (strlen($match_row['group_id']) > 0) ? true : false,
'MATCH_GROUP' => $match_group,
'MATCH_GROUP' => $match_group,
'S_SHOW_TABLE' => $show_table,
'S_KO_CHECKED' => $match_row['ko_match'],
'FORMULA_HOME' => $match_row['formula_home'],
'FORMULA_GUEST' => $match_row['formula_guest'],

View File

@@ -33,7 +33,7 @@
</dl>
<dl>
<dt><label for="league_name">{L_LEAGUE_NAME}:</label></dt>
<dd><input name="league_name" type="text" id="league_name" size="20" maxlength="20" value="{LEAGUE_NAME}" /></dd>
<dd><input name="league_name" type="text" id="league_name" size="25" maxlength="21" value="{LEAGUE_NAME}" /></dd>
</dl>
<dl>
<dt><label for="league_short">{L_LEAGUE_SHORT}:</label><br /><span>{L_LEAGUE_SHORT_EXPLAIN}</span></dt>
@@ -100,6 +100,10 @@
</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="bet_type">{L_BET_TYPE}:</label><br /><span>{L_BET_TYPE_EXPLAIN}</span></dt>
<dd><input name="bet_type" type="checkbox" id="bet_type" <!-- IF S_BET_TYPE -->checked="checked" <!-- ENDIF --> /></dd>
</dl>
</fieldset>
<fieldset>

View File

@@ -96,6 +96,10 @@
<dd><input name="formula_guest" type="text" id="formula_guest" size="9" maxlength="9" value="{FORMULA_GUEST}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="show_table">{L_SHOW_TABLE}:</label><br /><span>{L_SHOW_TABLE_EXPLAIN}</span></dt>
<dd><input name="show_table" type="checkbox" class="radio" id="show_table" <!-- IF S_SHOW_TABLE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<input type="hidden" name="ko_league" value="1" />
</fieldset>

View File

@@ -46,7 +46,9 @@ $lang = array_merge($lang, array(
'ALL_USERS' => 'Alle Mitglieder',
'BET_POINTS' => 'Einsatz',
'BET_POINTS_EXPLAIN' => 'Einsatz zur Teilnahme am Saisonanfang',
'BET_POINTS_EXPLAIN' => 'Einsatz zur Teilnahme am Saisonanfang',
'BET_TYPE' => 'Tippliga-Modus',
'BET_TYPE_EXPLAIN' => 'Wenn der Haken gesetzt ist tippen die Spieler gegeneinander, andernfalls werden nur die Tore addiert.',
'BET_TYPE_KO' => 'Tipp bei KO-Spielen',
'BET_TYPE_KO_EXPLAIN' => 'Auf welches Ergebnis soll bei KO-Spielen getippt werden?',

View File

@@ -98,7 +98,9 @@ $lang = array_merge($lang, array(
'PREDICTION_LEAGUE' => 'Tipprunde',
'SEASON' => 'Saison',
'SELECT_MATCHDAY' => 'Spieltag wählen',
'SELECT_MATCHDAY' => 'Spieltag wählen',
'SHOW_TABLE' => 'Spiel einberechnen',
'SHOW_TABLE_EXPLAIN' => 'Spiele werden bei gesetztem Haken für die Berechnung der Tabelle berücksichtigt',
'TOO_LARGE_MATCH_BEGIN_H' => 'Stundenangabe beim Spielbeginn zu groß.',
'TOO_LARGE_MATCH_BEGIN_MIN' => 'Minutenangabe beim Spielbeginn zu groß.',