Skip to content

Commit 07b2d47

Browse files
committed
Merge remote-tracking branch 'remotes/dev/release'
2 parents acebd06 + f83070f commit 07b2d47

File tree

133 files changed

+6377
-472
lines changed

Some content is hidden

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

133 files changed

+6377
-472
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
CHANGELOG for 1.0.0-rc2
2+
===================
3+
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-rc2 versions.
4+
5+
* 1.0.0-rc2 (2014-02-25)
6+
* Refactored Flexible Workflows
7+
* Embedded forms
8+
* Account merging
9+
110
CHANGELOG for 1.0.0-rc1
211
===================
312
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-rc1 versions.

UPGRADE.md

+42
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
UPGRADE to 1.0.0-RC2 from 1.0.0-RC1
2+
=======================
3+
4+
### General
5+
6+
* Pull changes from repository
7+
```bash
8+
git pull
9+
```
10+
* Upgrade composer dependency
11+
```bash
12+
php composer.phar update --prefer-dist
13+
```
14+
* Remove old caches
15+
```bash
16+
rm -rf app/cache/*
17+
```
18+
* Fix extended entities configuration by executing below queries in mysql console.
19+
20+
delete FROM oro_entity_config_value where code = 'schema' and field_id is not null;
21+
delete FROM oro_entity_config_value where field_id in (select id FROM oro_entity_config_field where field_name like 'field_%');
22+
delete FROM oro_entity_config_field where field_name like 'field_%';
23+
delete FROM oro_entity_config_value where code = 'set_options' and value = 'Array';
24+
25+
* Update extend entities configuration
26+
```bash
27+
php app/console oro:entity-extend:update-config --env=prod
28+
php app/console oro:entity-extend:dump --env=prod
29+
```
30+
* Upgrade platform
31+
```bash
32+
php app/console oro:platform:update --env=prod
33+
```
34+
* Load new fixtures
35+
```bash
36+
php app/console oro:installer:fixtures:load --env=prod
37+
```
38+
* Load new workflows definitions
39+
```bash
40+
php app/console oro:workflow:definitions:load --env=prod
41+
```
42+
143
UPGRADE to any 1.0.0-alpha and beta version
244
=======================
345

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "oro/crm",
33
"description": "OroCRM",
44
"homepage": "https://github.com/orocrm/crm.git",
5-
"license": "The Open Software License version 3.0",
5+
"license": "OSL-3.0",
66
"authors": [
77
{
88
"name": "Oro, Inc",
@@ -16,7 +16,7 @@
1616
},
1717
"require": {
1818
"php": ">=5.4.4",
19-
"oro/platform": "1.0.0-rc2"
19+
"oro/platform": "1.0.0-rc3"
2020
},
2121
"minimum-stability": "dev",
2222
"prefer-stable": true,

src/OroCRM/Bundle/AccountBundle/Entity/Account.php

+36-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Oro\Bundle\DataAuditBundle\Metadata\Annotation as Oro;
1717

1818
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
19+
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;
1920

2021
use Oro\Bundle\UserBundle\Entity\User;
2122

@@ -28,7 +29,11 @@
2829
* routeName="orocrm_account_index",
2930
* routeView="orocrm_account_view",
3031
* defaultValues={
31-
* "entity"={"label"="Account", "plural_label"="Accounts"},
32+
* "entity"={
33+
* "label"="Account",
34+
* "plural_label"="Accounts",
35+
* "icon"="icon-suitcase"
36+
* },
3237
* "ownership"={
3338
* "owner_type"="USER",
3439
* "owner_field_name"="owner",
@@ -37,6 +42,9 @@
3742
* "security"={
3843
* "type"="ACL",
3944
* "group_name"=""
45+
* },
46+
* "merge"={
47+
* "enable"=true
4048
* }
4149
* }
4250
* )
@@ -57,6 +65,7 @@ class Account extends ExtendAccount implements Taggable
5765
* @ORM\Column(type="string", length=255)
5866
* @Soap\ComplexType("string")
5967
* @Oro\Versioned
68+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
6069
*/
6170
protected $name;
6271

@@ -65,6 +74,7 @@ class Account extends ExtendAccount implements Taggable
6574
* @ORM\ManyToOne(targetEntity="Oro\Bundle\UserBundle\Entity\User")
6675
* @ORM\JoinColumn(name="user_owner_id", referencedColumnName="id", onDelete="SET NULL")
6776
* @Soap\ComplexType("string", nillable=true)
77+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
6878
*/
6979
protected $owner;
7080

@@ -73,6 +83,7 @@ class Account extends ExtendAccount implements Taggable
7383
*
7484
* @ORM\ManyToOne(targetEntity="Oro\Bundle\AddressBundle\Entity\Address", cascade={"persist", "remove"})
7585
* @ORM\JoinColumn(name="shipping_address_id", referencedColumnName="id", onDelete="SET NULL")
86+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
7687
*/
7788
protected $shippingAddress;
7889

@@ -81,6 +92,8 @@ class Account extends ExtendAccount implements Taggable
8192
*
8293
* @ORM\ManyToOne(targetEntity="Oro\Bundle\AddressBundle\Entity\Address", cascade={"persist", "remove"})
8394
* @ORM\JoinColumn(name="billing_address_id", referencedColumnName="id", onDelete="SET NULL")
95+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
96+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
8497
*/
8598
protected $billingAddress;
8699

@@ -91,6 +104,7 @@ class Account extends ExtendAccount implements Taggable
91104
*
92105
* @ORM\ManyToMany(targetEntity="OroCRM\Bundle\ContactBundle\Entity\Contact", inversedBy="accounts")
93106
* @ORM\JoinTable(name="orocrm_account_to_contact")
107+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
94108
*/
95109
protected $contacts;
96110

@@ -101,6 +115,7 @@ class Account extends ExtendAccount implements Taggable
101115
*
102116
* @ORM\ManyToOne(targetEntity="OroCRM\Bundle\ContactBundle\Entity\Contact")
103117
* @ORM\JoinColumn(name="default_contact_id", referencedColumnName="id", onDelete="SET NULL")
118+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
104119
*/
105120
protected $defaultContact;
106121

@@ -122,6 +137,7 @@ class Account extends ExtendAccount implements Taggable
122137

123138
/**
124139
* @var ArrayCollection $tags
140+
* @ConfigField(defaultValues={"merge"={"enable"=true}})
125141
*/
126142
protected $tags;
127143

@@ -240,6 +256,19 @@ public function addContact(Contact $contact)
240256
return $this;
241257
}
242258

