Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,25 @@
}
],
"require": {
"php": "^7.4||^8.0",
"php": "^7.4 || ^8.0",
"ausi/slug-generator": "^1.1",
"contao/core-bundle": "^4.9",
"contao/core-bundle": "^4.13 || ^5.0",
"elvanto/litemoji": "^5.2",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"heimrichhannot/contao-be_explanation-bundle": "^2.3",
"heimrichhannot/contao-field-value-copier-bundle": "^1.1",
"heimrichhannot/contao-list_widget": "^2.1",
"heimrichhannot/contao-list-widget-bundle": "^1.5",
"heimrichhannot/contao-multi-column-editor-bundle": "^2.4",
"heimrichhannot/contao-progress-bar-widget-bundle": "^0.1",
"heimrichhannot/contao-utils-bundle": "^2.135",
"symfony/cache": "^4.4 || ^5.2",
"symfony/config": "^4.4||^5.4",
"symfony/console": "^4.4||^5.4",
"symfony/dependency-injection": "^4.4||^5.4",
"symfony/event-dispatcher": "^4.4||^5.4",
"symfony/event-dispatcher-contracts": "^1||^2||^3",
"symfony/http-kernel": "^4.4||^5.4",
"symfony/stopwatch": "^4.4 || ^5.2",
"heimrichhannot/contao-progress-bar-widget-bundle": "dev-master",
"heimrichhannot/contao-utils-bundle": "^2.135 || ^3.7",
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher-contracts": "^1 || ^2 || ^3",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0",
"terminal42/service-annotation-bundle": "^1.1"
},
"require-dev": {
Expand Down
6 changes: 5 additions & 1 deletion src/Resources/config/services.yml → config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ services:
public: true

HeimrichHannot\EntityImportBundle\:
resource: '../../{Command,Controller,DataContainer,EventListener}/*'
resource: '../src/{Command,Controller,DataContainer,EventListener}/*'

HeimrichHannot\EntityImportBundle\Importer\ImporterFactory: ~
HeimrichHannot\EntityImportBundle\Source\SourceFactory: ~
HeimrichHannot\EntityImportBundle\Util\EntityImportUtil: ~

HeimrichHannot\EntityImportBundle\Command\ExecuteImportCommand:
arguments:
$projectDir: '%kernel.project_dir%'
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,3 @@
$GLOBALS['TL_CRON']['daily'][] = [HeimrichHannot\EntityImportBundle\Controller\PoorManCronController::class, 'runDaily'];
$GLOBALS['TL_CRON']['weekly'][] = [HeimrichHannot\EntityImportBundle\Controller\PoorManCronController::class, 'runWeekly'];
$GLOBALS['TL_CRON']['monthly'][] = [HeimrichHannot\EntityImportBundle\Controller\PoorManCronController::class, 'runMonthly'];

if ('BE' === TL_MODE) {
$GLOBALS['TL_CSS']['be_entityimportbundle'] = 'bundles/heimrichhannotcontaoentityimport/assets/contao-entity-import-bundle-be.css|static';
$GLOBALS['TL_JAVASCRIPT']['be_entityimportbundle'] = 'bundles/heimrichhannotcontaoentityimport/assets/contao-entity-import-bundle-be.js|static';
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

$GLOBALS['TL_DCA']['tl_entity_import_cache'] = [
'config' => [
'dataContainer' => 'Table',
'dataContainer' => \Contao\DC_Table::class,
'sql' => [
'keys' => [
'id' => 'primary',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
* @license LGPL-3.0-or-later
*/

\HeimrichHannot\UtilsBundle\Dca\DateAddedField::register('tl_entity_import_config');

$GLOBALS['TL_DCA']['tl_entity_import_config'] = [
'config' => [
'dataContainer' => 'Table',
'dataContainer' => \Contao\DC_Table::class,
'enableVersioning' => true,
'ptable' => 'tl_entity_import_source',
'onload_callback' => [[\HeimrichHannot\EntityImportBundle\DataContainer\EntityImportConfigContainer::class, 'initPalette']],
'onsubmit_callback' => [
['huh.utils.dca', 'setDateAdded'],
[\HeimrichHannot\EntityImportBundle\DataContainer\EntityImportConfigContainer::class, 'setPreset'],
],
'oncopy_callback' => [
['huh.utils.dca', 'setDateAddedOnCopy'],
],
'sql' => [
'keys' => [
'id' => 'primary',
Expand Down Expand Up @@ -77,8 +75,8 @@
'import' => [
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_config']['import'],
'href' => 'key=import',
'icon' => 'store.svg',
'attributes' => 'onclick="if (!confirm(\''.($GLOBALS['TL_LANG']['tl_entity_import_config']['importConfirm'] ?? null).'\')) return false; Backend.getScrollOffset();"',
'icon' => 'theme_import.svg',
'attributes' => 'data-turbo="false" onclick="if (!confirm(\''.($GLOBALS['TL_LANG']['tl_entity_import_config']['importConfirm'] ?? null).'\')) return false; Backend.getScrollOffset();"',
],
],
],
Expand Down Expand Up @@ -110,13 +108,6 @@
'sql' => "int(10) unsigned NOT NULL default '0'",
'relation' => ['type' => 'belongsTo', 'load' => 'eager'],
],
'dateAdded' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'],
'sorting' => true,
'flag' => 6,
'eval' => ['rgxp' => 'datim', 'doNotCopy' => true],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
Expand Down Expand Up @@ -549,7 +540,7 @@
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_config']['cronLanguage'],
'exclude' => true,
'inputType' => 'select',
'options' => \Contao\System::getLanguages(),
'options' => \Contao\System::getContainer()->get('contao.intl.locales')->getLanguages(),
'eval' => ['tl_class' => 'w50', 'mandatory' => true, 'includeBlankOption' => true, 'chosen' => true],
'sql' => "varchar(64) NOT NULL default ''",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@
* @license LGPL-3.0-or-later
*/

System::getContainer()->get('huh.utils.dca')->loadLanguageFile('tl_entity_import_source');
System::getContainer()->get('huh.utils.dca')->loadLanguageFile('tl_entity_import_config');
\Contao\System::loadLanguageFile('tl_entity_import_source');
\Contao\System::loadLanguageFile('tl_entity_import_config');

\HeimrichHannot\UtilsBundle\Dca\DateAddedField::register('tl_entity_import_quick_config');

$GLOBALS['TL_DCA']['tl_entity_import_quick_config'] = [
'config' => [
'dataContainer' => 'Table',
'dataContainer' => \Contao\DC_Table::class,
'enableVersioning' => true,
'onload_callback' => [
[\HeimrichHannot\EntityImportBundle\DataContainer\EntityImportQuickConfigContainer::class, 'modifyDca'],
],
'onsubmit_callback' => [
['huh.utils.dca', 'setDateAdded'],
[\HeimrichHannot\EntityImportBundle\DataContainer\EntityImportQuickConfigContainer::class, 'cacheCsvRows'],
],
'oncopy_callback' => [
['huh.utils.dca', 'setDateAddedOnCopy'],
],
'sql' => [
'keys' => [
'id' => 'primary',
Expand Down Expand Up @@ -79,8 +77,8 @@
'import' => [
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_quick_config']['import'],
'href' => 'key=import',
'icon' => 'store.svg',
'attributes' => 'onclick="if (!confirm(\''.$GLOBALS['TL_LANG']['tl_entity_import_config']['importConfirm'].'\')) return false; Backend.getScrollOffset();"',
'icon' => 'theme_import.svg',
'attributes' => 'data-turbo="false" onclick="if (!confirm(\''.$GLOBALS['TL_LANG']['tl_entity_import_config']['importConfirm'].'\')) return false; Backend.getScrollOffset();"',
],
],
],
Expand All @@ -95,13 +93,6 @@
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_quick_config']['tstamp'],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'dateAdded' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'],
'sorting' => true,
'flag' => 6,
'eval' => ['rgxp' => 'datim', 'doNotCopy' => true],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_quick_config']['title'],
'exclude' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
* @license LGPL-3.0-or-later
*/

\HeimrichHannot\UtilsBundle\Dca\DateAddedField::register('tl_entity_import_source');

$connection = \Contao\System::getContainer()->get('doctrine.dbal.default_connection');
$connectionParams = $connection->getParams();

$GLOBALS['TL_DCA']['tl_entity_import_source'] = [
// Config
'config' => [
'dataContainer' => 'Table',
'dataContainer' => \Contao\DC_Table::class,
'ctable' => ['tl_entity_import_config'],
'enableVersioning' => true,
'onload_callback' => [[\HeimrichHannot\EntityImportBundle\DataContainer\EntityImportSourceContainer::class, 'initPalette']],
'onsubmit_callback' => [
['huh.utils.dca', 'setDateAdded'],
[\HeimrichHannot\EntityImportBundle\DataContainer\EntityImportSourceContainer::class, 'setPreset'],
],
'oncopy_callback' => [
['huh.utils.dca', 'setDateAddedOnCopy'],
],
'sql' => [
'keys' => [
'id' => 'primary',
Expand Down Expand Up @@ -103,13 +104,6 @@
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'dateAdded' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'],
'sorting' => true,
'flag' => 6,
'eval' => ['rgxp' => 'datim', 'doNotCopy' => true],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['title'],
'search' => true,
Expand All @@ -132,24 +126,24 @@
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['dbDriver'],
'inputType' => 'select',
'default' => version_compare(VERSION, '4.0', '<') ? \Config::get('dbDriver') : 'pdo_mysql',
'options' => version_compare(VERSION, '4.0', '<') ? ['MySQLi', 'MySQL'] : ['pdo_mysql'],
'default' => 'pdo_mysql',
'options' => ['pdo_mysql'],
'eval' => ['mandatory' => true, 'tl_class' => 'w50'],
'sql' => "varchar(12) NOT NULL default ''",
],
'dbHost' => [
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['dbHost'],
'inputType' => 'text',
'default' => \Config::get('dbHost'),
'default' => $connectionParams['host'],
'eval' => ['mandatory' => true, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
'dbUser' => [
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['dbUser'],
'inputType' => 'text',
'default' => \Config::get('dbUser') ?: '',
'default' => $connectionParams['user'] ?? '',
'eval' => ['mandatory' => true, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
Expand All @@ -164,7 +158,7 @@
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['dbDatabase'],
'inputType' => 'text',
'default' => \Config::get('dbDatabase') ?: '',
'default' => $connectionParams['dbname'] ?? '',
'eval' => ['mandatory' => true, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
Expand All @@ -181,15 +175,15 @@
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['dbCharset'],
'inputType' => 'text',
'default' => \Config::get('dbCharset'),
'default' => $connectionParams['charset'] ?? '',
'eval' => ['mandatory' => true, 'maxlength' => 32, 'tl_class' => 'w50'],
'sql' => "varchar(32) NOT NULL default ''",
],
'dbPort' => [
'exclude' => true,
'label' => &$GLOBALS['TL_LANG']['tl_entity_import_source']['dbPort'],
'inputType' => 'text',
'default' => \Config::get('dbPort'),
'default' => $connectionParams['port'] ?? 0,
'eval' => ['maxlength' => 5, 'tl_class' => 'w50', 'rgxp' => 'digit'],
'sql' => "int(5) unsigned NOT NULL default '0'",
],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#tl_entity_import_source{
#tl_entity_import_source {
[name="fileContent"] + .ace_editor {
height: 500px !important;
}
Expand Down
1 change: 1 addition & 0 deletions public/css/contao-entity-import-bundle-be.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#tl_entity_import_source{[name="fileContent"]+.ace_editor{height:500px!important}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '../scss/contao-entity-import-bundle-be.scss';

class ContaoEntityImportBundleBe {
static init() {
ContaoEntityImportBundleBe.removeWidthLimitForQuickImporters();
Expand Down
1 change: 1 addition & 0 deletions public/js/contao-entity-import-bundle-be.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading