diff --git a/src/Application/Model/Configuration.php b/src/Application/Model/Configuration.php index c382550..b212ec7 100644 --- a/src/Application/Model/Configuration.php +++ b/src/Application/Model/Configuration.php @@ -15,6 +15,8 @@ declare(strict_types=1); namespace D3\DataWizard\Application\Model; +use D3\DataWizard\Application\Model\Exports\InactiveCategories; + class Configuration { const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES'; @@ -32,7 +34,7 @@ class Configuration public function configure() { - + $this->registerExport(self::GROUP_CATEGORY, oxNew(InactiveCategories::class)); } /** diff --git a/src/Application/Model/Exports/InactiveCategories.php b/src/Application/Model/Exports/InactiveCategories.php new file mode 100644 index 0000000..04534fd --- /dev/null +++ b/src/Application/Model/Exports/InactiveCategories.php @@ -0,0 +1,68 @@ + + * @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] + ]; + } +} \ No newline at end of file diff --git a/src/Application/views/admin/de/d3DataWizard_lang.php b/src/Application/views/admin/de/d3DataWizard_lang.php index 8fce196..38d1fc2 100644 --- a/src/Application/views/admin/de/d3DataWizard_lang.php +++ b/src/Application/views/admin/de/d3DataWizard_lang.php @@ -42,7 +42,9 @@ $aLang = array( '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_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 // Harry Potter