Showing with 6,906 additions and 5,126 deletions.
  1. +19 −1 UPGRADE.md
  2. +18 −19 _sql/demo/latest.sql
  3. +30 −0 _sql/migrations/725-remove-emotion-grids.php
  4. +13 −0 _sql/migrations/726-remove-landingpage-teaser.php
  5. +44 −0 _sql/migrations/727-add-translatable-field-with-data.php
  6. +22 −0 _sql/migrations/728-new-emotion-shop-association.php
  7. +35 −0 _sql/migrations/729-migrate-old-emotion-relation.php
  8. +29 −0 _sql/migrations/730-add-article-widget-categorie-selection.php
  9. +28 −0 _sql/migrations/731-add-emotion-element-viewport.php
  10. +17 −0 _sql/migrations/732-fixed-iframe-widget-xtype.php
  11. +33 −0 _sql/migrations/733-migrate-emotion-widget-settings.php
  12. +36 −0 _sql/migrations/734-new-border-setting-for-emotion-widgets.php
  13. +0 −1 engine/Shopware/Bundle/MediaBundle/GarbageCollectorFactory.php
  14. +39 −2 engine/Shopware/Components/Emotion/DeviceConfiguration.php
  15. +6 −5 engine/Shopware/Components/SitemapXMLRepository.php
  16. +424 −518 engine/Shopware/Controllers/Backend/Emotion.php
  17. +2 −12 engine/Shopware/Controllers/Frontend/Blog.php
  18. +17 −4 engine/Shopware/Controllers/Frontend/Campaign.php
  19. +0 −21 engine/Shopware/Controllers/Frontend/Listing.php
  20. +25 −5 engine/Shopware/Controllers/Frontend/Sitemap.php
  21. +0 −5 engine/Shopware/Controllers/Widgets/Campaign.php
  22. +55 −30 engine/Shopware/Controllers/Widgets/Emotion.php
  23. +20 −15 engine/Shopware/Core/sRewriteTable.php
  24. +3 −18 engine/Shopware/Models/Emotion/Data.php
  25. +39 −60 engine/Shopware/Models/Emotion/Element.php
  26. +274 −0 engine/Shopware/Models/Emotion/ElementViewport.php
  27. +127 −87 engine/Shopware/Models/Emotion/Emotion.php
  28. +0 −222 engine/Shopware/Models/Emotion/Grid.php
  29. +4 −17 engine/Shopware/Models/Emotion/Library/Component.php
  30. +24 −16 engine/Shopware/Models/Emotion/Library/Field.php
  31. +88 −65 engine/Shopware/Models/Emotion/Repository.php
  32. +5 −5 engine/Shopware/Models/Emotion/Template.php
  33. +0 −32 snippets/backend/emotion/grids/list.ini
  34. +23 −3 snippets/backend/emotion/list/grid.ini
  35. +3 −3 snippets/backend/emotion/list/toolbar.ini
  36. +4 −0 snippets/backend/emotion/view/components/article.ini
  37. +108 −114 snippets/backend/emotion/view/detail.ini
  38. +0 −4 snippets/backend/emotion/view/main.ini
  39. +9 −0 tests/Mink/README.md
  40. +1 −1 themes/Backend/ExtJs/backend/_resources/resources/css/ext-all.css
  41. +671 −252 .../Backend/ExtJs/backend/_resources/resources/themes/stylesheets/shopware-ui/modules/_emotions.scss
  42. +4 −0 themes/Backend/ExtJs/backend/_resources/resources/themes/stylesheets/shopware-ui/widgets/_grid.scss
  43. +21 −8 themes/Backend/ExtJs/backend/emotion/app.js
  44. +338 −183 themes/Backend/ExtJs/backend/emotion/controller/detail.js
  45. +0 −363 themes/Backend/ExtJs/backend/emotion/controller/grids.js
  46. +11 −19 themes/Backend/ExtJs/backend/emotion/controller/main.js
  47. +1 −1 themes/Backend/ExtJs/backend/emotion/controller/templates.js
  48. +1 −1 themes/Backend/ExtJs/backend/emotion/model/attribute.js
  49. +17 −12 themes/Backend/ExtJs/backend/emotion/model/emotion.js
  50. +14 −12 themes/Backend/ExtJs/backend/emotion/model/emotion_element.js
  51. +1 −0 themes/Backend/ExtJs/backend/emotion/model/field.js
  52. +0 −88 themes/Backend/ExtJs/backend/emotion/model/grid.js
  53. +23 −18 ...re/Models/Emotion/Library/Repository.php → themes/Backend/ExtJs/backend/emotion/model/viewport.js
  54. +0 −90 themes/Backend/ExtJs/backend/emotion/store/grids.js
  55. +1 −1 themes/Backend/ExtJs/backend/emotion/store/list.js
  56. +57 −6 themes/Backend/ExtJs/backend/emotion/view/components/article.js
  57. +6 −1 themes/Backend/ExtJs/backend/emotion/view/components/article_slider.js
  58. +13 −3 themes/Backend/ExtJs/backend/emotion/view/components/base.js
  59. +6 −1 themes/Backend/ExtJs/backend/emotion/view/components/manufacturer_slider.js
  60. +23 −24 themes/Backend/ExtJs/backend/emotion/view/components/settings_window.js
  61. +402 −52 themes/Backend/ExtJs/backend/emotion/view/detail/designer.js
  62. +44 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/article.js
  63. +44 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/article_slider.js
  64. +58 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/banner.js
  65. +54 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/banner_slider.js
  66. +722 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/base.js
  67. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/blog.js
  68. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/category_teaser.js
  69. +54 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/html.js
  70. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/html_code.js
  71. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/html_video.js
  72. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/iframe.js
  73. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/manufacturer_slider.js
  74. +42 −0 themes/Backend/ExtJs/backend/emotion/view/detail/elements/youtube.js
  75. +790 −851 themes/Backend/ExtJs/backend/emotion/view/detail/grid.js
  76. +332 −0 themes/Backend/ExtJs/backend/emotion/view/detail/layout.js
  77. +61 −149 themes/Backend/ExtJs/backend/emotion/view/detail/preview.js
  78. +210 −401 themes/Backend/ExtJs/backend/emotion/view/detail/settings.js
  79. +244 −0 themes/Backend/ExtJs/backend/emotion/view/detail/widgets.js
  80. +121 −235 themes/Backend/ExtJs/backend/emotion/view/detail/window.js
  81. +0 −305 themes/Backend/ExtJs/backend/emotion/view/grids/list.js
  82. +0 −199 themes/Backend/ExtJs/backend/emotion/view/grids/settings.js
  83. +0 −104 themes/Backend/ExtJs/backend/emotion/view/grids/toolbar.js
  84. +214 −96 themes/Backend/ExtJs/backend/emotion/view/list/grid.js
  85. +1 −1 themes/Backend/ExtJs/backend/emotion/view/list/toolbar.js
  86. +27 −87 themes/Backend/ExtJs/backend/emotion/view/main/window.js
  87. +0 −14 themes/Frontend/Bare/frontend/blog/listing_sidebar.tpl
  88. +0 −15 themes/Frontend/Bare/frontend/campaign/box.tpl
  89. +21 −36 themes/Frontend/Bare/frontend/index/sidebar.tpl
  90. +1 −1 themes/Frontend/Bare/widgets/emotion/components/component_article.tpl
  91. +1 −1 themes/Frontend/Bare/widgets/emotion/components/component_article_slider.tpl
  92. +1 −1 themes/Frontend/Bare/widgets/emotion/components/component_manufacturer_slider.tpl
  93. +85 −31 themes/Frontend/Bare/widgets/emotion/index.tpl
  94. +16 −6 themes/Frontend/Bare/widgets/emotion/preview.tpl
  95. +0 −11 themes/Frontend/Responsive/Gruntfile.js
  96. +0 −1 themes/Frontend/Responsive/Theme.php
  97. +78 −24 themes/Frontend/Responsive/frontend/_public/src/js/jquery.emotion.js
  98. +199 −51 themes/Frontend/Responsive/frontend/_public/src/less/_components/emotions.less
  99. +0 −76 themes/Frontend/Responsive/frontend/_public/vendors/js/masonry/README.mdown
  100. +0 −9 themes/Frontend/Responsive/frontend/_public/vendors/js/masonry/masonry.pkgd.min.js
  101. +0 −1 themes/Frontend/Responsive/package.json
