Skip to content

Commit 129121b

Browse files
committed
Merge remote-tracking branch 'remotes/dev/1.10' into 1.10
2 parents 1a06418 + 84f640e commit 129121b

File tree

50 files changed

+1469
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1469
-217
lines changed

Diff for: src/Oro/Bridge/CrmTask/Migrations/Data/Demo/ORM/LoadTaskData.php

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
1010
use Symfony\Component\DependencyInjection\ContainerInterface;
1111

12+
use Oro\Bundle\EntityExtendBundle\Tools\ExtendHelper;
1213
use Oro\Bundle\SecurityBundle\Authentication\Token\UsernamePasswordOrganizationToken;
1314
use Oro\Bundle\UserBundle\Entity\User;
1415
use OroCRM\Bundle\TaskBundle\Entity\Task;
@@ -124,6 +125,7 @@ protected function persistDemoTasks(ObjectManager $om)
124125
}
125126
$accounts = $om->getRepository('OroCRMAccountBundle:Account')->findAll();
126127
$contacts = $om->getRepository('OroCRMContactBundle:Contact')->findAll();
128+
$status = $om->getRepository(ExtendHelper::buildEnumValueClassName('task_status'))->find('open');
127129

128130
for ($i = 0; $i < self::FIXTURES_COUNT; ++$i) {
129131
/** @var User $assignedTo */
@@ -145,6 +147,7 @@ protected function persistDemoTasks(ObjectManager $om)
145147
$task->setOwner($assignedTo);
146148
$task->setTaskPriority($taskPriority);
147149
$task->setOrganization($organization);
150+
$task->setStatus($status);
148151

149152
$randomPath = rand(1, 10);
150153

Diff for: src/OroCRM/Bundle/AccountBundle/Datagrid/AccountsViewList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protected function getViewsList()
2121
))
2222
->setLabel($this->translator->trans(
2323
'oro.datagrid.gridview.duplicate.label',
24-
['%entity%' => $this->translator->trans('orocrm.account.entity_label')]
24+
['%entity%' => $this->translator->trans('orocrm.account.entity_plural_label')]
2525
))
2626
];
2727
}

Diff for: src/OroCRM/Bundle/AccountBundle/Entity/Account.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/**
2323
* @ORM\Entity()
24-
* @ORM\Table(name="orocrm_account", indexes={@ORM\Index(name="account_name_idx", columns={"name"})})
24+
* @ORM\Table(name="orocrm_account", indexes={@ORM\Index(name="account_name_idx", columns={"name", "id"})})
2525
* @ORM\HasLifecycleCallbacks()
2626
* @Oro\Loggable
2727
* @Config(

Diff for: src/OroCRM/Bundle/AccountBundle/Migrations/Schema/OroCRMAccountBundleInstaller.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function setAttachmentExtension(AttachmentExtension $attachmentExtension)
8080
*/
8181
public function getMigrationVersion()
8282
{
83-
return 'v1_11';
83+
return 'v1_11_1';
8484
}
8585

