Skip to content

Commit

Permalink
Merge branch 'upmerge-7-1-x-latest' into 'master'
Browse files Browse the repository at this point in the history
ref #63913 the redirect in the execute method triggers to late. It can't work...

See merge request chameleon-system-oss/chameleon-base!87
  • Loading branch information
pixeljunkie committed Sep 16, 2024
2 parents e2da32a + 90e9021 commit f4008de
Show file tree
Hide file tree
Showing 88 changed files with 43,804 additions and 4,311 deletions.
2 changes: 1 addition & 1 deletion src/CommentBundle/objects/db/TPkgComment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TPkgComment extends TPkgCommentAutoParent
public const URL_NAME_ID_PAGE = 'chameleon_system_comment_url_id_page';
public const URL_NAME_JUMPER = 'chameleon_system_comment_url_jumper';

private const MESSAGE_CONSUMER_NAME = 'comments';
public const MESSAGE_CONSUMER_NAME = 'comments';
private const URL_ACTION_PARAMETER = 'action';

private const VIEW_PATH = 'pkgComment/views/db/TPkgComment';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<h1>Build #1722946918</h1>
<h2>Date: 2024-08-06</h2>
<div class="changelog">
- #64178: new field type "Geo-Koordinaten" with OpenStreetMap instead of Google Maps
</div>
<?php

$data = TCMSLogChange::createMigrationQueryData('cms_field_type', 'de')
->setFields([
'049_trans' => 'Geo-Koordinaten',
'mysql_standard_value' => '',
'force_auto_increment' => '0',
'fieldclass' => '\ChameleonSystem\CoreBundle\Field\FieldGeoCoordinates',
'indextype' => 'index',
'constname' => 'CMSFIELD_GEO_COORD',
'mysql_type' => 'VARCHAR',
'length_set' => '255',
'base_type' => 'standard',
'help_text' => '<div class="field-name"><strong>Feldname:</strong> beliebig</div>
<div class="php-class"><strong>PHP Klasse:</strong>&nbsp;FieldGeoCoordinates extends TCMSField</div>
<div>Erzeugt zwei Textfelder für die Eingabe der Geo-Koordinaten Breitengrad (latitude) und Längengrad (longitude).</div>
<div>Zusätzlich wird ein Button generiert, welcher ein PopUp mit OpenStreet Maps-Karte öffnet, in welchem dann gesucht werden kann.</div>
<div>&nbsp;</div>
<div>Ermöglicht die Angabe von Längen- und Breitengraden auf manuellem Wege oder über Suchen und Anklicken in einer OpenStreet Maps-Karte.</div>
<div>&nbsp;</div>
<div>
<ul>
<li class="parameter required head">Pflicht-Parameter:</li>
<li>
<ul>
<li class="parameter required">n/a</li>
</ul>
</li>
<li>&nbsp;</li>
<li class="parameter optional head">Optionale Parameter:</li>
<li>
<ul>
<li class="parameter optional">n/a</li>
</ul>
</li>
<li>
<ul>
</ul>
</li>
</ul>
</div>
',
'contains_images' => '0',
'class_type' => 'Core',
'class_subtype' => '',
'id' => '343b02d4-f02c-c533-be6f-f063d62bc982',
])
;
TCMSLogChange::insert(__LINE__, $data);

$data = TCMSLogChange::createMigrationQueryData('cms_field_type', 'en')
->setFields([
'049_trans' => 'Geo Coordinates',
'help_text' => '<div class="field-name"><strong>Field Name:</strong> arbitrary</div>
<div class="php-class"><strong>PHP Class:</strong>&nbsp;FieldGeoCoordinates extends TCMSField</div>
<div>Creates two text fields for entering the geo-coordinates latitude and longitude.</div>
<div>Additionally, a button is generated that opens a popup with an OpenStreet Maps map, where a search can be performed.</div>
<div>&nbsp;</div>
<div>Allows the entry of latitude and longitude manually or by searching and clicking on an OpenStreet Maps map.</div>
<div>&nbsp;</div>
<div>
<ul>
<li class="parameter required head">Required Parameters:</li>
<li>
<ul>
<li class="parameter required">n/a</li>
</ul>
</li>
<li>&nbsp;</li>
<li class="parameter optional head">Optional Parameters:</li>
<li>
<ul>
<li class="parameter optional">n/a</li>
</ul>
</li>
<li>
<ul>
</ul>
</li>
</ul>
</div>
',
])
->setWhereEquals([
'id' => '343b02d4-f02c-c533-be6f-f063d62bc982',
])
;
TCMSLogChange::update(__LINE__, $data);


$data = TCMSLogChange::createMigrationQueryData('cms_tpl_module', 'de')
->setFields([
'classname' => 'chameleon_system_core.module.map_coordinates',
'name' => 'Geo Koordinaten Backendmodul',
'description' => '',
'icon_font_css_class' => '',
'view_mapper_config' => 'standard=MapCoordinates/standard.html.twig',
'mapper_chain' => '',
'view_mapping' => '',
'revision_management_active' => '0',
'is_copy_allowed' => '0',
'show_in_template_engine' => '0',
'is_restricted' => '0',
'icon_list' => 'application.png',
'position' => '0',
'id' => 'a692affe-4283-2dd3-5a1d-1733d7b95dc8',
])
;
TCMSLogChange::insert(__LINE__, $data);

