Vergelijk commits

...

9 Commits

15 gewijzigde bestanden met toevoegingen van 359 en 33 verwijderingen

Bestand weergeven

@ -0,0 +1,87 @@
<?php
namespace D3\CategoryLongtext\Application\Controllers\Admin;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use stdClass;
abstract class d3manufacturerlongtext extends AdminDetailsController
{
public $sFieldName = 'd3longdesc1';
public $_sThisTemplate = 'd3_manufacturer_longtext.tpl';
public function render()
{
$tpl = parent::render();
$this->_aViewData['edit'] = $oManufacturer = oxNew(Manufacturer::class);
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
// load object
$selectedLang = Registry::getRequest()->getRequestEscapedParameter( "selectedlang");
if (!isset($selectedLang)) {
$selectedLang = $this->_iEditLang;
}
$this->_aViewData["selectedlang"] = $selectedLang;
$oManufacturer->loadInLang($selectedLang, $soxId);
//Disable editing for derived items
if ($oManufacturer->isDerived()) {
$this->_aViewData['readonly'] = true;
}
foreach ( Registry::getLang()->getLanguageNames() as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
}
$this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oManufacturer, "oxmanufacturers__".$this->sFieldName, "list.tpl.css");
return $tpl;
}
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
$manufacturer = oxNew( Manufacturer::class);
$selectedLang = Registry::getRequest()->getRequestEscapedParameter( "selectedlang");
$selectedLang = $selectedLang ?: 0;
if ($soxId != "-1") {
$manufacturer->loadInLang($selectedLang, $soxId);
} else {
$aParams['oxmanufacturers__oxid'] = null;
}
//Disable editing for derived items
if ($manufacturer->isDerived()) {
return;
}
$manufacturer->setLanguage(0);
$manufacturer->assign($aParams);
$manufacturer->setLanguage($selectedLang);
$manufacturer->save();
// set oxid if inserted
$this->setEditObjectId($manufacturer->getId());
}
public function getFieldName()
{
return $this->sFieldName;
}
}

Bestand weergeven

@ -0,0 +1,8 @@
<?php
namespace D3\CategoryLongtext\Application\Controllers\Admin;
class d3manufacturerlongtext1 extends d3manufacturerlongtext
{
public $sFieldName = 'd3longdesc1';
}

Bestand weergeven

@ -0,0 +1,8 @@
<?php
namespace D3\CategoryLongtext\Application\Controllers\Admin;
class d3manufacturerlongtext2 extends d3manufacturerlongtext
{
public $sFieldName = 'd3longdesc2';
}

Bestand weergeven

@ -24,4 +24,6 @@ $aLang = [
//Navigation
'charset' => 'UTF-8',
'd3categorylongtext' => $logo.' zweiter Langtext',
'd3manufacturerlongtext1' => $logo.' Langtext 1',
'd3manufacturerlongtext2' => $logo.' Langtext 2',
];

Bestand weergeven

@ -0,0 +1,59 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
<script type="text/javascript">
<!--
function loadLang(obj)
{
var langvar = document.getElementById("selectedlang");
if (langvar != null )
langvar.value = obj.value;
document.myedit.submit();
}
//-->
</script>
[{if $readonly}]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<form name="transfer" id="transfer" action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
</form>
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__[{$oView->getFieldName()}]' );" style="padding: 0;margin: 0;height:0;">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<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="selectedlang" value="[{$selectedlang}]">
<input type="hidden" value="" name="editval[oxmanufacturers__[{$oView->getFieldName()}]]">
[{$editor}]
<table cellspacing="0" cellpadding="0" border="0" style="width:99%;">
<tr>
<td valign="top" class="edittext">
[{if $languages}]<strong>[{oxmultilang ident="GENERAL_LANGUAGE"}]</strong>
<select name="selectedlang" class="editinput" onchange="loadLang(this)" [{$readonly}]>
[{foreach key=key item=item from=$languages}]
<option value="[{$key}]"[{if $selectedlang == $key}] SELECTED[{/if}]>[{$item->name}]</option>
[{/foreach}]
</select>
[{/if}]
</td>
<tr>
<td>
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="CATEGORY_TEXT_SAVE"}]" onClick="document.myedit.fnc.value='save'">
</td>
</tr>
</table>
</form>
[{include file="bottomnaviitem.tpl"}]
[{include file="bottomitem.tpl"}]

