Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/release'
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Feb 25, 2014
2 parents acebd06 + f83070f commit 07b2d47
Show file tree
Hide file tree
Showing 133 changed files with 6,377 additions and 472 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
CHANGELOG for 1.0.0-rc2
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-rc2 versions.

* 1.0.0-rc2 (2014-02-25)
* Refactored Flexible Workflows
* Embedded forms
* Account merging

CHANGELOG for 1.0.0-rc1
===================
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-rc1 versions.
Expand Down
42 changes: 42 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
UPGRADE to 1.0.0-RC2 from 1.0.0-RC1
=======================

### General

* Pull changes from repository
```bash
git pull
```
* Upgrade composer dependency
```bash
php composer.phar update --prefer-dist
```
* Remove old caches
```bash
rm -rf app/cache/*
```
* Fix extended entities configuration by executing below queries in mysql console.

delete FROM oro_entity_config_value where code = 'schema' and field_id is not null;
delete FROM oro_entity_config_value where field_id in (select id FROM oro_entity_config_field where field_name like 'field_%');
delete FROM oro_entity_config_field where field_name like 'field_%';
delete FROM oro_entity_config_value where code = 'set_options' and value = 'Array';

* Update extend entities configuration
```bash
php app/console oro:entity-extend:update-config --env=prod
php app/console oro:entity-extend:dump --env=prod
```
* Upgrade platform
```bash
php app/console oro:platform:update --env=prod
```
* Load new fixtures
```bash
php app/console oro:installer:fixtures:load --env=prod
```
* Load new workflows definitions
```bash
php app/console oro:workflow:definitions:load --env=prod
```

