add example export
This commit is contained in:
parent
f663697bad
commit
b40558364e
@ -15,6 +15,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace D3\DataWizard\Application\Model;
|
namespace D3\DataWizard\Application\Model;
|
||||||
|
|
||||||
|
use D3\DataWizard\Application\Model\Exports\InactiveCategories;
|
||||||
|
|
||||||
class Configuration
|
class Configuration
|
||||||
{
|
{
|
||||||
const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
|
const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
|
||||||
@ -32,7 +34,7 @@ class Configuration
|
|||||||
|
|
||||||
public function configure()
|
public function configure()
|
||||||
{
|
{
|
||||||
|
$this->registerExport(self::GROUP_CATEGORY, oxNew(InactiveCategories::class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
68
src/Application/Model/Exports/InactiveCategories.php
Normal file
68
src/Application/Model/Exports/InactiveCategories.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?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\Core\Registry;
|
||||||
|
|
||||||
|
class InactiveCategories extends ExportBase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Kategorien -deaktiviert, mit aktiven Artikel
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTitle() : string
|
||||||
|
{
|
||||||
|
return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDescription() : string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getQuery() : array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"SELECT
|
||||||
|
oc.OXID,
|
||||||
|
oc.OXSHOPID,
|
||||||
|
oc.oxtitle as 'Titel',
|
||||||
|
(
|
||||||
|
SELECT GROUP_CONCAT(oxtitle ORDER BY oxleft ASC SEPARATOR ' > ')
|
||||||
|
from oxcategories
|
||||||
|
WHERE OXLEFT < oc.oxleft AND OXRIGHT > oc.oxright AND OXROOTID = oc.OXROOTID AND OXSHOPID = oc.OXSHOPID
|
||||||
|
) as 'Baum',
|
||||||
|
COUNT(oa.oxid) as 'Anzahl'
|
||||||
|
FROM oxcategories oc
|
||||||
|
LEFT JOIN oxobject2category o2c ON oc.OXID = o2c.OXCATNID
|
||||||
|
LEFT JOIN oxarticles oa ON o2c.OXOBJECTID = oa.OXID
|
||||||
|
WHERE oc.OXACTIVE = ? AND oa.OXACTIVE = ?
|
||||||
|
GROUP BY oc.oxid
|
||||||
|
ORDER BY oc.oxleft ASC",
|
||||||
|
[0, 1]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -42,7 +42,9 @@ $aLang = array(
|
|||||||
'D3_DATAWIZARD_ERR_NOEXPORTSELECT' => 'Export kann nicht ausgeführt werden. Exporte erfordern SELECT Query.',
|
'D3_DATAWIZARD_ERR_NOEXPORTSELECT' => 'Export kann nicht ausgeführt werden. Exporte erfordern SELECT Query.',
|
||||||
'D3_DATAWIZARD_ERR_NOEXPORT_INSTALLED' => 'Es sind keine Exporte installiert oder aktiviert.',
|
'D3_DATAWIZARD_ERR_NOEXPORT_INSTALLED' => 'Es sind keine Exporte installiert oder aktiviert.',
|
||||||
'D3_DATAWIZARD_ERR_NOEXPORTCONTENT' => 'Export ist leer, kein Inhalt zum Download verfügbar',
|
'D3_DATAWIZARD_ERR_NOEXPORTCONTENT' => 'Export ist leer, kein Inhalt zum Download verfügbar',
|
||||||
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer für Format "%1$s" registriert'
|
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer für Format "%1$s" registriert',
|
||||||
|
|
||||||
|
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikel'
|
||||||
|
|
||||||
// Abracadata
|
// Abracadata
|
||||||
// Harry Potter
|
// Harry Potter
|
||||||
|
Loading…
Reference in New Issue
Block a user