259+
/**
260+
* Set contacts collection
261+
*
262+
* @param Collection $contacts
263+
* @return Account
264+
*/
265+
public function setContacts(Collection $contacts)
266+
{
267+
$this->contacts = $contacts;
268+
269+
return $this;
270+
}
271+
243272
/**
244273
* Get shipping address
245274
*
@@ -256,7 +285,7 @@ public function getShippingAddress()
256285
* @param Address $address
257286
* @return Account
258287
*/
259-
public function setShippingAddress(Address $address)
288+
public function setShippingAddress($address)
260289
{
261290
$this->shippingAddress = $address;
262291

@@ -279,7 +308,7 @@ public function getBillingAddress()
279308
* @param Address $address
280309
* @return Account
281310
*/
282-
public function setBillingAddress(Address $address)
311+
public function setBillingAddress($address)
283312
{
284313
$this->billingAddress = $address;
285314

@@ -383,6 +412,10 @@ public function setDefaultContact($defaultContact)
383412
{
384413
$this->defaultContact = $defaultContact;
385414

415+
if ($defaultContact && !$this->contacts->contains($defaultContact)) {
416+
$this->addContact($defaultContact);
417+
}
418+
386419
return $this;
387420
}
388421

src/OroCRM/Bundle/AccountBundle/Resources/config/datagrid.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
datagrid:
22
dashboard-my-accounts-activity-grid:
3-
options:
4-
entityHint: account
53
source:
64
type: orm
75
acl_resource: orocrm_call_view
@@ -42,6 +40,7 @@ datagrid:
4240
contactPhone:
4341
label: orocrm.contact.contactphone.phone.label
4442
options:
43+
entityHint: account
4544
toolbarOptions:
4645
hide: true
4746
pageSize:
@@ -169,8 +168,14 @@ datagrid:
169168
label: Delete
170169
icon: trash
171170
link: delete_link
171+
mass_actions:
172+
merge:
173+
type: merge
174+
entity_name: %orocrm_account.account.entity.class%
175+
data_identifier: a.id
172176
options:
173177
entityHint: account
178+
export: true
174179

175180
base-account-contacts-grid:
176181
extended_entity_name: %orocrm_contact.entity.class%

src/OroCRM/Bundle/AccountBundle/Resources/config/navigation.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ oro_menu_config:
99
label: orocrm.account.entity_plural_label
1010
route: orocrm_account_index
1111
extras:
12+
position: 5
1213
routes: ['orocrm_account_*']
1314
description: List of accounts
1415

src/OroCRM/Bundle/AccountBundle/Resources/config/search.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ OroCRM\Bundle\AccountBundle\Entity\Account:
77
parameters:
88
id: id
99
search_template: OroCRMAccountBundle:Account:searchResult.html.twig
10-
entity_icon_class: icon-home
1110
fields:
1211
-
1312
name: name

src/OroCRM/Bundle/AccountBundle/Tests/Functional/API/RestAccountTest.php

+17-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ public function testCreate()
2828
"owner" => '1',
2929
)
3030
);
31-
$this->client->request('POST', $this->client->generate('oro_api_post_account'), $request);
31+
$this->client->request(
32+
'POST',
33+
$this->client->generate('oro_api_post_account'),
34+
$request
35+
);
3236
$result = $this->client->getResponse();
3337
ToolsAPI::assertJsonResponse($result, 201);
3438
$result = ToolsAPI::jsonToArray($result->getContent());
@@ -45,7 +49,10 @@ public function testCreate()
4549
*/
4650
public function testGet($request)
4751
{
48-
$this->client->request('GET', $this->client->generate('oro_api_get_accounts'));
52+
$this->client->request(
53+
'GET',
54+
$this->client->generate('oro_api_get_accounts')
55+
);
4956
$result = $this->client->getResponse();
5057
$result = ToolsAPI::jsonToArray($result->getContent());
5158
$id = $request['id'];
@@ -59,7 +66,10 @@ function ($a) use ($id) {
5966
$this->assertNotEmpty($result);
6067
$this->assertEquals($request['account']['name'], reset($result)['name']);
6168

62-
$this->client->request('GET', $this->client->generate('oro_api_get_account', array('id' => $request['id'])));
69+
$this->client->request(
70+
'GET',
71+
$this->client->generate('oro_api_get_account', array('id' => $request['id']))
72+
);
6373
$result = $this->client->getResponse();
6474
ToolsAPI::assertJsonResponse($result, 200);
6575

@@ -84,7 +94,10 @@ public function testUpdate($request)
8494

8595
ToolsAPI::assertJsonResponse($result, 204);
8696

87-
$this->client->request('GET', $this->client->generate('oro_api_get_account', array('id' => $request['id'])));
97+
$this->client->request(
98+
'GET',
99+
$this->client->generate('oro_api_get_account', array('id' => $request['id']))
100+
);
88101
$result = $this->client->getResponse();
89102
ToolsAPI::assertJsonResponse($result, 200);
90103

src/OroCRM/Bundle/AccountBundle/Tests/Functional/API/SoapAccountTest.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ public function testUpdate($request)
7979
$accountUpdate = $request;
8080
unset($accountUpdate['id']);
8181
$accountUpdate['name'] .= '_Updated';
82+
8283
$result = $this->client->getSoap()->updateAccount($request['id'], $accountUpdate);
8384
$this->assertTrue($result);
85+
8486
$account = $this->client->getSoap()->getAccount($request['id']);
8587
$account = ToolsAPI::classToArray($account);
8688

@@ -92,18 +94,13 @@ public function testUpdate($request)
9294
/**
9395
* @param $request
9496
* @depends testUpdate
95-
* @throws \Exception|\SoapFault
9697
*/
9798
public function testDelete($request)
9899
{
99100
$result = $this->client->getSoap()->deleteAccount($request['id']);
100101
$this->assertTrue($result);
101-
try {
102-
$this->client->getSoap()->getAccount($request['id']);
103-
} catch (\SoapFault $e) {
104-
if ($e->faultcode != 'NOT_FOUND') {
105-
throw $e;
106-
}
107-
}
102+
103+
$this->setExpectedException('\SoapFault', 'Record with ID "' . $request['id'] . '" can not be found');
104+
$this->client->getSoap()->getAccount($request['id']);
108105
}
109106
}

src/OroCRM/Bundle/AccountBundle/Tests/Selenium/CreateAccountTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testUpdateAccount($accountName)
6363
$newAccountName = 'Update_' . $accountName;
6464

6565
$login = $this->login();
66-
$login->openAccounts('OroCRM\Bundle\AccountBundle')
66+
$login = $login->openAccounts('OroCRM\Bundle\AccountBundle')
6767
->filterBy('Account name', $accountName)
6868
->open(array($accountName))
6969
->edit()
@@ -74,8 +74,7 @@ public function testUpdateAccount($accountName)
7474
->toGrid()
7575
->assertTitle('Accounts - Customers')
7676
->close();
77-
78-
return $newAccountName;
77+
return $newAccountName;
7978
}
8079

8180
/**

src/OroCRM/Bundle/CRMBundle/OroCRMBundle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
class OroCRMBundle extends Bundle
88
{
9-
const VERSION = '1.0.0-RC1';
9+
const VERSION = '1.0.0-RC2';
1010
}

0 commit comments

Comments
 (0)