Merge remote-tracking branch 'remotes/origin/dev_1.x_actions' into rel_1.x

# Conflicts:
#	README.md
Cette révision appartient à :
Daniel Seifert 2021-06-22 13:36:06 +02:00
révision 344e88b1c8
Signé par: DanielS
ID de la clé GPG: 8A7C4C6ED1915C6F
14 fichiers modifiés avec 657 ajouts et 27 suppressions

0
CHANGELOG.md Fichier normal
Voir le fichier

141
README.en.md Fichier normal
Voir le fichier

@ -0,0 +1,141 @@
> [deutsche Version](README.md)
# D³ Data Wizard for OXID eShop
The module `DataWizard` offers a framework for the simple integration of exports via the admin area of the OXID shop.
The exports are defined via database queries or ready-made data lists. Various export formats are available. The generation is possible at any time and always recurring (within the system limits). These are offered as downloads in the browser.
All exports are grouped together for better clarity.
Sample exports are included in the scope of delivery. These are intended to serve as an implementation reference for individual exports. The display of the sample exports can be deactivated in the basic module settings.
Translated with www.DeepL.com/Translator (free version)
## Installation
In the console in the shop root (above source and vendor), execute the following command:
```bash
php composer require d3/datawizard:"dev-rel_1.x"
```
Activate in the admin area of the shop under "Extensions -> Modules".
# 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:
- Add exports
- Use existing and new groups
- Add export formats
Independently of this, all extension options are available that the OXID Shop provides for modules.
## Add exports
### Define export
Each export is defined in a separate class. This export class must extend the class `D3\DataWizard\Application\Model\ExportBase`. All necessary functions are predefined in it. The following methods are available:
#### mandatory method calls:
- getTitle() - defines the title in the admin area and the base of the later export file name.
- getQuery() - contains the query as a prepared statement that defines the data to be exported
#### optional method calls:
- getDescription() - contains a short additional description of the export, this will be shown in the admin area
- getButtonText() - defines the text of the submit button in the admin area
- getExportFilenameBase() - defines the base of the later export filename
- executeQuery() - returns the compiled export data
- further methods, the adaptation of which, however, can lead to changed module behaviour and should therefore only be changed with caution
### Register exports
In order to be able to use the created export in the module, it must be registered. For this purpose there is the class `D3\DataWizard\Application\Model\Configuration`. This is to be overloaded with the possibilities of the OXID shop and the method `configure()` contained therein is to be supplemented. The following call is available for registering an export:
```
$this->registerExport(self::GROUP_CATEGORY, oxNew(myCustomExport::class));
```
The first parameter contains the language identifier for the export group. Typical identifiers are already prepared in constants of the configuration class. The instance of the export class is expected as the 2nd parameter.
## Changelog
See [CHANGELOG](CHANGELOG.md) for further informations.
## Licence of this software (d3/datawizard)
(status: 06.05.2021)
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
This software is distributed under the GNU GENERAL PUBLIC LICENSE version 3.
```
For full copyright and licensing information, please see the [LICENSE](LICENSE.md) file distributed with this source code.
## Further licences and terms of use
### background gradients on src/Application/views/admin/tpl/ templates
(https://www.gradientmagic.com/licensing - status: 07.05.2021)
```
Image courtesy of gradientmagic.com
Free Gradients
Gradients available on the site are free to use on personal and commercial projects, with attribution.
```
-------------------------------------------------------------------------------
The following software packages are not part of this module. However, they are required for use. The linked packages are under the following licences:
### league/csv [MIT]
(https://github.com/thephpleague/csv - status: 06.05.2021)
```
Copyright (c) 2013-2017 ignace nyamagana butera
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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.
```
### mathieuviossat/arraytotexttable [MIT]
(https://github.com/viossat/arraytotexttable - status: 06.05.2021)
```
Copyright (c) 2015 Mathieu Viossat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
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.
```

Voir le fichier

@ -1,3 +1,5 @@
> [english version](README.en.md)
# D³ Data Wizard für OXID eShop
Das Modul `DataWizard` bietet ein Framework zur einfachen Integration von Exporten über den Adminbereich des OXID Shops.
@ -55,18 +57,33 @@ Der erste Parameter enthält den Sprachident für die Exportgruppe. In Konstante
## Changelog
Siehe [CHANGELOG](docs/daux/changelog/010_Changelog.md) für weitere Informationen.
Siehe [CHANGELOG](CHANGELOG.md) für weitere Informationen.
## Lizenz dieser Software (d3/datawizard)
(Stand: 06.05.2021)
Diese Software ist lizensiert unter der GNU General Public License Version 3.
Copyright (C) 2021 D3 Data Development, Inh. Thomas Dartsch
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
Siehe [LICENSE](LICENSE.md) für weitere Informationen.
Diese Software wird unter der GNU GENERAL PUBLIC LICENSE Version 3 vertrieben.
```
## weitere Lizenzen
Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [LICENSE](LICENSE.md)-Datei, die mit diesem Quellcode verteilt wurde.
## weitere Lizenzen und Nutzungsbedingungen
### Hintergrundgradienten in src/Application/views/admin/tpl/ Templates
(https://www.gradientmagic.com/licensing - Stand: 07.05.2021)
```
Image courtesy of gradientmagic.com
Free Gradients
Gradients available on the site are free to use on personal and commercial projects, with attribution.
```
-------------------------------------------------------------------------------
Die folgenden Softwarepakete sind nicht Teil dieses Moduls. Sie werden diese jedoch zur Verwendung benötigt. Die verlinkten Pakete stehen unter den folgenden Lizenzen:
@ -76,11 +93,21 @@ Die folgenden Softwarepakete sind nicht Teil dieses Moduls. Sie werden diese jed
```
Copyright (c) 2013-2017 ignace nyamagana butera
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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.
```
@ -90,10 +117,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
Copyright (c) 2015 Mathieu Viossat
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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.
```
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
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.
```

Voir le fichier

@ -0,0 +1,91 @@
<?php
/**
* 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)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\DataWizard\Application\Controller\Admin;
use D3\DataWizard\Application\Model\Configuration;
use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
use D3\DataWizard\Application\Model\Exceptions\DebugException;
use D3\ModCfg\Application\Model\d3database;
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
use Doctrine\DBAL\DBALException;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Registry;
class d3ActionWizard extends AdminDetailsController
{
protected $_sThisTemplate = 'd3ActionWizard.tpl';
/** @var Configuration */
protected $configuration;
public function __construct()
{
parent::__construct();
$this->configuration = oxNew(Configuration::class);
}
public function getGroups()
{
return $this->configuration->getActionGroups();
}
public function getGroupActions($group)
{
return $this->configuration->getActionsByGroup($group);
}
/**
* @throws DatabaseConnectionException
* @throws StandardException
* @throws d3ShopCompatibilityAdapterException
* @throws d3_cfg_mod_exception
*/
public function doAction()
{
try {
$id = Registry::getRequest()->getRequestEscapedParameter('actionid');
$action = $this->configuration->getActionById($id);
[ $queryString, $parameters ] = $action->getQuery();
if (Registry::getConfig()->getConfigParam('d3datawizard_debug')) {
throw oxNew(
DebugException::class,
d3database::getInstance()->getPreparedStatementQuery($queryString, $parameters)
);
}
$action->run();
} catch (DataWizardException|DBALException|DatabaseErrorException $e) {
Registry::getUtilsView()->addErrorToDisplay($e);
}
}
public function getUserMessages()
{
return null;
}
public function getHelpURL()
{
return null;
}
}

