Skip to content

Commit 9fc9e59

Browse files
author
Michael Banin
committed
Merge remote-tracking branch 'remotes/dev/1.7' into 1.7
2 parents 9c8f230 + 3c48b8c commit 9fc9e59

File tree

12 files changed

+210
-3
lines changed

12 files changed

+210
-3
lines changed

Diff for: CHANGELOG.md

+60
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
1+
CHANGELOG for 1.7.6
2+
===================
3+
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.6 versions.
4+
* 1.7.6 (2015-08-14)
5+
* Magento order items are now organization-aware
6+
* Fixed validation errors in REST API controller for Accounts
7+
8+
CHANGELOG for 1.7.5
9+
===================
10+
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.5 versions.
11+
* 1.7.5 (2015-07-29)
12+
* Role entity is now extendable
13+
* Data types for Data Audit may now be added by developers
14+
* Fixed issues with date & time queries in Reports
15+
16+
CHANGELOG for 1.7.4
17+
===================
18+
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.4 versions.
19+
* 1.7.4 (2015-07-08)
20+
This release fixes a major security issue - a so-called Open Redirect that might be exploited to redirect users to third-party servers in an underhand way, and may potentially lead to steal of user's login and password.
21+
Also fixed minor security issues.
22+
23+
CHANGELOG for 1.7.3
24+
===================
25+
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.3 versions.
26+
* 1.7.3 (2015-07-03)
27+
Oro Platform 1.7.3 dependency update
28+
29+
CHANGELOG for 1.7.2
30+
===================
31+
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.2 versions.
32+
* 1.7.2 (2015-06-17)
33+
* Fixed issue Magento cart items during sync
34+
* Fixed email html code visibility
35+
36+
CHANGELOG for 1.7.1
37+
===================
38+
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.1 versions.
39+
* 1.7.1 (2015-06-15)
40+
Guest Magento customer profiles
41+
With this feature we introduce a new type of Magento Customer – guest customers, i.e. those who for some reasons decided not to register in your Magento store but made a purchase anyway. Information collected during the guest check-out will be used to create Magento customer profiles that will look and behave exactly the same way as regular Magento customers except they won't be synced via integration and they won't have a current shopping cart.
42+
If, at some later point in time, this customer chooses to register, his existing guest profile will be automatically connected to his Magento account and then kept in sync by the integration. If a customer deletes an account in Magento, the Magento customer profile in Oro will remain, but turns into a guest one.
43+
Guest orders placed by registered customers will also be recognized and appended to their accounts, giving you the full picture of their purchases.
44+
This feature may be disabled in Magento integration settings. It is turned on by default.
45+
46+
Items removed from Magento cart will be recorded in OroCRM
47+
Shopping carts in OroCRM will now contain the entire history of what has been put into the cart and what has been removed from it, giving you more data for marketing segmentation and campaigning. It will now be possible to set filtering conditions on item state like:
48+
* filter all customers who do have item X in the cart
49+
* filter all customers who have ever added item X to their carts
50+
* filter all customers who have added but then removed item X from their carts
51+
52+
List of improvements and fixed bugs
53+
* Changed Oro Bridge detection to use soap getFunctions method
54+
* Improved Magento Region connector
55+
* Fixed "Create Magento Customer" is available for Organization without Magento Channel
56+
* Fixed Delete Marketing list provokes errors
57+
* Fixed error if add duplicate columns in Marketing list
58+
* Fixed import B2B Customer which is related to existing Lead
59+
* Fixed memory leak Sales Process
60+
161
CHANGELOG for 1.7.0
262
===================
363
This changelog references the relevant changes (new features, changes and bugs) done in 1.7.0 versions.

Diff for: src/OroCRM/Bundle/AccountBundle/Controller/Api/Rest/AccountController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function getManager()
137137
*/
138138
public function getForm()
139139
{
140-
return $this->get('orocrm_account.form.type.account.api');
140+
return $this->get('orocrm_account.form.account.api');
141141
}
142142

