20 Commits

Author SHA1 Message Date
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
16 changed files with 125 additions and 138 deletions

View File

@ -47,7 +47,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
}
}
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__D3DESCRIPTION", "list.tpl.css");
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__d3description", "list.tpl.css");
return "d3manufacturerlongdesc.tpl";
}
@ -110,7 +110,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
*/
public function d3GetLongdescParamValue() :string
{
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__D3DESCRIPTION'];
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
}
/**

View File

@ -10,5 +10,5 @@ class Constants
public const OXID_MODULE_ID = 'd3manufacturerinformation';
// Tables and Database
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'D3DESCRIPTION';
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'd3description';
}

View File

@ -7,5 +7,7 @@ $sLangName = "Deutsch";
$aLang = array(
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Langtext',
'mxd3manufacturerinfolongdesc' => 'Langtext',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen'
);

View File

@ -7,5 +7,7 @@ $sLangName = "Deutsch";
$aLang = array(
'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Text',
'mxd3manufacturerinfolongdesc' => 'Text',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab'
);

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="">
@ -33,7 +33,7 @@
<input type="hidden" name="voxid" value="[{$oxid}]">
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="[{$oxid}]">
<input type="hidden" name="catlang" value="[{$catlang}]">
<input type="hidden" name="editval[oxmanufacturers__D3DESCRIPTION]" value="">
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
[{include file="include/category_text_editor.tpl"}]
</form>

View File

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

View File

@ -0,0 +1,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->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}]

View File

@ -4,9 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2024-11-13
### Added
- installability OXID 6.2.3 - 6.5.x
## [unreleased](https://git.d3data.de/D3Public/MyModule/compare/1.0.1.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
### 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
- 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

@ -7,6 +7,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
@ -30,10 +31,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);
$longName = $this->getCoreTableName().'__'.strtolower(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName;
}
}

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
@ -17,13 +18,7 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
```bash
composer require d3/manufacturerinformation:"~1.1"
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
./vendor/bin/oe-console o:m:i source/modules/d3/manufacturerinformation
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
./vendor/bin/oe-console o:m:act d3manufacturerinformation
composer require d3/manufacturerinformation:"~1.0"
```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.

View File

@ -24,8 +24,8 @@
"proprietary"
],
"require": {
"php": "~7.0 || ~8.0",
"oxid-esales/oxideshop-ce": "v6.6.0 - v6.14.3"
"php": ">=7.0",
"oxid-esales/oxideshop-ce": "v6.0 - v6.5.6"
},
"require-dev": {
"phpunit/phpunit" : "^9.5",

View File

@ -15,6 +15,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;
@ -36,7 +37,7 @@ $aModule = [
'en' => 'adds manufacturer information to the article list',
],
'thumbnail' => 'image-file.png',
'version' => '1.1.0.0',
'version' => '1.0.1.0',
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
@ -47,7 +48,31 @@ $aModule = [
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',
],
'settings' => [
[
'group' => $sModuleId.'_main',
'name' => $sModuleId.'_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',
],
]
];

View File

@ -1,48 +0,0 @@
<?php
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,62 +0,0 @@
<?php
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 @@
name: D3 manufacturerinformation
migrations_namespace: D3\ManufacturerInformation\Migrations
table_name: d3migrations_manufacturerinformation
migrations_directory: data