Bestand weergeven

@ -1,5 +1,23 @@
[{assign var="oPageNavigation" value=$oView->getPageNavigation()}]
[{if $oViewConf->getActiveClassName() == 'manufacturerlist' &&
$actCategory && $actCategory->oxmanufacturers__d3longdesc1->value &&
$oPageNavigation->actPage == 1
}]
<div class="manufacturerDescription desc1" id="mnfLongDesc1">[{oxeval var=$actCategory->oxmanufacturers__d3longdesc1}]</div>
[{/if}]
[{$smarty.block.parent}]
[{if $actCategory && $actCategory->oxcategories__d3longdesc2->value }]
[{if $oViewConf->getActiveClassName() == 'alist' &&
$actCategory && $actCategory->oxcategories__d3longdesc2->value &&
$oPageNavigation->actPage == 1
}]
<div class="categoryDescription" id="catLongDesc">[{oxeval var=$actCategory->oxcategories__d3longdesc2}]</div>
[{/if}]
[{if $oViewConf->getActiveClassName() == 'manufacturerlist' &&
$actCategory && $actCategory->oxmanufacturers__d3longdesc2->value &&
$oPageNavigation->actPage == 1
}]
<div class="manufacturerDescription desc2" id="mnfLongDesc2">[{oxeval var=$actCategory->oxmanufacturers__d3longdesc2}]</div>
[{/if}]

Bestand weergeven

@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.4.0...rel_1.x)
## [1.7.0](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.4.0...1.5.0) - 2023-10-10
### Added
- make installable in OXID 6.5.3 (CE 6.14)
## [1.5.0](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.4.0...1.5.0) - 2023-08-02
### Added
- 2 longtexts for manufacturers
## [1.4.0](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.3.0...1.4.0) - 2023-04-04
### Removed
- composer.json version entry

Bestand weergeven

@ -2,7 +2,7 @@
# ![D3 Logo](https://logos.oxidmodule.com/d3logo_24x24.svg) Zweiter Langtext für OXID eShop
Zweiter Kategorielangtext
zusätzliche Langtexte
## Inhaltsverzeichnis
@ -19,8 +19,7 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
```bash
php composer config repositories.hele vcs gitfhfac@git.d3data.de:Customers/hele.de.git
php composer require d3/categorylongtext:"dev-modules/rel_categorylongtext"
php composer require d3/categorylongtext:"^1"
```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.

Bestand weergeven

@ -2,4 +2,16 @@ ALTER TABLE `oxcategories`
ADD `D3LONGDESC2` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC2_1` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC2_2` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC2_3` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
ALTER TABLE `oxmanufacturers`
ADD `D3LONGDESC1` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC1_1` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC1_2` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC1_3` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
ALTER TABLE `oxmanufacturers`
ADD `D3LONGDESC2` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC2_1` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC2_2` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ,
ADD `D3LONGDESC2_3` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;

Bestand weergeven