143143
/**

Diff for: src/OroCRM/Bundle/CaseBundle/Controller/Api/Rest/CommentController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function getManager()
135135
*/
136136
public function getForm()
137137
{
138-
return $this->get('orocrm_case.form.type.comment.api');
138+
return $this->get('orocrm_case.form.comment.api');
139139
}
140140

141141
/**

Diff for: src/OroCRM/Bundle/DemoDataBundle/Migrations/Data/Demo/ORM/LoadMagentoData.php

+2
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ protected function generateOrderItem(ObjectManager $om, Order $order, Cart $cart
312312
$orderItem->setPrice($cartItem->getPrice());
313313
$orderItem->setOriginalPrice($cartItem->getPrice());
314314
$orderItem->setName($cartItem->getName());
315+
$orderItem->setOwner($order->getOrganization());
315316
$orderItems[] = $orderItem;
316317

317318
$om->persist($orderItem);
@@ -415,6 +416,7 @@ protected function generateShoppingCartItem(ObjectManager $om, Cart $cart)
415416
$cartItem->setUpdatedAt(new \DateTime('now'));
416417
$cartItem->setOriginId($origin);
417418
$cartItem->setCart($cart);
419+
$cartItem->setOwner($cart->getOrganization());
418420
$cart->getCartItems()->add($cartItem);
419421
$cart->setItemsQty($i+1);
420422
$cart->setItemsCount($i+1);

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

+38
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Doctrine\ORM\Mapping as ORM;
66

7+
use Oro\Bundle\OrganizationBundle\Entity\Organization;
78
use OroCRM\Bundle\MagentoBundle\Model\ExtendCartItem;
89
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
910

@@ -21,6 +22,11 @@
2122
* "entity"={
2223
* "icon"="icon-shopping-cart"
2324
* },
25+
* "ownership"={
26+
* "owner_type"="ORGANIZATION",
27+
* "owner_field_name"="owner",
28+
* "owner_column_name"="owner_id"
29+
* },
2430
* "security"={
2531
* "type"="ACL",
2632
* "group_name"=""
@@ -154,6 +160,14 @@ class CartItem extends ExtendCartItem implements OriginAwareInterface, Integrati
154160
*/
155161
protected $removed = false;
156162

163+
/**
164+
* @var Organization
165+
*
166+
* @ORM\ManyToOne(targetEntity="Oro\Bundle\OrganizationBundle\Entity\Organization")
167+
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="SET NULL")
168+
*/
169+
protected $owner;
170+
157171
/**
158172
* @param float $customPrice
159173
*
@@ -453,4 +467,28 @@ public function setRemoved($removed)
453467

454468
return $this;
455469
}
470+
471+
/**
472+
* Set owner
473+
*
474+
* @param Organization $owner
475+
*
476+
* @return $this
477+
*/
478+
public function setOwner(Organization $owner = null)
479+
{
480+
$this->owner = $owner;
481+
482+
return $this;
483+
}
484+
485+
/**
486+
* Get owner
487+
*
488+
* @return Organization
489+
*/
490+
public function getOwner()
491+
{
492+
return $this->owner;
493+
}
456494
}

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

+38
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
88

9+
use Oro\Bundle\OrganizationBundle\Entity\Organization;
910
use OroCRM\Bundle\MagentoBundle\Model\ExtendOrderItem;
1011

1112
/**
@@ -16,6 +17,11 @@
1617
* "entity"={
1718
* "icon"="icon-list-alt"
1819
* },
20+
* "ownership"={
21+
* "owner_type"="ORGANIZATION",
22+
* "owner_field_name"="owner",
23+
* "owner_column_name"="owner_id"
24+
* },
1925
* "security"={
2026
* "type"="ACL",
2127
* "group_name"=""
@@ -79,6 +85,14 @@ class OrderItem extends ExtendOrderItem implements IntegrationAwareInterface, Or
7985
*/
8086
protected $discountPercent;
8187