8686
/**
@@ -157,7 +157,7 @@ protected function createOrocrmAccountTable(Schema $schema, QueryBag $queries)
157157
$table->addIndex(['user_owner_id'], 'IDX_7166D3719EB185F9', []);
158158
$table->addIndex(['organization_id'], 'IDX_7166D37132C8A3DE', []);
159159
$table->addIndex(['default_contact_id'], 'IDX_7166D371AF827129', []);
160-
$table->addIndex(['name'], 'account_name_idx', []);
160+
$table->addIndex(['name', 'id'], 'account_name_idx', []);
161161

162162
$queries->addPostQuery(new AccountNameExprIndexQuery());
163163
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace OroCRM\Bundle\AccountBundle\Migrations\Schema\v1_11_1;
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 UpdateIndexes implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
$table = $schema->getTable('orocrm_account');
18+
$indexName = 'account_name_idx';
19+
$indexColumns = ['name', 'id'];
20+
if ($table->hasIndex($indexName) && $table->getIndex($indexName)->getColumns() !== $indexColumns) {
21+
$table->dropIndex($indexName);
22+
$table->addIndex($indexColumns, $indexName);
23+
}
24+
}
25+
}

Diff for: src/OroCRM/Bundle/CRMBundle/Tests/Behat/Features/Fixtures/mass_action.yml

+12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
include:
22
- contacts.yml
33

4+
OroCRM\Bundle\TaskBundle\Entity\TaskPriority:
5+
testPriority:
6+
__construct: [test]
7+
label: test
8+
order: 1
9+
10+
Extend\Entity\EV_Task_Status:
11+
testStatus:
12+
__construct: [test, test]
13+
414
OroCRM\Bundle\TaskBundle\Entity\Task:
515
task-{1..30}:
616
subject: '<sentence()>'
717
owner: '@admin'
818
organization: '@organization'
19+
taskPriority: '@testPriority'
20+
status: '@testStatus'
921

1022
OroCRM\Bundle\AccountBundle\Entity\Account:
1123
account-{1..30}:

Diff for: src/OroCRM/Bundle/CampaignBundle/Dashboard/CampaignDataProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getCampaignLeadsData(array $dateRange)
4747
{
4848
$qb = $this->getCampaignRepository()->getCampaignsLeadsQB('lead');
4949
$qb->setMaxResults(self::CAMPAIGN_LEAD_COUNT);
50-
$this->dateFilterProcessor->process($qb, $dateRange, 'lead.createdAt');
50+
$this->dateFilterProcessor->applyDateRangeFilterToQuery($qb, $dateRange, 'lead.createdAt');
5151

5252
return $this->aclHelper->apply($qb)->getArrayResult();
5353
}
@@ -75,7 +75,7 @@ public function getCampaignsByCloseRevenueData(array $dateRange)
7575
{
7676
$qb = $this->getCampaignRepository()->getCampaignsByCloseRevenueQB('opportunities');
7777
$qb->setMaxResults(self::CAMPAIGN_CLOSE_REVENUE_COUNT);
78-
$this->dateFilterProcessor->process($qb, $dateRange, 'opportunities.createdAt');
78+
$this->dateFilterProcessor->applyDateRangeFilterToQuery($qb, $dateRange, 'opportunities.createdAt');
7979

8080
return $this->aclHelper->apply($qb)->getArrayResult();
8181
}

Diff for: src/OroCRM/Bundle/CampaignBundle/Entity/Repository/CampaignRepository.php

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function getCampaignsByCloseRevenueQB($opportunitiesAlias)
152152
->from('OroCRMCampaignBundle:Campaign', 'campaign')
153153
->join('OroCRMSalesBundle:Lead', 'lead', 'WITH', 'lead.campaign = campaign')
154154
->join('lead.opportunities', $opportunitiesAlias)
155+
->where(sprintf('%s.status=\'won\'', $opportunitiesAlias))
155156
->orderBy('closeRevenue', 'DESC')
156157
->groupBy('campaign.name');
157158

Diff for: src/OroCRM/Bundle/CaseBundle/Entity/CaseEntity.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
/**
2121
* @ORM\Entity
2222
* @ORM\Table(
23-
* name="orocrm_case"
23+
* name="orocrm_case",
24+
* indexes={@ORM\Index(name="case_reported_at_idx",columns={"reportedAt", "id"})}
2425
* )
2526
* @ORM\HasLifecycleCallbacks()
2627
* @Oro\Loggable

Diff for: src/OroCRM/Bundle/CaseBundle/Migrations/Schema/OroCRMCaseBundleInstaller.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class OroCRMCaseBundleInstaller implements
4242
*/
4343
public function getMigrationVersion()
4444
{
45-
return 'v1_9';
45+
return 'v1_10';
4646
}
4747

