23 Commits

Author SHA1 Message Date
563741bc86 update version information
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2024-12-05 12:56:46 +01:00
38fa707dea parse manufacturer longdesc through Smarty 2024-12-05 12:56:45 +01:00
39b24479fd generate field long name by shop method, assert return type 2024-12-05 12:56:45 +01:00
4e8a02fba1 remove unused assignment 2024-12-05 12:56:45 +01:00
0d05a3ec49 [Changed] longdesc-textinput-window bottom padding 2024-12-03 16:34:50 +01:00
9b119fb3fb update version information
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2024-11-26 11:18:08 +01:00
ffa41bcd50 update README
# Conflicts:
#	README.md
#	migration/data/Version20241023154223.php
#	migration/data/Version20241028172608.php
2024-11-26 11:16:37 +01:00
04de2369e6 rename incorrect language files by mistake ¯\(°_o)/¯ 2024-11-26 11:15:09 +01:00
c78e3f01df adjust version information 2024-11-21 20:53:46 +01:00
0dc4d5904c change logo 2024-11-21 20:51:26 +01:00
9110687cef make displaying manufacturer information on manufacturer list page configurable 2024-11-21 20:49:53 +01:00
4b408d4970 use customized tab description instead of shared term 2024-11-21 13:52:38 +01:00
969952efcf fix links in changelog
# Conflicts:
#	CHANGELOG.md
2024-11-21 13:52:38 +01:00
ea935ce882 adjust version information
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2024-11-21 11:50:06 +01:00
490792894c improve manufacturer block content 2024-11-21 11:42:12 +01:00
a5f245be9b fix WYSIWYG editor content 2024-11-21 11:42:12 +01:00
1cb629cc67 adjust version information
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2024-11-19 10:58:03 +01:00
e533b349fe improve code style by CS Fixer
# Conflicts:
#	composer.json
#	migration/data/Version20241023154223.php
#	migration/data/Version20241028172608.php
2024-11-19 10:56:15 +01:00
117cce87bd add noencode 2024-11-19 10:55:26 +01:00
a95a1ab768 improve code style
# Conflicts:
#	migration/data/Version20241023154223.php
#	migration/data/Version20241028172608.php
2024-11-19 10:55:26 +01:00
814ea3c193 don't hide "save" button on larger input form 2024-11-19 10:55:02 +01:00
547d3ab1dd show no content if it contains only empty elements 2024-11-19 10:55:01 +01:00
0600d16fc6 fix installation instructions 2024-11-19 08:52:16 +01:00
21 changed files with 675 additions and 227 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,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\Application\Controller\Admin;
@ -12,120 +25,100 @@ use OxidEsales\Eshop\Core\Registry;
class ManufacturerInfoLongdesc extends AdminDetailsController
{
/**
* @return string
*/
public function render()
{
parent::render();
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($sOXID) && $sOXID != "-1") {
// load object
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
if (!isset($d3manufacturerlang)) {
$d3manufacturerlang = $this->_iEditLang;
}
$this->_aViewData["catlang"] = $d3manufacturerlang;
$oManufacturer->loadInLang($d3manufacturerlang, $sOXID);
//Disable editing for derived items
if ($oManufacturer->isDerived()) {
$this->_aViewData['readonly'] = true;
}
foreach (\OxidEsales\Eshop\Core\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");
return "d3manufacturerlongdesc.tpl";
}
/**
* @return void
* @throws \Exception
*/
public function save()
{
parent::save();
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang"));
$sOXID = $this->getEditObjectId();
$this->setEditObjectId($sOXID);
if ($sOXID == "-1") {
return;
}
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
$oManufacturer = oxNew(Manufacturer::class);
$oManufacturer->loadInLang($iManufacturerLang, $sOXID);
if (!$oManufacturer->load($sOXID)) {
return;
}
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
$oManufacturer->assign($aParams);
if (false === is_null($this->d3GetLongdescParamValue())) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
$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
{
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
}
/**
* inhaltliche Uebernahme analog Article_Main
* wird genutzt zum Abspeichern der Artikel-Langbeschreibung
*
* @param $sValue
*
* @return mixed
*/
protected function _processLongDesc($sValue)
{
$aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>'];
$aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', ''];
return str_replace($aSearch, $aReplace, $sValue);
}
}
/**
* @return string
*/
public function render()
{
parent::render();
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($sOXID) && $sOXID != "-1") {
// load object
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
if (!isset($d3manufacturerlang)) {
$d3manufacturerlang = $this->_iEditLang;
}
$this->_aViewData["catlang"] = $d3manufacturerlang;
$oManufacturer->loadInLang($d3manufacturerlang, $sOXID);
//Disable editing for derived items
if ($oManufacturer->isDerived()) {
$this->_aViewData['readonly'] = true;
}
foreach (\OxidEsales\Eshop\Core\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");
return "d3manufacturerlongdesc.tpl";
}
/**
* @return void
* @throws \Exception
*/
public function save()
{
parent::save();
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang"));
$sOXID = $this->getEditObjectId();
$this->setEditObjectId($sOXID);
if ($sOXID == "-1") {
return;
}
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
$oManufacturer = oxNew(Manufacturer::class);
$oManufacturer->loadInLang($iManufacturerLang, $sOXID);
if (!$oManufacturer->load($sOXID)) {
return;
}
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
$oManufacturer->assign($aParams);
if (false === is_null($this->d3GetLongdescParamValue())) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
$oManufacturer->save();
}
}
/**
* @return string
*/
public function d3GetLongdescParamValue(): string
{
return (string) Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
}
/**
* inhaltliche Uebernahme analog Article_Main
* wird genutzt zum Abspeichern der Artikel-Langbeschreibung
*
* @param $sValue
*
* @return mixed
*/
protected function _processLongDesc($sValue)
{
$aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>'];
$aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', ''];
return str_replace($aSearch, $aReplace, $sValue);
}
}

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 OXID_MODULE_ID = 'd3manufacturerinformation';
// Tables and Database
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,13 +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 = array(
$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_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
];

View File

@ -1,13 +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 = array(
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Text',
$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_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
];

View File

@ -35,7 +35,9 @@
<input type="hidden" name="catlang" value="[{$catlang}]">
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
[{include file="include/category_text_editor.tpl"}]
<div style="margin-bottom: 40px; padding-bottom: 60px">
[{include file="include/category_text_editor.tpl"}]
</div>
</form>
[{include file="bottomnaviitem.tpl"}]

View File

@ -1,16 +1,18 @@
[{$smarty.block.parent}]
[{assign var="oConfig" value=$oViewConf->getConfig()}]
[{assign var="oManufacturer" value=$oView->getManufacturer()}]
[{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}]
[{assign var="description" value=$oManufacturer->d3GetLongdesc()}]
[{if $oManufacturer && $oManufacturer->getId()}]
[{assign var="oConfig" value=$oViewConf->getConfig()}]
[{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}]
[{assign var="description" value=$oManufacturer->d3GetLongdesc()}]
[{if $oManufacturer && $oConfig->getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') && $description->value}]
[{capture append="tabs"}]<a href="#manufacturertab" data-toggle="tab">[{oxmultilang ident="MANUFACTURER"}]</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 $oConfig->getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') && $description->rawValue|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,13 +4,44 @@ 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).
## [unreleased](https://git.d3data.de/D3Public/MyModule/compare/1.0.1.0...rel_1.x)
## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.4.0...rel_1.x)
## [1.0.1.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.0.1.0) - 2024-11-18
## [1.0.4.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.3.1...1.0.4.0) - 2024-12-05
### Added
- longdesc will parsed by Smarty
## [1.0.3.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.3.0...1.0.3.1) - 2024-11-26
### Fixed
- rename language files
### Changed
- switch to open source
## [1.0.3.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.2.1...1.0.3.0) - 2024-11-22
### Fixed
- content encoding on manufacturers list page
### Added
- displaying content on manufacturers list page configurable
## [1.0.2.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.2.0...1.0.2.1) - 2024-11-21
### Fixed
- tab class for Wave based theme
- encoding error when using the WYSIWYG editor
## [1.0.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.1.0...1.0.2.0) - 2024-11-19
### Fixed
- show hidden save button
### Added
- hide empty HTML elements content
## [1.0.1.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.0.0.0...1.0.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
## [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,23 @@
<?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;
class D3ManufacturerLongDesc_parent extends Manufacturer {}
}
use OxidEsales\Eshop\Application\Model\Manufacturer;
class D3ManufacturerLongDesc_parent extends Manufacturer
{
}
}

View File

@ -1,10 +1,22 @@
<?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;
@ -12,30 +24,30 @@ use OxidEsales\Eshop\Core\Registry;
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
{
/**
* @param string $sValue
* @return void
*/
public function d3SetLongdesc(string $sValue) :bool
{
if ($this->getId() and $this->isLoaded()){
try {
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
$this->save();
}catch (\Exception $exception){
Registry::getLogger()->error($exception->getMessage());
}
}
return true;
}
/**
* @return Field
*/
public function d3GetLongdesc(): Field
{
$longName = $this->getCoreTableName().'__'.strtolower(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName;
}
}
/**
* @param string $sValue
* @return void
*/
public function d3SetLongdesc(string $sValue): bool
{
if ($this->getId() and $this->isLoaded()) {
try {
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
$this->save();
} catch (\Exception $exception) {
Registry::getLogger()->error($exception->getMessage());
}
}
return true;
}
/**
* @return Field
*/
public function d3GetLongdesc(): Field
{
$longName = $this->_getFieldLongName(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName ?: oxNew(Field::class);
}
}

View File

@ -1,25 +1,55 @@
<?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;
class ManufacturerInfoList extends ManufacturerInfoList_parent
{
/**
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return void
*/
protected function _addCategoryFields($oManufacturer)
{
parent::_addCategoryFields($oManufacturer);
$oManufacturer->oxcategories__oxlongdesc = new Field($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME), Field::T_RAW);
}
}
/**
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return void
*/
protected function _addCategoryFields($oManufacturer)
{
parent::_addCategoryFields($oManufacturer);
if (Registry::getConfig()->getConfigParam('d3manufacturerinformation_showManufacturertextOnManufacturerPage')) {
/** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */
$oUtilsView = Registry::getUtilsView();
$longdesc = $oManufacturer->d3GetLongdesc()->getRawValue() ?? '';
$deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent');
$processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty');
if (!$deactivateSmarty && $processLongDescriptions) {
$longdesc = $oUtilsView->parseThroughSmarty(
$longdesc,
$oManufacturer->getId() . $oManufacturer->getLanguage(),
null,
true
) ?? '';
}
$oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW);
}
}
}

