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
18 changes: 6 additions & 12 deletions Command/ImportFromDirectoryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

namespace MauticPlugin\MauticCustomImportBundle\Command;

use Mautic\CoreBundle\Command\ModeratedCommand;
use Symfony\Component\Console\Command\Command;
use MauticPlugin\MauticCustomImportBundle\Exception\InvalidImportException;
use MauticPlugin\MauticCustomImportBundle\Import\CustomImportFactory;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class ImportFromDirectoryCommand extends ModeratedCommand
class ImportFromDirectoryCommand extends Command
{
/**
* @var CustomImportFactory
Expand All @@ -38,10 +38,11 @@ class ImportFromDirectoryCommand extends ModeratedCommand
*/
public function __construct(CustomImportFactory $customImportFactory, TranslatorInterface $translator)
{
parent::__construct();
$this->customImportFactory = $customImportFactory;
$this->translator = $translator;
parent::__construct();
}
// parent constructor removed for Mautic 5; locking deps are DI'd into parent in core
}

/**
* {@inheritdoc}
Expand All @@ -60,11 +61,6 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$key = __CLASS__;
if (!$this->checkRunStatus($input, $output, $key)) {
return 0;
}

try {
$files = $this->customImportFactory->createImportFromDirectory();
$output->writeln(
Expand All @@ -76,8 +72,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
} catch (InvalidImportException $importException) {
$output->writeln(sprintf("<error>%s</error>", $importException->getMessage()));
}
$this->completeRun();

return 0;
}
}
11 changes: 6 additions & 5 deletions Command/ParallelImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace MauticPlugin\MauticCustomImportBundle\Command;

use Mautic\CoreBundle\Command\ModeratedCommand;
use Symfony\Component\Console\Command\Command;
use Mautic\CoreBundle\Helper\ProgressBarHelper;
use MauticPlugin\MauticCustomImportBundle\Exception\InvalidImportException;
use MauticPlugin\MauticCustomImportBundle\Import\CustomImportFactory;
Expand All @@ -20,9 +20,9 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class ParallelImportCommand extends ModeratedCommand
class ParallelImportCommand extends Command
{

/**
Expand All @@ -43,10 +43,11 @@ class ParallelImportCommand extends ModeratedCommand
*/
public function __construct(CustomImportFactory $customImportFactory, TranslatorInterface $translator)
{
parent::__construct();
$this->translator = $translator;
$this->customImportFactory = $customImportFactory;
parent::__construct();
}
// parent constructor removed for Mautic 5; locking deps are DI'd into parent in core
}

/**
* {@inheritdoc}
Expand Down
16 changes: 6 additions & 10 deletions Command/RemoveTagsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

namespace MauticPlugin\MauticCustomImportBundle\Command;

use Mautic\CoreBundle\Command\ModeratedCommand;
use Symfony\Component\Console\Command\Command;
use MauticPlugin\MauticCustomImportBundle\Exception\InvalidImportException;
use MauticPlugin\MauticCustomImportBundle\Import\CustomImportFactory;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class RemoveTagsCommand extends ModeratedCommand
class RemoveTagsCommand extends Command
{
/**
* @var CustomImportFactory
Expand All @@ -38,10 +38,11 @@ class RemoveTagsCommand extends ModeratedCommand
*/
public function __construct(CustomImportFactory $customImportFactory, TranslatorInterface $translator)
{
parent::__construct();
$this->customImportFactory = $customImportFactory;
$this->translator = $translator;
parent::__construct();
}
// parent constructor removed for Mautic 5; locking deps are DI'd into parent in core
}

/**
* {@inheritdoc}
Expand All @@ -60,11 +61,6 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$key = __CLASS__;
if (!$this->checkRunStatus($input, $output, $key)) {
return 0;
}

try {
$removedTags = $this->customImportFactory->removeContactsTags();
if (!empty($removedTags)) {
Expand Down
1 change: 1 addition & 0 deletions Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
'class' => \MauticPlugin\MauticCustomImportBundle\Import\ImportFromDirectory::class,
'arguments' => [
'mautic.lead.model.import',
'doctrine.orm.entity_manager',
],
],
'mautic.custom.import.parallel' => [
Expand Down
2 changes: 1 addition & 1 deletion Form/Type/ImportListType.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function configureOptions(OptionsResolver $resolver)
'expanded' => false,
'multiple' => false,
'required' => false,
'empty_value' => '',
'placeholder' => '',
]);
}

Expand Down
Loading