Compare commits

...

73 Commits

Author SHA1 Message Date
df236f4bfd add phpunit dependencies 2025-03-03 13:50:51 +01:00
2af2e3bbcc update version number 2025-01-02 10:45:02 +01:00
ba123ad789 code cleanup 2024-12-19 16:28:29 +01:00
889f721279 add support for OXID 7.2 | update version number | update changelog 2024-12-19 16:28:10 +01:00
0f6c3c41af update old module installation commands 2024-12-19 16:26:23 +01:00
a4bd6d5bfd add support for OXID 7.2 2024-12-19 15:31:35 +01:00
2b0a3dc2a1 use new templaterenderer because old can't be used 2024-12-19 14:21:49 +01:00
47a0759ced import "field" | change return type declaration 2024-12-17 15:14:51 +01:00
2838ab70be add missing entry 2024-12-17 14:06:18 +01:00
3a34f0e5f5 re-add missing function 2024-12-17 13:53:15 +01:00
07224f9530 parse manufacturer longdesc through Smarty 2024-12-09 06:35:42 +01:00
b278f8a185 generate field long name by shop method, assert return type 2024-12-09 06:35:17 +01:00
bb6b465445 remove unused assignment 2024-12-09 06:34:33 +01:00
6f7acce537 remove unset logo variable 2024-12-03 09:56:42 +01:00
ed92b443f9 [Changed] Changelog 2024-11-22 22:19:09 +01:00
cb0bd3fc0b [Fixed] method usage to get setting and missing closing tag 2024-11-22 22:13:54 +01:00
3d2cb0e94b [Removed] unnecessary config get 2024-11-22 22:13:28 +01:00
99854e9409 [Fixed] wrong img 2024-11-22 22:06:04 +01:00
a790ebcb07 [Added] missing twig translation 2024-11-22 22:05:56 +01:00
ef5f4039d0 [Changed] extension of Config instead of ArticleDetails; [Fixed] wrong usage of modSetting getter
more general, global take
2024-11-22 22:00:04 +01:00
eb489933c9 [Fixed] unnecessary use 2024-11-22 21:44:06 +01:00
ce4a96c279 [Added] manufacturer to details; Component\ArticleDetails extension
method to call the settings on the details page
2024-11-22 21:38:55 +01:00
beb67d992e [Added] manufacturer longdesc to details page 2024-11-22 21:14:52 +01:00
13ee1b7340 [Changed] metadata && changelog 2024-11-22 20:20:31 +01:00
8bbe6262af rename incorrect language files by mistake ¯\(°_o)/¯ 2024-11-22 20:16:50 +01:00
ca9f9141ce change logo 2024-11-22 20:16:50 +01:00
5a6f8a1577 make displaying manufacturer information on manufacturer list page configurable 2024-11-22 20:16:40 +01:00
fcecc396df decode longdesc for manufacturer list page 2024-11-22 20:15:34 +01:00
dfdc0b1ecd [Added] 2.x changelog entries 2024-11-22 20:15:32 +01:00
7d5eeb59d2 fix links in changelog 2024-11-22 20:12:50 +01:00
bd9b8b6515 improve manufacturer block content 2024-11-22 20:12:25 +01:00
27cb316b74 fix WYSIWYG editor content 2024-11-22 20:08:47 +01:00
c99a7bc93c fix CHANGELOG 2024-11-22 20:07:59 +01:00
d7865aebe4 [Changed] potential solution manufacturer longdesc 2024-11-21 00:31:01 +01:00
febe1e7f8c [Fixed] tab pane styling; wrong config-variable 2024-11-21 00:00:31 +01:00
45e719d9f3 [Changed] clear code 2024-11-21 00:00:07 +01:00
d269745dac [Removed] unnecessary extension 2024-11-20 23:59:51 +01:00
77cb1d4594 [Changed] metadata && changelog 2024-11-20 19:28:47 +01:00
449f901976 [Added] new setting adjustments for twig 2024-11-20 19:11:15 +01:00
8794a005d7 [Fixed] missing translations 2024-11-20 18:54:00 +01:00
4c374ff39c [Fixed] empty var 2024-11-20 18:51:50 +01:00
8f046ed231 [Changed] php cs fixer adjustments 2024-11-20 18:50:18 +01:00
8d3421450b [Added] php cs fixer 2024-11-20 18:12:10 +01:00
b46175f5ab [Changed] property name to lower-case 2024-11-20 17:52:46 +01:00
99ea814987 [Added] php cs fixer 2024-11-20 17:51:07 +01:00
38b12bc3c0 add noencode 2024-11-20 17:49:43 +01:00
ebb9450812 [Fixed] dont hite "save" button on larger input form 2024-11-20 17:49:26 +01:00
64a70921c5 [Fixed] show no content on empty elements 2024-11-20 17:47:12 +01:00
ab0ea6cea7 [Fixed] installation instructions 2024-11-20 17:46:25 +01:00
fe7f3aa621 [Fixed] html entity code 2024-11-20 17:45:00 +01:00
2882aac57e make displaying manufacturer tab on details page configurable 2024-11-20 17:41:53 +01:00
8eaa97d889 display manufacturer content as additional tab on article details page 2024-11-20 17:41:28 +01:00
2ef3223e86 show manufacturer on article details page if manufacturer hasn't an icon 2024-11-20 17:40:58 +01:00
58663d9918 [Changed] readme 2024-11-20 17:40:32 +01:00
b5b4268335 [Fixed] readme 2024-11-18 19:17:13 +01:00
dfd4367066 [Added] extension 2024-11-18 19:16:05 +01:00
e61438f937 [Added] list block extension 2024-11-18 19:15:28 +01:00
1c2ee9f4f0 [Changed] README 2024-11-16 18:30:42 +01:00
1dc39f4fdd [Changed] changelog 2024-11-16 18:28:18 +01:00
c9ac21c4bb [Changed] deprecated method names 2024-11-16 18:14:54 +01:00
21e6d764cc [Changed] improved dynamization of the code 2024-11-16 17:45:20 +01:00
bf30cf85dc [Added] intellisense connection 2024-11-16 17:43:44 +01:00
56d8bbdd72 [Fixed] used stylesheet 2024-11-16 17:27:30 +01:00
c215ef5eef [Changed] to OXID 7 functionality 2024-11-16 17:27:17 +01:00
ce264a357e [Fixed] migration-yaml 2024-11-16 16:07:24 +01:00
75beb308d8 [Added] twig admin template 2024-11-16 16:03:22 +01:00
00a8017731 [Changed] template names 2024-11-16 16:03:12 +01:00
67f7bcb77f [Changed] deprecated code 2024-11-16 16:02:54 +01:00
6e960b34b2 [Added] twig admin lang files 2024-11-16 15:56:32 +01:00
67240260b2 [Fixed] missing namespace entry 2024-11-16 14:36:17 +01:00
58ef4bb533 [Fixed] missing namespace entry 2024-11-16 14:35:43 +01:00
3e30e0491b [Changed] rework for OXID 7 2024-11-16 14:33:16 +01:00
a7dfae8c5d [Changed] rework for OXID 7 2024-11-16 13:50:58 +01:00
33 changed files with 1211 additions and 334 deletions