88+
/**
89+
* @var Organization
90+
*
91+
* @ORM\ManyToOne(targetEntity="Oro\Bundle\OrganizationBundle\Entity\Organization")
92+
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="SET NULL")
93+
*/
94+
protected $owner;
95+
8296
/** Do not needed in magento order item, because magento api does not bring it up */
8397
protected $cost;
8498

@@ -181,4 +195,28 @@ public function getDiscountPercent()
181195
{
182196
return $this->discountPercent;
183197
}
198+
199+
/**
200+
* Set owner
201+
*
202+
* @param Organization $owner
203+
*
204+
* @return OrderItem
205+
*/
206+
public function setOwner(Organization $owner = null)
207+
{
208+
$this->owner = $owner;
209+
210+
return $this;
211+
}
212+
213+
/**
214+
* Get owner
215+
*
216+
* @return Organization
217+
*/
218+
public function getOwner()
219+
{
220+
return $this->owner;
221+
}
184222
}

Diff for: src/OroCRM/Bundle/MagentoBundle/ImportExport/Strategy/CartStrategy.php

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ protected function updateCustomer(Cart $cart)
120120
protected function updateCartItems(Cart $cart)
121121
{
122122
foreach ($cart->getCartItems() as $cartItem) {
123+
$cartItem->setOwner($cart->getOrganization());
123124
$cartItem->setCart($cart);
124125
}
125126

Diff for: src/OroCRM/Bundle/MagentoBundle/ImportExport/Strategy/OrderStrategy.php

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ protected function processCart(Order $entity)
118118
protected function processItems(Order $order)
119119
{
120120
foreach ($order->getItems() as $item) {
121+
$item->setOwner($order->getOrganization());
121122
$item->setOrder($order);
122123
}
123124

Diff for: src/OroCRM/Bundle/MagentoBundle/Migrations/Schema/OroCRMMagentoBundleInstaller.php

+17-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function setVisitEventAssociationExtension(VisitEventAssociationExtension
8080
*/
8181
public function getMigrationVersion()
8282
{
83-
return 'v1_34';
83+
return 'v1_35';
8484
}
8585

8686
/**
@@ -451,7 +451,9 @@ protected function createOrocrmMagentoCartItemTable(Schema $schema)
451451
$table->addColumn('origin_id', 'integer', ['notnull' => false, 'precision' => 0, 'unsigned' => true]);
452452
$table->addColumn('channel_id', 'integer', ['notnull' => false]);
453453
$table->addColumn('is_removed', 'boolean', ['notnull' => true, 'default' => false]);
454+
$table->addColumn('owner_id', 'integer', ['notnull' => false]);
454455
$table->addIndex(['cart_id'], 'IDX_A73DC8621AD5CDBF', []);
456+
$table->addIndex(['owner_id'], 'IDX_A73DC8627E3C61F9', []);
455457
$table->setPrimaryKey(['id']);
456458
$table->addIndex(['origin_id'], 'magecartitem_origin_idx', []);
457459
$table->addIndex(['sku'], 'magecartitem_sku_idx', []);
@@ -800,7 +802,9 @@ protected function createOrocrmMagentoOrderItemsTable(Schema $schema)
800802
$table->addColumn('row_total', 'money', ['notnull' => false, 'precision' => 0, 'comment' => '(DC2Type:money)']);
801803
$table->addColumn('origin_id', 'integer', ['notnull' => false, 'precision' => 0, 'unsigned' => true]);
802804
$table->addColumn('channel_id', 'integer', ['notnull' => false]);
805+
$table->addColumn('owner_id', 'integer', ['notnull' => false]);
803806
$table->addIndex(['order_id'], 'IDX_3135EFF68D9F6D38', []);
807+
$table->addIndex(['owner_id'], 'IDX_3135EFF67E3C61F9', []);
804808
$table->setPrimaryKey(['id']);
805809
}
806810

@@ -1086,6 +1090,12 @@ protected function addOrocrmMagentoCartItemForeignKeys(Schema $schema)
10861090
['id'],
10871091
['onDelete' => 'SET NULL']
10881092
);
1093+
$table->addForeignKeyConstraint(
1094+
$schema->getTable('oro_organization'),
1095+
['owner_id'],
1096+
['id'],
1097+
['onDelete' => 'SET NULL']
1098+
);
10891099
}
10901100

10911101
/**
@@ -1438,6 +1448,12 @@ protected function addOrocrmMagentoOrderItemsForeignKeys(Schema $schema)
14381448
['id'],
14391449
['onDelete' => 'SET NULL']
14401450
);
1451+
$table->addForeignKeyConstraint(
1452+
$schema->getTable('oro_organization'),
1453+
['owner_id'],
1454+
['id'],
1455+
['onDelete' => 'SET NULL']
1456+
);
14411457
}
14421458

14431459
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace OroCRM\Bundle\MagentoBundle\Migrations\Schema\v1_35;
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 ItemsOrganizationOwner implements Migration
11+
{
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function up(Schema $schema, QueryBag $queries)
16+
{
17+
$table = $schema->getTable('orocrm_magento_order_items');
18+
$table->addColumn('owner_id', 'integer', ['notnull' => false]);
19+
$table->addIndex(['owner_id'], 'IDX_3135EFF67E3C61F9', []);
20+
$table->addForeignKeyConstraint(
21+
$schema->getTable('oro_organization'),
22+
['owner_id'],
23+
['id'],
24+
['onDelete' => 'SET NULL']
25+
);
26+
27+
$queries->addPostQuery(
28+
'UPDATE orocrm_magento_order_items itm '.
29+
'SET owner_id = (SELECT organization_id FROM orocrm_magento_order WHERE itm.order_id = id)'
30+
);
31+
32+
$table = $schema->getTable('orocrm_magento_cart_item');
33+
$table->addColumn('owner_id', 'integer', ['notnull' => false]);
34+
$table->addIndex(['owner_id'], 'IDX_A73DC8627E3C61F9', []);
35+
$table->addForeignKeyConstraint(
36+
$schema->getTable('oro_organization'),
37+
['owner_id'],
38+
['id'],
39+
['onDelete' => 'SET NULL']
40+
);
41+
42+
$queries->addPostQuery(
43+
'UPDATE orocrm_magento_cart_item itm '.
44+
'SET owner_id = (SELECT organization_id FROM orocrm_magento_cart WHERE itm.cart_id = id)'
45+
);
46+
}
47+
}

Diff for: src/OroCRM/Bundle/MagentoBundle/Resources/translations/messages.en.yml

+2
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ orocrm:
291291
product_url.label: Product URL
292292
channel.label: Channel
293293
removed.label: Removed
294+
owner.label: Owner
294295

295296
cartstatus:
296297
entity_label: Magento Shopping Cart Status
@@ -319,6 +320,7 @@ orocrm:
319320
tax_percent.label: Tax percent
320321
weight.label: Weight
321322
channel.label: Channel
323+
owner.label: Owner
322324

323325
magentosoaptransport:
324326
entity_label: Magento Integration Channel Transport

Diff for: src/OroCRM/Bundle/MagentoBundle/Tests/Functional/Fixture/LoadMagentoChannel.php

+2
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ protected function createCartItem()
426426
$cartItem->setTaxPercent(0);
427427
$cartItem->setCreatedAt(new \DateTime('now'));
428428
$cartItem->setUpdatedAt(new \DateTime('now'));
429+
$cartItem->setOwner($this->organization);
429430

430431
$this->em->persist($cartItem);
431432

@@ -513,6 +514,7 @@ protected function createBaseOrderItem(Order $order)
513514
$orderItem->setDiscountPercent(4);
514515
$orderItem->setDiscountAmount(0);
515516
$orderItem->setRowTotal(234);
517+
$orderItem->setOwner($this->organization);
516518

517519
$this->em->persist($orderItem);
518520

0 commit comments

Comments
 (0)