diff --git a/Classes/EventListener/CalendarizeOdsOsmSqlListener.php b/Classes/EventListener/CalendarizeOdsOsmSqlListener.php new file mode 100644 index 0000000..509f439 --- /dev/null +++ b/Classes/EventListener/CalendarizeOdsOsmSqlListener.php @@ -0,0 +1,39 @@ +addSqlData($this->getCalendarizeDatabaseString()); + } + } + + /** + * Get the calendarize string for the registered tables. + * + * @return string + */ + protected function getCalendarizeDatabaseString() + { + $sql = []; + foreach (Register::getRegister() as $configuration) { + if ($configuration['tableName'] == 'tx_calendarize_domain_model_event') { + $sql[] = "CREATE TABLE " . $configuration['tableName'] . " ( + tx_odsosm_lon decimal(9,6) NOT NULL DEFAULT '0.000000', + tx_odsosm_lat decimal(8,6) NOT NULL DEFAULT '0.000000', + );"; + } + } + + return implode(LF, $sql); + } +} diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml new file mode 100644 index 0000000..9cce97c --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,16 @@ +# PSR-14 EventListener for eventExtendedMultiple() in CalendarController +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + Bobosch\OdsOsm\: + resource: '../Classes/*' + + Bobosch\OdsOsm\EventListener\CalendarizeOdsOsmSqlListener: + tags: + - name: event.listener + identifier: 'calendarizeOdsOsmSql' + event: TYPO3\CMS\Core\Database\Event\AlterTableDefinitionStatementsEvent + after: 'calendarizeField' diff --git a/ext_tables.sql b/ext_tables.sql index 6592ef6..cc5918d 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -20,14 +20,6 @@ CREATE TABLE sys_category ( tx_odsosm_marker int(10) unsigned NOT NULL DEFAULT '0' ); --- --- Table structure for table 'tx_calendarize_domain_model_event' --- -CREATE TABLE tx_calendarize_domain_model_event ( - tx_odsosm_lon decimal(9,6) NOT NULL DEFAULT '0.000000', - tx_odsosm_lat decimal(8,6) NOT NULL DEFAULT '0.000000' -); - -- -- Table structure for table 'tx_odsosm_geocache' --