@ -1,6 +1,6 @@
{
"name": "d3/categorylongtext",
"description": "2. Kategorie Langtext",
"description": "weitere Langtexte",
"type": "oxideshop-module",
"keywords": [
"oxid",
@ -11,7 +11,7 @@
{
"name": "D3 Data Development (Inh. Thomas Dartsch)",
"email": "info@shopmodule.com",
"homepage": "http://www.d3data.de",
"homepage": "https://www.d3data.de",
"role": "Owner"
}
],
@ -29,7 +29,7 @@
}
},
"require": {
"php": "^7",
"php": ">=7.3",
"oxid-esales/oxideshop-ce":"^6"
},
"autoload": {

Bestand weergeven

@ -6,5 +6,11 @@
<TAB id="d3categorylongtext" cl="d3clcategorylongtext"/>
</SUBMENU>
</MAINMENU>
<MAINMENU id="mxmainmenu">
<SUBMENU id="mxmanufacturer" cl="manufacturer" list="manufacturer_list">
<TAB id="d3manufacturerlongtext1" cl="d3manufacturerlongtext1"/>
<TAB id="d3manufacturerlongtext2" cl="d3manufacturerlongtext2"/>
</SUBMENU>
</MAINMENU>
</OXMENU>
</OX>

Bestand weergeven

@ -13,43 +13,59 @@
declare(strict_types=1);
use D3\CategoryLongtext\Application\Controllers\Admin\AdminDetailsController;
use D3\CategoryLongtext\Application\Controllers\Admin\d3manufacturerlongtext1;
use D3\CategoryLongtext\Application\Controllers\Admin\d3manufacturerlongtext2;
$sMetadataVersion = '2.1';
$sModuleId = 'd3categorylongtext';
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
$logo = '<img src="https://logos.oxidmodule.com/d3logo_individual.svg" alt="(D3)" style="height:1em;width:1em">';
$aModule = array(
$features = <<<FEATURES
<ul>
<li><a href="https://manager.oxidmodule.com/view.php?id=11735">#11735 - 2. Kategorielangtext</a>
<quote>
<strong>Hinweise:</strong>
<b>Voraussetzungen:</b><br>
Datenbank-Felder: <br>
- oxcategories__d3longdesc2<br>
- oxcategories__d3longdesc2_1<br>
- oxcategories__d3longdesc2_2<br>
- oxcategories__d3longdesc2_3<br>
Diese Erweiterung bietet einen zweiten Kategorielangtext.<br>
Angezeigt wird der zweite Langtext unter der Artikelauflistung in der Listenansicht.
</quote>
</li>
<li><a href="https://manager.oxidmodule.com/view.php?id=12128">#12128 - Herstellerlangtexte</a></li>
</ul>
FEATURES;
$aModule = [
'id' => $sModuleId,
'title' => $logo.' zweiter Kategorielangtext',
'description' => '<strong>Hinweise:</strong>'
. '<b>Voraussetzungen:</b><br>'
. 'Datenbank-Felder: <br>'
. '- oxcategories__d3longdesc2<br>'
. '- oxcategories__d3longdesc2_1<br>'
. '- oxcategories__d3longdesc2_2<br>'
. '- oxcategories__d3longdesc2_3<br>'
. 'Diese Erweiterung bietet einen zweiten Kategorielangtext.<br>' //
. 'Angezeigt wird der zweite Langtext unter der Artikelauflistung in der Listenansicht.',
'title' => $logo.' weitere Kategorie- und Herstellerlangtexte',
'description' => $features,
'thumbnail' => 'picture.png',
'version' => '1.4.0',
'version' => '1.7.0',
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
'd3clcategorylongtext' => AdminDetailsController::class
'd3clcategorylongtext' => AdminDetailsController::class,
'd3manufacturerlongtext1' => d3manufacturerlongtext1::class,
'd3manufacturerlongtext2' => d3manufacturerlongtext2::class,
],
'templates' => [
'd3_categories_longtext.tpl' => 'd3/categorylongtext/Application/views/admin/tpl/d3_categories_longtext.tpl',
'd3_manufacturer_longtext.tpl' => 'd3/categorylongtext/Application/views/admin/tpl/d3_manufacturer_longtext.tpl',
],
'blocks' => [
[
'template' => 'page/list/list.tpl',
'block' => 'page_list_listbody',
'file' => 'Application/views/blocks/list_second_longdescription.tpl',
],
]
],
'events' => [
'onActivate' => '\D3\CategoryLongtext\Setup\Events::onActivate',
//'onDeactivate' => '\D3\CategoryLongtext\Events\Events::onDeactivate'
]
);
];

