Skip to content

Commit

Permalink
added migration script and database schema for #4794 and optimized th…
Browse files Browse the repository at this point in the history
…e view
  • Loading branch information
brusch committed Aug 2, 2019
1 parent 9adc5d1 commit b0eec2b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 31 deletions.
Expand Up @@ -21,43 +21,32 @@ pimcore.document.newsletters.plaintextPanel = Class.create({
getLayout: function () {

if (this.layout == null) {

this.layout = new Ext.FormPanel({
title: t('plain_text'),
border: false,
autoScroll: true,
bodyStyle:'padding:0 10px 0 10px;',
iconCls: "pimcore_material_icon_text pimcore_material_icon",
items: [
{
items: [{
xtype:'fieldset',
title: t('plain_text_email_part'),
itemId: "plaintextPanel",
collapsible: true,
autoHeight:true,
defaults: {
labelWidth: 200
},
defaultType: 'textarea',
items :[
{
fieldLabel: t('plain_text') + " (" + this.document.data.plaintext.length + ")",
maxLength: 4000,
height: 700,
width: 1400,
name: 'plaintext',
itemId: 'plaintext',
value: this.document.data.plaintext,
enableKeyEvents: true,
listeners: {
"keyup": function (el) {
el.labelEl.update(t("plain_text") + " (" + el.getValue().length + "):");
}
}
}
]
}
]
title: t('plain_text_email_part'),
itemId: "plaintextPanel",
collapsible: false,
items: [{
xtype: 'textarea',
maxLength: 4000,
height: 700,
width: 1400,
name: 'plaintext',
value: this.document.data.plaintext,
enableKeyEvents: true,
listeners: {
"keyup": function (el) {
this.layout.getComponent('plaintextPanel').titleCmp.update(t("plain_text_email_part") + " (" + el.getValue().length + "):");
}.bind(this)
}
}]
}]
});
}

Expand All @@ -74,5 +63,4 @@ pimcore.document.newsletters.plaintextPanel = Class.create({
var plaintext = this.getLayout().getForm().getFieldValues();
return plaintext;
}

});
25 changes: 25 additions & 0 deletions bundles/CoreBundle/Resources/migrations/Version20190802090149.php
@@ -0,0 +1,25 @@
<?php

namespace Pimcore\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Pimcore\Migrations\Migration\AbstractPimcoreMigration;

class Version20190802090149 extends AbstractPimcoreMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE documents_newsletter ADD COLUMN plaintext LONGTEXT NULL DEFAULT NULL AFTER sendingMode;');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->addSql('ALTER TABLE documents_newsletter DROP COLUMN plaintext;');
}
}
1 change: 1 addition & 0 deletions bundles/InstallBundle/Resources/install.sql
Expand Up @@ -174,6 +174,7 @@ CREATE TABLE `documents_newsletter` (
`trackingParameterName` varchar(255) DEFAULT NULL,
`enableTrackingParameters` tinyint(1) unsigned DEFAULT NULL,
`sendingMode` varchar(20) DEFAULT NULL,
`plaintext` LONGTEXT NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8mb4;

Expand Down

0 comments on commit b0eec2b

Please sign in to comment.