6 Commits

19 changed files with 210 additions and 588 deletions

View File

@ -47,7 +47,7 @@ class d3ActionWizard extends AdminDetailsController
return $this->configuration->getActionGroups();
}
public function getGroupActions($group)
public function getGroupTasks($group)
{
return $this->configuration->getActionsByGroup($group);
}
@ -58,10 +58,10 @@ class d3ActionWizard extends AdminDetailsController
* @throws d3ShopCompatibilityAdapterException
* @throws d3_cfg_mod_exception
*/
public function doAction()
public function runTask()
{
try {
$id = Registry::getRequest()->getRequestEscapedParameter('actionid');
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
$action = $this->configuration->getActionById($id);
[ $queryString, $parameters ] = $action->getQuery();

View File

@ -47,7 +47,7 @@ class d3ExportWizard extends AdminDetailsController
return $this->configuration->getExportGroups();
}
public function getGroupExports($group)
public function getGroupTasks($group)
{
return $this->configuration->getExportsByGroup($group);
}
@ -58,10 +58,10 @@ class d3ExportWizard extends AdminDetailsController
* @throws d3ShopCompatibilityAdapterException
* @throws d3_cfg_mod_exception
*/
public function doExport()
public function runTask()
{
try {
$id = Registry::getRequest()->getRequestEscapedParameter('exportid');
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
$export = $this->configuration->getExportById($id);
[ $queryString, $parameters ] = $export->getQuery();
@ -73,7 +73,7 @@ class d3ExportWizard extends AdminDetailsController
);
}
$export->run(Registry::getRequest()->getRequestEscapedParameter('exportformat'));
$export->run(Registry::getRequest()->getRequestEscapedParameter('format'));
} catch (DataWizardException|DBALException|DatabaseErrorException $e) {
Registry::getUtilsView()->addErrorToDisplay($e);
}

View File

@ -1,89 +0,0 @@
<?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;
}
}

View File

@ -29,6 +29,7 @@ class Configuration
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';
protected $actions = [];
protected $exports = [];
@ -40,12 +41,7 @@ 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));
}
// extend to add exports and actions via 'registerAction()' or 'registerExport()' method
}
/**

View File

@ -1,77 +0,0 @@
<?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
*/
namespace D3\DataWizard\Application\Model\Exports;
use D3\DataWizard\Application\Model\ExportBase;
use OxidEsales\Eshop\Application\Model\Article;
use OxidEsales\Eshop\Application\Model\Category;
use OxidEsales\Eshop\Application\Model\Object2Category;
use OxidEsales\Eshop\Core\Registry;
class InactiveCategories extends ExportBase
{
/**
* Kategorien -deaktiviert, mit aktiven Artikeln
*/
/**
* @return string
*/
public function getTitle() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES');
}
/**
* @return array
*/
public function getQuery() : array
{
$categoryTableName = oxNew(Category::class)->getCoreTableName();
$object2categoryTableName = oxNew(Object2Category::class)->getCoreTableName();
$articleTableName = oxNew(Article::class)->getCoreTableName();
$treeTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TREE');
$titleTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TITLE');
$countTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_COUNT');
return [
"SELECT
oc.OXID,
oc.OXSHOPID,
oc.oxtitle as :titleTitle,
(
SELECT GROUP_CONCAT(oxtitle ORDER BY oxleft ASC SEPARATOR ' > ')
from ".$categoryTableName."
WHERE OXLEFT < oc.oxleft AND OXRIGHT > oc.oxright AND OXROOTID = oc.OXROOTID AND OXSHOPID = oc.OXSHOPID
) as :treeTitle,
COUNT(oa.oxid) as :countTitle
FROM ".$categoryTableName." oc
LEFT JOIN ".$object2categoryTableName." o2c ON oc.OXID = o2c.OXCATNID
LEFT JOIN ".$articleTableName." oa ON o2c.OXOBJECTID = oa.OXID
WHERE oc.OXACTIVE = :categoryActive AND oa.OXACTIVE = :articleActive
GROUP BY oc.oxid
ORDER BY oc.oxleft ASC",
[
'categoryActive' => 0,
'articleActive' => 1,
'titleTitle' => $titleTitle,
'treeTitle' => $treeTitle,
'countTitle' => $countTitle
]
];
}
}