Bestand weergeven

@ -4,13 +4,8 @@ declare(strict_types=1);
namespace D3\CategoryLongtext\Migrations;
use Doctrine\DBAL\DBALException;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\DBAL\Types\TextType;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
@ -33,20 +28,20 @@ final class Version20230403083243 extends AbstractMigration
$table = $schema->getTable('oxcategories');
if (!$table->hasColumn('D3LONGDESC2')){
$table->addColumn('D3LONGDESC2', (new TextType())->getName())
$table->addColumn('D3LONGDESC2', (Type::getType('text')->getName()))
->setNotnull(true);
}
$table->hasColumn('D3LONGDESC2_1') ?:
$table->addColumn('D3LONGDESC2_1', (new TextType())->getName())
$table->addColumn('D3LONGDESC2_1', (Type::getType('text')->getName()))
->setNotnull(true);
$table->hasColumn('D3LONGDESC2_2') ?:
$table->addColumn('D3LONGDESC2_2', (new TextType())->getName())
$table->addColumn('D3LONGDESC2_2', (Type::getType('text')->getName()))
->setNotnull(true);
$table->hasColumn('D3LONGDESC2_3') ?:
$table->addColumn('D3LONGDESC2_3', (new TextType())->getName())
$table->addColumn('D3LONGDESC2_3', (Type::getType('text')->getName()))
->setNotnull(true);
}

Bestand weergeven

@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace D3\CategoryLongtext\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230802094023 extends AbstractMigration
{
public function getDescription() : string
{
return 'add longtext 1 field in manufacturer table';
}
/**
* @throws SchemaException
* @throws DBALException
* @throws DatabaseErrorException
* @throws DatabaseConnectionException
*/
public function up(Schema $schema) : void
{
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$table = $schema->getTable('oxmanufacturers');
$table->hasColumn('D3LONGDESC1') ?:
$table->addColumn('D3LONGDESC1', (Type::getType('text')->getName()))
->setNotnull(true);
$table->hasColumn('D3LONGDESC1_1') ?:
$table->addColumn('D3LONGDESC1_1', (Type::getType('text')->getName()))
->setNotnull(true);
$table->hasColumn('D3LONGDESC1_2') ?:
$table->addColumn('D3LONGDESC1_2', (Type::getType('text')->getName()))
->setNotnull(true);
$table->hasColumn('D3LONGDESC1_3') ?:
$table->addColumn('D3LONGDESC1_3', (Type::getType('text')->getName()))
->setNotnull(true);
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
}
}

Bestand weergeven

@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace D3\CategoryLongtext\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230802094252 extends AbstractMigration
{
public function getDescription() : string
{
return 'add longtext 2 field in manufacturer table';
}
/**
* @throws SchemaException
* @throws DBALException
* @throws DatabaseErrorException
* @throws DatabaseConnectionException
*/
public function up(Schema $schema) : void
{
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$table = $schema->getTable('oxmanufacturers');
$table->hasColumn('D3LONGDESC2') ?:
$table->addColumn('D3LONGDESC2', (Type::getType('text'))->getName())
->setNotnull(true);
$table->hasColumn('D3LONGDESC2_1') ?:
$table->addColumn('D3LONGDESC2_1', (Type::getType('text'))->getName())
->setNotnull(true);
$table->hasColumn('D3LONGDESC2_2') ?:
$table->addColumn('D3LONGDESC2_2', (Type::getType('text'))->getName())
->setNotnull(true);
$table->hasColumn('D3LONGDESC2_3') ?:
$table->addColumn('D3LONGDESC2_3', (Type::getType('text'))->getName())
->setNotnull(true);
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
}
}