Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OrderBundle] rename Operators to be more CoreShop specific #787

Merged
merged 1 commit into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace CoreShop\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Pimcore\Migrations\Migration\AbstractPimcoreMigration;
use Pimcore\Model\GridConfig;

class Version20190122111926 extends AbstractPimcoreMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$list = new GridConfig\Listing();
$list->load();

/**
* @var GridConfig $config
*/
foreach ($list->getGridConfigs() as $config) {
$actualConfig = $config->getConfig();
$actualConfig = json_decode($actualConfig, true);

if (is_array($actualConfig)) {
array_walk_recursive($actualConfig, function(&$value, $key) {
if ($key !== 'class') {
return;
}

switch ($value) {
case 'OrderState':
$value = 'coreshop_order_state';
break;

case 'PriceFormatter':
$value = 'coreshop_price_formatter';
break;
}
});

$config->setConfig(json_encode($actualConfig));
$config->save();
}
}
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ core_shop_order:
quote_create: '/bundles/coreshoporder/pimcore/js/quote/create/panel.js'
core_extension_data_cart_price_rule: '/bundles/coreshoporder/pimcore/js/coreExtension/data/coreShopCartPriceRule.js'
core_extension_tag_cart_price_rule: '/bundles/coreshoporder/pimcore/js/coreExtension/tags/coreShopCartPriceRule.js'
object_grid_column_order_state: '/bundles/coreshoporder/pimcore/js/object/gridcolumn/operator/OrderState.js'
object_grid_column_price_formatter: '/bundles/coreshoporder/pimcore/js/object/gridcolumn/operator/PriceFormatter.js'
object_grid_column_order_state: '/bundles/coreshoporder/pimcore/js/object/gridcolumn/operator/coreshop_order_state.js'
object_grid_column_price_formatter: '/bundles/coreshoporder/pimcore/js/object/gridcolumn/operator/coreshop_price_formatter.js'
css:
order: '/bundles/coreshoporder/pimcore/css/order.css'
order: '/bundles/coreshoporder/pimcore/css/order.css'
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ services:
arguments:
- '@coreshop.workflow.state_manager'
tags:
- { name: pimcore.data_object.grid_column_config.operator_factory, id: OrderState }
- { name: pimcore.data_object.grid_column_config.operator_factory, id: coreshop_order_state }

coreshop.data_object.grid_column_config.operator.factory.price_formatter:
class: CoreShop\Bundle\OrderBundle\Pimcore\GridColumnConfig\Operator\Factory\PriceFormatterFactory
arguments:
- '@coreshop.money_formatter'
- '@coreshop.context.locale'
tags:
- { name: pimcore.data_object.grid_column_config.operator_factory, id: PriceFormatter }
- { name: pimcore.data_object.grid_column_config.operator_factory, id: coreshop_price_formatter }
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ grid_config:
attributes:
label: 'Order State'
type: operator
class: OrderState
class: coreshop_order_state
orderState: orderState
childs:
-
Expand All @@ -156,7 +156,7 @@ grid_config:
attributes:
label: 'Payment State'
type: operator
class: OrderState
class: coreshop_order_state
highlightLabel: true
childs:
-
Expand All @@ -178,7 +178,7 @@ grid_config:
attributes:
label: 'Shipping State'
type: operator
class: OrderState
class: coreshop_order_state
highlightLabel: true
childs:
-
Expand All @@ -200,7 +200,7 @@ grid_config:
attributes:
label: 'Total Amount'
type: operator
class: PriceFormatter
class: coreshop_price_formatter
childs:
-
label: 'Total gross (totalGross)'
Expand Down Expand Up @@ -379,7 +379,7 @@ grid_config:
attributes:
label: Bestellstatus
type: operator
class: OrderState
class: coreshop_order_state
orderState: orderState
childs:
-
Expand All @@ -402,7 +402,7 @@ grid_config:
attributes:
label: Zahlungsstatus
type: operator
class: OrderState
class: coreshop_order_state
highlightLabel: true
childs:
-
Expand All @@ -424,7 +424,7 @@ grid_config:
attributes:
label: Lieferstatus
type: operator
class: OrderState
class: coreshop_order_state
highlightLabel: true
childs:
-
Expand All @@ -446,7 +446,7 @@ grid_config:
attributes:
label: Gesamtpreis
type: operator
class: PriceFormatter
class: coreshop_price_formatter
childs:
-
label: 'Total Brutto (totalGross)'
Expand Down Expand Up @@ -625,7 +625,7 @@ grid_config:
attributes:
label: 'Total Gross'
type: operator
class: PriceFormatter
class: coreshop_price_formatter
childs:
-
label: 'Total Gross (totalGross)'
Expand Down Expand Up @@ -802,7 +802,7 @@ grid_config:
attributes:
label: Gesamtpreis
type: operator
class: PriceFormatter
class: coreshop_price_formatter
childs:
-
label: 'Total Brutto (totalGross)'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pimcore.registerNS('pimcore.object.gridcolumn.operator.orderstate');
pimcore.registerNS('pimcore.object.gridcolumn.operator.coreshop_order_state');

pimcore.object.gridcolumn.operator.orderstate = Class.create(pimcore.object.gridcolumn.Abstract, {
pimcore.object.gridcolumn.operator.coreshop_order_state = Class.create(pimcore.object.gridcolumn.Abstract, {
type: 'operator',
class: 'OrderState',
class: 'coreshop_order_state',
iconCls: 'coreshop_icon_operator_orderstate',
defaultText: 'coreshop_operator_orderstate',
group: 'coreshop',
Expand Down Expand Up @@ -126,4 +126,4 @@ pimcore.object.gridcolumn.operator.orderstate = Class.create(pimcore.object.grid
getNodeLabel: function (configAttributes) {
return configAttributes.label;
}
});
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pimcore.registerNS('pimcore.object.gridcolumn.operator.priceformatter');
pimcore.registerNS('pimcore.object.gridcolumn.operator.coreshop_price_formatter');

pimcore.object.gridcolumn.operator.priceformatter = Class.create(pimcore.object.gridcolumn.Abstract, {
pimcore.object.gridcolumn.operator.coreshop_price_formatter = Class.create(pimcore.object.gridcolumn.Abstract, {
type: 'operator',
class: 'PriceFormatter',
class: 'coreshop_price_formatter',
iconCls: 'coreshop_icon_operator_priceformatter',
defaultText: 'coreshop_operator_priceformatter',
group: 'coreshop',
Expand Down Expand Up @@ -116,4 +116,4 @@ pimcore.object.gridcolumn.operator.priceformatter = Class.create(pimcore.object.
getNodeLabel: function (configAttributes) {
return configAttributes.label;
}
});
});