Voir le fichier

@ -44,7 +44,7 @@ class d3ExportWizard extends AdminDetailsController
public function getGroups()
{
return $this->configuration->getGroups();
return $this->configuration->getExportGroups();
}
public function getGroupExports($group)

Voir le fichier

@ -0,0 +1,84 @@
<?php
/**
* 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)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\DataWizard\Application\Model;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
use OxidEsales\Eshop\Core\Registry;
abstract class ActionBase implements QueryBase
{
/**
* @return string
*/
public function getDescription() : string
{
return '';
}
/**
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function run()
{
$this->executeAction( $this->getQuery() );
}
/**
* @param array $query
*
* @return int
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function executeAction( array $query ): int
{
[ $queryString, $parameters ] = $query;
$queryString = trim($queryString);
if ( strtolower( substr( $queryString, 0, 6 ) ) === 'select' ) {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_ACTIONSELECT' )
);
}
$affected = DatabaseProvider::getDb( DatabaseProvider::FETCH_MODE_ASSOC )->execute( $queryString, $parameters );
throw oxNew(
Exceptions\TaskException::class,
$this,
sprintf(
Registry::getLang()->translateString(
$affected === 1 ? 'D3_DATAWIZARD_ERR_ACTIONRESULT' : 'D3_DATAWIZARD_ERR_ACTIONRESULTS'
),
$affected
)
);
}
/**
* @return string
*/
public function getButtonText() : string
{
return "D3_DATAWIZARD_ACTION_SUBMIT";
}
}