4848
/**
@@ -138,6 +138,7 @@ protected function createOrocrmCaseTable(Schema $schema)
138138
$table->addIndex(['related_account_id'], 'IDX_AB3BAC1E11A6570A', []);
139139
$table->addIndex(['source_name'], 'IDX_AB3BAC1E5FA9FB05', []);
140140
$table->addIndex(['priority_name'], 'IDX_AB3BAC1E965BD3DF', []);
141+
$table->addIndex(['reportedAt', 'id'], 'case_reported_at_idx', []);
141142
}
142143

143144
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace OroCRM\Bundle\CaseBundle\Migrations\Schema\v1_10;
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 UpdateIndexes implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
$table = $schema->getTable('orocrm_case');
18+
$indexName = 'case_reported_at_idx';
19+
$indexColumns = ['reportedAt', 'id'];
20+
if ($table->hasIndex($indexName)) {
21+
if ($table->getIndex($indexName)->getColumns() !== $indexColumns) {
22+
$table->dropIndex($indexName);
23+
$table->addIndex($indexColumns, $indexName);
24+
}
25+
} else {
26+
$table->addIndex($indexColumns, $indexName);
27+
}
28+
}
29+
}

Diff for: src/OroCRM/Bundle/ContactBundle/Datagrid/ContactsViewList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protected function getViewsList()
2121
))
2222
->setLabel($this->translator->trans(
2323
'oro.datagrid.gridview.duplicate.label',
24-
['%entity%' => $this->translator->trans('orocrm.contact.entity_label')]
24+
['%entity%' => $this->translator->trans('orocrm.contact.entity_plural_label')]
2525
))
2626
];
2727
}

Diff for: src/OroCRM/Bundle/ContactBundle/Entity/Contact.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @ORM\Table(
3434
* name="orocrm_contact",
3535
* indexes={
36-
* @ORM\Index(name="contact_name_idx",columns={"last_name", "first_name"}),
36+
* @ORM\Index(name="contact_name_idx",columns={"last_name", "first_name", "id"}),
3737
* @ORM\Index(name="contact_updated_at_idx",columns={"updatedAt"}),
3838
* }
3939
* )

Diff for: src/OroCRM/Bundle/ContactBundle/Entity/Repository/ContactRepository.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace OroCRM\Bundle\ContactBundle\Entity\Repository;
44

55
use Doctrine\ORM\EntityRepository;
6-
use Doctrine\ORM\QueryBuilder;
76

87
use Oro\Bundle\EmailBundle\Entity\Repository\EmailAwareRepository;
98

@@ -18,24 +17,25 @@ public function getPrimaryEmailsQb($fullNameQueryPart, array $excludedEmailNames
1817

1918
$qb
2019
->select(sprintf('%s AS name', $fullNameQueryPart))
21-
->addSelect('c.id AS entityId, c.email, o.name AS organization')
20+
->addSelect('c.id AS entityId, e.email, o.name AS organization')
2221
->orderBy('name')
2322
->leftJoin('c.organization', 'o')
24-
->andWhere('c.email IS NOT NULL');
23+
->leftJoin('c.emails', 'e')
24+
->andWhere('e.primary = true');
2525

2626
if ($query) {
2727
$qb
2828
->andWhere($qb->expr()->orX(
2929
$qb->expr()->like($fullNameQueryPart, ':query'),
30-
$qb->expr()->like('c.email', ':query')
30+
$qb->expr()->like('e.email', ':query')
3131
))
3232
->setParameter('query', sprintf('%%%s%%', $query));
3333
}
3434

3535
if ($excludedEmailNames) {
3636
$qb
3737
->andWhere($qb->expr()->notIn(
38-
sprintf('TRIM(CONCAT(%s, \' <\', c.email, \'>|\', o.name))', $fullNameQueryPart),
38+
sprintf('TRIM(CONCAT(%s, \' <\', e.email, \'>|\', o.name))', $fullNameQueryPart),
3939
':excluded_emails'
4040
))
4141
->setParameter('excluded_emails', array_values($excludedEmailNames));

Diff for: src/OroCRM/Bundle/ContactBundle/Migrations/Schema/OroCRMContactBundleInstaller.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function setAttachmentExtension(AttachmentExtension $attachmentExtension)
7373
*/
7474
public function getMigrationVersion()
7575
{
76-
return 'v1_14';
76+
return 'v1_15';
7777
}
7878

7979
/**
@@ -151,7 +151,7 @@ protected function createOrocrmContactTable(Schema $schema)
151151
$table->addIndex(['reports_to_contact_id'], 'IDX_403263EDF27EBC1E', []);
152152
$table->addIndex(['created_by_user_id'], 'IDX_403263ED7D182D95', []);
153153
$table->addIndex(['updated_by_user_id'], 'IDX_403263ED2793CC5E', []);
154-
$table->addIndex(['last_name', 'first_name'], 'contact_name_idx', []);
154+
$table->addIndex(['last_name', 'first_name', 'id'], 'contact_name_idx', []);
155155
$table->addIndex(['updatedAt'], 'contact_updated_at_idx', []);
156156
}
157157

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace OroCRM\Bundle\ContactBundle\Migrations\Schema\v1_15;
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 UpdateIndexes implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
$table = $schema->getTable('orocrm_contact');
18+
$indexName = 'contact_name_idx';
19+
$indexColumns = ['last_name', 'first_name', 'id'];
20+
if ($table->hasIndex($indexName) && $table->getIndex($indexName)->getColumns() !== $indexColumns) {
21+
$table->dropIndex($indexName);
22+
$table->addIndex($indexColumns, $indexName);
23+
}
24+
}
25+
}

Diff for: src/OroCRM/Bundle/ContactUsBundle/Entity/ContactRequest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @ORM\Entity
2323
* @ORM\Table(
2424
* name="orocrm_contactus_request",
25-
* indexes={@ORM\Index(name="request_create_idx",columns={"created_at"})}
25+
* indexes={@ORM\Index(name="request_create_idx",columns={"created_at", "id"})}
2626
* )
2727
*
2828
* @Config(

Diff for: src/OroCRM/Bundle/ContactUsBundle/Migrations/Schema/OroCRMContactUsBundleInstaller.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function setActivityExtension(ActivityExtension $activityExtension)
3434
*/
3535
public function getMigrationVersion()
3636
{
37-
return 'v1_10';
37+
return 'v1_10_1';
3838
}
3939

