30 Commits

Author SHA1 Message Date
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
58f1bd33b6 adjust version information
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2024-11-18 16:08:09 +01:00
f26fafda5f change description property name to lowercase (UC is not allowed in OXID), fix HTML entity encode 2024-11-18 16:06:34 +01:00
35ba3478ac make displaying manufacturer tab on details page configurable 2024-11-18 16:06:34 +01:00
2ea2b0f09f display manufacturer content as additional tab on article details page 2024-11-18 16:06:34 +01:00
4cc8391a0a show manufacturer on article details page if manufacturer hasn't an icon 2024-11-18 16:06:34 +01:00
d72a9414f5 update installation instructions 2024-11-18 16:06:30 +01:00
f9d179cf46 [Fixed] Events column types 2024-11-13 22:53:18 +01:00
62f421de26 [Fixed] readme 2024-11-13 22:49:26 +01:00
3beaf1f112 [Changed] readme content 2024-11-13 22:48:36 +01:00
2ebf7650b6 [Removed] dev files 2024-11-13 22:48:36 +01:00
36401177b9 [Fixed] description
[Removed] unnecessary metadata entries
2024-11-13 22:48:36 +01:00
a88866fbaf typo 2024-11-13 22:47:25 +01:00
5344476d62 [Fixed] license 2024-11-13 22:47:24 +01:00
acd9c5a420 [Fixed] defined composer installable 2024-11-07 19:02:26 +01:00
15ada9deac [Removed] unnecessary infos 2024-11-05 20:33:12 +01:00
764df09b17 [Update] descriptions 2024-11-05 20:30:42 +01:00
630f0c68bb [Fixed] sql statement 2024-11-05 20:23:32 +01:00
d3f1f74e89 [Removed] migrations
not working anyway; making module more light-weight
2024-11-05 20:02:44 +01:00
0a38b8a5d6 [Added] event handling 2024-11-05 20:02:14 +01:00
800ae296b5 [Changed] composer reqs 2024-11-05 19:43:48 +01:00
24 changed files with 138 additions and 532 deletions

View File

@ -1,10 +1,10 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$header = <<<EOF
$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
@ -16,19 +16,19 @@ https://www.d3data.de
@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)
$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

@ -32,13 +32,12 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
{
parent::render();
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
$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::getRequest()->getRequestEscapedParameter("catlang");
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
if (!isset($d3manufacturerlang)) {
$d3manufacturerlang = $this->_iEditLang;
@ -61,9 +60,9 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
}
}
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, $oManufacturer->getD3LongDescTableColumnName(), "list.css");
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__d3description", "list.tpl.css");
return "@d3manufacturerinformation/admin/d3manufacturerlongdesc";
return "d3manufacturerlongdesc.tpl";
}
/**
@ -74,7 +73,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
{
parent::save();
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang"));
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang"));
$sOXID = $this->getEditObjectId();
$this->setEditObjectId($sOXID);
@ -93,35 +92,18 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
$oManufacturer->assign($aParams);
if (false === is_null($this->d3GetLongdescParamValue($oManufacturer))) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue($oManufacturer));
if (false === is_null($this->d3GetLongdescParamValue())) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
$oManufacturer->save();
}
}
/**
* @param $oManufacturer
* @param $sField
* @return string
*/
protected function getEditValue($oManufacturer, $sField)
public function d3GetLongdescParamValue(): string
{
$sEditObjectValue = '';
if ($oManufacturer and $oManufacturer->getId()) {
$sEditObjectValue = $oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
}
return $sEditObjectValue;
}
/**
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return string
*/
public function d3GetLongdescParamValue(Manufacturer $oManufacturer): string
{
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")[$oManufacturer->getD3LongDescTableColumnName()];
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
}
/**
@ -132,7 +114,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
*
* @return mixed
*/
protected function processLongDesc($sValue)
protected function _processLongDesc($sValue)
{
$aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>'];
$aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', ''];

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: 0;margin: 0;height:0;">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="fnc" value="">

View File

@ -1,26 +0,0 @@
<?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',
];

View File