Voir le fichier

@ -0,0 +1,89 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\DataWizard\Application\Model\Actions;
use D3\DataWizard\Application\Model\ActionBase;
use OxidEsales\Eshop\Core\Model\BaseModel;
use OxidEsales\Eshop\Core\Model\MultiLanguageModel;
use OxidEsales\Eshop\Core\Registry;
class FixArtextendsItems extends ActionBase
{
/**
* fehlende oxartextends-Einträge nachtragen
*/
/**
* @return string
*/
public function getTitle() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARD_ACTIONS_FIXARTEXTENDSITEMS');
}
/**
* @return array
*/
public function getQuery() : array
{
$aDefaultValueFields = array(
'oxtimestamp' => "''",
);
$aNonArtExtendsFields = array(
'oxid' => 'oxarticles.oxid',
);
$aArtExtendsFields = array_fill_keys($this->getArtExtendsFields(), "''");
$aMergedFields = array_merge($aNonArtExtendsFields, $aArtExtendsFields);
$aQueryFields = array_diff_key($aMergedFields, $aDefaultValueFields);
$sArtExtendsFields = implode(', ', array_keys($aQueryFields));
$select = "SELECT ".implode(', ', $aQueryFields).
" FROM oxarticles".
" LEFT JOIN oxartextends AS arx ON oxarticles.oxid = arx.oxid".
" WHERE arx.oxid IS NULL";
$query = "INSERT INTO oxartextends ($sArtExtendsFields) ".
$select;
return [$query, []];
}
/**
* @return array
*/
public function getArtExtendsFields(): array
{
/** @var $oArtExtends MultiLanguageModel */
$oArtExtends = oxNew(BaseModel::class);
$oArtExtends->init('oxartextends', false);
$aFieldNames = $oArtExtends->getFieldNames();
if (false == $aFieldNames) {
$oArtExtends->disableLazyLoading();
$aFieldNames = $oArtExtends->getFieldNames();
}
unset($aFieldNames[array_search('oxid', $aFieldNames)]);
return $aFieldNames;
}
}

Voir le fichier

