diff --git a/README.md b/README.md index d11d02d761..1148e01036 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Extensions ? Änderungen --------------------- +* 12-03-2021: **3.8.70** Neue Felder für Kleinkaliber Schützenvereine * 10-03-2021: **3.8.60** Neue Felder für Kleinkaliber Schützenvereine * 03-03-2021: **3.8.50** Anpassungen Joomla 4 * 15-02-2021: **3.8.40** Historische Namen einer Mannschaft hinterlegen diff --git a/admin/models/forms/project.xml b/admin/models/forms/project.xml index a5fecdbc3c..d87d0a7532 100644 --- a/admin/models/forms/project.xml +++ b/admin/models/forms/project.xml @@ -513,7 +513,7 @@ description="COM_SPORTSMANAGEMENT_SMALL_BORE_RIFLE_ASSOCIATION_F_SPORTS_SHOOTER" '.print_r($project,true).''; - + switch ($project->sports_type_name) + { + case 'COM_SPORTSMANAGEMENT_ST_SMALL_BORE_RIFLE_ASSOCIATION': + $this->jsmquery->clear(); + $this->jsmquery->select('COUNT(mc.id)'); + $this->jsmquery->from('#__sportsmanagement_match_single AS mc'); + $this->jsmquery->where('mc.match_id = ' . $match_id); + $this->jsmquery->where('mc.match_type = "SINGLE" '); + $this->jsmdb->setQuery($this->jsmquery); + $singleresult = $this->jsmdb->loadResult(); + if ($singleresult < $project->smallcaliber_single_matches) + { + $insertmatch = $project->smallcaliber_single_matches - $singleresult; + + for ($i = 0; $i < $insertmatch; $i++) + { + $temp = new stdClass; + $temp->round_id = $rid; + $temp->projectteam1_id = $projectteam1_id; + $temp->projectteam2_id = $projectteam2_id; + $temp->match_id = $match_id; + $temp->match_type = 'SINGLE'; + $temp->published = 1; + $temp->teamplayer1_id = 0; + $temp->teamplayer2_id = 0; + $temp->summary = ''; + $temp->preview = ''; + + $result = $this->jsmdb->insertObject('#__sportsmanagement_match_single', $temp); + } + } + + break; + case 'COM_SPORTSMANAGEMENT_ST_TENNIS': + $this->jsmquery->clear(); $this->jsmquery->select('COUNT(mc.id)'); $this->jsmquery->from('#__sportsmanagement_match_single AS mc'); @@ -121,7 +155,8 @@ function checkGames($project, $match_id, $rid, $projectteam1_id, $projectteam2_i $result = $this->jsmdb->insertObject('#__sportsmanagement_match_single', $temp); } } - + break; + } } /** @@ -133,29 +168,18 @@ function checkGames($project, $match_id, $rid, $projectteam1_id, $projectteam2_i */ function getProjectTeams($project_id) { - $option = Factory::getApplication()->input->getCmd('option'); - - $app = Factory::getApplication(); + $this->jsmquery->clear(); + $this->jsmquery->select('pt.id AS value'); + $this->jsmquery->select('t.name AS text,t.short_name AS short_name,t.notes'); + $this->jsmquery->from('#__sportsmanagement_team AS t'); + $this->jsmquery->join('INNER', '#__sportsmanagement_season_team_id AS st ON st.team_id = t.id'); + $this->jsmquery->join('INNER', '#__sportsmanagement_project_team AS pt ON pt.team_id = st.id'); + $this->jsmquery->where('pt.project_id = ' . $project_id); + $this->jsmquery->order('text ASC'); - // $project_id = $app->getUserState($option . 'project'); - // Create a new query object. - $db = sportsmanagementHelper::getDBConnection(); - $query = $db->getQuery(true); - - // $projectteam1_id = Factory::getApplication()->input->getvar('team1', 0); - - // Select some fields - $query->select('pt.id AS value'); - $query->select('t.name AS text,t.short_name AS short_name,t.notes'); - $query->from('#__sportsmanagement_team AS t'); - $query->join('INNER', '#__sportsmanagement_season_team_id AS st ON st.team_id = t.id'); - $query->join('INNER', '#__sportsmanagement_project_team AS pt ON pt.team_id = st.id'); - $query->where('pt.project_id = ' . $project_id); - $query->order('text ASC'); - - $db->setQuery($query); + $this->jsmdb->setQuery($this->jsmquery); - if (!$result = $db->loadObjectList()) + if (!$result = $this->jsmdb->loadObjectList()) { return false; } diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 09472b9bfe..4c050656b8 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -854,7 +854,7 @@ CREATE TABLE IF NOT EXISTS `#__sportsmanagement_project` ( `linkedin` VARCHAR(250) NOT NULL DEFAULT '' , `twitter` VARCHAR(250) NOT NULL DEFAULT '' , `facebook` VARCHAR(250) NOT NULL DEFAULT '' , - + `single_matches` SMALLINT(6) NOT NULL DEFAULT '0' , PRIMARY KEY (`id`) , KEY `league_id` (`league_id`), KEY `season_id` (`season_id`), diff --git a/admin/sql/updates/mysql/3.8.70 b/admin/sql/updates/mysql/3.8.70 new file mode 100644 index 0000000000..c95ef136de --- /dev/null +++ b/admin/sql/updates/mysql/3.8.70 @@ -0,0 +1,6 @@ +ALTER TABLE `#__sportsmanagement_project` ADD `single_matches` SMALLINT(6) NOT NULL DEFAULT '0' ; + + + +INSERT INTO `#__sportsmanagement_version_history` (`id`, `date`, `text`, `version`) VALUES +(NULL, '2021-03-12', 'COM_SPORTSMANAGEMENT_DB_UPDATE_2021-03-12', '3.8.70'); diff --git a/admin/views/jlextindividualsportes/view.html.php b/admin/views/jlextindividualsportes/view.html.php index 5f70b8a8db..feab7b0c70 100644 --- a/admin/views/jlextindividualsportes/view.html.php +++ b/admin/views/jlextindividualsportes/view.html.php @@ -65,15 +65,15 @@ function _displayDefault($tpl) $project_id = $this->app->getUserState("$this->option.pid", '0'); $match_id = $this->jinput->getInt('id', 0); $rid = $this->jinput->getInt('rid', 0); - $projectteam1_id = $this->jinput->getInt('team1', 0); - $projectteam2_id = $this->jinput->getInt('team2', 0); + $this->projectteam1_id = $this->jinput->getInt('team1', 0); + $this->projectteam2_id = $this->jinput->getInt('team2', 0); $mdlProject = BaseDatabaseModel::getInstance("Project", "sportsmanagementModel"); $this->projectws = $mdlProject->getProject($project_id); $mdlRound = BaseDatabaseModel::getInstance("Round", "sportsmanagementModel"); $roundws = $mdlRound->getRound($rid); - $this->model->checkGames($this->projectws , $match_id, $rid, $projectteam1_id, $projectteam2_id); + $this->model->checkGames($this->projectws , $match_id, $rid, $this->projectteam1_id, $this->projectteam2_id); $matches = $this->get('Items'); $total = $this->get('Total'); @@ -81,7 +81,7 @@ function _displayDefault($tpl) $teams[] = HTMLHelper::_('select.option', '0', Text::_('COM_SPORTSMANAGEMENT_GLOBAL_SELECT_TEAM_PLAYER')); - if ($projectteams = $this->model->getPlayer($projectteam1_id, $project_id)) + if ($projectteams = $this->model->getPlayer($this->projectteam1_id, $project_id)) { $teams = array_merge($teams, $projectteams); } @@ -91,7 +91,7 @@ function _displayDefault($tpl) $teams[] = HTMLHelper::_('select.option', '0', Text::_('COM_SPORTSMANAGEMENT_GLOBAL_SELECT_TEAM_PLAYER')); - if ($projectteams = $this->model->getPlayer($projectteam2_id, $project_id)) + if ($projectteams = $this->model->getPlayer($this->projectteam2_id, $project_id)) { $teams = array_merge($teams, $projectteams); } @@ -109,15 +109,15 @@ function _displayDefault($tpl) $this->match_id = $match_id; $this->rid = $rid; - $this->projectteam1_id = $projectteam1_id; - $this->projectteam2_id = $projectteam2_id; +// $this->projectteam1_id = $projectteam1_id; +// $this->projectteam2_id = $projectteam2_id; //$this->projectws = $projectws; $this->roundws = $roundws; - if ($result = $this->model->getPlayer($projectteam1_id, $project_id)) + if ($result = $this->model->getPlayer($this->projectteam1_id, $project_id)) { - $this->getHomePlayer = $this->model->getPlayer($projectteam1_id, $project_id); + $this->getHomePlayer = $this->model->getPlayer($this->projectteam1_id, $project_id); } else { @@ -128,9 +128,9 @@ function _displayDefault($tpl) $this->getHomePlayer = $exportplayer; } - if ($result = $this->model->getPlayer($projectteam2_id, $project_id)) + if ($result = $this->model->getPlayer($this->projectteam2_id, $project_id)) { - $this->getAwayPlayer = $this->model->getPlayer($projectteam2_id, $project_id); + $this->getAwayPlayer = $this->model->getPlayer($this->projectteam2_id, $project_id); } else { diff --git a/list.xml b/list.xml index 5bf03c3d9f..569d5bda9b 100644 --- a/list.xml +++ b/list.xml @@ -1,3 +1,3 @@ - + diff --git a/script.php b/script.php index c7feee0b72..927c5bbd3f 100644 --- a/script.php +++ b/script.php @@ -110,7 +110,7 @@ class com_sportsmanagementInstallerScript * The release value would ideally be extracted from in the manifest file, * but at preflight, the manifest file exists only in the uploaded temp folder. */ - private $release = '3.8.60'; + private $release = '3.8.70'; // $language_update = ''; diff --git a/sportsmanagement-update.xml b/sportsmanagement-update.xml index 11c9785076..c061f878d5 100644 --- a/sportsmanagement-update.xml +++ b/sportsmanagement-update.xml @@ -1840,6 +1840,27 @@
some-section
+ + + + + Sports-Management + Sports-Management Component + com_sportsmanagement + component + 3.8.70 + http://fussballineuropa.de + + https://github.com/diddipoeler/sportsmanagement/archive/master.zip + + + some-tag + + Sports-Management Inc. + http://fussballineuropa.de +
some-section
+ +
diff --git a/sportsmanagement.xml b/sportsmanagement.xml index 4e09e451fb..4e85ec7980 100644 --- a/sportsmanagement.xml +++ b/sportsmanagement.xml @@ -9,7 +9,7 @@ Copyright Info GNU General Public License version 2 or later; see LICENSE.txt - 3.8.60 + 3.8.70 COM_SPORTSMANAGEMENT_DESCRIPTION diff --git a/update-server.xml b/update-server.xml index 0213204300..448c2da8b7 100644 --- a/update-server.xml +++ b/update-server.xml @@ -5,10 +5,10 @@ Sports-Management Component com_sportsmanagement component - 3.8.60 + 3.8.70 http://fussballineuropa.de - https://github.com/diddipoeler/sportsmanagement/archive/3.8.6.zip + https://github.com/diddipoeler/sportsmanagement/archive/3.8.7.zip some-tag