Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/2.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Mar 17, 2017
2 parents 0908027 + 4373aee commit 3bd115b
Show file tree
Hide file tree
Showing 18 changed files with 195 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function load(ObjectManager $manager)
$producer = $this->container->get('oro_message_queue.client.message_producer');
$producer->send(Topics::RUN_COMMAND, [
'command' => ActivityContactRecalculateCommand::COMMAND_NAME,
'arguments' => ['-v']
'arguments' => ['-v', '--disabled-listeners=all']
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_2\MigrateGridViews;
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3\EmbededFormType;
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3\TaggingEntityName;
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3_1\WorkflowItemEntityClass;
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_4\NotificationEntityName;
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_6\ReminderEntityName;

class OroCRMBundleInstaller implements Installation, ContainerAwareInterface
{
Expand All @@ -23,7 +26,7 @@ class OroCRMBundleInstaller implements Installation, ContainerAwareInterface
*/
public function getMigrationVersion()
{
return 'v1_3';
return 'v1_6';
}

/**
Expand All @@ -36,6 +39,9 @@ public function up(Schema $schema, QueryBag $queries)
MigrateGridViews::updateGridViews($queries);
EmbededFormType::updateEmbededFormType($queries);
TaggingEntityName::updateTaggingEntityName($queries);
WorkflowItemEntityClass::updateWorkflowItemEntityClass($queries);
NotificationEntityName::updateTaggingEntityName($queries);
ReminderEntityName::updateRelatedEntityClassName($queries);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_3_1;

use Doctrine\DBAL\Schema\Schema;

use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class WorkflowItemEntityClass implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::updateWorkflowItemEntityClass($queries);
}

/**
* @param QueryBag $queries
*/
public static function updateWorkflowItemEntityClass(QueryBag $queries)
{
$queries->addQuery(new UpdateTableFieldQuery(
'oro_workflow_item',
'entity_class',
'OroCRM',
'Oro'
));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_4;

use Doctrine\DBAL\Schema\Schema;

use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class NotificationEntityName implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::updateTaggingEntityName($queries);
}

/**
* @param QueryBag $queries
*/
public static function updateTaggingEntityName(QueryBag $queries)
{
$queries->addQuery(new UpdateTableFieldQuery(
'oro_notification_email_notif',
'entity_name',
'OroCRM',
'Oro'
));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_5;

use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class MigrateNavigationItems implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
if (!$schema->hasTable('oro_navigation_item')) {
return;
}

$queries->addQuery(new UpdateTableFieldQuery(
'oro_navigation_item',
'title',
'orocrm',
'oro'
));
$queries->addQuery(new UpdateTableFieldQuery(
'oro_navigation_history',
'title',
'orocrm',
'oro'
));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_6;

use Doctrine\DBAL\Schema\Schema;

use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class ReminderEntityName implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::updateRelatedEntityClassName($queries);
}

/**
* @param QueryBag $queries
*/
public static function updateRelatedEntityClassName(QueryBag $queries)
{
$queries->addQuery(new UpdateTableFieldQuery(
'oro_reminder',
'related_entity_classname',
'OroCRM',
'Oro'
));
}
}
12 changes: 5 additions & 7 deletions src/Oro/Bundle/CaseBundle/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ oro:
message:
label: Message
description: The case comment text.
saved: Comment Saved
removed: Comment Removed
no_records: There are no comments.
delete_confirmation: Are you sure you want to delete this comment?
updated_by: Updated by {{ user }} at {{ date }}
public:
label: Make Public
description: Defiens wether the comment must be public on Zendesk.
Expand All @@ -100,20 +105,13 @@ oro:
attachment:
label: Attachment
description: The file that is attached to the case comment.

action:
add: Add Comment
edit: Edit Comment
delete: Remove Comment
dialog:
add: Add Comment
edit: Edit Comment
message:
saved: Comment Saved
removed: Comment Removed
no_records: There are no comments.
delete_confirmation: Are you sure you want to delete this comment?
updated_by: Updated by {{ user }} at {{ date }}
error:
load: Sorry, comments were not loaded correctly.
delete: Sorry, comment deleting failed.
Expand Down
10 changes: 2 additions & 8 deletions src/Oro/Bundle/ContactBundle/Resources/config/oro/datagrids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ datagrids:
name: oro_api_post_contact_email
http_method: POST
route_delete_entity:
name: oro_rest_api_delete_relationship
entityId: emailId
entity: contacts
association: emails
name: oro_api_delete_contact_email
http_method: DELETE
default_route_parameters:
className: Oro_Bundle_ContactBundle_Entity_ContactEmail
Expand All @@ -267,10 +264,7 @@ datagrids:
name: oro_api_post_contact_phone
http_method: POST
route_delete_entity:
name: oro_rest_api_delete_relationship
entityId: phoneId
entity: contacts
association: phones
name: oro_api_delete_contact_phone
http_method: DELETE
default_route_parameters:
className: Oro_Bundle_ContactBundle_Entity_ContactPhone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ define(function(require) {
body.primary = true;
}

if (this.isActiveDeleteEntityRoute()) {
var routeOptions = this.initialOptions.route_delete_entity;
body = {data: [urlParameters[routeOptions.entityId]]};
urlParameters.entity = routeOptions.entity;
urlParameters.association = routeOptions.association;
}

return ContactApiAccessor.__super__.send.call(this, urlParameters, body, headers, options);
},

Expand Down Expand Up @@ -110,14 +103,6 @@ define(function(require) {
/** @returns {boolean} */
isActiveDeleteEntityRoute: function() {
return this.route.get('routeName') === this.initialOptions.route_delete_entity.name;
},

prepareUrlParameters: function(urlParameters) {
if (this.isActiveDeleteEntityRoute()) {
return urlParameters;
}

return ContactApiAccessor.__super__.prepareUrlParameters.apply(this, arguments);
}
});

Expand Down
1 change: 1 addition & 0 deletions src/Oro/Bundle/MagentoBundle/Entity/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class Order extends ExtendOrder implements

/**
* @ORM\ManyToOne(targetEntity="Cart")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
protected $cart;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function setExtendExtension(ExtendExtension $extendExtension)
*/
public function getMigrationVersion()
{
return 'v1_45';
return 'v1_46';
}

/**
Expand Down Expand Up @@ -864,7 +864,7 @@ protected function addOrocrmMagentoOrderForeignKeys(Schema $schema)
$schema->getTable('orocrm_magento_cart'),
['cart_id'],
['id'],
[]
['onDelete' => 'CASCADE']
);
$table->addForeignKeyConstraint(
$schema->getTable('oro_user'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Oro\Bundle\MagentoBundle\Migrations\Schema\v1_46;

use Doctrine\DBAL\Schema\Schema;

use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class SetCascadeDeleteToOrderCartFK implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$table = $schema->getTable('orocrm_magento_order');
$fkName = 'FK_4D09F3051AD5CDBF';
$fk = $table->getForeignKey($fkName);
if ($fk->getOption('onDelete') !== 'CASCADE') {
$table->removeForeignKey($fkName);
$table->addForeignKeyConstraint(
$schema->getTable('orocrm_magento_cart'),
['cart_id'],
['id'],
['onDelete' => 'CASCADE']
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,9 @@ function ($entity) {

foreach ($entities as $entity) {
$b2bCustomer = null;
$needRecompute = false;
if (!$entity->getId() && $this->isValuable($entity)) {
// handle creation, just add to prev lifetime value and recalculate change set
// handle creation
$b2bCustomer = $entity->getCustomerAssociation()->getTarget();
$closeRevenueValue = $this->rateConverter->getBaseCurrencyAmount($entity->getCloseRevenue());
$b2bCustomer->setLifetime($b2bCustomer->getLifetime() + $closeRevenueValue);
$needRecompute = true;
} elseif ($this->uow->isScheduledForDelete($entity) && $this->isValuable($entity)) {
$b2bCustomer = $entity->getCustomerAssociation()->getTarget();
} elseif ($this->uow->isScheduledForUpdate($entity)) {
Expand All @@ -102,9 +98,6 @@ function ($entity) {
if (null !== $b2bCustomer) {
/** @var B2bCustomer $b2bCustomer */
$this->scheduleUpdate($b2bCustomer);
if ($needRecompute) {
$this->uow->computeChangeSet($this->em->getClassMetadata(B2bCustomer::class), $b2bCustomer);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ oro:
sales:
form:
add_new_customer: Add new {{ account }}
new_customer: New
email:
error:
delete.more_one: Email address was not deleted, the lead has more than one email addresses, can't set the new primary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ oro:
label: Industry
description: Industry where the lead's company is operating.
status:
label: Status
description: Current status of the lead.
label: Status
description: Current status of the lead.
change_error_message: Unable to change lead status.
contact:
label: Contact
description: A contact the lead was converted into.
Expand All @@ -328,6 +329,9 @@ oro:
source:
label: Source
description: Source of the lead.
unclassified: No source
others: Others
none: None
notes:
label: Additional comments
description: Additional notes made to the lead record.
Expand Down Expand Up @@ -359,12 +363,8 @@ oro:
primary_email:
label: Primary Email
description:
source:
unclassified: No source
others: Others
none: None
status:
change_error_message: Unable to change lead status.


convert:
error: Unable to convert lead to opportunity
feature.label: Lead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<%= _.escape(text) %>
<% if (id === null) { %>
<span class="select2__result-entry-info">
(<%= _.__('oro.sales.form.add_new_customer', {'account': context.account}) %>)
(<%= _.__('oro.sales.form.new_customer') %>)
</span>
<% } %>

0 comments on commit 3bd115b

Please sign in to comment.