View File

@ -1,98 +0,0 @@
<?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
*/
namespace D3\DataWizard\Application\Model\Exports;
use D3\DataWizard\Application\Model\ExportBase;
use FormManager\Inputs\Date;
use OxidEsales\Eshop\Application\Model\Order;
use OxidEsales\Eshop\Core\Registry;
use FormManager\Factory as FormFactory;
class KeyFigures extends ExportBase
{
const STARTDATE_NAME = 'startdate';
const ENDDATE_NAME = 'enddate';
/**
* Shopkennzahlen
*/
public function __construct()
{
/** @var Date $startDate */
$startDateValue = Registry::getRequest()->getRequestEscapedParameter(self::STARTDATE_NAME);
$startDate = FormFactory::date(
Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_KEYFIGURES_FIELD_STARTDATE'),
[
'name' => self::STARTDATE_NAME,
'value' => $startDateValue
]
);
$this->registerFormElement($startDate);
/** @var Date $endDate */
$endDateValue = Registry::getRequest()->getRequestEscapedParameter(self::ENDDATE_NAME);
$endDate = FormFactory::date(
Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_KEYFIGURES_FIELD_ENDDATE'),
[
'name' => self::ENDDATE_NAME,
'value' => $endDateValue
]
);
$this->registerFormElement($endDate);
}
/**
* @return string
*/
public function getTitle() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_KEYFIGURES');
}
/**
* @return array
*/
public function getQuery() : array
{
$orderTable = oxNew(Order::class)->getCoreTableName();
$ordersTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_KEYFIGURES_ORDERSPERMONTH');
$basketsTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_KEYFIGURES_BASKETSIZE');
$monthTitle = Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_KEYFIGURES_MONTH');
$startDateValue = Registry::getRequest()->getRequestEscapedParameter(self::STARTDATE_NAME) ?: '1970-01-01';
$endDateValue = Registry::getRequest()->getRequestEscapedParameter(self::ENDDATE_NAME) ?: date('Y-m-d');
return [
'SELECT
DATE_FORMAT(oo.oxorderdate, "%Y-%m") as :monthTitle,
FORMAT(COUNT(oo.oxid), 0) AS :ordersTitle,
FORMAT(SUM(oo.OXTOTALBRUTSUM / oo.oxcurrate) / COUNT(oo.oxid), 2) as :basketsTitle
FROM '.$orderTable.' AS oo
WHERE oo.oxorderdate >= :startDate AND oo.oxorderdate <= :endDate
GROUP BY DATE_FORMAT(oo.oxorderdate, "%Y-%m")
ORDER BY DATE_FORMAT(oo.oxorderdate, "%Y-%m") DESC
LIMIT 30',
[
'startDate' => $startDateValue,
'endDate' => $endDateValue,
'monthTitle' => $monthTitle,
'ordersTitle' => $ordersTitle,
'basketsTitle' => $basketsTitle
]
];
}
}

View File

