Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
77cb1d4594 | |||
449f901976 | |||
8794a005d7 | |||
4c374ff39c | |||
8f046ed231 | |||
8d3421450b | |||
b46175f5ab | |||
99ea814987 | |||
38b12bc3c0 | |||
ebb9450812 | |||
64a70921c5 | |||
ab0ea6cea7 | |||
fe7f3aa621 | |||
2882aac57e | |||
8eaa97d889 | |||
2ef3223e86 | |||
58663d9918 | |||
b5b4268335 | |||
dfd4367066 | |||
e61438f937 | |||
1c2ee9f4f0 | |||
1dc39f4fdd | |||
c9ac21c4bb | |||
21e6d764cc | |||
bf30cf85dc | |||
56d8bbdd72 | |||
c215ef5eef | |||
ce264a357e | |||
75beb308d8 | |||
00a8017731 | |||
67f7bcb77f | |||
6e960b34b2 | |||
67240260b2 | |||
58ef4bb533 | |||
3e30e0491b | |||
a7dfae8c5d |
1
.noencode
Normal file
1
.noencode
Normal file
@ -0,0 +1 @@
|
|||||||
|
copyAsIsFiles=metadata.php, .php-cs-fixer.php, IntelliSenseHelper.php, migration, Application/views
|
34
.php-cs-fixer.php
Normal file
34
.php-cs-fixer.php
Normal 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)
|
||||||
|
;
|
@ -1,5 +1,18 @@
|
|||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Application\Controller\Admin;
|
namespace D3\ManufacturerInformation\Application\Controller\Admin;
|
||||||
@ -12,120 +25,118 @@ use OxidEsales\Eshop\Core\Registry;
|
|||||||
|
|
||||||
class ManufacturerInfoLongdesc extends AdminDetailsController
|
class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
parent::render();
|
parent::render();
|
||||||
|
|
||||||
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
|
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
|
||||||
|
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
|
||||||
|
|
||||||
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
|
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
|
||||||
if (isset($sOXID) && $sOXID != "-1") {
|
if (isset($sOXID) && $sOXID != "-1") {
|
||||||
// load object
|
// load object
|
||||||
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
|
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang");
|
||||||
|
|
||||||
if (!isset($d3manufacturerlang)) {
|
if (!isset($d3manufacturerlang)) {
|
||||||
$d3manufacturerlang = $this->_iEditLang;
|
$d3manufacturerlang = $this->_iEditLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_aViewData["catlang"] = $d3manufacturerlang;
|
$this->_aViewData["catlang"] = $d3manufacturerlang;
|
||||||
|
|
||||||
$oManufacturer->loadInLang($d3manufacturerlang, $sOXID);
|
$oManufacturer->loadInLang($d3manufacturerlang, $sOXID);
|
||||||
|
|
||||||
//Disable editing for derived items
|
//Disable editing for derived items
|
||||||
if ($oManufacturer->isDerived()) {
|
if ($oManufacturer->isDerived()) {
|
||||||
$this->_aViewData['readonly'] = true;
|
$this->_aViewData['readonly'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
|
foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
|
||||||
$oLang = new \stdClass();
|
$oLang = new \stdClass();
|
||||||
$oLang->sLangDesc = $language;
|
$oLang->sLangDesc = $language;
|
||||||
$oLang->selected = ($id == $this->_iEditLang);
|
$oLang->selected = ($id == $this->_iEditLang);
|
||||||
$this->_aViewData["otherlang"][$id] = clone $oLang;
|
$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
|
* @return void
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
parent::save();
|
parent::save();
|
||||||
|
|
||||||
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang"));
|
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang"));
|
||||||
$sOXID = $this->getEditObjectId();
|
$sOXID = $this->getEditObjectId();
|
||||||
$this->setEditObjectId($sOXID);
|
$this->setEditObjectId($sOXID);
|
||||||
|
|
||||||
if ($sOXID == "-1") {
|
if ($sOXID == "-1") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
|
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
|
||||||
$oManufacturer = oxNew(Manufacturer::class);
|
$oManufacturer = oxNew(Manufacturer::class);
|
||||||
$oManufacturer->loadInLang($iManufacturerLang, $sOXID);
|
$oManufacturer->loadInLang($iManufacturerLang, $sOXID);
|
||||||
|
|
||||||
if (!$oManufacturer->load($sOXID)) {
|
if (!$oManufacturer->load($sOXID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
|
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
|
||||||
$oManufacturer->assign($aParams);
|
$oManufacturer->assign($aParams);
|
||||||
|
|
||||||
if (false === is_null($this->d3GetLongdescParamValue())) {
|
if (false === is_null($this->d3GetLongdescParamValue($oManufacturer))) {
|
||||||
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
|
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue($oManufacturer));
|
||||||
$oManufacturer->save();
|
$oManufacturer->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns string which must be edited by editor
|
* @param $oManufacturer
|
||||||
*
|
* @param $sField
|
||||||
* @param \OxidEsales\Eshop\Core\Model\BaseModel $oObject object with field will be used for editing
|
* @return string
|
||||||
* @param string $sField name of editable field
|
*/
|
||||||
*
|
protected function getEditValue($oManufacturer, $sField)
|
||||||
* @return string
|
{
|
||||||
* @deprecated underscore prefix violates PSR12, will be renamed to "getEditValue" in next major
|
$sEditObjectValue = '';
|
||||||
*/
|
|
||||||
protected function _getEditValue($oManufacturer, $sField) // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
|
||||||
{
|
|
||||||
$sEditObjectValue = '';
|
|
||||||
|
|
||||||
if ($oManufacturer and $oManufacturer->getId()) {
|
if ($oManufacturer and $oManufacturer->getId()) {
|
||||||
$sEditObjectValue = $this->_processEditValue($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME));
|
$sEditObjectValue = $oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sEditObjectValue;
|
return $sEditObjectValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
|
||||||
*/
|
* @return string
|
||||||
public function d3GetLongdescParamValue() :string
|
*/
|
||||||
{
|
public function d3GetLongdescParamValue(Manufacturer $oManufacturer): string
|
||||||
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__D3DESCRIPTION'];
|
{
|
||||||
}
|
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")[$oManufacturer->getD3LongDescTableColumnName()];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* inhaltliche Uebernahme analog Article_Main
|
* inhaltliche Uebernahme analog Article_Main
|
||||||
* wird genutzt zum Abspeichern der Artikel-Langbeschreibung
|
* wird genutzt zum Abspeichern der Artikel-Langbeschreibung
|
||||||
*
|
*
|
||||||
* @param $sValue
|
* @param $sValue
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function _processLongDesc($sValue)
|
protected function processLongDesc($sValue)
|
||||||
{
|
{
|
||||||
$aSearch = ['&nbsp;', '&', '"', '&lang=', '<p> </p>', '<p> </p>'];
|
$aSearch = ['&nbsp;', '&', '"', '&lang=', '<p> </p>', '<p> </p>'];
|
||||||
$aReplace = [' ', '&', '"', '&lang=', '', ''];
|
$aReplace = [' ', '&', '"', '&lang=', '', ''];
|
||||||
|
|
||||||
return str_replace($aSearch, $aReplace, $sValue);
|
return str_replace($aSearch, $aReplace, $sValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,14 +1,26 @@
|
|||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Application\Model;
|
namespace D3\ManufacturerInformation\Application\Model;
|
||||||
|
|
||||||
|
|
||||||
class Constants
|
class Constants
|
||||||
{
|
{
|
||||||
public const OXID_MODULE_ID = 'd3manufacturerinformation';
|
public const OXID_MODULE_ID = 'd3manufacturerinformation';
|
||||||
|
|
||||||
// Tables and Database
|
// Tables and Database
|
||||||
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'D3DESCRIPTION';
|
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'd3description';
|
||||||
}
|
}
|
@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$sLangName = "Deutsch";
|
|
||||||
// -------------------------------
|
|
||||||
// RESOURCE IDENTITFIER = STRING
|
|
||||||
// -------------------------------
|
|
||||||
$aLang = array(
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
|
|
||||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
|
||||||
);
|
|
@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$sLangName = "Deutsch";
|
|
||||||
// -------------------------------
|
|
||||||
// RESOURCE IDENTITFIER = STRING
|
|
||||||
// -------------------------------
|
|
||||||
$aLang = array(
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
|
|
||||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
|
||||||
);
|
|
@ -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
|
||||||
|
*/
|
||||||
|
|
||||||
|
$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',
|
||||||
|
];
|
@ -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
|
||||||
|
*/
|
||||||
|
|
||||||
|
$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',
|
||||||
|
];
|
@ -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
|
||||||
|
*/
|
||||||
|
|
||||||
|
$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',
|
||||||
|
];
|
@ -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
|
||||||
|
*/
|
||||||
|
|
||||||
|
$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',
|
||||||
|
];
|
@ -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}]
|
@ -0,0 +1,16 @@
|
|||||||
|
[{$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 && $oConfig->getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') && $description->rawValue|strip_tags|trim}]
|
||||||
|
[{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}]
|
33
CHANGELOG.md
33
CHANGELOG.md
@ -4,6 +4,39 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.1.1.0...1.1.2.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/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/D3Public/MyModule/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/D3Public/MyModule/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/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2024-11-13
|
## [1.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2024-11-13
|
||||||
### Added
|
### Added
|
||||||
- installability OXID 6.2.3 - 6.5.x
|
- installability OXID 6.2.3 - 6.5.x
|
||||||
|
@ -1,21 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Software is the property of Data Development and is protected
|
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
* by copyright law - it is NOT Freeware.
|
*
|
||||||
* Any unauthorized use of this software without a valid license
|
* For the full copyright and license information, please view
|
||||||
* is a violation of the license agreement and will be prosecuted by
|
* the LICENSE file that was distributed with this source code.
|
||||||
* civil and criminal law.
|
*
|
||||||
* http://www.shopmodule.com
|
* https://www.d3data.de
|
||||||
*
|
*
|
||||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
* @author D3 Data Development - Max Buhe, Daniel Seifert <info@shopmodule.com>
|
||||||
* @link http://www.oxidmodule.com
|
* @link https://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Modules\Application\Model{
|
namespace D3\ManufacturerInformation\Modules\Application\Model{
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
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
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,39 +1,59 @@
|
|||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
||||||
|
|
||||||
|
|
||||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $sValue
|
* @param string $sValue
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
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 {
|
try {
|
||||||
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
|
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
|
||||||
$this->save();
|
$this->save();
|
||||||
}catch (\Exception $exception){
|
} catch (\Exception $exception) {
|
||||||
Registry::getLogger()->error($exception->getMessage());
|
Registry::getLogger()->error($exception->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function d3GetLongdesc(): string
|
public function d3GetLongdesc(): string
|
||||||
{
|
{
|
||||||
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getD3LongDescTableColumnName(): string
|
||||||
|
{
|
||||||
|
return $sParamName = $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,10 +1,22 @@
|
|||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
||||||
|
|
||||||
|
|
||||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||||
use OxidEsales\Eshop\Application\Model\ManufacturerList;
|
use OxidEsales\Eshop\Application\Model\ManufacturerList;
|
||||||
@ -12,14 +24,14 @@ use OxidEsales\Eshop\Core\Field;
|
|||||||
|
|
||||||
class ManufacturerInfoList extends ManufacturerInfoList_parent
|
class ManufacturerInfoList extends ManufacturerInfoList_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
|
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _addCategoryFields($oManufacturer)
|
protected function addCategoryFields($oManufacturer)
|
||||||
{
|
{
|
||||||
parent::_addCategoryFields($oManufacturer);
|
parent::addCategoryFields($oManufacturer);
|
||||||
|
|
||||||
$oManufacturer->oxcategories__oxlongdesc = new Field($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME), Field::T_RAW);
|
$oManufacturer->oxcategories__oxlongdesc = new Field($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME), Field::T_RAW);
|
||||||
}
|
}
|
||||||
}
|
}
|
16
README.md
16
README.md
@ -17,24 +17,26 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
|
|||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer require d3/manufacturerinformation:"~1.1"
|
composer require d3/manufacturerinformation:"~2.0.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
||||||
|
|
||||||
|
```bash
|
||||||
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
|
./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:i source/modules/d3/manufacturerinformation
|
||||||
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
|
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
|
||||||
./vendor/bin/oe-console o:m:act d3manufacturerinformation
|
./vendor/bin/oe-console o:m:act d3manufacturerinformation
|
||||||
|
|
||||||
|
./vendor/bin/oe-eshop-db_views_generate
|
||||||
```
|
```
|
||||||
|
|
||||||
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
Leeren Sie anschlieĂźend den Temp Ordner des Shops.
|
||||||
|
|
||||||
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
|
||||||
|
|
||||||
Aktualisieren Sie anschlieĂźend die Datenbank-Views und leeren den Temp Ordner des Shops.
|
|
||||||
|
|
||||||
|
|
||||||
## Lizenz
|
## Lizenz
|
||||||
(Stand: 13.11.2024)
|
(Stand: 16.11.2024)
|
||||||
|
|
||||||
```
|
```
|
||||||
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@ -6,7 +6,9 @@
|
|||||||
"oxid",
|
"oxid",
|
||||||
"modules",
|
"modules",
|
||||||
"eShop",
|
"eShop",
|
||||||
"d3"
|
"d3",
|
||||||
|
"manufacturer",
|
||||||
|
"information"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
@ -24,28 +26,20 @@
|
|||||||
"proprietary"
|
"proprietary"
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "~7.0 || ~8.0",
|
"php": "^8.0",
|
||||||
"oxid-esales/oxideshop-ce": "v6.6.0 - v6.14.3"
|
"oxid-esales/oxideshop-ce": "7.0 - 7.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit" : "^9.5",
|
"oxid-esales/oxideshop-ce": "~6.14.0",
|
||||||
"friendsofphp/php-cs-fixer": "^3.9",
|
"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"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"D3\\ManufacturerInformation\\": "../../../source/modules/d3/manufacturerinformation"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
50
metadata.php
50
metadata.php
@ -1,13 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
* file that was distributed with this source code.
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
*
|
*
|
||||||
* https://www.d3data.de
|
* https://www.d3data.de
|
||||||
*
|
*
|
||||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
* @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
|
* @link https://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -22,32 +24,52 @@ use OxidEsales\Eshop\Application\Model\ManufacturerList as OEManufacturerList;
|
|||||||
|
|
||||||
$sMetadataVersion = '2.1';
|
$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
|
* Module information
|
||||||
*/
|
*/
|
||||||
$aModule = [
|
$aModule = [
|
||||||
'id' => $sModuleId,
|
'id' => Constants::OXID_MODULE_ID,
|
||||||
'title' => $logo.' Herstellerinformationen',
|
'title' => [
|
||||||
|
'de' => '(D3) Herstellerinformationen',
|
||||||
|
'en' => '(D3) Manufacturer information',
|
||||||
|
],
|
||||||
'description' => [
|
'description' => [
|
||||||
'de' => 'fĂĽgt Informationen der Hersteller zur Artikelliste hinzu',
|
'de' => 'fĂĽgt Informationen der Hersteller zur Artikelliste hinzu',
|
||||||
'en' => 'adds manufacturer information to the article list',
|
'en' => 'adds manufacturer information to the article list',
|
||||||
],
|
],
|
||||||
'thumbnail' => 'image-file.png',
|
'thumbnail' => 'image-file.png',
|
||||||
'version' => '1.1.0.0',
|
'version' => '2.1.0.0',
|
||||||
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
|
'author' => '(D3) Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
'controllers' => [
|
'controllers' => [
|
||||||
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class
|
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class,
|
||||||
],
|
],
|
||||||
'extend' => [
|
'extend' => [
|
||||||
OEManufacturer::class => D3ManufacturerLongDesc::class,
|
OEManufacturer::class => D3ManufacturerLongDesc::class,
|
||||||
OEManufacturerList::class => ManufacturerInfoList::class
|
OEManufacturerList::class => ManufacturerInfoList::class,
|
||||||
],
|
],
|
||||||
'templates' => [
|
'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' => Constants::OXID_MODULE_ID.'_main',
|
||||||
|
'name' => Constants::OXID_MODULE_ID.'_showManufacturertextOnDetailsPage',
|
||||||
|
'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',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -1,5 +1,18 @@
|
|||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Migrations;
|
namespace D3\ManufacturerInformation\Migrations;
|
||||||
@ -13,36 +26,38 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20241023154223 extends AbstractMigration
|
final class Version20241023154223 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function getDescription() : string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Adds the D3 manufacturer longdesc column';
|
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->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
|
||||||
|
|
||||||
$this->d3AddLongdescColumnToOxmanufacturers($schema);
|
$this->d3AddLongdescColumnToOxmanufacturers($schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Doctrine\DBAL\Schema\SchemaException
|
* @throws \Doctrine\DBAL\Schema\SchemaException
|
||||||
*/
|
*/
|
||||||
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema){
|
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema)
|
||||||
$table = !$schema->hasTable('oxmanufacturers') ?
|
{
|
||||||
$schema->createTable('oxmanufacturers') :
|
$table = !$schema->hasTable('oxmanufacturers') ?
|
||||||
$schema->getTable('oxmanufacturers');
|
$schema->createTable('oxmanufacturers') :
|
||||||
|
$schema->getTable('oxmanufacturers');
|
||||||
|
|
||||||
// Beschreibung
|
// Beschreibung
|
||||||
if (!$table->hasColumn('D3DESCRIPTION')) {
|
if (!$table->hasColumn('D3DESCRIPTION')) {
|
||||||
$table->addColumn('D3DESCRIPTION', (new TextType())->getName())
|
$table->addColumn('D3DESCRIPTION', (new TextType())->getName())
|
||||||
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
||||||
->setNotnull(true);
|
->setNotnull(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,18 @@
|
|||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\ManufacturerInformation\Migrations;
|
namespace D3\ManufacturerInformation\Migrations;
|
||||||
@ -13,50 +26,52 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20241028172608 extends AbstractMigration
|
final class Version20241028172608 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function getDescription() : string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Adds multilang tables for the D3 manufacturer longdesc';
|
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->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
|
||||||
|
|
||||||
$this->d3AddLongdescMultilangColumnsToOxmanufacturers($schema);
|
$this->d3AddLongdescMultilangColumnsToOxmanufacturers($schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Doctrine\DBAL\Schema\SchemaException
|
* @throws \Doctrine\DBAL\Schema\SchemaException
|
||||||
*/
|
*/
|
||||||
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema){
|
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema)
|
||||||
$table = !$schema->hasTable('oxmanufacturers') ?
|
{
|
||||||
$schema->createTable('oxmanufacturers') :
|
$table = !$schema->hasTable('oxmanufacturers') ?
|
||||||
$schema->getTable('oxmanufacturers');
|
$schema->createTable('oxmanufacturers') :
|
||||||
|
$schema->getTable('oxmanufacturers');
|
||||||
|
|
||||||
// lang 1
|
// lang 1
|
||||||
if (!$table->hasColumn('D3DESCRIPTION_1')) {
|
if (!$table->hasColumn('D3DESCRIPTION_1')) {
|
||||||
$table->addColumn('D3DESCRIPTION_1', (new TextType())->getName())
|
$table->addColumn('D3DESCRIPTION_1', (new TextType())->getName())
|
||||||
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
||||||
->setNotnull(true);
|
->setNotnull(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// lang 2
|
// lang 2
|
||||||
if (!$table->hasColumn('D3DESCRIPTION_2')) {
|
if (!$table->hasColumn('D3DESCRIPTION_2')) {
|
||||||
$table->addColumn('D3DESCRIPTION_2', (new TextType())->getName())
|
$table->addColumn('D3DESCRIPTION_2', (new TextType())->getName())
|
||||||
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
||||||
->setNotnull(true);
|
->setNotnull(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// lang 3
|
// lang 3
|
||||||
if (!$table->hasColumn('D3DESCRIPTION_3')) {
|
if (!$table->hasColumn('D3DESCRIPTION_3')) {
|
||||||
$table->addColumn('D3DESCRIPTION_3', (new TextType())->getName())
|
$table->addColumn('D3DESCRIPTION_3', (new TextType())->getName())
|
||||||
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
|
||||||
->setNotnull(true);
|
->setNotnull(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name: D3 manufacturerinformation
|
table_storage:
|
||||||
migrations_namespace: D3\ManufacturerInformation\Migrations
|
table_name: d3migrations_manufacturerinformation
|
||||||
table_name: d3migrations_manufacturerinformation
|
migrations_paths:
|
||||||
migrations_directory: data
|
'D3\ManufacturerInformation\Migrations': data
|
@ -25,7 +25,7 @@
|
|||||||
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
|
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
|
||||||
</form>
|
</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()}]
|
[{$oViewConf->getHiddenSid()}]
|
||||||
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
|
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
|
||||||
<input type="hidden" name="fnc" value="">
|
<input type="hidden" name="fnc" value="">
|
||||||
@ -33,9 +33,11 @@
|
|||||||
<input type="hidden" name="voxid" value="[{$oxid}]">
|
<input type="hidden" name="voxid" value="[{$oxid}]">
|
||||||
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="[{$oxid}]">
|
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="[{$oxid}]">
|
||||||
<input type="hidden" name="catlang" value="[{$catlang}]">
|
<input type="hidden" name="catlang" value="[{$catlang}]">
|
||||||
<input type="hidden" name="editval[oxmanufacturers__D3DESCRIPTION]" value="">
|
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
|
||||||
|
|
||||||
[{include file="include/category_text_editor.tpl"}]
|
<div style="margin-bottom: 40px">
|
||||||
|
[{include file="include/category_text_editor.tpl"}]
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
[{include file="bottomnaviitem.tpl"}]
|
[{include file="bottomnaviitem.tpl"}]
|
41
views/twig/admin/d3manufacturerlongdesc.html.twig
Normal file
41
views/twig/admin/d3manufacturerlongdesc.html.twig
Normal 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" %}
|
@ -0,0 +1,14 @@
|
|||||||
|
{% extends "page/details/inc/productmain.html.twig" %}
|
||||||
|
|
||||||
|
{% block details_productmain_manufacturersicon %}
|
||||||
|
{% if oManufacturer.oxmanufacturers__oxicon.value %}
|
||||||
|
{{ parent() }}
|
||||||
|
{% else %}
|
||||||
|
<div class="action-links text-left">
|
||||||
|
<a href="{{ oManufacturer.getLink() }}" title="{{ oManufacturer.oxmanufacturers__oxtitle.value }}">
|
||||||
|
{{ translate({ ident: "MANUFACTURER", suffix: "COLON" }) }} {{ oManufacturer.oxmanufacturers__oxtitle.value }}
|
||||||
|
</a>
|
||||||
|
<span itemprop="brand" class="hidden">{{ oManufacturer.oxmanufacturers__oxtitle.value }}</span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
@ -0,0 +1,20 @@
|
|||||||
|
{% extends "page/details/inc/tabs.html.twig" %}
|
||||||
|
|
||||||
|
{% block details_tabs_invite %}
|
||||||
|
{{ parent() }}
|
||||||
|
|
||||||
|
{% set oConfig = oViewConf.getConfig() %}
|
||||||
|
{% set oManufacturer = oView.getManufacturer() %}
|
||||||
|
{% set sShopURL = oConfig.getConfigParam('sShopURL') %}
|
||||||
|
{% set description = oManufacturer.d3GetLongdesc() %}
|
||||||
|
|
||||||
|
{% if oManufacturer and oConfig.getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') and description.rawValue|striptags|trim %}
|
||||||
|
{% capture append = "tabs" %}<a href="#manufacturertab" data-toggle="tab">{{ translate({ ident: "MANUFACTURER" }) }}</a>{% endcapture %}
|
||||||
|
{% capture append = "tabsContent" %}
|
||||||
|
<div id="manufacturertab" class="tab-pane{% if blFirstTab %} active{% endif %}">
|
||||||
|
{{ include(template_from_string(description)) }}
|
||||||
|
</div>
|
||||||
|
{% set blFirstTab = false %}
|
||||||
|
{% endcapture %}
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
126
views/twig/extensions/themes/default/page/list/list.html.twig
Normal file
126
views/twig/extensions/themes/default/page/list/list.html.twig
Normal 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 %}
|
Loading…
x
Reference in New Issue
Block a user