-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/dev/master'
- Loading branch information
Showing
234 changed files
with
5,585 additions
and
1,615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ branches: | |
- /^\d+\.\d+$/ | ||
|
||
php: | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
UPGRADE FROM 2.1 to 2.2 | ||
======================== | ||
|
||
MagentoBundle | ||
------------- | ||
- Class `Oro\Bundle\MagentoBundle\Async\SyncInitialIntegrationProcessor` | ||
- construction signature was changed now it takes next arguments: | ||
- `DoctrineHelper` $doctrineHelper, | ||
- `InitialSyncProcessor` $initialSyncProcessor, | ||
- `OptionalListenerManager` $optionalListenerManager, | ||
- `CalculateAnalyticsScheduler` $calculateAnalyticsScheduler, | ||
- `JobRunner` $jobRunner, | ||
- `IndexerInterface` $indexer, | ||
- `TokenStorageInterface` $tokenStorage, | ||
- `LoggerInterface` $logger | ||
- Class `Oro\Bundle\MagentoBundle\Async\SyncCartExpirationIntegrationProcessor` | ||
- construction signature was changed now it takes next arguments: | ||
`RegistryInterface` $doctrine, | ||
`CartExpirationProcessor` $cartExpirationProcessor, | ||
`JobRunner` $jobRunner, | ||
`TokenStorageInterface` $tokenStorage, | ||
`LoggerInterface` $logger | ||
|
||
SalesBundle | ||
----------- | ||
- Class `Oro\Bundle\SalesBundle\Provider\Customer\ConfigProvider` | ||
- method `getCustomersData` was removed. Use `getGridCustomersData` instead. | ||
- Class `Oro\Bundle\SalesBundle\Controller\CustomerController` | ||
- action `gridDialogAction` is rendered in `OroDataGridBundle:Grid/dialog:multi.html.twig` | ||
- action `customerGridAction` was removed | ||
- method `getCustomersData` was removed | ||
- Class `Oro\Bundle\SalesBundle\Form\Type\CustomerType` | ||
- construction signature was changed, now it takes the next arguments: | ||
- `DataTransformerInterface` $transformer | ||
- `ConfigProvider` $customerConfigProvider | ||
- `EntityAliasResolver` $entityAliasResolver | ||
- `CustomerIconProviderInterface` $customerIconProvider | ||
- `TranslatorInterface` $translator | ||
- `SecurityFacade` $securityFacade | ||
- `ManagerInterface` $gridManager | ||
- `EntityNameResolver` $entityNameResolver | ||
- `MultiGridProvider` $multiGridProvider | ||
- Class `Oro\Bundle\SalesBundle\Entity\LeadStatus` removed | ||
- Class `Oro\Bundle\SalesBundle\Entity\OpportunityStatus` removed | ||
- Class `Oro\Bundle\SalesBundle\Entity\Lead` | ||
- field `address` removed | ||
- methods `hasAddress`, `setAddress` removed | ||
|
||
MagentoBundle | ||
----------- | ||
- Classes `Oro\Bundle\MagentoBundle\Form\Extension\CustomerAssociationExtension`, `Oro\Bundle\MagentoBundle\Form\Extension\OpportunityCustomerAssociationExtension`, `Oro\Bundle\MagentoBundle\EventListener\Customer\CustomerAssociationListener` were removed. They are no longer used. | ||
- Added setter `setIso2CodeProvider` for `Oro\Bundle\MagentoBundle\ImportExport\Converter\AbstractAddressDataConverter` | ||
|
||
CaseBundle | ||
------------ | ||
- Search index fields `description`, `resolution` and `message` for `CaseEntity` now contain no more than 255 characters | ||
each. Please, run reindexation for this entity using command | ||
`php app/console oro:search:reindex OroCaseBundle:CaseEntity --env=prod` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/Oro/Bridge/MarketingCRM/Migrations/Data/Demo/ORM/LoadCampaignEmailData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM; | ||
|
||
use Doctrine\Common\DataFixtures\AbstractFixture; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
|
||
use Oro\Bundle\CampaignBundle\Entity\EmailCampaign; | ||
use Oro\Bundle\CampaignBundle\Entity\InternalTransportSettings; | ||
use Oro\Bundle\CampaignBundle\Transport\EmailTransport; | ||
|
||
class LoadCampaignEmailData extends AbstractFixture implements DependentFixtureInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getDependencies() | ||
{ | ||
return [ | ||
'Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM\LoadCampaignData', | ||
'Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM\LoadMarketingListData', | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function load(ObjectManager $manager) | ||
{ | ||
$manager->getClassMetadata('Oro\Bundle\CampaignBundle\Entity\EmailCampaign')->setLifecycleCallbacks([]); | ||
|
||
$marketingList = $manager->getRepository('OroMarketingListBundle:MarketingList')->findOneBy([ | ||
'entity' => 'Oro\Bundle\ContactBundle\Entity\Contact' | ||
]); | ||
$campaigns = $manager->getRepository('OroCampaignBundle:Campaign')->findAll(); | ||
$campaignsMax = count($campaigns) - 1; | ||
|
||
$defaultUser = $manager->getRepository('OroUserBundle:User')->findOneBy(['username' => 'admin']); | ||
$emailCampaign = new EmailCampaign(); | ||
$transportSettings = new InternalTransportSettings(); | ||
$emailCampaign->setTransportSettings($transportSettings) | ||
->setOwner($defaultUser) | ||
->setOrganization($this->getReference('default_organization')) | ||
->setMarketingList($marketingList) | ||
->setName('Special Sale') | ||
->setSent(1) | ||
->setCampaign($campaigns[mt_rand(0, $campaignsMax)]) | ||
->setTransport(EmailTransport::NAME) | ||
->setSchedule('manual') | ||
->setSenderEmail('[email protected]') | ||
->setSenderName('Magento Shop') | ||
->setCreatedAt(date_create('-' . (mt_rand(3600, 32535)) . 'seconds', new \DateTimeZone('UTC'))); | ||
$emailCampaign->setUpdatedAt($emailCampaign->getCreatedAt()); | ||
$emailCampaign->setSentAt($emailCampaign->getUpdatedAt()); | ||
$this->addReference('marketing_activity_campaign', $emailCampaign); | ||
|
||
$manager->persist($emailCampaign); | ||
$manager->flush(); | ||
} | ||
} |
157 changes: 157 additions & 0 deletions
157
src/Oro/Bridge/MarketingCRM/Migrations/Data/Demo/ORM/LoadMarketingActivityData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<?php | ||
|
||
namespace Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM; | ||
|
||
use Doctrine\Common\DataFixtures\AbstractFixture; | ||
use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
use Doctrine\Common\Util\ClassUtils; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
|
||
use Oro\Bundle\CampaignBundle\Entity\EmailCampaign; | ||
use Oro\Bundle\CampaignBundle\Entity\Campaign; | ||
use Oro\Bundle\MarketingActivityBundle\Entity\MarketingActivity; | ||
use Oro\Bundle\OrganizationBundle\Entity\Organization; | ||
|
||
class LoadMarketingActivityData extends AbstractFixture implements ContainerAwareInterface, DependentFixtureInterface | ||
{ | ||
const OPENS_COUNT = 5; | ||
const CLICKS_COUNT = 10; | ||
|
||
/** | ||
* @var ContainerInterface | ||
*/ | ||
protected $container; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getDependencies() | ||
{ | ||
return [ | ||
'Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM\LoadCampaignEmailData', | ||
'Oro\Bundle\DemoDataBundle\Migrations\Data\Demo\ORM\LoadContactData' | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function setContainer(ContainerInterface $container = null) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function load(ObjectManager $manager) | ||
{ | ||
/** @var Organization $organization */ | ||
$organization = $this->getReference('default_organization'); | ||
/** @var array $entities */ | ||
$entities = $manager->getRepository('OroContactBundle:Contact')->findAll(); | ||
/** @var EmailCampaign $emailCampaign */ | ||
$emailCampaign = $this->getReference('marketing_activity_campaign'); | ||
$rareTypes = [ | ||
MarketingActivity::TYPE_HARD_BOUNCE, | ||
MarketingActivity::TYPE_SOFT_BOUNCE, | ||
MarketingActivity::TYPE_UNSUBSCRIBE | ||
]; | ||
|
||
$timezoneUTC = new \DateTimeZone('UTC'); | ||
|
||
|
||
$hours = mt_rand(12, 24); | ||
$sendDate = date_create('-' . $hours . 'hours', $timezoneUTC); | ||
foreach ($entities as $entity) { | ||
//add send activity | ||
$this->addMarketingActivity( | ||
$manager, | ||
$emailCampaign, | ||
$entity, | ||
$organization, | ||
MarketingActivity::TYPE_SEND, | ||
$sendDate | ||
); | ||
/** | ||
* randomly add click/open (for the most entities) or bounce activities. | ||
*/ | ||
$randomPath = mt_rand(0, 100); | ||
if ($randomPath > 15) { | ||
$opensCount = mt_rand(1, self::OPENS_COUNT); | ||
for ($j = 0; $j < $opensCount; $j++) { | ||
$this->addMarketingActivity( | ||
$manager, | ||
$emailCampaign, | ||
$entity, | ||
$organization, | ||
MarketingActivity::TYPE_OPEN, | ||
date_create('-' . (mt_rand($hours - 6, $hours)) . 'hours', $timezoneUTC) | ||
); | ||
} | ||
//clicks should be later than opens. | ||
$clicksCount = mt_rand(1, self::CLICKS_COUNT); | ||
for ($j = 0; $j < $clicksCount; $j++) { | ||
$this->addMarketingActivity( | ||
$manager, | ||
$emailCampaign, | ||
$entity, | ||
$organization, | ||
MarketingActivity::TYPE_CLICK, | ||
date_create('-' . mt_rand(0, $hours - 6) . 'hours', $timezoneUTC), | ||
"http://example.com/test{$j}.html" | ||
); | ||
} | ||
} else { | ||
$this->addMarketingActivity( | ||
$manager, | ||
$emailCampaign, | ||
$entity, | ||
$organization, | ||
$rareTypes[mt_rand(0, count($rareTypes) - 1)], | ||
date_create('-' . mt_rand(0, $hours) . 'hours', $timezoneUTC) | ||
); | ||
} | ||
} | ||
|
||
$manager->flush(); | ||
} | ||
|
||
/** | ||
* @param ObjectManager $manager | ||
* @param EmailCampaign $emailCampaign | ||
* @param object $entity | ||
* @param Organization $organization | ||
* @param string $type | ||
* @param \DateTime $date | ||
* @param string $details | ||
*/ | ||
protected function addMarketingActivity( | ||
$manager, | ||
$emailCampaign, | ||
$entity, | ||
$organization, | ||
$type, | ||
$date, | ||
$details = null | ||
) { | ||
$activityFactory = $this->container->get('oro_marketing_activity.factory'); | ||
$timezoneUTC = new \DateTimeZone('UTC'); | ||
$marketingActivity = $activityFactory->create( | ||
$emailCampaign->getCampaign(), | ||
ClassUtils::getClass($entity), | ||
$entity->getId(), | ||
$date, | ||
$type, | ||
$organization, | ||
$emailCampaign->getId() | ||
); | ||
if ($details) { | ||
$marketingActivity->setDetails($details); | ||
} | ||
$manager->persist($marketingActivity); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/Oro/Bridge/MarketingCRM/Migrations/Data/Demo/ORM/LoadMarketingListData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM; | ||
|
||
use Doctrine\Common\DataFixtures\AbstractFixture; | ||
use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
use Oro\Bundle\MarketingListBundle\Entity\MarketingList; | ||
use Oro\Bundle\MarketingListBundle\Entity\MarketingListType; | ||
|
||
class LoadMarketingListData extends AbstractFixture implements DependentFixtureInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getDependencies() | ||
{ | ||
return [ | ||
'Oro\Bridge\MarketingCRM\Migrations\Data\Demo\ORM\LoadSegmentsData' | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function load(ObjectManager $manager) | ||
{ | ||
$defaultUser = $manager->getRepository('OroUserBundle:User')->findOneBy(['username' => 'admin']); | ||
$type = $manager->getRepository('OroMarketingListBundle:MarketingListType')->findOneBy(['name' => 'dynamic']); | ||
$segment = $manager->getRepository('OroSegmentBundle:Segment')->findOneBy(['name' => 'Contact List Segment']); | ||
$list = new MarketingList(); | ||
$list->setName('Contact list') | ||
->setDescription('Contact list') | ||
->setEntity('Oro\Bundle\ContactBundle\Entity\Contact') | ||
->setOrganization($this->getReference('default_organization')) | ||
->setOwner($defaultUser) | ||
->setType($type) | ||
->setSegment($segment) | ||
->setCreatedAt(date_create('-' . (mt_rand(3600, 32535)) . 'seconds', new \DateTimeZone('UTC'))) | ||
->setUpdatedAt($list->getCreatedAt()); | ||
|
||
$manager->persist($list); | ||
$manager->flush(); | ||
} | ||
} |
Oops, something went wrong.