1
.noencode Normal file
View File

@ -0,0 +1 @@
copyAsIsFiles=metadata.php, .php-cs-fixer.php, IntelliSenseHelper.php, migration, Application/views

34
.php-cs-fixer.php Normal file
View File

@ -0,0 +1,34 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$header = <<<EOF
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
@link https://www.oxidmodule.com
EOF;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP80Migration' => true,
'@PSR12' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'location' => 'after_open',
'separate' => 'both',
],
'php_unit_test_class_requires_covers' => true,
'doctrine_annotation_indentation' => true,
])
->setFinder($finder)
;

View File

@ -1,14 +1,28 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Application\Controller\Admin;
use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use Exception;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Registry;
use stdClass;
class ManufacturerInfoLongdesc extends AdminDetailsController
{
@ -19,12 +33,13 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
{
parent::render();
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
$this->_aViewData['edit'] = $oManufacturer = oxNew(Manufacturer::class);
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($sOXID) && $sOXID != "-1") {
// load object
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
$d3manufacturerlang = Registry::getRequest()->getRequestEscapedParameter("catlang");
if (!isset($d3manufacturerlang)) {
$d3manufacturerlang = $this->_iEditLang;
@ -39,28 +54,28 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
$this->_aViewData['readonly'] = true;
}
foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
$oLang = new \stdClass();
foreach (Registry::getLang()->getLanguageNames() as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
}
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__D3DESCRIPTION", "list.tpl.css");
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, $oManufacturer->getD3LongDescTableColumnName(), "list.css");
return "d3manufacturerlongdesc.tpl";
return "@d3manufacturerinformation/admin/d3manufacturerlongdesc";
}
/**
* @return void
* @throws \Exception
* @throws Exception
*/
public function save()
public function save(): void
{
parent::save();
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang"));
$iManufacturerLang = intval(Registry::getRequest()->getRequestEscapedParameter("catlang"));
$sOXID = $this->getEditObjectId();
$this->setEditObjectId($sOXID);
@ -79,38 +94,18 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
$oManufacturer->assign($aParams);
if (false === is_null($this->d3GetLongdescParamValue())) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
if (false === is_null($this->d3GetLongdescParamValue($oManufacturer))) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue($oManufacturer));
$oManufacturer->save();
}
}
/**
* Returns string which must be edited by editor
*
* @param \OxidEsales\Eshop\Core\Model\BaseModel $oObject object with field will be used for editing
* @param string $sField name of editable field
*
* @return string
* @deprecated underscore prefix violates PSR12, will be renamed to "getEditValue" in next major
*/
protected function _getEditValue($oManufacturer, $sField) // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
{
$sEditObjectValue = '';
if ($oManufacturer and $oManufacturer->getId()) {
$sEditObjectValue = $this->_processEditValue($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME));
}
return $sEditObjectValue;
}
/**
* @return string
*/
public function d3GetLongdescParamValue() :string
public function d3GetLongdescParamValue(Manufacturer $oManufacturer): string
{
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__D3DESCRIPTION'];
return (string) Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
}
/**
@ -121,7 +116,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
*
* @return mixed
*/
protected function _processLongDesc($sValue)
protected function processLongDesc($sValue): mixed
{
$aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>'];
$aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', ''];

View File

@ -1,14 +1,26 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Application\Model;
class Constants
{
public const OXID_MODULE_ID = 'd3manufacturerinformation';
// Tables and Database
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'D3DESCRIPTION';
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'd3description';
}

View File

@ -0,0 +1,24 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
// @codeCoverageIgnoreStart
$sLangName = "Deutsch";
$aLang = include __DIR__."/d3_manufacturerinformation_translations.php";
// @codeCoverageIgnoreEnd

View File

@ -0,0 +1,26 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
// @codeCoverageIgnoreStart
return [
'charset' => 'UTF-8',
'D3_MANUFACTURERINFO_TAB' => 'Hersteller',
];
// @codeCoverageIgnoreEnd

View File

@ -0,0 +1,24 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
// @codeCoverageIgnoreStart
$sLangName = "English";
$aLang = include __DIR__."/d3_manufacturerinformation_translations.php";
// @codeCoverageIgnoreEnd

View File

@ -0,0 +1,26 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
// @codeCoverageIgnoreStart
return [
'charset' => 'UTF-8',
'D3_MANUFACTURERINFO_TAB' => 'Manufacturer',
];
// @codeCoverageIgnoreEnd

View File

@ -1,11 +0,0 @@
<?php
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Langtext',
);