4040
/**
@@ -117,7 +117,7 @@ protected function createOrocrmContactusRequestTable(Schema $schema)
117117
$table->addIndex(['opportunity_id'], 'IDX_342872E89A34590F', []);
118118
$table->addIndex(['lead_id'], 'IDX_342872E855458D', []);
119119
$table->addIndex(['workflow_step_id'], 'IDX_342872E871FE882C', []);
120-
$table->addIndex(['created_at'], 'request_create_idx', []);
120+
$table->addIndex(['created_at', 'id'], 'request_create_idx', []);
121121
}
122122

123123

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace OroCRM\Bundle\ContactUsBundle\Migrations\Schema\v1_10_1;
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 UpdateIndexes implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
$table = $schema->getTable('orocrm_contactus_request');
18+
$indexName = 'request_create_idx';
19+
$indexColumns = ['created_at', 'id'];
20+
if ($table->hasIndex($indexName) && $table->getIndex($indexName)->getColumns() !== $indexColumns) {
21+
$table->dropIndex($indexName);
22+
$table->addIndex($indexColumns, $indexName);
23+
}
24+
}
25+
}

Diff for: src/OroCRM/Bundle/MagentoBundle/Entity/Cart.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @ORM\Table(name="orocrm_magento_cart",
3131
* indexes={
3232
* @ORM\Index(name="magecart_origin_idx", columns={"origin_id"}),
33-
* @ORM\Index(name="magecart_updated_idx", columns={"updatedAt"}),
33+
* @ORM\Index(name="magecart_updated_idx", columns={"updatedAt", "id"}),
3434
* @ORM\Index(name="magecart_payment_details_idx", columns={"payment_details"}),
3535
* @ORM\Index(name="status_name_items_qty_idx", columns={"status_name", "items_qty"})
3636
* },

Diff for: src/OroCRM/Bundle/MagentoBundle/Entity/Customer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* uniqueConstraints={@ORM\UniqueConstraint(name="magecustomer_oid_cid_unq", columns={"origin_id", "channel_id"})},
3636
* indexes={
3737
* @ORM\Index(name="magecustomer_name_idx",columns={"first_name", "last_name"}),
38-
* @ORM\Index(name="magecustomer_rev_name_idx",columns={"last_name", "first_name"}),
38+
* @ORM\Index(name="magecustomer_rev_name_idx",columns={"last_name", "first_name", "id"}),
3939
* @ORM\Index(name="magecustomer_email_guest_idx",columns={"email"})
4040
* }
4141
* )

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use Oro\Bundle\UserBundle\Entity\User;
1313
use Oro\Bundle\AddressBundle\Entity\AddressType;
1414
use Oro\Bundle\AddressBundle\Entity\AbstractTypedAddress;
15-
use Oro\Bundle\WorkflowBundle\Entity\WorkflowItem;
16-
use Oro\Bundle\WorkflowBundle\Entity\WorkflowStep;
1715
use Oro\Bundle\LocaleBundle\Model\FirstNameInterface;
1816
use Oro\Bundle\LocaleBundle\Model\LastNameInterface;
1917

@@ -28,7 +26,7 @@
2826
* @ORM\HasLifecycleCallbacks
2927
* @ORM\Table(name="orocrm_magento_order",
3028
* indexes={
31-
* @ORM\Index(name="mageorder_created_idx",columns={"created_at"})
29+
* @ORM\Index(name="mageorder_created_idx",columns={"created_at", "id"})
3230
* },
3331
* uniqueConstraints={
3432
* @ORM\UniqueConstraint(name="unq_increment_id_channel_id", columns={"increment_id", "channel_id"})

0 commit comments

Comments
 (0)