$data = TCMSLogChange::createMigrationQueryData('cms_tpl_module', 'en')
->setFields([
'name' => 'Geo Coordinates Backendmodul',
])
->setWhereEquals([
'id' => 'a692affe-4283-2dd3-5a1d-1733d7b95dc8',
])
;
TCMSLogChange::update(__LINE__, $data);
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h1>Build #1723198752</h1>
<h2>Date: 2024-08-09</h2>
<div class="changelog">
- #64178: Set all fields "Google Maps-Koordinaten" to new field "Maps-Koordinaten" with OpenStreetMap instead of Google Maps
</div>
<?php

$data = TCMSLogChange::createMigrationQueryData('cms_field_conf', 'en')
->setFields([
//set to Maps-Koordinaten (FieldGeoCoordinates)
'cms_field_type_id' => '343b02d4-f02c-c533-be6f-f063d62bc982',
])
->setWhereEquals([
//all Google Maps-Koordinaten (TCMSFieldGMapCoordinate)
'cms_field_type_id' => '2659ecf0-e16c-3c3f-1ec8-eba7d8887417'
])
;
TCMSLogChange::update(__LINE__, $data);
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<h1>Build #1725870468</h1>
<h2>Date: 2024-09-09</h2>
<div class="changelog">
- #64178: Set all fields "Google Maps-Koordinaten" to new field "Maps-Koordinaten" with OpenStreetMap instead of Google Maps (SELECT BY OLD CLASSNAME)
</div>
<?php

$query = "UPDATE `cms_field_conf`
LEFT JOIN `cms_field_type` ON `cms_field_type`.`id` = `cms_field_conf`.`cms_field_type_id`
SET `cms_field_conf`.`cms_field_type_id` = '343b02d4-f02c-c533-be6f-f063d62bc982'
WHERE `cms_field_type`.`fieldclass` = 'TCMSFieldGMapCoordinate'";

$connection = TCMSLogChange::getDatabaseConnection();
$connection->executeQuery($query);
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

/*
* This file is part of the Chameleon System (https://www.chameleonsystem.com).
*
* (c) ESONO AG (https://www.esono.de)
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ChameleonSystem\CoreBundle\Bridge\Chameleon\Module\MapCoordinates;

use ChameleonSystem\CoreBundle\Util\InputFilterUtilInterface;
use MTPkgViewRendererAbstractModuleMapper;
use ChameleonSystem\CoreBundle\ServiceLocator;


class MapCoordinates extends MTPkgViewRendererAbstractModuleMapper
{
public function __construct(
private readonly InputFilterUtilInterface $inputFilterUtil
) {
}
/**
* {@inheritdoc}
*/
public function Accept(\IMapperVisitorRestricted $visitor, $cachingEnabled, \IMapperCacheTriggerRestricted $cacheTriggerManager)
{
$visitor->SetMappedValue('fieldname', $this->inputFilterUtil->getFilteredGetInput('sFieldName', ''));
$visitor->SetMappedValue('lat', $this->inputFilterUtil->getFilteredGetInput('lat', ''));
$visitor->SetMappedValue('lng', $this->inputFilterUtil->getFilteredGetInput('lng', ''));

if (ServiceLocator::getParameter('chameleon_system_core.geocoding.attribution.show')) {
$visitor->SetMappedValue('showGeocodingAttribution', true);
$visitor->SetMappedValue('geocodingAttributionName', ServiceLocator::getParameter('chameleon_system_core.geocoding.attribution.name'));
$visitor->SetMappedValue('geocodingAttributionUrl', ServiceLocator::getParameter('chameleon_system_core.geocoding.attribution.url'));
} else {
$visitor->SetMappedValue('showGeocodingAttribution', false);
}
}
/**
* {@inheritdoc}
*/
public function GetHtmlHeadIncludes()
{
$includes = parent::GetHtmlHeadIncludes();
$includes[] = '<link rel="stylesheet" href="'.$this->global->GetStaticUrlToWebLib('/fields/FieldGeoCoordinates/Leaflet-dist/leaflet.css').'" />';
$includes[] = '<script type="text/javascript" src="'.$this->global->GetStaticUrlToWebLib('/fields/FieldGeoCoordinates/Leaflet-dist/leaflet.js', false).'"></script>';
$includes[] = '<link rel="stylesheet" href="'.$this->global->GetStaticUrlToWebLib('/fields/FieldGeoCoordinates/Geocoder-dist/Control.Geocoder.css').'" />';
$includes[] = '<script type="text/javascript" src="'.$this->global->GetStaticUrlToWebLib('/fields/FieldGeoCoordinates/Geocoder-dist/Control.Geocoder.js', false).'"></script>';
$includes[] = '<link rel="stylesheet" href="'.$this->global->GetStaticUrlToWebLib('/fields/FieldGeoCoordinates/FieldGeoCoordinates.css?v2').'" />';
$includes[] = '<script type="text/javascript" src="'.$this->global->GetStaticURLToWebLib('/fields/FieldGeoCoordinates/FieldGeoCoordinates.js').'"></script>';

return $includes;
}
}
10 changes: 2 additions & 8 deletions src/CoreBundle/Controller/ChameleonBackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@

class ChameleonBackendController extends ChameleonController
{
/**
* @var BackendAccessCheck
*/
private $backendAccessCheck;
/**
* @var string
*/
private $homePagedef;
private BackendAccessCheck $backendAccessCheck;
private string $homePagedef = 'welcome';

/**
* {@inheritdoc}
Expand Down
Loading

0 comments on commit f4008de

Please sign in to comment.