@ -27,13 +27,13 @@ $aLang = array(
'SHOP_MODULE_GROUP_d3datawizard_general' => 'Grundeinstellungen',
'SHOP_MODULE_d3datawizard_debug' => 'zeigt Abfragen anstatt diese auszufĂĽhren',
'SHOP_MODULE_d3datawizard_hideexamples' => 'Beispielexporte ausblenden',
'D3_DATAWIZARD_GROUP_ARTICLES' => 'Artikel',
'D3_DATAWIZARD_GROUP_CATEGORIES' => 'Kategorien',
'D3_DATAWIZARD_GROUP_ORDERS' => 'Bestellungen',
'D3_DATAWIZARD_GROUP_REMARKS' => 'Bewertungen',
'D3_DATAWIZARD_GROUP_SHOP' => 'Shop',
'D3_DATAWIZARD_GROUP_CMS' => 'CMS-Texte',
'D3_DATAWIZARD_GROUP_USERS' => 'Benutzer',
'D3_DATAWIZARD_EXPORT_SUBMIT' => 'Export starten',
@ -50,21 +50,8 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer fĂĽr Format "%1$s" registriert',
'D3_DATAWIZARD_ERR_EXPORTFILEERROR' => 'Exportdatei "%1$s" kann nicht angelegt werden',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikeln',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TREE' => 'Baum',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TITLE' => 'Titel',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_COUNT' => 'Anzahl',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES' => 'Bestellungskennzahlen nach Monat',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_FIELD_STARTDATE'=> 'Startdatum (optional)',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_FIELD_ENDDATE' => 'Enddatum (optional)',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'Bestellungen pro Monat',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_BASKETSIZE' => 'Warenkorbhöhe',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_MONTH' => 'Monat',
'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',
);

View File

@ -27,13 +27,13 @@ $aLang = array(
'SHOP_MODULE_GROUP_d3datawizard_general' => 'basic settings',
'SHOP_MODULE_d3datawizard_debug' => 'shows queries instead of executing them',
'SHOP_MODULE_d3datawizard_hideexamples' => 'hide sample exports',
'D3_DATAWIZARD_GROUP_ARTICLES' => 'articles',
'D3_DATAWIZARD_GROUP_CATEGORIES' => 'categories',
'D3_DATAWIZARD_GROUP_ORDERS' => 'orders',
'D3_DATAWIZARD_GROUP_REMARKS' => 'remarks',
'D3_DATAWIZARD_GROUP_SHOP' => 'shop',
'D3_DATAWIZARD_GROUP_CMS' => 'CMS items',
'D3_DATAWIZARD_GROUP_USERS' => 'users',
'D3_DATAWIZARD_EXPORT_SUBMIT' => 'generate export',
@ -50,21 +50,8 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'No renderer registered for format "%1$s"',
'D3_DATAWIZARD_ERR_EXPORTFILEERROR' => 'Export file "%1$s" cannot be created',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deactivated categories, with active articles',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TREE' => 'tree',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_TITLE' => 'title',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES_COUNT' => 'count',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES' => 'Order key figures by month',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_FIELD_STARTDATE'=> 'start date (optional)',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_FIELD_ENDDATE' => 'end date (optional)',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'orders per month',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_BASKETSIZE' => 'shopping cart value',
'D3_DATAWIZARD_EXPORTS_KEYFIGURES_MONTH' => 'month',
'D3_DATAWIZARD_ERR_ACTIONSELECT' => 'Action cannot be executed. Actions cannot export SELECTs.',
'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',
'D3_DATAWIZARD_ACTIONS_FIXARTEXTENDSITEMS' => 'add missing oxartextends entries',
);

View File