@ -15,6 +15,7 @@ declare(strict_types=1);
namespace D3\DataWizard\Application\Model;
use D3\DataWizard\Application\Model\Actions\FixArtextendsItems;
use D3\DataWizard\Application\Model\Exports\InactiveCategories;
use D3\DataWizard\Application\Model\Exports\KeyFigures;
use OxidEsales\Eshop\Core\Registry;
@ -28,6 +29,7 @@ class Configuration
const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
protected $actions = [];
protected $exports = [];
public function __construct()
@ -38,11 +40,22 @@ class Configuration
public function configure()
{
if (false === Registry::getConfig()->getConfigParam('d3datawizard_hideexamples', false)) {
$this->registerAction(self::GROUP_ARTICLES, oxNew(FixArtextendsItems::class));
$this->registerExport(self::GROUP_CATEGORY, oxNew(InactiveCategories::class));
$this->registerExport(self::GROUP_SHOP, oxNew(KeyFigures::class));
}
}
/**
* @param $group
* @param ActionBase $action
*/
public function registerAction($group, ActionBase $action)
{
$this->actions[$group][md5(serialize($action))] = $action;
}
/**
* @param $group
* @param ExportBase $export
@ -52,6 +65,14 @@ class Configuration
$this->exports[$group][md5(serialize($export))] = $export;
}
/**
* @return array
*/
public function getGroupedActions(): array
{
return $this->actions;
}
/**
* @return array
*/
@ -63,16 +84,53 @@ class Configuration
/**
* @return array
*/
public function getGroups(): array
public function getActionGroups(): array
{
return array_keys($this->actions);
}
/**
* @return array
*/
public function getExportGroups(): array
{
return array_keys($this->exports);
}
/**
* @param $group
*
* @return mixed
*/
public function getActionsByGroup($group)
{
return $this->actions[$group];
}
/**
* @param $group
*
* @return mixed
*/
public function getExportsByGroup($group)
{
return $this->exports[$group];
}
/**
* @return array
*/
public function getAllActions() : array
{
$all = [];
foreach ($this->getActionGroups() as $group) {
$all = array_merge($all, $this->getActionsByGroup($group));
}
return $all;
}
/**
* @return array
*/
@ -80,13 +138,23 @@ class Configuration
{
$all = [];
foreach ($this->getGroups() as $group) {
foreach ($this->getExportGroups() as $group) {
$all = array_merge($all, $this->getExportsByGroup($group));
}
return $all;
}
/**
* @param $id
*
* @return ActionBase
*/
public function getActionById($id) : ActionBase
{
return $this->getAllActions()[$id];
}
/**
* @param $id
*
@ -96,4 +164,4 @@ class Configuration
{
return $this->getAllExports()[$id];
}
}
}

Voir le fichier

@ -19,11 +19,6 @@ interface QueryBase
{
public function run();
/**
* @return string
*/
public function getExportFilenameBase() : string;
/**
* @return string
*/

Voir le fichier

@ -23,6 +23,7 @@ $aLang = array(
'charset' => 'UTF-8',
'd3mxDataWizard' => '<i class="fas fa-fw fa-hat-wizard"></i> Data Wizard',
'd3mxDataWizard_Export' => 'Exporte',
'd3mxDataWizard_Action' => 'Aktionen',
'SHOP_MODULE_GROUP_d3datawizard_general' => 'Grundeinstellungen',
'SHOP_MODULE_d3datawizard_debug' => 'zeigt Abfragen anstatt diese auszuführen',
@ -39,6 +40,8 @@ $aLang = array(
'D3_DATAWIZARD_EXPORT_FORMAT_CSV' => 'CSV-Format',
'D3_DATAWIZARD_EXPORT_FORMAT_PRETTY' => 'Pretty-Format',
'D3_DATAWIZARD_ACTION_SUBMIT' => 'Aktion starten',
'D3_DATAWIZARD_DEBUG' => 'Debug: %1$s',
'D3_DATAWIZARD_ERR_NOEXPORTSELECT' => 'Export kann nicht ausgeführt werden. Exporte erfordern SELECT Query.',
@ -56,7 +59,9 @@ $aLang = array(
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_BASKETSIZE' => 'Warenkorbhöhe',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_MONTH' => 'Monat',
// Abracadata
// Harry Potter
// Magic
'D3_DATAWIZARD_ERR_ACTIONSELECT' => 'Aktion kann nicht ausgeführt werden. Aktionen können keine SELECTs exportieren.',
'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',
'D3_DATAWIZARD_ACTIONS_FIXARTEXTENDSITEMS' => 'fehlende oxartextends-Einträge nachtragen',
);

Voir le fichier

@ -0,0 +1,115 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
[{oxstyle include="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"}]
[{oxscript include="https://code.jquery.com/jquery-3.2.1.slim.min.js"}]
[{oxscript include="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"}]
[{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"}]
<style>
button {
margin: 1em 1em 1em 5em;
}
html {
font-size: 0.8em;
}
/* Image courtesy of gradientmagic.com */
body {
background-image: linear-gradient(22.5deg, rgba(66, 66, 66, 0.02) 0%, rgba(66, 66, 66, 0.02) 11%,rgba(135, 135, 135, 0.02) 11%, rgba(135, 135, 135, 0.02) 24%,rgba(29, 29, 29, 0.02) 24%, rgba(29, 29, 29, 0.02) 38%,rgba(15, 15, 15, 0.02) 38%, rgba(15, 15, 15, 0.02) 50%,rgba(180, 180, 180, 0.02) 50%, rgba(180, 180, 180, 0.02) 77%,rgba(205, 205, 205, 0.02) 77%, rgba(205, 205, 205, 0.02) 100%),linear-gradient(67.5deg, rgba(10, 10, 10, 0.02) 0%, rgba(10, 10, 10, 0.02) 22%,rgba(52, 52, 52, 0.02) 22%, rgba(52, 52, 52, 0.02) 29%,rgba(203, 203, 203, 0.02) 29%, rgba(203, 203, 203, 0.02) 30%,rgba(69, 69, 69, 0.02) 30%, rgba(69, 69, 69, 0.02) 75%,rgba(231, 231, 231, 0.02) 75%, rgba(231, 231, 231, 0.02) 95%,rgba(138, 138, 138, 0.02) 95%, rgba(138, 138, 138, 0.02) 100%),linear-gradient(112.5deg, rgba(221, 221, 221, 0.02) 0%, rgba(221, 221, 221, 0.02) 17%,rgba(190, 190, 190, 0.02) 17%, rgba(190, 190, 190, 0.02) 39%,rgba(186, 186, 186, 0.02) 39%, rgba(186, 186, 186, 0.02) 66%,rgba(191, 191, 191, 0.02) 66%, rgba(191, 191, 191, 0.02) 68%,rgba(16, 16, 16, 0.02) 68%, rgba(16, 16, 16, 0.02) 70%,rgba(94, 94, 94, 0.02) 70%, rgba(94, 94, 94, 0.02) 100%),linear-gradient(90deg, #ffffff,#ffffff);
}
h4 .btn {
font-size: 1.3rem;
}
h5.card-header {
font-size: 1.1rem;
}
</style>
[{capture name="d3script"}][{strip}]
function startAction(id) {
let elements = document.getElementsByClassName('errorbox');
for (var i = 0; i < elements.length; i++){
elements[i].style.display = 'none';
}
setTimeout(function(){
document.getElementById('mask').className='';
document.getElementById('popup2').className='d3loader-2';
}, 3000);
document.getElementById('mask').className='on';
document.getElementById('popup2').className='d3loader-2 on';
document.getElementById('actionid').value = id;
document.getElementById('myedit').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="doAction">
<input type="hidden" name="actionid" id="actionid" value="">
[{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->getGroupActions($group) key="id" item="action"}]
<div class="col-sm-6 col-md-4 col-lg-3 pb-4">
<div class="card">
<h5 class="card-header">
[{$action->getTitle()}]
</h5>
<div class="card-body">
<p class="card-text">
[{$action->getDescription()}]
</p>
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startAction('[{$id}]')">
<i class="fas fa-magic"></i>
[{oxmultilang ident=$action->getButtonText()}]
</button>
</div>
</div>
</div>
</div>
[{/foreach}]
</div>
<div class="clear"></div>
</div>
</div>
</div>
[{/foreach}]
</div>
[{else}]
<div class="alert alert-primary" role="alert">
[{oxmultilang ident="D3_DATAWIZARD_ERR_NOACTION_INSTALLED"}]
</div>
[{/if}]
</form>
<div id="mask" class=""></div>
<div id="popup2" class="d3loader-2">
<div class="d3loader-spinner">
<div class="d3loader-circle-1"></div>
<div class="d3loader-circle-2"></div>
<div class="d3loader-circle-3"></div>
</div>
</div>
[{include file="d3_cfg_mod_inc.tpl"}]

Voir le fichier

@ -13,6 +13,7 @@
html {
font-size: 0.8em;
}
/* Image courtesy of gradientmagic.com */
body {
background-image: linear-gradient(339deg, rgba(47, 47, 47,0.02) 0%, rgba(47, 47, 47,0.02) 42%,transparent 42%, transparent 99%,rgba(17, 17, 17,0.02) 99%, rgba(17, 17, 17,0.02) 100%),linear-gradient(257deg, rgba(65, 65, 65,0.02) 0%, rgba(65, 65, 65,0.02) 11%,transparent 11%, transparent 92%,rgba(53, 53, 53,0.02) 92%, rgba(53, 53, 53,0.02) 100%),linear-gradient(191deg, rgba(5, 5, 5,0.02) 0%, rgba(5, 5, 5,0.02) 1%,transparent 1%, transparent 45%,rgba(19, 19, 19,0.02) 45%, rgba(19, 19, 19,0.02) 100%),linear-gradient(29deg, rgba(28, 28, 28,0.02) 0%, rgba(28, 28, 28,0.02) 33%,transparent 33%, transparent 40%,rgba(220, 220, 220,0.02) 40%, rgba(220, 220, 220,0.02) 100%),linear-gradient(90deg, rgb(255,255,255),rgb(255,255,255));
}

Voir le fichier

@ -3,6 +3,7 @@
<OXMENU id="d3mxd3modules">
<MAINMENU id="d3mxDataWizard">
<SUBMENU id="d3mxDataWizard_Export" cl="d3ExportWizard" disableForDemoShop="1" />
<SUBMENU id="d3mxDataWizard_Action" cl="d3ActionWizard" disableForDemoShop="1" />
</MAINMENU>
</OXMENU>
</OX>
</OX>

Voir le fichier

@ -37,12 +37,14 @@ $aModule = [
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
'd3ExportWizard' => D3\DataWizard\Application\Controller\Admin\d3ExportWizard::class
'd3ExportWizard' => D3\DataWizard\Application\Controller\Admin\d3ExportWizard::class,
'd3ActionWizard' => D3\DataWizard\Application\Controller\Admin\d3ActionWizard::class
],
'extend' => [],
'events' => [],
'templates' => [
'd3ExportWizard.tpl' => 'd3/datawizard/Application/views/admin/tpl/d3ExportWizard.tpl',
'd3ActionWizard.tpl' => 'd3/datawizard/Application/views/admin/tpl/d3ActionWizard.tpl',
],
'settings' => [
[