Skip to content

Commit 3bd115b

Browse files
committed
Merge remote-tracking branch 'remotes/dev/2.0' into 2.0
2 parents 0908027 + 4373aee commit 3bd115b

File tree

18 files changed

+195
-53
lines changed

18 files changed

+195
-53
lines changed

Diff for: src/Oro/Bundle/ActivityContactBundle/Migrations/Data/ORM/ActivityContactRecalculate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function load(ObjectManager $manager)
3434
$producer = $this->container->get('oro_message_queue.client.message_producer');
3535
$producer->send(Topics::RUN_COMMAND, [
3636
'command' => ActivityContactRecalculateCommand::COMMAND_NAME,
37-
'arguments' => ['-v']
37+
'arguments' => ['-v', '--disabled-listeners=all']
3838
]);
3939
}
4040
}

Diff for: src/Oro/Bundle/CRMBundle/Migrations/Schema/OroCRMBundleInstaller.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_2\MigrateGridViews;
1414
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3\EmbededFormType;
1515
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3\TaggingEntityName;
16+
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3_1\WorkflowItemEntityClass;
17+
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_4\NotificationEntityName;
18+
use Oro\Bundle\CRMBundle\Migrations\Schema\v1_6\ReminderEntityName;
1619

1720
class OroCRMBundleInstaller implements Installation, ContainerAwareInterface
1821
{
@@ -23,7 +26,7 @@ class OroCRMBundleInstaller implements Installation, ContainerAwareInterface
2326
*/
2427
public function getMigrationVersion()
2528
{
26-
return 'v1_3';
29+
return 'v1_6';
2730
}
2831

2932
/**
@@ -36,6 +39,9 @@ public function up(Schema $schema, QueryBag $queries)
3639
MigrateGridViews::updateGridViews($queries);
3740
EmbededFormType::updateEmbededFormType($queries);
3841
TaggingEntityName::updateTaggingEntityName($queries);
42+
WorkflowItemEntityClass::updateWorkflowItemEntityClass($queries);
43+
NotificationEntityName::updateTaggingEntityName($queries);
44+
ReminderEntityName::updateRelatedEntityClassName($queries);
3945
}
4046
}
4147
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_3_1;
4+
5+
use Doctrine\DBAL\Schema\Schema;
6+
7+
use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
8+
use Oro\Bundle\MigrationBundle\Migration\Migration;
9+
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
10+
11+
class WorkflowItemEntityClass implements Migration
12+
{
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public function up(Schema $schema, QueryBag $queries)
17+
{
18+
self::updateWorkflowItemEntityClass($queries);
19+
}
20+
21+
/**
22+
* @param QueryBag $queries
23+
*/
24+
public static function updateWorkflowItemEntityClass(QueryBag $queries)
25+
{
26+
$queries->addQuery(new UpdateTableFieldQuery(
27+
'oro_workflow_item',
28+
'entity_class',
29+
'OroCRM',
30+
'Oro'
31+
));
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_4;
4+
5+
use Doctrine\DBAL\Schema\Schema;
6+
7+
use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
8+
use Oro\Bundle\MigrationBundle\Migration\Migration;
9+
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
10+
11+
class NotificationEntityName implements Migration
12+
{
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public function up(Schema $schema, QueryBag $queries)
17+
{
18+
self::updateTaggingEntityName($queries);
19+
}
20+
21+
/**
22+
* @param QueryBag $queries
23+
*/
24+
public static function updateTaggingEntityName(QueryBag $queries)
25+
{
26+
$queries->addQuery(new UpdateTableFieldQuery(
27+
'oro_notification_email_notif',
28+
'entity_name',
29+
'OroCRM',
30+
'Oro'
31+
));
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_5;
4+
5+
use Doctrine\DBAL\Schema\Schema;
6+
use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
7+
use Oro\Bundle\MigrationBundle\Migration\Migration;
8+
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
9+
10+
class MigrateNavigationItems implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
if (!$schema->hasTable('oro_navigation_item')) {
18+
return;
19+
}
20+
21+
$queries->addQuery(new UpdateTableFieldQuery(
22+
'oro_navigation_item',
23+
'title',
24+
'orocrm',
25+
'oro'
26+
));
27+
$queries->addQuery(new UpdateTableFieldQuery(
28+
'oro_navigation_history',
29+
'title',
30+
'orocrm',
31+
'oro'
32+
));
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Oro\Bundle\CRMBundle\Migrations\Schema\v1_6;
4+
5+
use Doctrine\DBAL\Schema\Schema;
6+
7+
use Oro\Bundle\InstallerBundle\Migration\UpdateTableFieldQuery;
8+
use Oro\Bundle\MigrationBundle\Migration\Migration;
9+
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
10+
11+
class ReminderEntityName implements Migration
12+
{
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public function up(Schema $schema, QueryBag $queries)
17+
{
18+
self::updateRelatedEntityClassName($queries);
19+
}
20+
21+
/**
22+
* @param QueryBag $queries
23+
*/
24+
public static function updateRelatedEntityClassName(QueryBag $queries)
25+
{
26+
$queries->addQuery(new UpdateTableFieldQuery(
27+
'oro_reminder',
28+
'related_entity_classname',
29+
'OroCRM',
30+
'Oro'
31+
));
32+
}
33+
}

Diff for: src/Oro/Bundle/CaseBundle/Resources/translations/messages.en.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ oro:
8080
message:
8181
label: Message
8282
description: The case comment text.
83+
saved: Comment Saved
84+
removed: Comment Removed
85+
no_records: There are no comments.
86+
delete_confirmation: Are you sure you want to delete this comment?
87+
updated_by: Updated by {{ user }} at {{ date }}
8388
public:
8489
label: Make Public
8590
description: Defiens wether the comment must be public on Zendesk.
@@ -100,20 +105,13 @@ oro:
100105
attachment:
101106
label: Attachment
102107
description: The file that is attached to the case comment.
103-
104108
action:
105109
add: Add Comment
106110
edit: Edit Comment
107111
delete: Remove Comment
108112
dialog:
109113
add: Add Comment
110114
edit: Edit Comment
111-
message:
112-
saved: Comment Saved
113-
removed: Comment Removed
114-
no_records: There are no comments.
115-
delete_confirmation: Are you sure you want to delete this comment?
116-
updated_by: Updated by {{ user }} at {{ date }}
117115
error:
118116
load: Sorry, comments were not loaded correctly.
119117
delete: Sorry, comment deleting failed.

Diff for: src/Oro/Bundle/ContactBundle/Resources/config/oro/datagrids.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,7 @@ datagrids:
245245
name: oro_api_post_contact_email
246246
http_method: POST
247247
route_delete_entity:
248-
name: oro_rest_api_delete_relationship
249-
entityId: emailId
250-
entity: contacts
251-
association: emails
248+
name: oro_api_delete_contact_email
252249
http_method: DELETE
253250
default_route_parameters:
254251
className: Oro_Bundle_ContactBundle_Entity_ContactEmail
@@ -267,10 +264,7 @@ datagrids:
267264
name: oro_api_post_contact_phone
268265
http_method: POST
269266
route_delete_entity:
270-
name: oro_rest_api_delete_relationship
271-
entityId: phoneId
272-
entity: contacts
273-
association: phones
267+
name: oro_api_delete_contact_phone
274268
http_method: DELETE
275269
default_route_parameters:
276270
className: Oro_Bundle_ContactBundle_Entity_ContactPhone

Diff for: src/Oro/Bundle/ContactBundle/Resources/public/js/datagrid/inline-editing/save-api-accessor.js

-15
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ define(function(require) {
4545
body.primary = true;
4646
}
4747

48-
if (this.isActiveDeleteEntityRoute()) {
49-
var routeOptions = this.initialOptions.route_delete_entity;
50-
body = {data: [urlParameters[routeOptions.entityId]]};
51-
urlParameters.entity = routeOptions.entity;
52-
urlParameters.association = routeOptions.association;
53-
}
54-
5548
return ContactApiAccessor.__super__.send.call(this, urlParameters, body, headers, options);
5649
},
5750

@@ -110,14 +103,6 @@ define(function(require) {
110103
/** @returns {boolean} */
111104
isActiveDeleteEntityRoute: function() {
112105
return this.route.get('routeName') === this.initialOptions.route_delete_entity.name;
113-
},
114-
115-
prepareUrlParameters: function(urlParameters) {
116-
if (this.isActiveDeleteEntityRoute()) {
117-
return urlParameters;
118-
}
119-
120-
return ContactApiAccessor.__super__.prepareUrlParameters.apply(this, arguments);
121106
}
122107
});
123108

Diff for: src/Oro/Bundle/MagentoBundle/Entity/Order.php

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ class Order extends ExtendOrder implements
192192

193193
/**
194194
* @ORM\ManyToOne(targetEntity="Cart")
195+
* @ORM\JoinColumn(onDelete="CASCADE")
195196
*/
196197
protected $cart;
197198

Diff for: src/Oro/Bundle/MagentoBundle/Migrations/Schema/OroMagentoBundleInstaller.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function setExtendExtension(ExtendExtension $extendExtension)
7272
*/
7373
public function getMigrationVersion()
7474
{
75-
return 'v1_45';
75+
return 'v1_46';
7676
}
7777

7878
/**
@@ -864,7 +864,7 @@ protected function addOrocrmMagentoOrderForeignKeys(Schema $schema)
864864
$schema->getTable('orocrm_magento_cart'),
865865
['cart_id'],
866866
['id'],
867-
[]
867+
['onDelete' => 'CASCADE']
868868
);
869869
$table->addForeignKeyConstraint(
870870
$schema->getTable('oro_user'),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Oro\Bundle\MagentoBundle\Migrations\Schema\v1_46;
4+
5+
use Doctrine\DBAL\Schema\Schema;
6+
7+
use Oro\Bundle\MigrationBundle\Migration\Migration;
8+
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
9+
10+
class SetCascadeDeleteToOrderCartFK implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
$table = $schema->getTable('orocrm_magento_order');
18+
$fkName = 'FK_4D09F3051AD5CDBF';
19+
$fk = $table->getForeignKey($fkName);
20+
if ($fk->getOption('onDelete') !== 'CASCADE') {
21+
$table->removeForeignKey($fkName);
22+
$table->addForeignKeyConstraint(
23+
$schema->getTable('orocrm_magento_cart'),
24+
['cart_id'],
25+
['id'],
26+
['onDelete' => 'CASCADE']
27+
);
28+
}
29+
}
30+
}

Diff for: src/Oro/Bundle/SalesBundle/EventListener/B2bCustomerLifetimeListener.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,9 @@ function ($entity) {
6969

7070
foreach ($entities as $entity) {
7171
$b2bCustomer = null;
72-
$needRecompute = false;
7372
if (!$entity->getId() && $this->isValuable($entity)) {
74-
// handle creation, just add to prev lifetime value and recalculate change set
73+
// handle creation
7574
$b2bCustomer = $entity->getCustomerAssociation()->getTarget();
76-
$closeRevenueValue = $this->rateConverter->getBaseCurrencyAmount($entity->getCloseRevenue());
77-
$b2bCustomer->setLifetime($b2bCustomer->getLifetime() + $closeRevenueValue);
78-
$needRecompute = true;
7975
} elseif ($this->uow->isScheduledForDelete($entity) && $this->isValuable($entity)) {
8076
$b2bCustomer = $entity->getCustomerAssociation()->getTarget();
8177
} elseif ($this->uow->isScheduledForUpdate($entity)) {
@@ -102,9 +98,6 @@ function ($entity) {
10298
if (null !== $b2bCustomer) {
10399
/** @var B2bCustomer $b2bCustomer */
104100
$this->scheduleUpdate($b2bCustomer);
105-
if ($needRecompute) {
106-
$this->uow->computeChangeSet($this->em->getClassMetadata(B2bCustomer::class), $b2bCustomer);
107-
}
108101
}
109102
}
110103
}

Diff for: src/Oro/Bundle/SalesBundle/Resources/translations/jsmessages.en.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ oro:
22
sales:
33
form:
44
add_new_customer: Add new {{ account }}
5+
new_customer: New
56
email:
67
error:
78
delete.more_one: Email address was not deleted, the lead has more than one email addresses, can't set the new primary.

Diff for: src/Oro/Bundle/SalesBundle/Resources/translations/messages.en.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ oro:
307307
label: Industry
308308
description: Industry where the lead's company is operating.
309309
status:
310-
label: Status
311-
description: Current status of the lead.
310+
label: Status
311+
description: Current status of the lead.
312+
change_error_message: Unable to change lead status.
312313
contact:
313314
label: Contact
314315
description: A contact the lead was converted into.
@@ -328,6 +329,9 @@ oro:
328329
source:
329330
label: Source
330331
description: Source of the lead.
332+
unclassified: No source
333+
others: Others
334+
none: None
331335
notes:
332336
label: Additional comments
333337
description: Additional notes made to the lead record.
@@ -359,12 +363,8 @@ oro:
359363
primary_email:
360364
label: Primary Email
361365
description:
362-
source:
363-
unclassified: No source
364-
others: Others
365-
none: None
366-
status:
367-
change_error_message: Unable to change lead status.
366+
367+
368368
convert:
369369
error: Unable to convert lead to opportunity
370370
feature.label: Lead

Diff for: src/Oro/Bundle/SalesBundle/Resources/views/Autocomplete/customer/selection.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<%= _.escape(text) %>
99
<% if (id === null) { %>
1010
<span class="select2__result-entry-info">
11-
(<%= _.__('oro.sales.form.add_new_customer', {'account': context.account}) %>)
11+
(<%= _.__('oro.sales.form.new_customer') %>)
1212
</span>
1313
<% } %>

0 commit comments

Comments
 (0)