View File

@ -1,11 +0,0 @@
<?php
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Text',
);

View File

@ -0,0 +1,27 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Langtext',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
];

View File

@ -0,0 +1,27 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Text',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
];

View File

@ -0,0 +1,27 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Langtext',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
];

View File

@ -0,0 +1,27 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Text',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
];

View File

@ -0,0 +1,10 @@
[{if $oManufacturer->oxmanufacturers__oxicon->value}]
[{$smarty.block.parent}]
[{else}]
<div class="action-links text-left">
<a href="[{$oManufacturer->getLink()}]" title="[{$oManufacturer->oxmanufacturers__oxtitle->value}]">
[{oxmultilang ident="MANUFACTURER" suffix="COLON"}] [{$oManufacturer->oxmanufacturers__oxtitle->value}]
</a>
<span itemprop="brand" class="hidden">[{$oManufacturer->oxmanufacturers__oxtitle->value}]</span>
</div>
[{/if}]

View File

@ -0,0 +1,20 @@
[{$smarty.block.parent}]
[{assign var="registry" value="\OxidEsales\Eshop\Core\Registry"|@oxNew}]
[{assign var="oConfig" value=$registry->getConfig()}]
[{assign var="oManufacturer" value=$oView->getManufacturer()}]
[{if $oManufacturer && $oManufacturer->getId()}]
[{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}]
[{assign var="description" value=$oManufacturer->d3GetLongdesc()}]
[{if $oConfig->d3GetBoolModuleSettingByName('_showManufacturertextOnDetailsPage') && $description|strip_tags|trim}]
[{capture append="tabs"}]<a href="#manufacturertab" class="nav-link[{if $blFirstTab}] active[{/if}]" data-toggle="tab">[{oxmultilang ident="D3_MANUFACTURERINFO_TAB"}]</a>[{/capture}]
[{capture append="tabsContent"}]
<div id="manufacturertab" class="tab-pane[{if $blFirstTab}] active[{/if}]">
[{oxeval var=$description}]
</div>
[{assign var="blFirstTab" value=false}]
[{/capture}]
[{/if}]
[{/if}]

View File

@ -4,9 +4,73 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2024-11-13
## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/2.1.0.0...rel_2.x)
## [2.0.3.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.2.0...2.0.3.0) - 2024-12-19
### Added
- Dynamic Template Renderer Support
- Support for OXID 7.2
## [2.0.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.1.0...2.0.2.0) - 2024-11-22
### Fixed
- template code
- module image file
### Added
- Config method and extension
- missing twig translation
## [2.0.1.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.0.0...2.0.1.0) - 2024-11-20
### Fixed
- show hidden save button
- installation instructions
- show manufacturer link on article details page, if manufacturer hasn't an icon
- prevent encoding HTML entities
### Added
- display manufacturer content as additional tab on article details page
- make displaying manufacturer tab on details page configurable
- hide empty HTML elements content
## [2.0.0.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.1...2.0.0.0) - 2024-11-16
### Added
- installability OXID 7.0 - 7.1
## [1.1.2.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.0...1.1.2.1) - 2024-11-21
### Fixed
- show hidden save button
- installation instructions
- show manufacturer link on article details page, if manufacturer hasn't an icon
- prevent encoding HTML entities
### Added
- display manufacturer content as additional tab on article details page
- make displaying manufacturer tab on details page configurable
- hide empty HTML elements content
## [2.0.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2024-11-16
### Added
- installability OXID 7.0 - 7.1
## [1.1.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.1.0...1.1.2.0) - 2024-11-19
### Fixed
- show hidden save button
### Added
- hide empty HTML elements content
## [1.1.1.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.0.0...1.1.1.0) - 2024-11-18
### Fixed
- installation instructions
- show manufacturer link on article details page, if manufacturer hasn't an icon
- prevent encoding HTML entities
### Added
- display manufacturer content as additional tab on article details page
- make displaying manufacturer tab on details page configurable
## [1.1.0.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.0.0...1.1.0.0) - 2024-11-13
### Added
- installability OXID 6.2.3 - 6.5.x
## [1.0.0.0](https://git.d3data.de/D3Public/MyModule/releases/tag/1.0.0.0) - 2024-11-13
## [1.0.0.0](https://git.d3data.de/D3Private/manufacturer-information/releases/tag/1.0.0.0) - 2024-11-13
- initial release

View File

@ -1,21 +1,37 @@
<?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)
*
* 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 <support@shopmodule.com>
* @link http://www.oxidmodule.com
* @author D3 Data Development - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
namespace D3\ManufacturerInformation\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList;
class D3ManufacturerLongDesc_parent extends Manufacturer {}
class D3ManufacturerLongDesc_parent extends Manufacturer
{
}
class ManufacturerInfoList_parent extends ManufacturerList
{
}
}
namespace D3\ManufacturerInformation\Modules\Core{
use OxidEsales\Eshop\Core\Config;
class ManufacturerConfig_parent extends Config
{
}
}

