Compare commits

...

23 Commits

Author SHA1 Message Date
Daniel Seifert 4b726bb678
use vector module icon 2023-12-05 23:27:49 +01:00
Markus Gärtner c414eb3683 Tag version 2.1.1.3, make installable in OXID 6.5.3 2023-09-12 13:54:03 +02:00
Markus Gärtner 5ddd1a3923 make installable in OXID 6.5.3 2023-09-12 13:43:59 +02:00
Daniel Seifert aac67d8550
add product logo 2023-06-09 12:18:36 +02:00
Daniel Seifert 3debde96c9
apply roles and rights 2023-05-23 10:59:44 +02:00
Daniel Seifert 03f31f3e8b
adjust documentation 2023-03-30 13:33:39 +02:00
Daniel Seifert 3d83650f7c
fix JS for multiforms 2023-03-30 13:30:04 +02:00
Daniel Seifert cf6dd76aa9
adjust documentation 2023-03-22 16:00:53 +01:00
Daniel Seifert 0213f2e6b3
fix cascaded HTML elements to prevent form issues 2023-03-22 15:58:02 +01:00
Daniel Seifert 1fd00635f9
define code coverage exclusions 2022-12-24 23:39:45 +01:00
Daniel Seifert 640152b6a6
adjust version informations 2022-12-24 23:28:33 +01:00
Daniel Seifert 7d8ed628eb
make installable in OXID 6.5.1 2022-12-19 11:22:50 +01:00
Daniel Seifert 8356ff3a62
make installable in OXID 6.5 (CE 6.12) 2022-08-30 00:23:18 +02:00
Daniel Seifert 7c479d02c8
improve changelog 2022-07-28 11:08:54 +02:00
Daniel Seifert b1e3bd98f0
Merge branch 'rel_2.x' of git.d3data.de:D3Public/DataWizard into rel_2.x 2022-07-13 13:46:17 +02:00
Daniel Seifert 72478c06e7
fix typo 2022-07-13 13:45:55 +02:00
Daniel Seifert bd4dfaf36c
0010966 execute action after confirmation 2022-02-27 22:56:00 +01:00
Daniel Seifert 7e1e65cb37
prevent commiting CS-Fixer cache file 2022-01-17 11:09:16 +01:00
Daniel Seifert 0c0d564554
add CS-fixed files 2022-01-17 10:59:18 +01:00
Daniel Seifert 51642b57c7
add CS-Fixer configuration 2022-01-17 10:58:46 +01:00
Daniel Seifert d0464d4a20
enhance README file 2021-12-29 23:41:51 +01:00
Daniel Seifert 6aa028fb8c
improve package description 2021-12-23 14:46:43 +01:00
Daniel Seifert 143173be2f
set Modcfg as dependency 2021-12-22 15:10:24 +01:00
52 changed files with 493 additions and 294 deletions

5
.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
* text=auto
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.php export-ignore

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.php-cs-fixer.cache

13
.php-cs-fixer.php Normal file
View File

