diff --git a/src/Application/Model/Configuration.php b/src/Application/Model/Configuration.php index 4dde3e9..380ad91 100644 --- a/src/Application/Model/Configuration.php +++ b/src/Application/Model/Configuration.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace D3\DataWizard\Application\Model; use D3\DataWizard\Application\Model\Exports\InactiveCategories; +use D3\DataWizard\Application\Model\Exports\KeyFigures; use OxidEsales\Eshop\Core\Registry; class Configuration diff --git a/src/Application/Model/ExportBase.php b/src/Application/Model/ExportBase.php index a9357ff..bf69d7e 100644 --- a/src/Application/Model/ExportBase.php +++ b/src/Application/Model/ExportBase.php @@ -28,6 +28,14 @@ use OxidEsales\Eshop\Core\Registry; abstract class ExportBase implements QueryBase { + /** + * @return string + */ + public function getDescription() : string + { + return ''; + } + /** * @param string $format * diff --git a/src/Application/Model/Exports/InactiveCategories.php b/src/Application/Model/Exports/InactiveCategories.php index 04534fd..694041e 100644 --- a/src/Application/Model/Exports/InactiveCategories.php +++ b/src/Application/Model/Exports/InactiveCategories.php @@ -16,6 +16,9 @@ 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 @@ -32,37 +35,43 @@ class InactiveCategories extends ExportBase return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES'); } - /** - * @return string - */ - public function getDescription() : string - { - return ''; - } - /** * @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 'Titel', + oc.oxtitle as :titleTitle, ( SELECT GROUP_CONCAT(oxtitle ORDER BY oxleft ASC SEPARATOR ' > ') - from oxcategories + from ".$categoryTableName." 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 = ? + ) 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", - [0, 1] + [ + 'categoryActive' => 0, + 'articleActive' => 1, + 'titleTitle' => $titleTitle, + 'treeTitle' => $treeTitle, + 'countTitle' => $countTitle + ] ]; } } \ 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 b807e8e..2d7538d 100644 --- a/src/Application/views/admin/de/d3DataWizard_lang.php +++ b/src/Application/views/admin/de/d3DataWizard_lang.php @@ -30,9 +30,10 @@ $aLang = array( 'D3_DATAWIZARD_GROUP_ARTICLES' => 'Artikel', 'D3_DATAWIZARD_GROUP_CATEGORIES' => 'Kategorien', - 'D3_DATAWIZARD_GROUP_REMARKS' => 'Bewertungen', - 'D3_DATAWIZARD_GROUP_USERS' => 'Benutzer', 'D3_DATAWIZARD_GROUP_ORDERS' => 'Bestellungen', + 'D3_DATAWIZARD_GROUP_REMARKS' => 'Bewertungen', + 'D3_DATAWIZARD_GROUP_SHOP' => 'Shop', + 'D3_DATAWIZARD_GROUP_USERS' => 'Benutzer', 'D3_DATAWIZARD_EXPORT_SUBMIT' => 'Export starten', 'D3_DATAWIZARD_EXPORT_FORMAT_CSV' => 'CSV-Format', @@ -45,7 +46,15 @@ $aLang = array( '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_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikel' + 'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikel', + '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_ORDERSPERMONTH' => 'Bestellungen pro Monat', + 'D3_DATAWIZARD_EXPORTS_KEYFIGURES_BASKETSIZE' => 'Warenkorbhöhe', + 'D3_DATAWIZARD_EXPORTS_KEYFIGURES_MONTH' => 'Monat', // Abracadata // Harry Potter diff --git a/src/metadata.php b/src/metadata.php index 6d5f73c..29786e0 100644 --- a/src/metadata.php +++ b/src/metadata.php @@ -26,7 +26,7 @@ $logo = '