View File

@ -1,27 +1,39 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry;
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
{
/**
* @param string $sValue
* @return void
* @return bool
*/
public function d3SetLongdesc(string $sValue) :bool
public function d3SetLongdesc(string $sValue): bool
{
if ($this->getId() and $this->isLoaded()){
if ($this->getId() and $this->isLoaded()) {
try {
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
$this->save();
}catch (\Exception $exception){
} catch (\Exception $exception) {
Registry::getLogger()->error($exception->getMessage());
}
}
@ -29,11 +41,21 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
return true;
}
/**
* @return field
*/
public function d3GetLongdesc(): field
{
$longName = $this->getFieldLongName(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName ?: oxNew(Field::class);
}
/**
* @return string
*/
public function d3GetLongdesc(): string
public function getD3LongDescTableColumnName(): string
{
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
}
}

View File

@ -1,14 +1,31 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\UtilsView;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingService;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererInterface;
class ManufacturerInfoList extends ManufacturerInfoList_parent
{
@ -16,10 +33,33 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return void
*/
protected function _addCategoryFields($oManufacturer)
protected function addCategoryFields($oManufacturer): void
{
parent::_addCategoryFields($oManufacturer);
parent::addCategoryFields($oManufacturer);
$oManufacturer->oxcategories__oxlongdesc = new Field($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME), Field::T_RAW);
/** @var ModuleSettingService $setting */
$setting = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
if ($setting->getBoolean('d3manufacturerinformation_showManufacturertextOnManufacturerPage', 'd3manufacturerinformation')) {
/** @var UtilsView $oUtilsView */
$oUtilsView = Registry::getUtilsView();
$longdesc = $oManufacturer->d3GetLongdesc( )->getRawValue() ?? '';
$deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent');
$processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty');
if (!$deactivateSmarty && $processLongDescriptions) {
$longdesc = $this->getRenderer()->renderFragment(
$longdesc,
$oManufacturer->getId() . $oManufacturer->getLanguage(),
[],
true
) ?? '';
}
$oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW);
}
}
private function getRenderer(): TemplateRendererInterface
{
return $this->getContainer()->get(TemplateRendererBridgeInterface::class)->getTemplateRenderer();
}
}

View File

@ -0,0 +1,36 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Core;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
class ManufacturerConfig extends ManufacturerConfig_parent
{
/**
* @param string $sName
* @return bool
*/
public function d3GetBoolModuleSettingByName(string $sName): bool
{
$moduleSettingService = ContainerFacade::get(ModuleSettingServiceInterface::class);
return $moduleSettingService->getBoolean(Constants::OXID_MODULE_ID.$sName, Constants::OXID_MODULE_ID);
}
}

View File

@ -17,24 +17,27 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
```bash
composer require d3/manufacturerinformation:"~1.1"
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
./vendor/bin/oe-console o:m:i source/modules/d3/manufacturerinformation
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
./vendor/bin/oe-console o:m:act d3manufacturerinformation
composer config repositories.d3manufacturerinformation vcs https://git.d3data.de/D3Public/manufacturer-information.git
composer require d3/manufacturerinformation:"~2.0.0"
```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
```bash
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
Aktualisieren Sie anschließend die Datenbank-Views und leeren den Temp Ordner des Shops.
./vendor/bin/oe-console oe:module:install source/modules/d3/manufacturerinformation
./vendor/bin/oe-console oe:module:deactivate d3manufacturerinformation
./vendor/bin/oe-console oe:module:activate d3manufacturerinformation
./vendor/bin/oe-eshop-db_views_generate
```
Leeren Sie anschließend den Temp Ordner des Shops.
## Lizenz
(Stand: 13.11.2024)
(Stand: 19.12.2024)
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)

