Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Dec 22, 2014
2 parents d5a89bb + 3a5bcfa commit 920f4d1
Show file tree
Hide file tree
Showing 7 changed files with 569 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function setAttachmentExtension(AttachmentExtension $attachmentExtension)
*/
public function getMigrationVersion()
{
return 'v1_6';
return 'v1_7';
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace OroCRM\Bundle\AccountBundle\Migrations\Schema\v1_7;

use Psr\Log\LoggerInterface;

use Oro\Bundle\MigrationBundle\Migration\ArrayLogger;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedMigrationQuery;

class DropExtendConfigQuery extends ParametrizedMigrationQuery
{
/**
* {@inheritdoc}
*/
public function getDescription()
{
$logger = new ArrayLogger();
$logger->info('Drop extend config values');
$this->doExecute($logger, true);

return $logger->getMessages();
}

/**
* {@inheritdoc}
*/
public function execute(LoggerInterface $logger)
{
$this->doExecute($logger);
}

/**
* {@inheritdoc}
*/
public function doExecute(LoggerInterface $logger, $dryRun = false)
{
$updateSql = <<<DQL
DELETE FROM oro_entity_config_field WHERE field_name IN (?, ?, ?, ?, ?, ?, ?)
AND entity_id IN (SELECT id FROM oro_entity_config WHERE class_name = ?);
DQL;

$params = [
'extend_website',
'extend_employees',
'extend_ownership',
'extend_ticker_symbol',
'extend_rating',
'shippingAddress',
'billingAddress',
'OroCRM\\Bundle\\AccountBundle\\Entity\\Account',
];

$this->logQuery($logger, $updateSql, $params);
if (!$dryRun) {
$this->connection->executeUpdate($updateSql, $params);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace OroCRM\Bundle\AccountBundle\Migrations\Schema\v1_7;

use Doctrine\DBAL\Schema\Schema;

use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class OroCRMSalesBundle implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$queries->addPostQuery(new DropExtendConfigQuery());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

{{ ui.renderProperty('orocrm.magento.order.status.label'|trans, entity.status|trans) }}
{{ ui.renderProperty('orocrm.magento.order.currency.label'|trans, entity.currency) }}
{{ ui.renderProperty('orocrm.magento.order.subtotal_amount.label'|trans, entity.subtotalAmount|oro_format_currency({'currency': entity.currency})) }}
{{ ui.renderProperty('orocrm.magento.order.total_amount.label'|trans, entity.totalAmount|oro_format_currency({'currency': entity.currency})) }}
{{ ui.renderProperty('orocrm.magento.order.discount_amount.label'|trans, entity.discountAmount|oro_format_currency({'currency': entity.currency})) }}
{{ ui.renderProperty('orocrm.magento.order.tax_amount.label'|trans, entity.taxAmount|oro_format_currency({'currency': entity.currency})) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ protected function setUp()
{
$metadataDriver = new AnnotationDriver(
new AnnotationReader(),
'OroCRM\Bundle\TaskBundle\Entity'
'OroCRM\Bundle\TaskBundle\Tests\Unit\Fixtures\Entity'
);

$this->em = $this->getTestEntityManager();
$this->em->getConfiguration()->setMetadataDriverImpl($metadataDriver);
$this->em->getConfiguration()->setEntityNamespaces(
[
'OroCRMTaskBundle' => 'OroCRM\Bundle\TaskBundle\Entity'
'OroCRMTaskBundle' => 'OroCRM\Bundle\TaskBundle\Tests\Unit\Fixtures\Entity'
]
);
}
Expand All @@ -43,7 +43,7 @@ public function testGetTaskListByTimeIntervalQueryBuilder()

$this->assertEquals(
'SELECT t.id, t.subject, t.description, t.dueDate, t.createdAt, t.updatedAt'
. ' FROM OroCRM\Bundle\TaskBundle\Entity\Task t'
. ' FROM OroCRM\Bundle\TaskBundle\Tests\Unit\Fixtures\Entity\Task t'
. ' WHERE t.owner = :assignedTo AND t.dueDate >= :start AND t.dueDate <= :end',
$qb->getDQL()
);
Expand Down
Loading

0 comments on commit 920f4d1

Please sign in to comment.