@ -1,127 +1,4 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
[{capture assign="d3dw_backgroundimage"}]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)[{/capture}]
[{capture assign="d3dw_noitemmessageid"}]D3_DATAWIZARD_ERR_NOACTION_INSTALLED[{/capture}]
[{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;
}
.formElements label {
display: inline-block;
margin: .5rem 0;
}
</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">
[{if $action->getDescription()}]
<p class="card-text">
[{$action->getDescription()}]
</p>
[{/if}]
[{if $action->hasFormElements()}]
[{foreach from=$action->getFormElements() item="formElement"}]
[{$formElement}]
[{/foreach}]
[{/if}]
<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"}]
[{include file="d3Wizards.tpl" submit="d3ActionSubmit.tpl"}]

View File

@ -1,145 +1,4 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
[{capture assign="d3dw_backgroundimage"}]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))[{/capture}]
[{capture assign="d3dw_noitemmessageid"}]D3_DATAWIZARD_ERR_NOEXPORT_INSTALLED[{/capture}]
[{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(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));
}
h4 .btn {
font-size: 1.3rem;
}
h5.card-header {
font-size: 1.1rem;
}
.formElements label {
display: inline-block;
margin: .5rem 0;
}
</style>
[{capture name="d3script"}][{strip}]
function startExport(id, format) {
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('exportid').value = id;
document.getElementById('exportformat').value = format;
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="doExport">
<input type="hidden" name="exportid" id="exportid" value="">
<input type="hidden" name="exportformat" id="exportformat" 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->getGroupExports($group) key="id" item="export"}]
<div class="col-sm-6 col-md-4 col-lg-3 pb-4">
<div class="card">
<h5 class="card-header">
[{$export->getTitle()}]
</h5>
<div class="card-body">
[{if $export->getDescription()}]
<p class="card-text">
[{$export->getDescription()}]
</p>
[{/if}]
[{if $export->hasFormElements()}]
[{foreach from=$export->getFormElements() item="formElement"}]
[{$formElement}]
[{/foreach}]
[{/if}]
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startExport('[{$id}]', 'CSV')">
<i class="fas fa-magic"></i>
[{oxmultilang ident=$export->getButtonText()}]
</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">
<i class="fas fa-magic"></i>
[{oxmultilang ident=$export->getButtonText()}]
</span>
</button>
<div class="dropdown-menu">
[{block name="dataWizardExportFormat"}]
<button class="dropdown-item" onclick="startExport('[{$id}]', 'CSV')">
[{oxmultilang ident="D3_DATAWIZARD_EXPORT_FORMAT_CSV"}]
</button>
<button class="dropdown-item" onclick="startExport('[{$id}]', 'Pretty')">
[{oxmultilang ident="D3_DATAWIZARD_EXPORT_FORMAT_PRETTY"}]
</button>
[{/block}]
</div>
</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_NOEXPORT_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"}]
[{include file="d3Wizards.tpl" submit="d3ExportSubmit.tpl"}]

View File