@@ -213,9 +213,27 @@ In this document you will find a changelog of the important changes related to t
* `sOrder::sGetOrderNumber()`
* `Shopware_Components_Document::saveDocument()`
* HttpCache: Added possibility to add multiple, comma separated proxy URLs
* Removed `landingPageTeaser` and `landingPageBlock` fields from emotion shopping worlds.
* Removed unnecessary method `getCampaignByCategoryQuery()` from `Models/Emotion/Repository.php`.
* Removed template blocks for campaign boxes corresponding to the removed emotion fields.
* `frontend_index_left_campaigns_top`
* `frontend_index_left_campaigns_middle`
* `frontend_index_left_campaigns_bottom`
* `frontend_blog_index_campaign_top`
* `frontend_blog_index_campaign_middle`
* `frontend_blog_index_campaign_bottom`
* Removed unnecessary template file for campaign boxes `frontend/campaign/box.tpl`.
* Removed third party jQuery plugin dependency `masonry`.
* Deprecated `initMasonryGrid` method and `plugin/swEmotion/onInitMasonryGrid` event in `jquery.emotion.js`
* Removed shopping world mode `masonry`. The fallback is the new mode `fluid`.
* Replaced old LESS mixin `createColumnSizes` for new grid mixins `createGrid` and `createColumns` in `_components/emotion.less`.
* Added new blocks to `widgets/emotion/index.tpl` for better overriding of the configuration.
* `widgets/emotion/index/config`
* `widgets/emotion/index/attributes`
* `widgets/emotion/index/element/config`