192
assets/picture.svg Normal file
View File

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
x="0px"
y="0px"
width="201px"
height="124px"
viewBox="-25.453 -14.933 201 124"
enable-background="new -25.453 -14.933 201 124"
xml:space="preserve"
id="svg937"
sodipodi:docname="picture.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"><metadata
id="metadata941"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1848"
inkscape:window-height="1016"
id="namedview939"
showgrid="false"
inkscape:zoom="4.3299648"
inkscape:cx="100.26905"
inkscape:cy="55.441687"
inkscape:window-x="72"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg937" />
<defs
id="defs815">
</defs>
<linearGradient
id="SVGID_1_"
gradientUnits="userSpaceOnUse"
x1="13.207"
y1="16.7153"
x2="13.207"
y2="29.6128"
gradientTransform="matrix(1 0 0 -1 8.3999 69.2939)">
<stop
offset="0.0056"
style="stop-color:#3266A9"
id="stop817" />
<stop
offset="1"
style="stop-color:#0099FF"
id="stop819" />
</linearGradient>
<path
fill="url(#SVGID_1_)"
d="M24.829,40.569c-0.784-0.592-2.104-0.888-3.961-0.888h-1.376l-2.283,12.897h1.779 c3.76,0,6.032-2.244,6.815-6.733c0.134-0.871,0.202-1.642,0.202-2.313C26.004,42.148,25.611,41.16,24.829,40.569z"
id="path822" />
<linearGradient
id="SVGID_2_"
gradientUnits="userSpaceOnUse"
x1="32.1064"
y1="35.123"
x2="32.1064"
y2="47.2842"
gradientTransform="matrix(1 0 0 -1 8.3999 69.2939)">
<stop
offset="0.0056"
style="stop-color:#3266A9"
id="stop824" />
<stop
offset="1"
style="stop-color:#0099FF"
id="stop826" />
</linearGradient>
<path
fill="url(#SVGID_2_)"
d="M40.267,25.549c1.074,0,1.611,0.381,1.611,1.143c0,0.701-0.321,1.201-0.962,1.5 c-0.209,0.119-0.366,0.194-0.471,0.224c-0.065,0.019-0.158,0.037-0.271,0.056c1.98,1.621,3.702,3.544,5.097,5.699 c0.117-0.321,0.21-0.658,0.277-1.013l0.09-1.008c0-1.223-0.568-2.081-1.701-2.574c0.776-0.402,1.376-0.94,1.801-1.611 c0.425-0.672,0.638-1.418,0.638-2.239c0-0.642-0.198-1.265-0.593-1.868c-0.396-0.605-0.98-1.049-1.757-1.333 c-0.433-0.193-0.876-0.328-1.332-0.402c-0.456-0.075-1.003-0.113-1.645-0.113c-0.82,0-1.663,0.124-2.529,0.37 c-0.865,0.246-1.6,0.563-2.204,0.952c-0.604,0.389-1.13,0.907-1.578,1.557c-0.036,0.052-0.066,0.109-0.101,0.163 c1.196,0.534,2.341,1.163,3.426,1.874C38.494,26.01,39.227,25.549,40.267,25.549z"
id="path829" />
<linearGradient
id="SVGID_3_"
gradientUnits="userSpaceOnUse"
x1="16.2036"
y1="-2.8335"
x2="16.2036"
y2="46.3721"
gradientTransform="matrix(1 0 0 -1 8.3999 69.2939)">
<stop
offset="0.0056"
style="stop-color:#3266A9"
id="stop831" />
<stop
offset="1"
style="stop-color:#0099FF"
id="stop833" />
</linearGradient>
<path
fill="url(#SVGID_3_)"
d="M45.272,34.171c-0.433,1.189-1.208,2.147-2.331,2.871c-1.425,0.918-3.182,1.377-5.271,1.377 c-1.179,0-2.175-0.176-2.988-0.525c-0.813-0.35-1.444-0.864-1.891-1.543c-0.448-0.678-0.671-1.481-0.671-2.405l0.022-0.694 l0.156-0.693h4.367l-0.028,0.179v0.179v0.246c0,1.164,0.628,1.746,1.884,1.746c0.635,0,1.201-0.217,1.696-0.649 c0.495-0.434,0.742-0.94,0.742-1.522c0-0.522-0.194-0.887-0.582-1.097c-0.329-0.208-1.007-0.313-2.036-0.313l0.47-2.754l1.141-0.067 c0.083-0.011,0.154-0.022,0.221-0.033c-0.674-0.551-1.378-1.067-2.11-1.546c-0.044,0.096-0.087,0.195-0.125,0.302h-4.185 c0.192-0.837,0.49-1.56,0.884-2.175c-3.064-1.372-6.46-2.133-10.034-2.133C11.015,22.922,0,33.936,0,47.523 c0,13.59,11.015,24.604,24.603,24.604c13.588,0,24.604-11.018,24.604-24.607C49.207,42.599,47.761,38.016,45.272,34.171z M33.96,44.3l-0.168,1.275c-0.538,2.953-1.511,5.404-2.921,7.35c-1.298,1.836-3.016,3.18-5.153,4.028 c-2.138,0.851-4.494,1.274-7.067,1.274H8.278l4.264-24.198h10.441c1.141,0,2.204,0.073,3.189,0.218 c0.984,0.146,1.868,0.364,2.651,0.655c1.611,0.537,2.887,1.471,3.827,2.802c0.94,1.332,1.41,2.992,1.41,4.984L33.96,44.3z"
id="path836" />
<linearGradient
id="SVGID_4_"
gradientUnits="userSpaceOnUse"
x1="73.4502"
y1="-21.6289"
x2="59.2201"
y2="68.2165"
gradientTransform="matrix(1 0 0 -1 8.3999 69.2939)">
<stop
offset="0"
style="stop-color:#B2B2B2;stop-opacity:0"
id="stop838" />
<stop
offset="0.2"
style="stop-color:#B2B2B2"
id="stop840" />
<stop
offset="0.8"
style="stop-color:#B2B2B2"
id="stop842" />
<stop
offset="1"
style="stop-color:#B2B2B2;stop-opacity:0"
id="stop844" />
</linearGradient>
<rect
x="74.422"
fill="url(#SVGID_4_)"
width="0.625"
height="92"
id="rect847" />
<g
style="clip-rule:evenodd;fill-rule:evenodd;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision"
id="g1654"
transform="matrix(0.10671339,0,0,0.10671339,102.89032,19.747305)"><path
id="path1643"
d="m 324.87,279.77 c 32.01,0 61.01,13.01 82.03,34.02 21.09,21 34.1,50.05 34.1,82.1 0,32.06 -13.01,61.11 -34.02,82.11 l -1.32,1.22 c -20.92,20.29 -49.41,32.8 -80.79,32.8 -32.06,0 -61.1,-13.01 -82.1,-34.02 -21.01,-21 -34.02,-50.05 -34.02,-82.11 0,-32.06 13.01,-61.1 34.02,-82.1 21,-21.01 50.04,-34.02 82.1,-34.02 z M 243.11,38.08 v 54.18 c 0.99,12.93 5.5,23.09 13.42,29.85 8.2,7.01 20.46,10.94 36.69,11.23 l 37.92,-0.04 z m 91.21,120.49 -41.3,-0.04 c -22.49,-0.35 -40.21,-6.4 -52.9,-17.24 -13.23,-11.31 -20.68,-27.35 -22.19,-47.23 l -0.11,-1.74 V 25.29 H 62.87 c -10.34,0 -19.75,4.23 -26.55,11.03 -6.8,6.8 -11.03,16.21 -11.03,26.55 v 336.49 c 0,10.3 4.25,19.71 11.06,26.52 6.8,6.8 16.22,11.05 26.52,11.05 h 119.41 c 2.54,8.79 5.87,17.25 9.92,25.29 H 62.87 c -17.28,0 -33.02,-7.08 -44.41,-18.46 C 7.08,432.37 0,416.64 0,399.36 V 62.87 C 0,45.61 7.08,29.89 18.45,18.51 29.89,7.08 45.61,0 62.87,0 h 173.88 c 4.11,0 7.76,1.96 10.07,5 l 109.39,118.34 c 2.24,2.43 3.34,5.49 3.34,8.55 l 0.03,119.72 c -8.18,-1.97 -16.62,-3.25 -25.26,-3.79 z m -229.76,54.49 c -6.98,0 -12.64,-5.66 -12.64,-12.64 0,-6.99 5.66,-12.65 12.64,-12.65 h 150.49 c 6.98,0 12.65,5.66 12.65,12.65 0,6.98 -5.67,12.64 -12.65,12.64 z m 0,72.3 c -6.98,0 -12.64,-5.66 -12.64,-12.65 0,-6.98 5.66,-12.64 12.64,-12.64 h 142.52 c 3.71,0 7.05,1.6 9.37,4.15 a 149.03,149.03 0 0 0 -30.54,21.14 z m 0,72.3 c -6.98,0 -12.64,-5.66 -12.64,-12.65 0,-6.98 5.66,-12.64 12.64,-12.64 h 86.2 c -3.82,8.05 -6.95,16.51 -9.29,25.29 z m 239.61,-18.85 c 7.41,7.43 4.68,18.9 -3.05,25.23 -7.46,6.01 -20.97,8.92 -28.68,1.83 -7.77,-7.23 -4.68,-18.87 2.76,-25.24 7.18,-6.05 21.39,-9.37 28.97,-1.82 z m -43.88,95 h 6.34 V 392.48 H 294.6 c 0,-16.37 30.05,-5.74 52.18,-11.32 v 52.65 h 8.37 v 17.58 h -54.86 z"
inkscape:connector-curvature="0" /></g></svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -6,7 +6,9 @@
"oxid",
"modules",
"eShop",
"d3"
"d3",
"manufacturer",
"information"
],
"authors": [
{
@ -24,28 +26,22 @@
"proprietary"
],
"require": {
"php": "~7.0 || ~8.0",
"oxid-esales/oxideshop-ce": "v6.6.0 - v6.14.3"
"php": "^8.0",
"oxid-esales/oxideshop-ce": "7.0 - 7.2"
},
"require-dev": {
"phpunit/phpunit" : "^9.5",
"friendsofphp/php-cs-fixer": "^3.9",
"phpstan/phpstan": "^1.8"
},
"extra": {
"oxideshop": {
"blacklist-filter": [
"*.md",
"composer.json",
".php-cs-fixer.php",
"*.neon"
],
"target-directory": "d3/manufacturerinformation"
}
"phpunit/phpunit": "^9.1.1"
},
"autoload": {
"psr-4": {
"D3\\ManufacturerInformation\\": "../../../source/modules/d3/manufacturerinformation"
"D3\\ManufacturerInformation\\": ""
}
},
"scripts": {
"phpunit": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/manufacturerinformation/Tests/ --no-coverage",
"phpunit-coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/manufacturerinformation/Tests/ --coverage-html=vendor/d3/manufacturerinformation/tests/result/coverage",
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/manufacturerinformation/.php-cs-fixer.php",
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/manufacturerinformation/.php-cs-fixer.php"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,13 +1,15 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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>
* @author D3 Data Development - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
@ -17,37 +19,66 @@ use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLong
use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use D3\ManufacturerInformation\Modules\Application\Model\ManufacturerInfoList;
use D3\ManufacturerInformation\Modules\Core\ManufacturerConfig;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList as OEManufacturerList;
use OxidEsales\Eshop\Core\Config as OEConfig;
$sMetadataVersion = '2.1';
$sModuleId = Constants::OXID_MODULE_ID;
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
/**
* Module information
*/
$aModule = [
'id' => $sModuleId,
'title' => $logo.' Herstellerinformationen',
'title' => [
'de' => '(D3) Herstellerinformationen',
'en' => '(D3) Manufacturer information',
],
'description' => [
'de' => 'fügt Informationen der Hersteller zur Artikelliste hinzu',
'en' => 'adds manufacturer information to the article list',
],
'thumbnail' => 'image-file.png',
'version' => '1.1.0.0',
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
'thumbnail' => 'picture.svg',
'version' => '2.0.3.0',
'author' => '(D3) Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class,
],
'extend' => [
OEManufacturer::class => D3ManufacturerLongDesc::class,
OEManufacturerList::class => ManufacturerInfoList::class
OEManufacturerList::class => ManufacturerInfoList::class,
OEConfig::class => ManufacturerConfig::class,
],
'templates' => [
'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl',
],
'settings' => [
[
'group' => $sModuleId.'_main',
'name' => $sModuleId.'_showManufacturertextOnDetailsPage',
'type' => 'bool',
'value' => true,
],
[
'group' => $sModuleId.'_main',
'name' => $sModuleId.'_showManufacturertextOnManufacturerPage',
'type' => 'bool',
'value' => true,
],
],
'blocks' => [
[
'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_manufacturersicon',
'file' => 'Application/views/blocks/page/details/inc/details_productmain_manufacturersicon.html.tpl',
],
[
'template' => 'page/details/inc/tabs.tpl',
'block' => 'details_tabs_invite',
'file' => 'Application/views/blocks/page/details/inc/details_tabs_invite.html.tpl',
],
],
];

View File

@ -1,5 +1,18 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Migrations;
@ -13,27 +26,29 @@ use Doctrine\Migrations\AbstractMigration;
*/
final class Version20241023154223 extends AbstractMigration
{
public function getDescription() : string
public function getDescription(): string
{
return 'Adds the D3 manufacturer longdesc column';
}
public function up(Schema $schema) : void
public function up(Schema $schema): void
{
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$this->d3AddLongdescColumnToOxmanufacturers($schema);
}
public function down(Schema $schema) : void
{}
public function down(Schema $schema): void
{
}
/**
* @param Schema $schema
* @return void
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema){
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema)
{
$table = !$schema->hasTable('oxmanufacturers') ?
$schema->createTable('oxmanufacturers') :
$schema->getTable('oxmanufacturers');

View File

@ -1,5 +1,18 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* 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 - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Migrations;
@ -13,27 +26,29 @@ use Doctrine\Migrations\AbstractMigration;
*/
final class Version20241028172608 extends AbstractMigration
{
public function getDescription() : string
public function getDescription(): string
{
return 'Adds multilang tables for the D3 manufacturer longdesc';
}
public function up(Schema $schema) : void
public function up(Schema $schema): void
{
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$this->d3AddLongdescMultilangColumnsToOxmanufacturers($schema);
}
public function down(Schema $schema) : void
{}
public function down(Schema $schema): void
{
}
/**
* @param Schema $schema
* @return void
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema){
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema)
{
$table = !$schema->hasTable('oxmanufacturers') ?
$schema->createTable('oxmanufacturers') :
$schema->getTable('oxmanufacturers');

View File

@ -1,4 +1,4 @@
name: D3 manufacturerinformation
migrations_namespace: D3\ManufacturerInformation\Migrations
table_name: d3migrations_manufacturerinformation
migrations_directory: data
table_storage:
table_name: d3migrations_manufacturerinformation
migrations_paths:
'D3\ManufacturerInformation\Migrations': data

View File

@ -25,7 +25,7 @@
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
</form>
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__D3DESCRIPTION' );" style="padding: 0px;margin: 0px;height:0px;">
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__d3description' );" style="padding: 0px;margin: 0px;height:0px;">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="fnc" value="">
@ -33,9 +33,11 @@
<input type="hidden" name="voxid" value="[{$oxid}]">
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="[{$oxid}]">
<input type="hidden" name="catlang" value="[{$catlang}]">
<input type="hidden" name="editval[oxmanufacturers__D3DESCRIPTION]" value="">
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
<div style="margin-bottom: 40px">
[{include file="include/category_text_editor.tpl"}]
</div>
</form>
[{include file="bottomnaviitem.tpl"}]

View File

@ -0,0 +1,41 @@
{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}
<script type="text/javascript">
function loadLang(obj)
{
var langvar = document.getElementById("catlang");
if (langvar != null )
langvar.value = obj.value;
document.myedit.submit();
}
</script>
{% if readonly %}
{% set readonly = "readonly disabled" %}
{% else %}
{% set readonly = "" %}
{% endif %}
<form name="transfer" id="transfer" action="{{ oViewConf.getSelfLink() }}" method="post">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="oxid" value="{{ oxid }}">
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="editlanguage" value="{{ editlanguage }}">
</form>
<form name="myedit" id="myedit" action="{{ oViewConf.getSelfLink() }}" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__d3description' );" style="padding: 0px;margin: 0px;height:0px;">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="oxid" value="{{ oxid }}">
<input type="hidden" name="voxid" value="{{ oxid }}">
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="{{ oxid }}">
<input type="hidden" name="catlang" value="{{ catlang }}">
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
{% include "include/category_text_editor.html.twig" %}
</form>
{% include "bottomnaviitem.html.twig" %}
{% include "bottomitem.html.twig" %}

View File

@ -0,0 +1,20 @@
{% extends "page/details/inc/accordeon.html.twig" %}
{% block details_longdescription %}
{{ parent() }}
{% set oManufacturer = oView.getManufacturer() %}
{% set sShopURL = config.getConfigParam('sShopURL') %}
{% set description = oManufacturer.d3GetLongdesc() %}
{% if oManufacturer and config.d3GetBoolModuleSettingByName('_showManufacturertextOnDetailsPage') and description|striptags|trim %}
<div class="col-12 col-md-6">
<div id="manufacturer-collapsible" class="h4" data-bs-target="#manufacturer" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="manufacturer">
{{ translate({ ident: "D3_MANUFACTURERINFO_TAB" }) }}
</div>
<div id="manufacturer" class="collapse" aria-labelledby="manufacturer-collapsible">
{{ include(template_from_string(description)) }}
</div>
</div>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,126 @@
{% extends "page/list/list.html.twig" %}
{% block page_list_listhead %}
{% if listType=='manufacturer' or listType=='vendor'%}
<div class="bg-white list-header mb-4">
<div class="container-xxl">
<div class="row">
<div class="col-12{% if actCategory.getIconUrl() %} col-md-6 order-2 order-md-1 {% endif %}">
{% if showPopBreadcrump %}
<div class="row">
{% include "widget/breadcrumb.html.twig" %}
</div>
{% endif %}
<h1{% if actCategory.oxcategories__oxthumb.value and actCategory.getThumbUrl() %} class="text-white"{% endif %}>
{{ actCategory.getTitle() }}
</h1>
{% if actCategory and actCategory.getShortDescription() and oPageNavigation.actPage == 1 %}
<div id="catDescLocator" class="categoryDescription pb-5">
{{ actCategory.getShortDescription()|raw() }}
</div>
{% endif %}
{% if actCategory.oxcategories__oxlongdesc.value and oPageNavigation.actPage == 1 %}
{% block d3_page_list_long_desc %}
<div id="d3catLongDescLocator" class="categoryDescription">
{{ include(template_from_string(actCategory.oxcategories__oxlongdesc)) }}
</div>
{% endblock %}
{% endif %}
</div>
{% if actCategory.getIconUrl() %}
<div class="col-12 col-md-6 order-1 order-md-1 py-4">
<img src="{{ actCategory.getIconUrl()|raw }}" alt="{{ translate({ ident: "MANUFACTURER_IMAGE_ALT", args: actCategory.getTitle() }) }}">
</div>
{% endif %}
</div>
</div>
</div>
{% else %}
<div class="bg-white list-header mb-4">
<div class="container-xxl">
<div class="row">
<div class="col-12{% if actCategory.oxcategories__oxthumb.value and actCategory.getThumbUrl() %} col-md-6 order-2 order-md-1 {% endif %}">
{% if showPopBreadcrump %}
<div class="row">
{% include "widget/breadcrumb.html.twig" %}
</div>
{% endif %}
<h1 class="h2">
{{ oView.getTitle() }}
</h1>
{% if actCategory and actCategory.getShortDescription() and oPageNavigation.actPage == 1 %}
<div id="catDescLocator" class="categoryDescription pb-3">
{{ actCategory.getShortDescription()|raw() }}
</div>
{% endif %}
{% if actCategory.oxcategories__oxlongdesc.value and oPageNavigation.actPage == 1 %}
{% block page_list_long_desc %}
<div id="catLongDescLocator" class="categoryDescription">
{{ include(template_from_string(actCategory.oxcategories__oxlongdesc)) }}
</div>
{% endblock %}
{% endif %}
</div>
{% if actCategory.oxcategories__oxthumb.value and actCategory.getThumbUrl() %}
<div class="col-12 col-md-6 order-1 order-md-1 py-4 text-right">
<img src="{{ actCategory.getThumbUrl()|raw }}" alt="{{ translate({ ident: "CATEGORY_IMAGE_ALT", args: actCategory.oxcategories__oxtitle.value }) }}" class="w-100 img-fluid">
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% if oView.hasVisibleSubCats() %}
<div class="container-xxl">
{% set iSubCategoriesCount = 0 %}
<div class="cat-list mb-4 pb-3">
{% for category in oView.getSubCatList() %}
{% if category.getIsVisible() %}
{% set iSubCategoriesCount = iSubCategoriesCount+1 %}
{% set iconUrl = category.getIconUrl() %}
{% if listType=='manufacturer' or listType=='vendor' %}
{% set iconAltAttribute = translate({ ident: "MANUFACTURER_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% else %}
{% set iconAltAttribute = translate({ ident: "CATEGORY_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% endif %}
<a href="{{ category.getLink()|raw }}" class="cat-list-item">
{% if iconUrl %}
<img loading="lazy" src="{{ category.getIconUrl()|raw }}" alt="{{ iconAltAttribute }}" class="cat-list-item-img">
{% else %}
<img loading="lazy" src="{{ oViewConf.getImageUrl('subcat-placeholder.png')|raw }}" alt="{{ iconAltAttribute }}" class="cat-list-item-img">
{% endif %}
<span class="cat-list-item-name">
{{ category.oxcategories__oxtitle.value }}
{% if oView.showCategoryArticlesCount() and (category.getNrOfArticles() > 0) %}
<span class="text-muted">({{ category.getNrOfArticles() }})</span>
{% endif %}
</span>
</a>
{% endif %}
{% if category.getContentCats() %}
{% for ocont in category.getContentCats() %}
<a href="{{ ocont.getLink()|raw }}" class="cat-list-item">
{% if listType=='manufacturer' or listType=='vendor' %}
{% set iconAltAttribute = translate({ ident: "MANUFACTURER_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% else %}
{% set iconAltAttribute = translate({ ident: "CATEGORY_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% endif %}
<img loading="lazy" src="{{ oViewConf.getImageUrl('subcat-placeholder.png')|raw }}" alt="{{ iconAltAttribute }}" class="cat-list-item-img">
<span class="cat-list-item-name">
{{ ocont.oxcontents__oxtitle.value }}
</span>
</a>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endblock %}