diff --git a/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php b/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php
index 3f8861ed726..444b544e096 100644
--- a/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php
+++ b/src/Oro/Bundle/ActivityListBundle/Entity/ActivityList.php
@@ -324,7 +324,7 @@ public function getSubject()
}
/**
- * Set a subject of the related record
+ * Set a subject of the related record. The subject cutes to 250 symbols.
*
* @param string $subject
*
@@ -332,7 +332,7 @@ public function getSubject()
*/
public function setSubject($subject)
{
- $this->subject = substr($subject, 0, 255);
+ $this->subject = mb_substr($subject, 0, 250, mb_detect_encoding($subject));
return $this;
}
diff --git a/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Entity/ActivityListTest.php b/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Entity/ActivityListTest.php
index 644b432f99e..ce53bc5e468 100644
--- a/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Entity/ActivityListTest.php
+++ b/src/Oro/Bundle/ActivityListBundle/Tests/Unit/Entity/ActivityListTest.php
@@ -159,4 +159,20 @@ public function testIsNotUpdatedFlags()
$this->assertFalse($activityList->isUpdatedBySet());
$this->assertFalse($activityList->isUpdatedAtSet());
}
+
+ public function testSetSubjectOnLongString()
+ {
+ $activityList = new ActivityList();
+ $activityList->setSubject(
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget elementum velit, ac tempor orci. '
+ . 'Cras aliquet massa id dignissim bibendum. Interdum et malesuada fames ac ante ipsum primis in faucibus.'
+ .' Aenean ac libero magna. Proin eu tristiqäe est. Donec convallis pretium congue. Nullam sed.'
+ );
+ self::assertEquals(
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget elementum velit, ac tempor orci. '
+ . 'Cras aliquet massa id dignissim bibendum. Interdum et malesuada fames ac ante ipsum primis in faucibus.'
+ . ' Aenean ac libero magna. Proin eu tristiqä',
+ $activityList->getSubject()
+ );
+ }
}
diff --git a/src/Oro/Bundle/CronBundle/Command/CronCommandInterface.php b/src/Oro/Bundle/CronBundle/Command/CronCommandInterface.php
index d5a8b7cca6d..25e317d8ba7 100644
--- a/src/Oro/Bundle/CronBundle/Command/CronCommandInterface.php
+++ b/src/Oro/Bundle/CronBundle/Command/CronCommandInterface.php
@@ -8,7 +8,7 @@ interface CronCommandInterface
* Define default cron schedule definition for a command.
* Example: "5 * * * *"
*
- * @see Oro\Bundle\CronBundle\Entity\Schedule::setDefinition()
+ * @see \Oro\Bundle\CronBundle\Entity\Schedule::setDefinition()
* @return string
*/
public function getDefaultDefinition();
diff --git a/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/extensions.md b/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/extensions.md
index b10e72c1147..fe85c3047ed 100644
--- a/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/extensions.md
+++ b/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/extensions.md
@@ -18,6 +18,7 @@ Here's list of already implemented extensions:
- [Export](extensions/export.md) - responsible for export grid data
- [Field ACL](extensions/field_acl.md) - allow to protect entity fields with ACL
- [Board](extensions/board.md) - responsible for adding Kanban board views for datagrids
+- [Filter](http://github.com/orocrm/platform/blob/master/src/Oro/Bundle/FilterBundle/Resources/doc/reference/grid_extension.md) - responsible for adding filtering and filter widgets to grid
Customization
-------------
diff --git a/src/Oro/Bundle/DataGridBundle/Resources/public/js/app/components/column-manager-component.js b/src/Oro/Bundle/DataGridBundle/Resources/public/js/app/components/column-manager-component.js
index 82051aef784..d9d7cbd4ca9 100644
--- a/src/Oro/Bundle/DataGridBundle/Resources/public/js/app/components/column-manager-component.js
+++ b/src/Oro/Bundle/DataGridBundle/Resources/public/js/app/components/column-manager-component.js
@@ -52,7 +52,7 @@ define(function(require) {
this.columnFilterModel = new ColumnFilterModel();
- this._createViews(options);
+ this.createViews = _.bind(this._createViews, this, options);
this._applyState(this.grid.collection, this.grid.collection.state);
@@ -79,7 +79,6 @@ define(function(require) {
*/
delegateListeners: function() {
this.listenTo(this.grid.collection, 'updateState', this._applyState);
- this.listenTo(this.columnManagerCollectionView, 'reordered', this._pushState);
this.listenTo(this.managedColumns, 'change:renderable', this._pushState);
this.listenTo(this.managedColumns, 'sort', function() {
this.columns.sort();
@@ -112,9 +111,13 @@ define(function(require) {
filterModel: this.columnFilterModel,
orderShift: orderShift
});
+ this.listenTo(this.columnManagerCollectionView, 'reordered', this._pushState);
},
updateViews: function() {
+ if (!this.columnManagerCollectionView) {
+ this.createViews();
+ }
this.columnManagerCollectionView.updateView();
},
diff --git a/src/Oro/Bundle/DataGridBundle/Resources/public/js/datagrid/action-component-dropdown-launcher.js b/src/Oro/Bundle/DataGridBundle/Resources/public/js/datagrid/action-component-dropdown-launcher.js
index ea0fdf0b488..b74fa0b4222 100755
--- a/src/Oro/Bundle/DataGridBundle/Resources/public/js/datagrid/action-component-dropdown-launcher.js
+++ b/src/Oro/Bundle/DataGridBundle/Resources/public/js/datagrid/action-component-dropdown-launcher.js
@@ -56,10 +56,12 @@ define(function(require) {
/**
* @inheritDoc
*/
- initComponent: function() {
+ render: function() {
+ ActionComponentDropdownLauncher.__super__.render.call(this);
this.componentOptions._sourceElement = this.$('.dropdown-menu');
var Component = this.componentConstructor;
this.component = new Component(this.componentOptions);
+ return this;
},
/**
@@ -92,8 +94,8 @@ define(function(require) {
* Handles dropdown menu open and sets max-width for the element
*/
onOpen: function() {
- if (!this.component) {
- this.initComponent();
+ if (_.isFunction(this.component.updateViews)) {
+ this.component.updateViews();
}
var $dropdownMenu = this.$('>.dropdown-menu');
if ($dropdownMenu.length) {
@@ -105,9 +107,6 @@ define(function(require) {
var $elem = this.$('.dropdown-menu');
// focus input after Bootstrap opened dropdown menu
$elem.focusFirstInput();
- if (_.isFunction(this.component.updateViews)) {
- this.component.updateViews();
- }
},
/**
diff --git a/src/Oro/Bundle/EmailBundle/Builder/EmailBodyBuilder.php b/src/Oro/Bundle/EmailBundle/Builder/EmailBodyBuilder.php
index 1f2bbf95cc0..5a0c42c34b5 100644
--- a/src/Oro/Bundle/EmailBundle/Builder/EmailBodyBuilder.php
+++ b/src/Oro/Bundle/EmailBundle/Builder/EmailBodyBuilder.php
@@ -7,6 +7,7 @@
use Oro\Bundle\EmailBundle\Entity\EmailAttachment;
use Oro\Bundle\EmailBundle\Entity\EmailAttachmentContent;
use Oro\Bundle\ConfigBundle\Config\ConfigManager;
+use Oro\Bundle\EmailBundle\Tools\EmailBodyHelper;
/**
* A helper class allows you to easy build EmailBody entity
@@ -24,6 +25,9 @@ class EmailBodyBuilder
/** @var ConfigManager */
protected $configManager;
+ /** @var EmailBodyHelper */
+ private $emailBodyHelper;
+
/**
* @param ConfigManager $configManager
*/
@@ -58,7 +62,8 @@ public function setEmailBody($content, $bodyIsText)
$this->emailBody = new EmailBody();
$this->emailBody
->setBodyContent($content)
- ->setBodyIsText($bodyIsText);
+ ->setBodyIsText($bodyIsText)
+ ->setTextBody($this->getEmailBodyHelper()->getTrimmedClearText($content));
}
/**
@@ -159,4 +164,16 @@ protected function checkContentSizeValue($content, $contentSize, $contentTransfe
return $contentSize;
}
+
+ /**
+ * @return EmailBodyHelper
+ */
+ protected function getEmailBodyHelper()
+ {
+ if (!$this->emailBodyHelper) {
+ $this->emailBodyHelper = new EmailBodyHelper();
+ }
+
+ return $this->emailBodyHelper;
+ }
}
diff --git a/src/Oro/Bundle/EmailBundle/Builder/EmailEntityBuilder.php b/src/Oro/Bundle/EmailBundle/Builder/EmailEntityBuilder.php
index d9e49b02531..9725a63c31a 100644
--- a/src/Oro/Bundle/EmailBundle/Builder/EmailEntityBuilder.php
+++ b/src/Oro/Bundle/EmailBundle/Builder/EmailEntityBuilder.php
@@ -15,6 +15,7 @@
use Oro\Bundle\EmailBundle\Exception\UnexpectedTypeException;
use Oro\Bundle\EmailBundle\Model\FolderType;
use Oro\Bundle\EmailBundle\Tools\EmailAddressHelper;
+use Oro\Bundle\EmailBundle\Tools\EmailBodyHelper;
use Oro\Bundle\OrganizationBundle\Entity\OrganizationInterface;
use Oro\Bundle\UserBundle\Entity\User;
@@ -35,6 +36,9 @@ class EmailEntityBuilder
*/
private $emailAddressHelper;
+ /** @var EmailBodyHelper */
+ private $emailBodyHelper;
+
/**
* Constructor
*
@@ -250,7 +254,8 @@ public function body($content, $isHtml, $persistent = false)
$result
->setBodyContent($content)
->setBodyIsText(!$isHtml)
- ->setPersistent($persistent);
+ ->setPersistent($persistent)
+ ->setTextBody($this->getEmailBodyHelper()->getTrimmedClearText($content, !$isHtml));
return $result;
}
@@ -476,4 +481,16 @@ public function setObject($obj)
);
}
}
+
+ /**
+ * @return EmailBodyHelper
+ */
+ protected function getEmailBodyHelper()
+ {
+ if (!$this->emailBodyHelper) {
+ $this->emailBodyHelper = new EmailBodyHelper();
+ }
+
+ return $this->emailBodyHelper;
+ }
}
diff --git a/src/Oro/Bundle/EmailBundle/Command/ConvertEmailBodyToTextBody.php b/src/Oro/Bundle/EmailBundle/Command/ConvertEmailBodyToTextBody.php
new file mode 100644
index 00000000000..3c84deaf51d
--- /dev/null
+++ b/src/Oro/Bundle/EmailBundle/Command/ConvertEmailBodyToTextBody.php
@@ -0,0 +1,77 @@
+setName(static::COMMAND_NAME)
+ ->setDescription('Converts emails body. Generates and stores textual email body representation.');
+
+ parent::configure();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('
Lorem ipsum
-dolor sit amet, consectetur adipiscing elit. -Integer | -sagittis | -
---|---|
ornare | -do | -