UPGRADE to any 1.0.0-alpha and beta version
=======================

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "oro/crm",
"description": "OroCRM",
"homepage": "https://github.com/orocrm/crm.git",
"license": "The Open Software License version 3.0",
"license": "OSL-3.0",
"authors": [
{
"name": "Oro, Inc",
Expand All @@ -16,7 +16,7 @@
},
"require": {
"php": ">=5.4.4",
"oro/platform": "1.0.0-rc2"
"oro/platform": "1.0.0-rc3"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
39 changes: 36 additions & 3 deletions src/OroCRM/Bundle/AccountBundle/Entity/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Oro\Bundle\DataAuditBundle\Metadata\Annotation as Oro;

use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;

use Oro\Bundle\UserBundle\Entity\User;

Expand All @@ -28,7 +29,11 @@
* routeName="orocrm_account_index",
* routeView="orocrm_account_view",
* defaultValues={
* "entity"={"label"="Account", "plural_label"="Accounts"},
* "entity"={
* "label"="Account",
* "plural_label"="Accounts",
* "icon"="icon-suitcase"
* },
* "ownership"={
* "owner_type"="USER",
* "owner_field_name"="owner",
Expand All @@ -37,6 +42,9 @@
* "security"={
* "type"="ACL",
* "group_name"=""
* },
* "merge"={
* "enable"=true
* }
* }
* )
Expand All @@ -57,6 +65,7 @@ class Account extends ExtendAccount implements Taggable
* @ORM\Column(type="string", length=255)
* @Soap\ComplexType("string")
* @Oro\Versioned
* @ConfigField(defaultValues={"merge"={"enable"=true}})
*/
protected $name;

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

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

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

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

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

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

/**
* @var ArrayCollection $tags
* @ConfigField(defaultValues={"merge"={"enable"=true}})
*/
protected $tags;

Expand Down Expand Up @@ -240,6 +256,19 @@ public function addContact(Contact $contact)
return $this;
}

/**
* Set contacts collection
*
* @param Collection $contacts
* @return Account
*/
public function setContacts(Collection $contacts)
{
$this->contacts = $contacts;

return $this;
}

/**
* Get shipping address
*
Expand All @@ -256,7 +285,7 @@ public function getShippingAddress()
* @param Address $address
* @return Account
*/
public function setShippingAddress(Address $address)
public function setShippingAddress($address)
{
$this->shippingAddress = $address;

Expand All @@ -279,7 +308,7 @@ public function getBillingAddress()
* @param Address $address
* @return Account
*/
public function setBillingAddress(Address $address)
public function setBillingAddress($address)
{
$this->billingAddress = $address;

Expand Down Expand Up @@ -383,6 +412,10 @@ public function setDefaultContact($defaultContact)
{
$this->defaultContact = $defaultContact;

if ($defaultContact && !$this->contacts->contains($defaultContact)) {
$this->addContact($defaultContact);
}

return $this;
}

Expand Down
9 changes: 7 additions & 2 deletions src/OroCRM/Bundle/AccountBundle/Resources/config/datagrid.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
datagrid:
dashboard-my-accounts-activity-grid:
options:
entityHint: account
source:
type: orm
acl_resource: orocrm_call_view
Expand Down Expand Up @@ -42,6 +40,7 @@ datagrid:
contactPhone:
label: orocrm.contact.contactphone.phone.label
options:
entityHint: account
toolbarOptions:
hide: true
pageSize:
Expand Down Expand Up @@ -169,8 +168,14 @@ datagrid:
label: Delete
icon: trash
link: delete_link
mass_actions:
merge:
type: merge
entity_name: %orocrm_account.account.entity.class%
data_identifier: a.id
options:
entityHint: account
export: true

base-account-contacts-grid:
extended_entity_name: %orocrm_contact.entity.class%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ oro_menu_config:
label: orocrm.account.entity_plural_label
route: orocrm_account_index
extras:
position: 5
routes: ['orocrm_account_*']
description: List of accounts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ OroCRM\Bundle\AccountBundle\Entity\Account:
parameters:
id: id
search_template: OroCRMAccountBundle:Account:searchResult.html.twig
entity_icon_class: icon-home
fields:
-
name: name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public function testCreate()
"owner" => '1',
)
);
$this->client->request('POST', $this->client->generate('oro_api_post_account'), $request);
$this->client->request(
'POST',
$this->client->generate('oro_api_post_account'),
$request
);
$result = $this->client->getResponse();
ToolsAPI::assertJsonResponse($result, 201);
$result = ToolsAPI::jsonToArray($result->getContent());
Expand All @@ -45,7 +49,10 @@ public function testCreate()
*/
public function testGet($request)
{
$this->client->request('GET', $this->client->generate('oro_api_get_accounts'));
$this->client->request(
'GET',
$this->client->generate('oro_api_get_accounts')
);
$result = $this->client->getResponse();
$result = ToolsAPI::jsonToArray($result->getContent());
$id = $request['id'];
Expand All @@ -59,7 +66,10 @@ function ($a) use ($id) {
$this->assertNotEmpty($result);
$this->assertEquals($request['account']['name'], reset($result)['name']);

$this->client->request('GET', $this->client->generate('oro_api_get_account', array('id' => $request['id'])));
$this->client->request(
'GET',
$this->client->generate('oro_api_get_account', array('id' => $request['id']))
);
$result = $this->client->getResponse();
ToolsAPI::assertJsonResponse($result, 200);

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

ToolsAPI::assertJsonResponse($result, 204);

$this->client->request('GET', $this->client->generate('oro_api_get_account', array('id' => $request['id'])));
$this->client->request(
'GET',
$this->client->generate('oro_api_get_account', array('id' => $request['id']))
);
$result = $this->client->getResponse();
ToolsAPI::assertJsonResponse($result, 200);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ public function testUpdate($request)
$accountUpdate = $request;
unset($accountUpdate['id']);
$accountUpdate['name'] .= '_Updated';

$result = $this->client->getSoap()->updateAccount($request['id'], $accountUpdate);
$this->assertTrue($result);

$account = $this->client->getSoap()->getAccount($request['id']);
$account = ToolsAPI::classToArray($account);

Expand All @@ -92,18 +94,13 @@ public function testUpdate($request)
/**
* @param $request
* @depends testUpdate
* @throws \Exception|\SoapFault
*/
public function testDelete($request)
{
$result = $this->client->getSoap()->deleteAccount($request['id']);
$this->assertTrue($result);
try {
$this->client->getSoap()->getAccount($request['id']);
} catch (\SoapFault $e) {
if ($e->faultcode != 'NOT_FOUND') {
throw $e;
}
}

$this->setExpectedException('\SoapFault', 'Record with ID "' . $request['id'] . '" can not be found');
$this->client->getSoap()->getAccount($request['id']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testUpdateAccount($accountName)
$newAccountName = 'Update_' . $accountName;

$login = $this->login();
$login->openAccounts('OroCRM\Bundle\AccountBundle')
$login = $login->openAccounts('OroCRM\Bundle\AccountBundle')
->filterBy('Account name', $accountName)
->open(array($accountName))
->edit()
Expand All @@ -74,8 +74,7 @@ public function testUpdateAccount($accountName)
->toGrid()
->assertTitle('Accounts - Customers')
->close();

return $newAccountName;
return $newAccountName;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/OroCRM/Bundle/CRMBundle/OroCRMBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

class OroCRMBundle extends Bundle
{
const VERSION = '1.0.0-RC1';
const VERSION = '1.0.0-RC2';
}
Loading

0 comments on commit 07b2d47

Please sign in to comment.