@ -1,26 +0,0 @@
<?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',
];

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->rawValue|strip_tags|trim}]
[{capture append="tabs"}]<a href="#manufacturertab" data-toggle="tab">[{oxmultilang ident="MANUFACTURER"}]</a>[{/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="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}]
<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,42 +4,25 @@ 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).
## [2.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.1.1.0...1.1.2.0) - 2024-11-20
## [unreleased](https://git.d3data.de/D3Public/MyModule/compare/1.0.2.1...rel_1.x)
## [1.0.2.1](https://git.d3data.de/D3Public/MyModule/compare/1.0.2.0...1.0.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
- tab class for Wave based theme
- encoding error when using the WYSIWYG editor
### 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
## [1.0.2.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.1.0...1.0.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
## [1.0.1.0](https://git.d3data.de/D3Public/MyModule/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
### 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
### 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
- initial release

45
Events/Events.php Normal file
View File

@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace D3\ManufacturerInformation\Events;
use OxidEsales\Eshop\Core\DatabaseProvider;
class Events
{
public static function activate()
{
self::d3AddLongdescColumnsToOxmanufacturers();
}
public static function deActivate()
{
}
/**
* @return bool
* @throws Exception
*/
protected static function d3AddLongdescColumnsToOxmanufacturers()
{
try {
DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->execute("
ALTER TABLE oxmanufacturers ADD COLUMN D3DESCRIPTION TEXT NOT NULL DEFAULT '';
ALTER TABLE oxmanufacturers ADD COLUMN D3DESCRIPTION_1 TEXT NOT NULL DEFAULT '';
ALTER TABLE oxmanufacturers ADD COLUMN D3DESCRIPTION_2 TEXT NOT NULL DEFAULT '';
ALTER TABLE oxmanufacturers ADD COLUMN D3DESCRIPTION_3 TEXT NOT NULL DEFAULT '';
");
} catch (\Exception $e) {
if ((string)$e->getCode() === '1054') {
return true;
}
throw $e;
}
return false;
}
}

View File

@ -16,13 +16,8 @@
namespace D3\ManufacturerInformation\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList;
class D3ManufacturerLongDesc_parent extends Manufacturer
{
}
class ManufacturerInfoList_parent extends ManufacturerList
{
}
}

View File

@ -19,6 +19,7 @@ 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
@ -42,18 +43,11 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
}
/**
* @return string
* @return Field
*/
public function d3GetLongdesc(): string
public function d3GetLongdesc(): Field
{
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
}
/**
* @return string
*/
public function getD3LongDescTableColumnName(): string
{
return $sParamName = $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
$longName = $this->getCoreTableName().'__'.strtolower(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName;
}
}

View File

@ -28,9 +28,9 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @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);
}

View File