## 5.1.5
* The smarty variable `sCategoryInfo` in Listing and Blog controllers is now deprecated and will be removed soon. Use `sCategoryContent` instead, it's a drop in replacement.
* The smarty variable `sCategoryInfo` in Listing and Blog controllers is now deprecated and will be removed soon. Use `sCategoryContent` instead, it's a drop in replacement.

## 5.1.4
* Customer logout will now regenerate the session id and clear the customers basket.
@@ -6284,18 +6284,18 @@ INSERT INTO `s_emarketing_voucher_codes` (`id`, `voucherID`, `userID`, `code`, `
(100, 4, NULL, '23A7CBA5', 0);

TRUNCATE TABLE `s_emotion`;
INSERT INTO `s_emotion` (`id`, `active`, `name`, `cols`, `cell_height`, `article_height`, `rows`, `valid_from`, `valid_to`, `userID`, `show_listing`, `is_landingpage`, `landingpage_block`, `landingpage_teaser`, `seo_title`, `seo_keywords`, `seo_description`, `create_date`, `modified`, `grid_id`, `template_id`, `device`, `fullscreen`, `mode`, `position`, `parent_id`) VALUES
(1, 1, 'Meine Startseite', 4, 185, 2, 20, NULL, NULL, 55, 0, 0, '', '', '', '', '', '2012-08-29 08:41:30', '2012-08-31 11:04:08', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(2, 1, 'Genusswelten', 3, 185, 2, 20, NULL, NULL, 57, 0, 0, '', '', '', '', '', '2012-08-29 10:17:44', '2012-08-31 11:32:22', 1, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(3, 1, 'Freizeitwelten', 3, 185, 2, 20, NULL, NULL, 51, 0, 0, '', '', '', '', '', '2012-08-30 10:01:28', '2012-08-30 17:17:59', 1, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(4, 1, 'Wohnwelten', 3, 185, 2, 20, NULL, NULL, 51, 0, 0, '', '', '', '', '', '2012-08-30 10:25:14', '2012-08-31 11:59:00', 1, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(5, 1, 'Stop The Water While Using Me', 4, 185, 2, 20, NULL, NULL, 60, 0, 1, 'leftMiddle', 'media/image/testbild.jpg', '', '', '', '2012-08-30 14:19:51', '2012-08-30 16:12:15', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(6, 1, 'The Deli Garage', 4, 185, 2, 20, NULL, NULL, 57, 0, 1, 'leftMiddle', 'media/image/testbild.jpg', '', '', '', '2012-08-30 15:25:01', '2012-08-31 12:10:33', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(7, 1, 'Sommerwelten', 4, 185, 2, 20, NULL, NULL, 51, 0, 0, '', '', '', '', '', '2012-08-30 17:20:14', '2012-08-31 12:36:20', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(8, 1, 'Beispiele', 4, 185, 2, 20, NULL, NULL, 59, 0, 0, '', '', '', '', '', '2012-08-30 17:55:11', '2012-08-31 11:46:27', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(9, 1, 'Passend für Ihren Sommerurlaub', 4, 185, 2, 20, NULL, NULL, 57, 0, 1, 'leftMiddle', '', '', '', '', '2012-08-30 18:21:14', '2012-08-31 11:01:16', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(10, 1, 'English', 4, 185, 2, 20, NULL, NULL, 53, 0, 0, '', '', '', '', '', '2012-08-31 08:45:10', '2012-08-31 12:35:55', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(12, 1, 'in Kürze verfügbar', 4, 185, 2, 20, NULL, NULL, 52, 0, 0, '', '', '', '', '', '2012-08-31 09:50:53', '2012-08-31 11:57:10', 2, 1, '0,1,2,3,4', 0, 'masonry', 1, NULL);
INSERT INTO `s_emotion` (`id`, `active`, `name`, `cols`, `cell_spacing`, `cell_height`, `article_height`, `rows`, `valid_from`, `valid_to`, `userID`, `show_listing`, `is_landingpage`, `seo_title`, `seo_keywords`, `seo_description`, `create_date`, `modified`, `template_id`, `device`, `fullscreen`, `mode`, `position`, `parent_id`) VALUES
(1, 1, 'Meine Startseite', 4, 10, 185, 2, 20, NULL, NULL, 55, 0, 0, '', '', '', '2012-08-29 08:41:30', '2012-08-31 11:04:08', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(2, 1, 'Genusswelten', 3, 10, 185, 2, 20, NULL, NULL, 57, 0, 0, '', '', '', '2012-08-29 10:17:44', '2012-08-31 11:32:22', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(3, 1, 'Freizeitwelten', 3, 10, 185, 2, 20, NULL, NULL, 51, 0, 0, '', '', '', '2012-08-30 10:01:28', '2012-08-30 17:17:59', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(4, 1, 'Wohnwelten', 3, 10, 185, 2, 20, NULL, NULL, 51, 0, 0, '', '', '', '2012-08-30 10:25:14', '2012-08-31 11:59:00', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(5, 1, 'Stop The Water While Using Me', 4, 10, 185, 2, 20, NULL, NULL, 60, 0, 1, '', '', '', '2012-08-30 14:19:51', '2012-08-30 16:12:15', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(6, 1, 'The Deli Garage', 4, 10, 185, 2, 20, NULL, NULL, 57, 0, 1, '', '', '', '2012-08-30 15:25:01', '2012-08-31 12:10:33', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(7, 1, 'Sommerwelten', 4, 10, 185, 2, 20, NULL, NULL, 51, 0, 0, '', '', '', '2012-08-30 17:20:14', '2012-08-31 12:36:20', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(8, 1, 'Beispiele', 4, 10, 185, 2, 20, NULL, NULL, 59, 0, 0, '', '', '', '2012-08-30 17:55:11', '2012-08-31 11:46:27', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(9, 1, 'Passend für Ihren Sommerurlaub', 4, 10, 185, 2, 20, NULL, NULL, 57, 0, 1, '', '', '', '2012-08-30 18:21:14', '2012-08-31 11:01:16', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(10, 1, 'English', 4, 10, 185, 2, 20, NULL, NULL, 53, 0, 0, '', '', '', '2012-08-31 08:45:10', '2012-08-31 12:35:55', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL),
(12, 1, 'in Kürze verfügbar', 4, 10, 185, 2, 20, NULL, NULL, 52, 0, 0, '', '', '', '2012-08-31 09:50:53', '2012-08-31 11:57:10', 1, '0,1,2,3,4', 0, 'masonry', 1, NULL);

TRUNCATE TABLE `s_emotion_attributes`;
TRUNCATE TABLE `s_emotion_categories`;
@@ -6626,12 +6626,6 @@ INSERT INTO `s_emotion_element_value` (`id`, `emotionID`, `elementID`, `componen
(4259, 7, 1511, 4, 8, 'selected_article'),
(4260, 7, 1512, 6, 12, '3');

TRUNCATE TABLE `s_emotion_grid`;
INSERT INTO `s_emotion_grid` (`id`, `name`, `cols`, `rows`, `cell_height`, `article_height`, `gutter`) VALUES
(1, '3-Spaltig', 3, 20, 185, 2, 10),
(2, '4-Spaltig', 4, 20, 185, 2, 10);


TRUNCATE TABLE `s_emotion_templates`;
INSERT INTO `s_emotion_templates` (`id`, `name`, `file`) VALUES
(1, 'Standard', 'index.tpl');
@@ -10369,4 +10363,9 @@ INSERT INTO `s_user_addresses` (`id`, `user_id`, `company`, `department`, `salut
(1, 1, 'Muster GmbH', NULL, 'mr', 'Max', 'Mustermann', 'Musterstr. 55', '55555', 'Musterhausen', '05555 / 555555', 2, 3, NULL),
(2, 2, 'B2B', 'Einkauf', 'mr', 'Händler', 'Kundengruppe-Netto', 'Musterweg 1', '55555', 'Musterstadt', '012345 / 6789', 2, 3, NULL),
(3, 1, 'shopware AG', NULL, 'mr', 'Max', 'Mustermann', 'Mustermannstraße 92', '48624', 'Schöppingen', NULL, 2, NULL, NULL),
(4, 2, 'B2B', 'Einkauf', 'mr', 'Händler', 'Kundengruppe-Netto', 'Musterweg 1', '00000', 'Musterstadt', NULL, 2, 3, NULL);
(4, 2, 'B2B', 'Einkauf', 'mr', 'Händler', 'Kundengruppe-Netto', 'Musterweg 1', '00000', 'Musterstadt', NULL, 2, 3, NULL);

TRUNCATE s_emotion_shops;
INSERT INTO `s_emotion_shops` (`id`, `emotion_id`, `shop_id`) VALUES
(1, 5, 1),
(2, 9, 1);
@@ -0,0 +1,30 @@
<?php

class Migrations_Migration725 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$this->addSql("ALTER TABLE `s_emotion` ADD `cell_spacing` INT NOT NULL AFTER `cols`");

$sql = <<<'EOD'
UPDATE `s_emotion` AS e
INNER JOIN s_emotion_grid AS eg
ON e.grid_id = eg.id SET
e.cols = eg.cols,
e.rows = eg.rows,
e.cell_spacing = eg.gutter,
e.cell_height = eg.cell_height,
e.article_height = eg.article_height
EOD;

$this->addSql($sql);

$this->addSql("ALTER TABLE `s_emotion` DROP `grid_id`");

$this->addSql("DROP TABLE IF EXISTS s_emotion_grid");
}
}
@@ -0,0 +1,13 @@
<?php

class Migrations_Migration726 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$this->addSql("ALTER TABLE `s_emotion` DROP `landingpage_block`, DROP `landingpage_teaser`");
}
}
@@ -0,0 +1,44 @@
<?php

class Migrations_Migration727 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$translatables = [
['name' => 'article_slider_title', 'componentID' => 11],
['name' => 'title', 'componentID' => 3],
['name' => 'link', 'componentID' => 3],
['name' => 'banner_slider_title', 'componentID' => 7],
['name' => 'javascript', 'componentID' => 13],
['name' => 'smarty', 'componentID' => 13],
['name' => 'manufacturer_slider_title', 'componentID' => 10],
['name' => 'iframe_url', 'componentID' => 9],
['name' => 'cms_title', 'componentID' => 2],
['name' => 'text', 'componentID' => 2],
['name' => 'video_id', 'componentID' => 8],
];

$sql = "ALTER TABLE `s_library_component_field` ADD translatable INT(1) NOT NULL DEFAULT 0 AFTER `allow_blank`";
$statement = $this->connection->prepare($sql);
$statement->execute();

$sql = <<<EOD
UPDATE `s_library_component_field`
SET `translatable` = 1
WHERE `name` = :name
AND `componentID` = :componentID
EOD;
$statement = $this->connection->prepare($sql);

foreach ($translatables as $translatable) {
$statement->execute([
':name' => $translatable['name'],
':componentID' => $translatable['componentID'],
]);
}
}
}
@@ -0,0 +1,22 @@
<?php

class Migrations_Migration728 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$sql = <<<'EOD'
CREATE TABLE IF NOT EXISTS `s_emotion_shops` (
`id` INT(11) NOT NULL AUTO_INCREMENT ,
`emotion_id` INT(11) NOT NULL ,
`shop_id` INT(11) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
EOD;

$this->addSql($sql);
}
}
@@ -0,0 +1,35 @@
<?php

class Migrations_Migration729 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$statement = $this->connection->query("SELECT id, category_id FROM s_core_shops");
$shopCategories = $statement->fetchAll(PDO::FETCH_KEY_PAIR);

$sql = <<<EOD
INSERT IGNORE INTO s_emotion_shops (shop_id, emotion_id)
SELECT :shopId as shop_id,
ec.emotion_id as emotion_id
FROM s_emotion_categories ec
INNER JOIN s_emotion e
ON e.id = ec.emotion_id
AND e.is_landingpage = 1
INNER JOIN s_categories c
ON c.id = ec.category_id
AND (c.path LIKE :path OR c.id = :categoryId)
EOD;

$statement = $this->connection->prepare($sql);

foreach ($shopCategories as $shopId => $category) {
$path = '%|'.$category.'|%';
$statement->execute([':path' => $path, ':categoryId' => $category, ':shopId' => $shopId]);
}
}
}
@@ -0,0 +1,29 @@
<?php

class Migrations_Migration730 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$sql = <<<'EOD'
UPDATE `s_library_component_field` as `field`
SET `position` = 9
WHERE `field`.`name` = 'article'
AND `field`.`componentID` = 4
EOD;

$this->addSql($sql);

$sql = <<<'EOD'
INSERT INTO `s_library_component_field`
(`componentID`, `name`, `x_type`, `field_label`, `allow_blank`, `translatable`, `position`)
VALUES ('4', 'article_category', 'emotion-components-fields-category-selection', 'Kategorie', '1', '0', '9');
EOD;

$this->addSql($sql);

}
}
@@ -0,0 +1,28 @@
<?php

class Migrations_Migration731 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$sql = <<<SQL
CREATE TABLE IF NOT EXISTS `s_emotion_element_viewports` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`elementID` INT(11) NOT NULL,
`emotionID` INT(11) NOT NULL,
`alias` VARCHAR(255) COLLATE utf8_unicode_ci NOT NULL,
`start_row` INT(11) NOT NULL,
`start_col` INT(11) NOT NULL,
`end_row` INT(11) NOT NULL,
`end_col` INT(11) NOT NULL,
`visible` INT(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`)) ENGINE = InnoDB
DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SQL;