@ -0,0 +1,13 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP73Migration' => true,
'@PSR12' => true
])
->setFinder($finder)
;

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -40,6 +40,10 @@ class d3ActionWizard extends AdminDetailsController
$this->configuration = oxNew(Configuration::class);
}
public function getViewId()
{
return 'd3mxDataWizard_Action';
}
public function getGroups(): array
{
return $this->configuration->getActionGroups();
@ -101,4 +105,4 @@ class d3ActionWizard extends AdminDetailsController
{
return null;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -45,6 +45,11 @@ class d3ExportWizard extends AdminDetailsController
$this->configuration = oxNew(Configuration::class);
}
public function getViewId()
{
return 'd3mxDataWizard_Export';
}
public function getGroups(): array
{
return $this->configuration->getExportGroups();
@ -115,4 +120,4 @@ class d3ExportWizard extends AdminDetailsController
{
return null;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -33,7 +33,7 @@ abstract class ActionBase implements QueryBase
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getDescription() : string
public function getDescription(): string
{
return '';
}
@ -53,7 +53,7 @@ abstract class ActionBase implements QueryBase
}
}
$this->executeAction( $this->getQuery() );
$this->executeAction($this->getQuery());
}
/**
@ -63,21 +63,21 @@ abstract class ActionBase implements QueryBase
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function executeAction( array $query ): int
public function executeAction(array $query): int
{
[ $queryString, $parameters ] = $query;
$queryString = trim($queryString);
if ( strtolower( substr( $queryString, 0, 6 ) ) === 'select' ) {
if (strtolower(substr($queryString, 0, 6)) === 'select') {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_ACTIONSELECT' )
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_ACTIONSELECT')
);
}
$affected = $this->d3GetDb()->execute( $queryString, $parameters );
$affected = $this->d3GetDb()->execute($queryString, $parameters);
throw oxNew(
Exceptions\TaskException::class,
@ -97,13 +97,13 @@ abstract class ActionBase implements QueryBase
*/
public function d3GetDb(): ?DatabaseInterface
{
return DatabaseProvider::getDb( DatabaseProvider::FETCH_MODE_ASSOC );
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
}
/**
* @return string
*/
public function getButtonText() : string
public function getButtonText(): string
{
return "D3_DATAWIZARD_ACTION_SUBMIT";
}
@ -138,4 +138,4 @@ abstract class ActionBase implements QueryBase
{
return $this->formElements;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -19,13 +19,13 @@ use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
class Configuration
{
const GROUP_SHOP = 'D3_DATAWIZARD_GROUP_SHOP';
const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
const GROUP_ARTICLES = 'D3_DATAWIZARD_GROUP_ARTICLES';
const GROUP_USERS = 'D3_DATAWIZARD_GROUP_USERS';
const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
const GROUP_CMS = 'D3_DATAWIZARD_GROUP_CMS';
public const GROUP_SHOP = 'D3_DATAWIZARD_GROUP_SHOP';
public const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
public const GROUP_ARTICLES = 'D3_DATAWIZARD_GROUP_ARTICLES';
public const GROUP_USERS = 'D3_DATAWIZARD_GROUP_USERS';
public const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
public const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
public const GROUP_CMS = 'D3_DATAWIZARD_GROUP_CMS';
protected $actions = [];
protected $exports = [];
@ -113,7 +113,7 @@ class Configuration
/**
* @return array
*/
public function getAllActions() : array
public function getAllActions(): array
{
$all = [];
@ -127,7 +127,7 @@ class Configuration
/**
* @return array
*/
public function getAllExports() : array
public function getAllExports(): array
{
$all = [];
@ -143,7 +143,7 @@ class Configuration
*
* @return ActionBase
*/
public function getActionById($id) : ActionBase
public function getActionById($id): ActionBase
{
$allActions = $this->getAllActions();
@ -159,7 +159,7 @@ class Configuration
*
* @return ExportBase
*/
public function getExportById($id) : ExportBase
public function getExportById($id): ExportBase
{
$allExports = $this->getAllExports();

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -19,4 +19,4 @@ use OxidEsales\Eshop\Core\Exception\StandardException;
class DataWizardException extends StandardException
{
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -20,13 +20,13 @@ use OxidEsales\Eshop\Core\Registry;
class DebugException extends DataWizardException
{
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = sprintf(
Registry::getLang()->translateString('D3_DATAWIZARD_DEBUG'),
$sMessage
);
parent::__construct($sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -20,13 +20,13 @@ use OxidEsales\Eshop\Core\Registry;
class ExportFileException extends DataWizardException
{
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = sprintf(
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_EXPORTFILEERROR'),
$sMessage
);
parent::__construct($sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -32,7 +32,7 @@ class InputUnvalidException extends DataWizardException
* @param Exception|null $previous
* @throws Exception
*/
public function __construct( QueryBase $task, Input $inputElement, $iCode = 0, Exception $previous = null )
public function __construct(QueryBase $task, Input $inputElement, $iCode = 0, Exception $previous = null)
{
$messages = [];
foreach ($inputElement->getError()->getIterator() as $item) {
@ -43,11 +43,11 @@ class InputUnvalidException extends DataWizardException
' - ',
[
$task->getTitle(),
implode(', ', $messages)
implode(', ', $messages),
]
);
parent::__construct( $sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
$this->task = $task;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -20,13 +20,13 @@ use OxidEsales\Eshop\Core\Registry;
class NoSuitableRendererException extends DataWizardException
{
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = sprintf(
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOSUITABLERENDERER'),
$sMessage
);
parent::__construct($sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -17,4 +17,4 @@ namespace D3\DataWizard\Application\Model\Exceptions;
class RenderException extends DataWizardException
{
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -23,17 +23,17 @@ class TaskException extends DataWizardException
/** @var QueryBase */
public $task;
public function __construct( QueryBase $task, $sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct(QueryBase $task, $sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = implode(
' - ',
[
$task->getTitle(),
$sMessage
$sMessage,
]
);
parent::__construct( $sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
$this->task = $task;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -40,11 +40,11 @@ abstract class ExportBase implements QueryBase
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getDescription() : string
public function getDescription(): string
{
return '';
}
/**
* @param string $format
* @param $path
@ -59,7 +59,7 @@ abstract class ExportBase implements QueryBase
* @throws d3_cfg_mod_exception
* @return string
*/
public function run( string $format = RendererBridge::FORMAT_CSV, $path = null): string
public function run(string $format = RendererBridge::FORMAT_CSV, $path = null): string
{
if ($this->hasFormElements()) {
/** @var Input $element */
@ -76,7 +76,7 @@ abstract class ExportBase implements QueryBase
/**
* @return string
*/
public function getButtonText() : string
public function getButtonText(): string
{
return "D3_DATAWIZARD_EXPORT_SUBMIT";
}
@ -128,7 +128,7 @@ abstract class ExportBase implements QueryBase
/**
* @return string
*/
public function getExportFilenameBase() : string
public function getExportFilenameBase(): string
{
return $this->getTitle();
}
@ -139,7 +139,7 @@ abstract class ExportBase implements QueryBase
* @return string
* @throws Exceptions\NoSuitableRendererException
*/
public function getExportFileName($format) : string
public function getExportFileName($format): string
{
return $this->getExportFilenameBase().'_'.date('Y-m-d_H-i-s').'.'.$this->getFileExtension($format);
}
@ -151,31 +151,31 @@ abstract class ExportBase implements QueryBase
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function getExportData( array $query ): array
public function getExportData(array $query): array
{
[ $queryString, $parameters ] = $query;
$queryString = trim($queryString);
if ( strtolower( substr( $queryString, 0, 6 ) ) !== 'select' ) {
if (strtolower(substr($queryString, 0, 6)) !== 'select') {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_NOEXPORTSELECT' )
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOEXPORTSELECT')
);
}
$rows = $this->d3GetDb()->getAll( $queryString, $parameters );
$rows = $this->d3GetDb()->getAll($queryString, $parameters);
if ( count( $rows ) <= 0 ) {
if (count($rows) <= 0) {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_NOEXPORTCONTENT', null, true )
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOEXPORTCONTENT', null, true)
);
}
$fieldNames = array_keys( $rows[0] );
$fieldNames = array_keys($rows[0]);
return [ $rows, $fieldNames ];
}
@ -225,7 +225,7 @@ abstract class ExportBase implements QueryBase
*/
protected function executeExport(string $format, $path): string
{
$content = $this->getContent( $format );
$content = $this->getContent($format);
/** @var $oFS d3filesystem */
$oFS = $this->getFileSystem();
@ -267,12 +267,12 @@ abstract class ExportBase implements QueryBase
* @throws DatabaseErrorException
* @throws Exceptions\NoSuitableRendererException
*/
public function getContent( string $format ): string
public function getContent(string $format): string
{
[ $rows, $fieldNames ] = $this->getExportData( $this->getQuery() );
[ $rows, $fieldNames ] = $this->getExportData($this->getQuery());
$content = $this->renderContent( $rows, $fieldNames, $format );
$content = $this->renderContent($rows, $fieldNames, $format);
return $content;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -35,12 +35,12 @@ class Csv implements RendererInterface
{
try {
$csv = $this->getCsv();
$csv->insertOne( $fieldNames );
$csv->insertAll( $rows );
$csv->insertOne($fieldNames);
$csv->insertAll($rows);
return (string) $csv;
} catch (Exception $e) {
/** @var RenderException $newException */
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e );
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e);
throw $newException;
}
}
@ -90,4 +90,4 @@ class Csv implements RendererInterface
{
return Registry::getConfig();
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -31,11 +31,11 @@ class Json implements RendererInterface
{
try {
$flags = JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR;
$json = json_encode( $rows, $flags );
$json = json_encode($rows, $flags);
return $json;
} catch ( JsonException $e) {
} catch (JsonException $e) {
/** @var RenderException $newException */
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e );
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e);
throw $newException;
}
}
@ -52,4 +52,4 @@ class Json implements RendererInterface
{
return "D3_DATAWIZARD_EXPORT_FORMAT_JSON";
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -25,7 +25,7 @@ class Pretty implements RendererInterface
*
* @return string
*/
public function getContent($rows, $fieldNames) : string
public function getContent($rows, $fieldNames): string
{
$renderer = $this->getArrayToTextTableInstance($rows);
return $renderer->getTable();
@ -55,4 +55,4 @@ class Pretty implements RendererInterface
{
return "D3_DATAWIZARD_EXPORT_FORMAT_PRETTY";
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -19,9 +19,9 @@ use D3\DataWizard\Application\Model\Exceptions\NoSuitableRendererException;
class RendererBridge
{
const FORMAT_CSV = 'CSV';
const FORMAT_PRETTY = 'Pretty';
const FORMAT_JSON = 'JSON';
public const FORMAT_CSV = 'CSV';
public const FORMAT_PRETTY = 'Pretty';
public const FORMAT_JSON = 'JSON';
/**
* @return array
@ -31,7 +31,7 @@ class RendererBridge
return [
self::FORMAT_CSV => oxNew(Csv::class),
self::FORMAT_PRETTY => oxNew(Pretty::class),
self::FORMAT_JSON => oxNew(Json::class)
self::FORMAT_JSON => oxNew(Json::class),
];
}
@ -71,4 +71,4 @@ class RendererBridge
$e = oxNew(NoSuitableRendererException::class, $format);
throw $e;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -23,15 +23,15 @@ interface RendererInterface
*
* @return string
*/
public function getContent($rows, $fieldNames) : string;
public function getContent($rows, $fieldNames): string;
/**
* @return string
*/
public function getFileExtension() : string;
public function getFileExtension(): string;
/**
* @return string
*/
public function getTitleTranslationId() : string;
}
public function getTitleTranslationId(): string;
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -25,23 +25,23 @@ interface QueryBase
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getTitle() : string;
public function getTitle(): string;
/**
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getDescription() : string;
public function getDescription(): string;
/**
* @return string
*/
public function getButtonText() : string;
public function getButtonText(): string;
/**
* @return array [string $query, array $parameters]
*/
public function getQuery() : array;
public function getQuery(): array;
/**
* @param Input $input
@ -57,4 +57,4 @@ interface QueryBase
* @return array
*/
public function getFormElements(): array;
}
}

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -11,13 +11,14 @@
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
declare(strict_types=1);
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
$aLang = [
//Navigation
'charset' => 'UTF-8',
@ -42,6 +43,7 @@ $aLang = array(
'D3_DATAWIZARD_EXPORT_FORMAT_JSON' => 'JSON-Format',
'D3_DATAWIZARD_ACTION_SUBMIT' => 'Aktion starten',
'D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM' => 'Soll die Aktion gestartet werden?',
'D3_DATAWIZARD_DEBUG' => 'Debug: %1$s',
@ -55,4 +57,5 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'Es sind keine Aktionen installiert oder aktiviert.',
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s Eintrag verändert',
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s Einträge verändert',
);
];
// @codeCoverageIgnoreEnd

View File

@ -3,7 +3,7 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
@ -11,13 +11,14 @@
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
declare(strict_types=1);
$sLangName = "English";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
$aLang = [
//Navigation
'charset' => 'UTF-8',
@ -42,6 +43,7 @@ $aLang = array(
'D3_DATAWIZARD_EXPORT_FORMAT_JSON' => 'JSON format',
'D3_DATAWIZARD_ACTION_SUBMIT' => 'run action',
'D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM' => 'Should the action be executed?',
'D3_DATAWIZARD_DEBUG' => 'Debug: %1$s',
@ -55,4 +57,5 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'No actions are installed or activated.',
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s entry changed',
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s entries changed',
);
];
// @codeCoverageIgnoreEnd

View File

@ -6,6 +6,12 @@
[{oxscript include="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"}]
[{oxstyle include="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/solid.min.css"}]
[{if $readonly}]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<style>
button {
margin: 1em 1em 1em 5em;
@ -41,43 +47,45 @@
}, 3000);
document.getElementById('mask').className='on';
document.getElementById('popup2').className='d3loader-2 on';
document.getElementById('taskid').value = id;
document.getElementById('format').value = format;
document.getElementById('myedit').submit();
form = document.getElementById('form_' + id);
form.format.value = format;
form.submit();
}
[{/strip}][{/capture}]
[{oxscript add=$smarty.capture.d3script}]
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" style="padding: 0;margin: 0;height:0;">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value="runTask">
<input type="hidden" name="taskid" id="taskid" value="">
<input type="hidden" name="format" id="format" value="CSV">
[{assign var="groups" value=$oView->getGroups()}]
[{if $groups|@count}]
<div id="accordion">
[{foreach from=$oView->getGroups() item="group"}]
<div class="card mb-2">
<div class="card-header p-1" id="heading[{$group}]">
<h4 class="mb-0">
<span class="btn p-1" data-toggle="collapse" data-target="#collapse[{$group}]" aria-expanded="false" aria-controls="collapse[{$group}]">
[{oxmultilang ident=$group}]
</span>
</h4>
</div>
<div id="collapse[{$group}]" class="collapse" aria-labelledby="heading[{$group}]" data-parent="#accordion">
<div class="card-body pb-0">
<div class="row">
[{foreach from=$oView->getGroupTasks($group) key="id" item="item"}]
<div class="col-sm-6 col-md-4 col-lg-3 pb-4">
<div class="card">
<h5 class="card-header">
[{$item->getTitle()}]
</h5>
<div class="card-body">
<form name="myedit" id="form_[{$id}]" action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value="runTask">
<input type="hidden" name="taskid" value="[{$id}]">
<input type="hidden" name="format" value="CSV">
[{assign var="groups" value=$oView->getGroups()}]
[{if $groups|@count}]
<div id="accordion">
[{foreach from=$oView->getGroups() item="group"}]
<div class="card mb-2">
<div class="card-header p-1" id="heading[{$group}]">
<h4 class="mb-0">
<span class="btn p-1" data-toggle="collapse" data-target="#collapse[{$group}]" aria-expanded="false" aria-controls="collapse[{$group}]">
[{oxmultilang ident=$group}]
</span>
</h4>
</div>
<div id="collapse[{$group}]" class="collapse" aria-labelledby="heading[{$group}]" data-parent="#accordion">
<div class="card-body pb-0">
<div class="row">
[{foreach from=$oView->getGroupTasks($group) key="id" item="item"}]
<div class="col-sm-6 col-md-4 col-lg-3 pb-4">
<div class="card">
<h5 class="card-header">
[{$item->getTitle()}]
</h5>
<div class="card-body">
[{if $item->getDescription()}]
[{assign var="description" value=$item->getDescription()}]
[{assign var="sectionlength" value="100"}]
@ -89,7 +97,7 @@
<p class="card-text" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample" style="cursor: pointer">
[{$shorttext}]...
</p>
<p class="card-text collapse" id="collapseExample">
<p class="card-text collapse" id="collapseExample_[{$id}]">
...[{$description|replace:$shorttext:''}]
</p>
[{/if}]
@ -104,25 +112,27 @@
[{block name="exportSubmit"}]
[{include file=$submit}]
[{/block}]
</div>
</form>
</div>
</div>
[{/foreach}]
</div>
<div class="clear"></div>
</div>
[{/foreach}]
</div>
<div class="clear"></div>
</div>
</div>
</div>
[{/foreach}]
</div>
[{else}]
<div class="alert alert-primary" role="alert">
[{oxmultilang ident=$d3dw_noitemmessageid}]
</div>
[{/if}]
</form>
[{/foreach}]
</div>
[{else}]
<div class="alert alert-primary" role="alert">
[{oxmultilang ident=$d3dw_noitemmessageid}]
</div>
[{/if}]
<div id="mask" class=""></div>
<div id="popup2" class="d3loader-2">

View File

@ -1,6 +1,6 @@
[{block name="submitElements"}]
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startTask('[{$id}]')">
<div class="btn-group" [{$readonly}]>
<button type="button" class="btn btn-primary" onclick="if (confirm('[{oxmultilang ident="D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM"}]') === true) {startTask('[{$id}]')}" [{$readonly}]>
<i class="fas fa-fw fa-magic"></i>
[{oxmultilang ident=$item->getButtonText()}]
</button>

View File

@ -1,10 +1,10 @@
[{block name="submitElements"}]
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startTask('[{$id}]', 'CSV')">
<div class="btn-group" [{$readonly}]>
<button type="button" class="btn btn-primary" onclick="startTask('[{$id}]', 'CSV')" [{$readonly}]>
<i class="fas fa-fw fa-magic"></i>
[{oxmultilang ident=$item->getButtonText()}]
</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" [{$readonly}]>
<span class="sr-only">
<i class="fas fa-fw fa-magic"></i>
[{oxmultilang ident=$item->getButtonText()}]
@ -14,7 +14,7 @@
[{block name="dataWizardFormat"}]
[{assign var="rendererBridge" value=$item->getRendererBridge()}]
[{foreach from=$rendererBridge->getTranslatedRendererIdList() key="key" item="translationId"}]
<button class="dropdown-item" onclick="startTask('[{$id}]', '[{$key}]')">
<button class="dropdown-item" onclick="startTask('[{$id}]', '[{$key}]')" [{$readonly}]>
[{oxmultilang ident=$translationId}]
</button>
[{/foreach}]

View File

@ -1,64 +1,75 @@
# Changelog
All notable changes to this project will be documented in this file.
## 2.1.0.0 (2021-12-21)
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
#### Changed
## [2.1.1.3](https://git.d3data.de/D3Public/DataWizard/compare/2.1.1.2...rel_2.x) - 2023-09-12
### Added
- apply roles and rights
## [2.1.1.2](https://git.d3data.de/D3Public/DataWizard/compare/2.1.1.1...2.1.1.2) - 2023-03-30
### Fixed
- fix JavaScript for multiple forms
## [2.1.1.1](https://git.d3data.de/D3Public/DataWizard/compare/2.1.1.0...2.1.1.1) - 2023-03-22
### Fixed
- wrong cascaded HTML elements
## [2.1.1.0](https://git.d3data.de/D3Public/DataWizard/compare/2.1.0.0...2.1.1.0) - 2022-12-24
### Added
- installable in OXID 6.5.0 and 6.5.1
- request confirmation before execute action
### Changed
- documentation extended
## [2.1.0.0](https://git.d3data.de/D3Public/DataWizard/compare/2.0.0.0...2.1.0.0) - 2021-12-21
### Changed
- adjust to CLI extension which can export to STDOUT
---
## 2.0.0.0 (2021-12-20)
#### Added
## [2.0.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.4.0.0...2.0.0.0) - 2021-12-20
### Added
- add tests
- make installable in OXID 6.4
#### Changed
### Changed
- adjust code to PHP 7.3 and up
---
## 1.4.0.0 (2021-11-11)
#### Added
## [1.4.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.3.1.0...1.4.0.0) - 2021-11-11
### Added
- add JSON export renderer
- add tpl block for easier extension
- enable controller based exception handling
#### Changed
### Changed
- change deprecated CSV export code
- show registered export renderers in admin submit without required tpl block extension
- force get translations from admin
---
## 1.3.1.0 (2021-09-10)
## [1.3.1.0](https://git.d3data.de/D3Public/DataWizard/compare/1.2.0.0...1.3.0.0) - 2021-09-10
### Added
- installable in OXID 6.3.1
---
## 1.3.0.0 (2021-07-29)
## [1.3.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.2.0.0...1.3.0.0) - 2021-07-29
### Changed
- can handle long task description text
- has more generic admin controller templates
---
## 1.2.0.0 (2021-07-27)
## [1.2.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.1.0.0...1.2.0.0) - 2021-07-27
### Added
- adjustments for CLI extension
### Fixed
- fix OXID 6.1 incompatibilities
---
## 1.1.0.0 (2021-06-25)
## [1.1.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.0.0.0...1.1.0.0) - 2021-06-25
### Added
- implement form builder
### Fixed
- fix key figures export
---
## 1.0.0.0 (2021-06-22)
## [1.0.0.0](https://git.d3data.de/D3Public/DataWizard/releases/tag/1.0.0.0) - 2021-06-22
### Added
- initial implementation

View File

@ -9,13 +9,26 @@ The exports are defined via database queries or ready-made data lists. Various e
All exports and tasks are grouped together for better clarity.
Sample exports are included in the package d3/datawizardtasks. These are intended to serve as an implementation reference for individual exports.
Sample exports are included in the package `d3/datawizardtasks`. These are intended to serve as an implementation reference for individual exports.
![administration area](assets/administration_exports.jpg "administration area")
## Table of content
- [Installation](#installation)
- [Usage](#usage)
- [Extensibility](#extensibility)
- [Extension packages](#extension-packages)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)
- [Further licences and terms of use](#further-licences-and-terms-of-use)
## Installation
In the console in the shop root (above source and vendor), execute the following command:
This package requires an Composer installed OXID eShop as defined in [composer.json](composer.json).
Open a command line interface and navigate to the shop root directory (parent of source and vendor). Execute the following command. Adapt the paths to your environment.
```bash
php composer require d3/datawizard:^2.0
@ -23,6 +36,12 @@ php composer require d3/datawizard:^2.0
Activate the module in the admin area of the shop in "Extensions -> Modules".
## Usage
These package doesn't contain any export or action items. See [Extension packages](#extension_packages) for installable example items.
Log in to the admin area of your shop and navigate to "D³ Modules -> Data Wizard". Go to "Exports" or "Actions" (as desired). Choose your desired item and export or execute it.
## Extensibility
The module represents the technical basic framework of the exports and does not claim to be complete. In order to adapt the scope to individual requirements, the following extensions are prepared:
@ -33,7 +52,7 @@ The module represents the technical basic framework of the exports and does not
Independently of this, all extension options are available that the OXID Shop provides for modules.
## Extension packages
### Extension packages
- `d3/datawizardtasks` - provides sample exports and their implementation reference
- `d3/datawizardcli` - provides the execution of exports or tasks via the command prompt (e.g. as cronjobs)
@ -43,9 +62,21 @@ Independently of this, all extension options are available that the OXID Shop pr
See [CHANGELOG](CHANGELOG.md) for further informations.
## Licence of this software (d3/datawizard)
## Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
## Licence
(status: 2021-05-06)
Distributed under the GPLv3 license.
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
@ -118,4 +149,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
```

View File

@ -9,13 +9,27 @@ Die Exporte werden über Datenbankabfragen oder fertige Datenlisten definiert. E
Alle Exporte bzw. Tasks sind für eine bessere Übersichtlichkeit in Gruppen zusammengefasst.
Im Paket d3/datawizardtasks sind Beispielexporte enthalten. Diese sollen als Implementierungsreferenz für individuelle Exporte dienen.
Im Paket `d3/datawizardtasks` sind Beispielexporte enthalten. Diese sollen als Implementierungsreferenz für individuelle Exporte dienen.
![Adminbereich](assets/administration_exports.jpg "Adminbereich")
## Schnellinstallation
## Inhaltsverzeichnis
- [Installation](#installation)
- [Verwendung](#verwendung)
- [Erweiterbarkeit](#erweiterbarkeit)
- [Erweiterungspakete](#erweiterungspakete)
- [Changelog](#changelog)
- [Beitragen](#beitragen)
- [Lizenz](#lizenz)
- [weitere Lizenzen und Nutzungsbedingungen](#weitere-lizenzen-und-nutzungsbedingungen)
## Installation
Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version.
Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
Auf der Konsole im Shoproot (oberhalb von source und vendor) folgenden Befehl ausführen:
```bash
php composer require d3/datawizard:^2.0
@ -23,6 +37,12 @@ php composer require d3/datawizard:^2.0
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
## Verwendung
Dieses Paket enthält keine Exporte oder Aktionen. In [Erweiterungspakete](#erweiterungspakete) finden Sie installierbare Beispieleinträge.
Melden Sie sich im Adminbereich Ihres Shops an und navigieren Sie zu "D³ Module -> Data Wizard". Wechseln Sie je nach Wunsch zu "Exporte" oder "Aktionen". Wählen Sie den gewünschten Eintrag und starten Sie den Export bzw. die Aktion.
## Erweiterbarkeit
Das Modul stellt das technische Grundgerüst der Exporte dar und erhebt keinen Anspruch auf Vollständigkeit. Um den Umfang an die individuellen Anforderungen anzupassen, sind folgende Erweiterungen vorbereitet:
@ -33,7 +53,7 @@ Das Modul stellt das technische Grundgerüst der Exporte dar und erhebt keinen A
Unabhängig dessen stehen alle Erweiterungsmöglichkeiten zur Verfügung, die der OXID Shop für Module bereitstellt.
## Erweiterungspakete
### Erweiterungspakete
- `d3/datawizardtasks` - liefert Beispielexporte und deren Implementierungsreferenz
- `d3/datawizardcli` - ermöglicht die Ausführung der Exporte oder Tasks über die Eingabeaufforderung (z.B. als Cronjobs)
@ -43,9 +63,21 @@ Unabhängig dessen stehen alle Erweiterungsmöglichkeiten zur Verfügung, die de
Siehe [CHANGELOG](CHANGELOG.md) für weitere Informationen.
## Lizenz dieser Software (d3/datawizard)
## Beitragen
Wenn Sie eine Verbesserungsvorschlag haben, legen Sie einen Fork des Repositories an und erstellen Sie einen Pull Request. Alternativ können Sie einfach ein Issue erstellen. Fügen Sie das Projekt zu Ihren Favoriten hinzu. Vielen Dank.
- Erstellen Sie einen Fork des Projekts
- Erstellen Sie einen Feature Branch (git checkout -b feature/AmazingFeature)
- Fügen Sie Ihre Änderungen hinzu (git commit -m 'Add some AmazingFeature')
- Übertragen Sie den Branch (git push origin feature/AmazingFeature)
- Öffnen Sie einen Pull Request
## Lizenz
(Stand: 06.05.2021)
Vertrieben unter der GPLv3 Lizenz.
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)

View File

@ -1,6 +1,6 @@
{
"name": "d3/datawizard",
"description": "das magische Datenwerkzeug",
"description": "the magical data tool /\n das magische Datenwerkzeug",
"type": "oxideshop-module",
"keywords": [
"oxid",
@ -26,10 +26,11 @@
],
"require": {
"php": ">=7.3",
"oxid-esales/oxideshop-ce": "6.8 - 6.10",
"oxid-esales/oxideshop-ce": "6.8 - 6.14",
"league/csv": "^9.0",
"mathieuviossat/arraytotexttable": "^1.0",
"form-manager/form-manager": "^6.1"
"form-manager/form-manager": "^6.1",
"d3/modcfg": "^6.0"
},
"extra": {
"oxideshop": {

View File

@ -31,14 +31,14 @@ $aModule = [
'de' => '',
'en' => '',
],
'thumbnail' => '',
'version' => '2.1.0.0',
'thumbnail' => 'picture.svg',
'version' => '2.1.1.3',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
'd3ExportWizard' => D3\DataWizard\Application\Controller\Admin\d3ExportWizard::class,
'd3ActionWizard' => D3\DataWizard\Application\Controller\Admin\d3ActionWizard::class
'd3ActionWizard' => D3\DataWizard\Application\Controller\Admin\d3ActionWizard::class,
],
'extend' => [],
'events' => [],
@ -54,8 +54,8 @@ $aModule = [
'group' => $sModuleId.'_general',
'name' => $sModuleId.'_debug',
'type' => 'bool',
'value' => false
]
'value' => false,
],
],
'blocks' => []
'blocks' => [],
];

84
picture.svg Normal file
View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="201px" height="124px" viewBox="0 0 201 124" enable-background="new 0 0 201 124" xml:space="preserve">
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="47.0591" y1="67.5117" x2="47.0591" y2="54.6143">
<stop offset="0.0056" style="stop-color:#3266A9"/>
<stop offset="1" style="stop-color:#0099FF"/>
</linearGradient>
<path fill="url(#SVGID_1_)" d="M50.282,55.502c-0.784-0.592-2.104-0.888-3.961-0.888h-1.376l-2.283,12.898h1.779
c3.76,0,6.032-2.245,6.815-6.733c0.134-0.871,0.202-1.642,0.202-2.313C51.457,57.081,51.064,56.093,50.282,55.502z"/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="65.9609" y1="49.104" x2="65.9609" y2="36.9434">
<stop offset="0.0056" style="stop-color:#3266A9"/>
<stop offset="1" style="stop-color:#0099FF"/>
</linearGradient>
<path fill="url(#SVGID_2_)" d="M65.72,40.482c1.074,0,1.611,0.381,1.611,1.143c0,0.701-0.321,1.201-0.962,1.5
c-0.209,0.119-0.366,0.194-0.471,0.224c-0.065,0.019-0.158,0.037-0.271,0.056c1.98,1.621,3.702,3.544,5.097,5.699
c0.117-0.321,0.21-0.658,0.277-1.013l0.09-1.008c0-1.223-0.568-2.081-1.701-2.574c0.776-0.402,1.376-0.94,1.801-1.611
c0.425-0.672,0.638-1.418,0.638-2.239c0-0.642-0.198-1.265-0.593-1.868c-0.396-0.605-0.98-1.049-1.757-1.333
c-0.433-0.193-0.876-0.328-1.332-0.402c-0.456-0.075-1.003-0.113-1.645-0.113c-0.82,0-1.663,0.124-2.529,0.37
c-0.865,0.246-1.6,0.563-2.204,0.952s-1.13,0.907-1.578,1.557c-0.036,0.052-0.066,0.109-0.101,0.163
c1.196,0.534,2.341,1.163,3.426,1.874C63.947,40.943,64.68,40.482,65.72,40.482z"/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="50.0576" y1="87.0566" x2="50.0576" y2="37.8525">
<stop offset="0.0056" style="stop-color:#3266A9"/>
<stop offset="1" style="stop-color:#0099FF"/>
</linearGradient>
<path fill="url(#SVGID_3_)" d="M70.725,49.104c-0.433,1.189-1.208,2.147-2.331,2.871c-1.425,0.918-3.182,1.377-5.271,1.377
c-1.179,0-2.175-0.176-2.988-0.525c-0.813-0.35-1.444-0.864-1.891-1.543c-0.448-0.678-0.671-1.481-0.671-2.405l0.022-0.694
l0.156-0.693h4.367l-0.028,0.179v0.179v0.246c0,1.164,0.628,1.746,1.884,1.746c0.635,0,1.201-0.217,1.696-0.649
c0.495-0.434,0.742-0.94,0.742-1.522c0-0.522-0.194-0.887-0.582-1.097c-0.329-0.208-1.007-0.313-2.036-0.313l0.47-2.754
l1.141-0.067c0.083-0.011,0.154-0.022,0.221-0.033c-0.674-0.551-1.378-1.067-2.11-1.546c-0.044,0.096-0.087,0.195-0.125,0.302
h-4.185c0.192-0.837,0.49-1.56,0.884-2.175c-3.064-1.372-6.46-2.133-10.034-2.133c-13.588,0-24.603,11.014-24.603,24.601
c0,13.59,11.015,24.604,24.603,24.604S74.66,76.043,74.66,62.453C74.66,57.532,73.214,52.949,70.725,49.104z M59.413,59.233
l-0.168,1.275c-0.538,2.953-1.511,5.404-2.921,7.35c-1.298,1.835-3.016,3.179-5.153,4.028c-2.138,0.851-4.494,1.274-7.067,1.274
H33.731l4.264-24.198h10.441c1.141,0,2.204,0.073,3.189,0.218c0.984,0.146,1.868,0.364,2.651,0.655
c1.611,0.537,2.887,1.471,3.827,2.802c0.94,1.332,1.41,2.992,1.41,4.984L59.413,59.233z"/>
</g>
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="107.3027" y1="105.8555" x2="93.0727" y2="16.0106">
<stop offset="0" style="stop-color:#B2B2B2;stop-opacity:0"/>
<stop offset="0.2" style="stop-color:#B2B2B2"/>
<stop offset="0.8" style="stop-color:#B2B2B2"/>
<stop offset="1" style="stop-color:#B2B2B2;stop-opacity:0"/>
</linearGradient>
<rect x="99.875" y="14.933" fill="url(#SVGID_4_)" width="0.625" height="92"/>
<script xmlns=""></script>
<g>
<g>
<path fill="none" d="M153.855,40.748H140.76v9.354c0,1.034-0.839,1.872-1.871,1.872h-9.354v20.582
c0,1.031,0.838,1.869,1.871,1.869h22.45c0.083,0,0.159-0.014,0.239-0.023l-5.59-5.588h-13.358c-1.032,0-1.871-0.84-1.871-1.871
c0-1.033,0.839-1.871,1.871-1.871h9.617l-3.742-3.743h-5.875c-1.032,0-1.871-0.837-1.871-1.871c0-1.034,0.839-1.871,1.871-1.871
h3.215c-0.183-1.584,0.68-3.495,2.505-5.326c0.765-0.765,2.763-2.533,4.869-2.533c0.546,0,1.063,0.117,1.527,0.339
c0.346,0.133,0.668,0.338,0.945,0.615l7.52,7.517V42.618C155.728,41.585,154.889,40.748,153.855,40.748z"/>
<polygon fill="none" points="137.018,43.393 132.18,48.231 137.018,48.231 "/>
<path d="M133.275,66.941c0,1.031,0.839,1.871,1.871,1.871h13.358l-3.741-3.742h-9.617
C134.114,65.07,133.275,65.908,133.275,66.941z"/>
<path d="M133.275,59.457c0,1.033,0.839,1.871,1.871,1.871h5.875l-1.73-1.73c-0.272-0.272-0.476-0.587-0.613-0.923
c-0.169-0.339-0.272-0.705-0.316-1.089h-3.215C134.114,57.585,133.275,58.423,133.275,59.457z"/>
<path d="M153.855,74.424h-22.45c-1.033,0-1.871-0.838-1.871-1.869V51.973h9.354c1.032,0,1.871-0.838,1.871-1.872v-9.354h13.096
c1.033,0,1.872,0.837,1.872,1.871v15.579l1.419,1.42l1.301-1.736l-0.989-2.9c-0.358-1.065-0.215-2.155,0.394-3.001
c0.401-0.559,0.971-0.953,1.617-1.147v-8.215c0-3.1-2.514-5.613-5.613-5.613h-14.967c-0.496,0-0.973,0.197-1.322,0.548
L126.34,48.779c-0.351,0.352-0.548,0.827-0.548,1.323v22.453c0,3.1,2.514,5.611,5.613,5.611h22.45
c1.139,0,2.196-0.342,3.081-0.924l-2.842-2.842C154.015,74.41,153.938,74.424,153.855,74.424z M137.018,43.393v4.838h-4.838
L137.018,43.393z"/>
</g>
<g>
<g>
<g>
<path fill="#010002" d="M159.092,62.488l3.655-0.048c0.479-0.006,1.107,0.314,1.388,0.71l2.109,2.982
c0.281,0.393,0.624,0.34,0.769-0.125l1.089-3.486c0.14-0.466,0.636-0.96,1.098-1.103l3.487-1.084
c0.465-0.142,0.52-0.488,0.126-0.768l-2.985-2.112c-0.396-0.281-0.716-0.903-0.705-1.385l0.044-3.656
c0.006-0.479-0.305-0.644-0.694-0.352l-2.929,2.186c-0.385,0.289-1.076,0.397-1.536,0.246l-3.46-1.177
c-0.459-0.153-0.709,0.093-0.555,0.549l1.179,3.46c0.15,0.455,0.043,1.149-0.24,1.539l-2.19,2.926
C158.447,62.182,158.61,62.492,159.092,62.488z"/>
<path fill="#010002" d="M175.635,82.078l0.061-0.063l-29.578-29.571l-0.033,0.032c-0.005-0.002-0.005-0.006-0.009-0.007
c-0.489-0.496-1.99,0.201-3.343,1.552c-1.348,1.353-2.045,2.848-1.553,3.343c0.003,0.005,0.009,0.005,0.01,0.006l-0.033,0.036
l29.575,29.578l0.059-0.064c0.587,0.313,1.962-0.367,3.215-1.625C175.267,84.037,175.943,82.662,175.635,82.078z
M149.582,60.874c-0.715,0.715-1.469,1.239-2.096,1.51l-4.374-4.4c0.624-0.272,1.368-0.795,2.08-1.503
c0.705-0.708,1.222-1.446,1.497-2.066l4.385,4.41C150.801,59.443,150.28,60.174,149.582,60.874z"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -12,6 +12,7 @@
*/
// Include datawizard test config
namespace D3\DataWizard\tests;
use D3\ModCfg\Tests\additional_abstract;
@ -36,4 +37,5 @@ class additional extends additional_abstract
try {
d3GetModCfgDIC()->get(additional::class);
} catch (Exception $e) {}
} catch (Exception $e) {
}

View File

@ -12,4 +12,3 @@
*/
const D3DATAWIZARD_REQUIRE_MODCFG = true;

View File

@ -15,4 +15,4 @@ class d3TestAction extends ActionBase
{
return ["UPDATE 1"];
}
}
}

View File

@ -15,4 +15,4 @@ class d3TestExport extends ExportBase
{
return ["SELECT 1"];
}
}
}

View File

@ -33,7 +33,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
protected $testClassName = d3ActionWizard::class;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -99,7 +99,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
{
return [
['test1'],
['test2']
['test2'],
];
}
@ -144,7 +144,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
$actionMock = $this->getMockBuilder(d3TestAction::class)
->onlyMethods([
'getQuery',
'run'
'run',
])
->getMock();
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
@ -190,4 +190,4 @@ class d3ActionWizardTest extends d3AdminControllerTest
'debug' => [true],
];
}
}
}

View File

@ -39,7 +39,7 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
protected $testClassName;
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -169,7 +169,7 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
$actionMock = $this->getMockBuilder(d3TestAction::class)
->onlyMethods([
'getQuery',
'run'
'run',
])
->getMock();
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
@ -259,4 +259,4 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -34,7 +34,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
protected $testClassName = d3ExportWizard::class;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -100,7 +100,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
{
return [
['test1'],
['test2']
['test2'],
];
}
@ -146,7 +146,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
$exportMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getQuery',
'run'
'run',
])
->getMock();
$exportMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
@ -192,4 +192,4 @@ class d3ExportWizardTest extends d3AdminControllerTest
'debug' => [true],
];
}
}
}

View File

@ -31,14 +31,14 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestAction */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
$this->_oModel = oxNew(d3TestAction::class);
}
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -135,7 +135,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
$inputMock = $this->getMockBuilder($inputClass)
->onlyMethods([
'setTemplate',
'setAttribute'
'setAttribute',
])
->getMock();
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
@ -160,7 +160,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
return [
'Radio' => [Radio::class],
'Checkbox' => [Radio::class],
'Hidden' => [Hidden::class]
'Hidden' => [Hidden::class],
];
}
@ -175,7 +175,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'hasFormElements',
'executeAction',
'getQuery'
'getQuery',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
@ -204,7 +204,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
'hasFormElements',
'executeAction',
'getQuery',
'getFormElements'
'getFormElements',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
@ -246,7 +246,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
return [
'validElements' => [[$validMock, $validMock], false],
'invalidElements' => [[$validMock, $invalidField], true]
'invalidElements' => [[$validMock, $invalidField], true],
];
}
@ -313,4 +313,4 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -28,14 +28,14 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/** @var Configuration */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
$this->_oModel = oxNew(Configuration::class);
}
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -148,16 +148,16 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
* @param $array
* @return array|false
*/
public function array_flatten($array) {
public function array_flatten($array)
{
if (!is_array($array)) {
return false;
}
$result = array();
$result = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
$result = array_merge($result, $this->array_flatten($value));
}
else {
} else {
$result[$key] = $value;
}
}
@ -321,7 +321,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(Configuration::class)
->onlyMethods([
'getActionGroups',
'getActionsByGroup'
'getActionsByGroup',
])
->getMock();
$modelMock->expects($this->once())->method('getActionGroups')->willReturn(['123', '456']);
@ -352,7 +352,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(Configuration::class)
->onlyMethods([
'getExportGroups',
'getExportsByGroup'
'getExportsByGroup',
])
->getMock();
$modelMock->expects($this->once())->method('getExportGroups')->willReturn(['123', '456']);
@ -452,4 +452,4 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
'set id' => ['456', false],
];
}
}
}

View File

@ -35,7 +35,7 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
{
$code = '500';
$exception = oxNew( Exception::class);
$exception = oxNew(Exception::class);
/** @var DebugException|MockObject $modelMock */
$modelMock = $this->getMockBuilder(DebugException::class)
@ -74,5 +74,4 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -35,7 +35,7 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
{
$code = '500';
$exception = oxNew( Exception::class);
$exception = oxNew(Exception::class);
/** @var ExportFileException|MockObject $modelMock */
$modelMock = $this->getMockBuilder(ExportFileException::class)
@ -74,5 +74,4 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -38,7 +38,7 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
{
$code = '500';
$exception = oxNew( Exception::class);
$exception = oxNew(Exception::class);
$invalidField = new Number(null, [
'required' => true,
@ -93,5 +93,4 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -35,7 +35,7 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
{
$code = '500';
$exception = oxNew( Exception::class);
$exception = oxNew(Exception::class);
/** @var NoSuitableRendererException|MockObject $modelMock */
$modelMock = $this->getMockBuilder(NoSuitableRendererException::class)
@ -74,5 +74,4 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -37,7 +37,7 @@ class TaskExceptionTest extends d3ModCfgUnitTestCase
{
$code = '500';
$exception = oxNew( Exception::class);
$exception = oxNew(Exception::class);
/** @var ExportBase|MockObject $taskMock */
$taskMock = $this->getMockBuilder(d3TestExport::class)
@ -82,5 +82,4 @@ class TaskExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -36,14 +36,14 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
$this->_oModel = oxNew(d3TestExport::class);
}
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -140,7 +140,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$inputMock = $this->getMockBuilder($inputClass)
->onlyMethods([
'setTemplate',
'setAttribute'
'setAttribute',
])
->getMock();
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
@ -165,7 +165,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
return [
'Radio' => [Radio::class],
'Checkbox' => [Radio::class],
'Hidden' => [Hidden::class]
'Hidden' => [Hidden::class],
];
}
@ -183,7 +183,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'hasFormElements',
'executeExport'
'executeExport',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
@ -214,7 +214,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'hasFormElements',
'executeExport',
'getFormElements'
'getFormElements',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
@ -256,7 +256,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
return [
'validElements' => [[$validMock, $validMock], false],
'invalidElements' => [[$validMock, $invalidField], true]
'invalidElements' => [[$validMock, $invalidField], true],
];
}
@ -274,7 +274,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
'startDirectDownload',
'filterFilename',
'trailingslashit',
'createFile'
'createFile',
])
->getMock();
$fsMock->expects($this->exactly((int) !isset($path)))->method('startDirectDownload')->willReturn(true);
@ -287,7 +287,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'getContent',
'getFileSystem',
'getExportFileName'
'getExportFileName',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getContent')->willReturn('some content');
@ -371,7 +371,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getRendererBridge'
'getRendererBridge',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getRendererBridge')->willReturn($rendererBridgeMock);
@ -425,7 +425,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getRenderer'
'getRenderer',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
@ -463,7 +463,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getRenderer'
'getRenderer',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
@ -490,7 +490,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getTitle'
'getTitle',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getTitle')->willReturn('someTitle');
@ -516,7 +516,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getExportFilenameBase',
'getFileExtension'
'getFileExtension',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getExportFilenameBase')->willReturn('base');
@ -551,7 +551,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'd3GetDb'
'd3GetDb',
])
->getMock();
$modelMock->expects($this->exactly((int) !$throwsException))->method('d3GetDb')->willReturn($dbMock);
@ -570,13 +570,13 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
[
[
'field1' => 'content1',
'field2' => 'content2'
]
'field2' => 'content2',
],
],
[
'field1',
'field2'
]
'field2',
],
],
$result
);
@ -613,7 +613,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'getQuery',
'getExportData',
'renderContent'
'renderContent',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['arg1', 'arg2']]);
@ -631,4 +631,4 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -29,7 +29,7 @@ class CsvTest extends ExportRendererTest
/** @var Csv */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -49,7 +49,7 @@ class CsvTest extends ExportRendererTest
$valueList = ['value1', 'value2'];
/** @var Writer|MockObject $csvMock */
$csvMockBuilder = $this->getMockBuilder( Writer::class);
$csvMockBuilder = $this->getMockBuilder(Writer::class);
$csvMockBuilder->disableOriginalConstructor();
$onlyMethods = ['__toString', 'insertOne', 'insertAll'];
$csvMockBuilder->onlyMethods($onlyMethods);
@ -89,7 +89,7 @@ class CsvTest extends ExportRendererTest
{
return [
'exception' => [true],
'no exception' => [false]
'no exception' => [false],
];
}
@ -174,4 +174,4 @@ class CsvTest extends ExportRendererTest
)
);
}
}
}

View File

@ -22,7 +22,7 @@ abstract class ExportRendererTest extends d3ModCfgUnitTestCase
/** @var RendererInterface */
protected $_oModel;
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -63,4 +63,4 @@ abstract class ExportRendererTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -24,7 +24,7 @@ class JsonTest extends ExportRendererTest
/** @var Json */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -61,7 +61,7 @@ class JsonTest extends ExportRendererTest
{
return [
'valid' => [['value1', 'value2'], false],
'invalid' => [["text" => "\xB1\x31"], true] // malformed UTF8 chars
'invalid' => [["text" => "\xB1\x31"], true], // malformed UTF8 chars
];
}
}
}

View File

@ -25,7 +25,7 @@ class PrettyTest extends ExportRendererTest
/** @var Pretty */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -83,4 +83,4 @@ class PrettyTest extends ExportRendererTest
)
);
}
}
}

View File

@ -30,7 +30,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
/** @var RendererBridge */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -122,7 +122,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
[
'CSV' => $this->getMockBuilder(Csv::class)->getMock(),
'Pretty' => $this->getMockBuilder(Pretty::class)->getMock(),
'JSON' => $this->getMockBuilder(Json::class)->getMock()
'JSON' => $this->getMockBuilder(Json::class)->getMock(),
]
);
@ -146,7 +146,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
{
return [
'existing renderer'=> [RendererBridge::FORMAT_JSON, false],
'unknown renderer'=> ['unknownRenderer', true]
'unknown renderer'=> ['unknownRenderer', true],
];
}
}
}