View File

@ -2,8 +2,10 @@
# ![D3 Logo](https://logos.oxidmodule.com/d3logo_24x24.svg) Herstellerinformationen für OXID eShop
Dieses Modul fügt Ihren Herstellereinstellungen einen Tab zur
detaillierten Beschreibung Ihrer Hersteller hinzu.
Fügt die Möglichkeit zur Langtextbeschreibung den Herstellern hinzu. Die Anzeige der Informationen erfolgt einstellbar auf der Herstellerübersicht und/oder als Infotab an den Artikeln der Herstellers.
**Diese Software wird unter einer kommerziellen Lizenz vertrieben.**
Kontaktieren Sie uns für eine Nutzungslizenz vor der Installation.
## Inhaltsverzeichnis
@ -16,9 +18,9 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie die folgenden Befehle aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
```bash
composer require d3/manufacturerinformation:"~1.0"
composer config repositories.d3manufacturerinformation vcs https://git.d3data.de/D3Public/manufacturer-information.git
composer require d3/manufacturerinformation:"~1.0.0"
```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
@ -27,7 +29,6 @@ Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
Aktualisieren Sie anschließend die Datenbank-Views und leeren den Temp Ordner des Shops.
## Lizenz
(Stand: 13.11.2024)

View File

@ -27,11 +27,7 @@
"php": ">=7.0",
"oxid-esales/oxideshop-ce": "v6.0 - v6.5.6"
},
"require-dev": {
"phpunit/phpunit" : "^9.5",
"friendsofphp/php-cs-fixer": "^3.9",
"phpstan/phpstan": "^1.8"
},
"require-dev": {},
"extra": {
"oxideshop": {
"blacklist-filter": [
@ -47,5 +43,9 @@
"psr-4": {
"D3\\ManufacturerInformation\\": "../../../source/modules/d3/manufacturerinformation"
}
},
"scripts": {
"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,18 +1,20 @@
<?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
*/
declare(strict_types=1);
use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLongdesc;
use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Events\Events;
@ -36,31 +38,37 @@ $aModule = [
'de' => 'fügt Informationen der Hersteller zur Artikelliste hinzu',
'en' => 'adds manufacturer information to the article list',
],
'thumbnail' => 'image-file.png',
'version' => '1.0.1.0',
'thumbnail' => 'picture.svg',
'version' => '1.0.4.0',
'author' => $logo.' 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
OEManufacturer::class => D3ManufacturerLongDesc::class,
OEManufacturerList::class => ManufacturerInfoList::class,
],
'events' => [
'onActivate' => Events::class.'::activate',
'onDeactivate' => Events::class.'::deActivate',
],
'templates' => [
'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl',
'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl',
],
'settings' => [
[
'group' => $sModuleId.'_main',
'name' => $sModuleId.'_showManufacturertextOnDetailsPage',
'type' => 'bool',
'value' => true
'value' => true,
],
[
'group' => $sModuleId.'_main',
'name' => $sModuleId.'_showManufacturertextOnManufacturerPage',
'type' => 'bool',
'value' => true,
],
],
'blocks' => [
@ -74,5 +82,5 @@ $aModule = [
'block' => 'details_tabs_invite',
'file' => 'Application/views/blocks/page/details/inc/details_tabs_invite.html.tpl',
],
]
],
];

192
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