$this->addSql($sql);
}
}
@@ -0,0 +1,17 @@
<?php

class Migrations_Migration732 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$sql = <<<SQL
UPDATE `s_library_component` SET `x_type` = 'emotion-components-iframe' WHERE `name` = 'iFrame-Element'
SQL;

$this->addSql($sql);
}
}
@@ -0,0 +1,33 @@
<?php

class Migrations_Migration733 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$viewports = [ 'xs', 's', 'm', 'l', 'xl' ];

$sql = <<<EOD
INSERT IGNORE INTO s_emotion_element_viewports (elementID, emotionID, alias, start_row, start_col, end_row, end_col, visible)
SELECT
id as elementID,
emotionID,
:viewport,
start_row,
start_col,
end_row,
end_col,
1 as visible
FROM s_emotion_element
EOD;

$statement = $this->connection->prepare($sql);

foreach($viewports as $viewport) {
$statement->execute([':viewport' => $viewport]);
}
}
}
@@ -0,0 +1,36 @@
<?php

class Migrations_Migration734 extends Shopware\Components\Migrations\AbstractMigration
{
/**
* @param string $modus
* @return void
*/
public function up($modus)
{
$components = [
'emotion-components-article',
'emotion-components-article-slider',
'emotion-components-manufacturer-slider'
];

$sql = <<<'EOD'
INSERT IGNORE INTO s_library_component_field
(componentID, name, x_type, allow_blank, position)
SELECT
id as componentID,
'no_border' as name,
'checkbox' as x_type,
1 as allow_blank,
90 as position
FROM s_library_component
WHERE x_type = :xtype
EOD;

$statement = $this->connection->prepare($sql);

foreach($components as $component) {
$statement->execute([':xtype' => $component]);
}
}
}
@@ -88,7 +88,6 @@ private function getDefaultMediaPositions()
new MediaPosition('s_emotion_element_value', 'value', 'path'),
new MediaPosition('s_emotion_element_value', 'value', 'path', MediaPosition::PARSE_JSON),
new MediaPosition('s_emotion_element_value', 'value', 'path', MediaPosition::PARSE_HTML),
new MediaPosition('s_emotion', 'landingpage_teaser', 'path'),
new MediaPosition('s_articles_downloads', 'filename', 'path'),
new MediaPosition('s_articles_supplier', 'img', 'path'),
new MediaPosition('s_core_templates_config_values', 'value', 'path', MediaPosition::PARSE_SERIALIZE),