@ -0,0 +1,134 @@
[{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: [{$d3dw_backgroundimage}];
}
h4 .btn {
font-size: 1.3rem;
}
h5.card-header {
font-size: 1.1rem;
}
.formElements label {
display: inline-block;
margin: .5rem 0;
}
</style>
[{capture name="d3script"}][{strip}]
function startTask(id, format = '') {
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('taskid').value = id;
document.getElementById('format').value = format;
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="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">
[{if $item->getDescription()}]
[{assign var="description" value=$item->getDescription()}]
[{assign var="sectionlength" value="100"}]
[{if $description|count_characters:true <= $sectionlength}]
<p class="card-text">[{$description}]</p>
[{else}]
[{assign var="shorttext" value=$description|truncate:$sectionlength:''}]
<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">
...[{$description|replace:$shorttext:''}]
</p>
[{/if}]
[{/if}]
[{if $item->hasFormElements()}]
[{foreach from=$item->getFormElements() item="formElement"}]
[{$formElement}]
[{/foreach}]
[{/if}]
[{include file=$submit}]
</div>
</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>
<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"}]

View File

@ -0,0 +1,6 @@
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startTask('[{$id}]')">
<i class="fas fa-magic"></i>
[{oxmultilang ident=$item->getButtonText()}]
</button>
</div>

View File

@ -0,0 +1,22 @@
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startTask('[{$id}]', 'CSV')">
<i class="fas 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">
<span class="sr-only">
<i class="fas fa-magic"></i>
[{oxmultilang ident=$item->getButtonText()}]
</span>
</button>
<div class="dropdown-menu">
[{block name="dataWizardFormat"}]
<button class="dropdown-item" onclick="startTask('[{$id}]', 'CSV')">
[{oxmultilang ident="D3_DATAWIZARD_EXPORT_FORMAT_CSV"}]
</button>
<button class="dropdown-item" onclick="startTask('[{$id}]', 'Pretty')">
[{oxmultilang ident="D3_DATAWIZARD_EXPORT_FORMAT_PRETTY"}]
</button>
[{/block}]
</div>
</div>

View File

@ -1,15 +1,26 @@
# Changelog
## 1.3.0.0 (2021-07-29)
- can handle long task description text
- has more generic admin controller templates
---
## 1.2.0.0 (2021-07-27)
- adjustments for CLI extension
- fix OXID 6.1 incompatibilities
---
## 1.1.0.0 (2021-06-25)
- implement form builder
- fix key figures export
---
## 1.0.0.0 (2021-06-22)
- initial implementation

View File

@ -1,4 +1,5 @@
> [deutsche Version](README.md)
[![deutsche Version](https://logos.oxidmodule.com/de2_xs.svg)](README.md)
[![english version](https://logos.oxidmodule.com/en2_xs.svg)](README.en.md)
# DÂł Data Wizard for OXID eShop
@ -8,7 +9,9 @@ The exports are defined via database queries or ready-made data lists. Various e
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.
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")
## Installation

View File

@ -1,4 +1,5 @@
> [english version](README.en.md)
[![deutsche Version](https://logos.oxidmodule.com/de2_xs.svg)](README.md)
[![english version](https://logos.oxidmodule.com/en2_xs.svg)](README.en.md)
# DÂł Data Wizard fĂĽr OXID eShop
@ -8,7 +9,9 @@ Die Exporte werden ĂĽber Datenbankabfragen oder fertige Datenlisten definiert. E
Alle Exporte sind fĂĽr eine bessere Ăśbersichtlichkeit in Gruppen zusammengefasst.
Im Lieferumfang sind Beispielexporte enthalten. Diese sollen als Implementierungsreferenz fĂĽr individuelle Exporte dienen. Die Anzeige der Beispielexporte kann in den Modulgrundeinstellungen deaktiviert werden.
Im Paket d3/datawizardtasks sind Beispielexporte enthalten. Diese sollen als Implementierungsreferenz fĂĽr individuelle Exporte dienen.
![Adminbereich](assets/administration_exports.jpg "Adminbereich")
## Schnellinstallation

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -26,7 +26,7 @@
],
"require": {
"php": ">=7.1",
"oxid-esales/oxideshop-ce": "6.3 - 6.8",
"oxid-esales/oxideshop-ce": "6.3 - 6.9",
"league/csv": "^9.0",
"mathieuviossat/arraytotexttable": "^1.0",
"form-manager/form-manager": "^5.1 || ^6.1"
@ -40,6 +40,10 @@
"target-directory": "d3/datawizard"
}
},
"suggest": {
"d3/datawizardtasks": "useful example tasks for Data Wizard",
"d3/datawizardcli": "command line implementation for fully automated Data Wizard tasks"
},
"autoload": {
"psr-4": {
"D3\\DataWizard\\": "../../../source/modules/d3/datawizard"

View File

@ -32,7 +32,7 @@ $aModule = [
'en' => '',
],
'thumbnail' => '',
'version' => '1.2.0.0',
'version' => '1.3.0.0',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
@ -45,6 +45,9 @@ $aModule = [
'templates' => [
'd3ExportWizard.tpl' => 'd3/datawizard/Application/views/admin/tpl/d3ExportWizard.tpl',
'd3ActionWizard.tpl' => 'd3/datawizard/Application/views/admin/tpl/d3ActionWizard.tpl',
'd3Wizards.tpl' => 'd3/datawizard/Application/views/admin/tpl/inc/Wizards.tpl',
'd3ExportSubmit.tpl' => 'd3/datawizard/Application/views/admin/tpl/inc/exportSubmit.tpl',
'd3ActionSubmit.tpl' => 'd3/datawizard/Application/views/admin/tpl/inc/actionSubmit.tpl',
],
'settings' => [
[
@ -52,13 +55,7 @@ $aModule = [
'name' => $sModuleId.'_debug',
'type' => 'bool',
'value' => false
],
[
'group' => $sModuleId.'_general',
'name' => $sModuleId.'_hideexamples',
'type' => 'bool',
'value' => false
],
]
],
'blocks' => []
];