@ -2,7 +2,8 @@
# ![D3 Logo](https://logos.oxidmodule.com/d3logo_24x24.svg) Herstellerinformationen fĂĽr OXID eShop
Fügt die Möglichkeit zur Langtextbeschreibung den Hersteller hinzu
Dieses Modul fĂĽgt Ihren Herstellereinstellungen einen Tab zur
detaillierten Beschreibung Ihrer Hersteller hinzu.
## Inhaltsverzeichnis
@ -15,28 +16,18 @@ 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:"~2.0.0"
composer require d3/manufacturerinformation:"~1.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-console o:m:i source/modules/d3/manufacturerinformation
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
./vendor/bin/oe-console o:m:act d3manufacturerinformation
./vendor/bin/oe-eshop-db_views_generate
```
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
(Stand: 16.11.2024)
(Stand: 13.11.2024)
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)

View File

@ -6,9 +6,7 @@
"oxid",
"modules",
"eShop",
"d3",
"manufacturer",
"information"
"d3"
],
"authors": [
{
@ -26,16 +24,24 @@
"proprietary"
],
"require": {
"php": "^8.0",
"oxid-esales/oxideshop-ce": "7.0 - 7.1"
"php": ">=7.0",
"oxid-esales/oxideshop-ce": "v6.0 - v6.5.6"
},
"require-dev": {
"oxid-esales/oxideshop-ce": "~6.14.0",
"friendsofphp/php-cs-fixer": "^3.9"
"require-dev": {},
"extra": {
"oxideshop": {
"blacklist-filter": [
"*.md",
"composer.json",
".php-cs-fixer.php",
"*.neon"
],
"target-directory": "d3/manufacturerinformation"
}
},
"autoload": {
"psr-4": {
"D3\\ManufacturerInformation\\": ""
"D3\\ManufacturerInformation\\": "../../../source/modules/d3/manufacturerinformation"
}
},
"scripts": {

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -17,6 +17,7 @@ declare(strict_types=1);
use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLongdesc;
use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Events\Events;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use D3\ManufacturerInformation\Modules\Application\Model\ManufacturerInfoList;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
@ -24,22 +25,22 @@ use OxidEsales\Eshop\Application\Model\ManufacturerList as OEManufacturerList;
$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' => Constants::OXID_MODULE_ID,
'title' => [
'de' => '(D3) Herstellerinformationen',
'en' => '(D3) Manufacturer information',
],
'id' => $sModuleId,
'title' => $logo.' Herstellerinformationen',
'description' => [
'de' => 'fĂĽgt Informationen der Hersteller zur Artikelliste hinzu',
'en' => 'adds manufacturer information to the article list',
],
'thumbnail' => 'image-file.png',
'version' => '2.1.0.0',
'author' => '(D3) Data Development (Inh.: Thomas Dartsch)',
'version' => '1.0.2.1',
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
@ -49,13 +50,17 @@ $aModule = [
OEManufacturer::class => D3ManufacturerLongDesc::class,
OEManufacturerList::class => ManufacturerInfoList::class,
],
'events' => [
'onActivate' => Events::class.'::activate',
'onDeactivate' => Events::class.'::deActivate',
],
'templates' => [
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl',
'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl',
],
'settings' => [
[
'group' => Constants::OXID_MODULE_ID.'_main',
'name' => Constants::OXID_MODULE_ID.'_showManufacturertextOnDetailsPage',
'group' => $sModuleId.'_main',
'name' => $sModuleId.'_showManufacturertextOnDetailsPage',
'type' => 'bool',
'value' => true,
],

View File

@ -1,63 +0,0 @@
<?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;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\TextType;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241023154223 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds the D3 manufacturer longdesc column';
}
public function up(Schema $schema): void
{
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$this->d3AddLongdescColumnToOxmanufacturers($schema);
}
public function down(Schema $schema): void
{
}
/**
* @param Schema $schema
* @return void
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema)
{
$table = !$schema->hasTable('oxmanufacturers') ?
$schema->createTable('oxmanufacturers') :
$schema->getTable('oxmanufacturers');
// Beschreibung
if (!$table->hasColumn('D3DESCRIPTION')) {
$table->addColumn('D3DESCRIPTION', (new TextType())->getName())
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
->setNotnull(true);
}
}
}

View File

@ -1,77 +0,0 @@
<?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;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\TextType;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241028172608 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds multilang tables for the D3 manufacturer longdesc';
}
public function up(Schema $schema): void
{
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$this->d3AddLongdescMultilangColumnsToOxmanufacturers($schema);
}
public function down(Schema $schema): void
{
}
/**
* @param Schema $schema
* @return void
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema)
{
$table = !$schema->hasTable('oxmanufacturers') ?
$schema->createTable('oxmanufacturers') :
$schema->getTable('oxmanufacturers');
// lang 1
if (!$table->hasColumn('D3DESCRIPTION_1')) {
$table->addColumn('D3DESCRIPTION_1', (new TextType())->getName())
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
->setNotnull(true);
}
// lang 2
if (!$table->hasColumn('D3DESCRIPTION_2')) {
$table->addColumn('D3DESCRIPTION_2', (new TextType())->getName())
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
->setNotnull(true);
}
// lang 3
if (!$table->hasColumn('D3DESCRIPTION_3')) {
$table->addColumn('D3DESCRIPTION_3', (new TextType())->getName())
->setLength($this->connection->getDatabasePlatform()::LENGTH_LIMIT_TEXT)
->setNotnull(true);
}
}
}

View File

@ -1,4 +0,0 @@
table_storage:
table_name: d3migrations_manufacturerinformation
migrations_paths:
'D3\ManufacturerInformation\Migrations': data

View File

@ -1,41 +0,0 @@
{% 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

@ -1,14 +0,0 @@
{% 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 %}

View File

@ -1,20 +0,0 @@
{% 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 %}

View File

@ -1,126 +0,0 @@
{% 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 %}