Skip to content

Commit 970263a

Browse files
author
Yuri Kovsher
committed
Merge remote-tracking branch 'main-ce/develop' into MAGETWO-34198
2 parents ab5c70d + 670849f commit 970263a

File tree

1,044 files changed

+54558
-38415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,044 files changed

+54558
-38415
lines changed

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
1414
{
1515
/**
16-
* @var \Magento\Core\Helper\Url
16+
* @var \Magento\Framework\Url\Helper\Data
1717
*/
1818
protected $_urlHelper;
1919

2020
/**
2121
* @param \Magento\Backend\Block\Context $context
22-
* @param \Magento\Core\Helper\Url $urlHelper
22+
* @param \Magento\Framework\Url\Helper\Data $urlHelper
2323
* @param array $data
2424
*/
2525
public function __construct(
2626
\Magento\Backend\Block\Context $context,
27-
\Magento\Core\Helper\Url $urlHelper,
27+
\Magento\Framework\Url\Helper\Data $urlHelper,
2828
array $data = []
2929
) {
3030
$this->_urlHelper = $urlHelper;

app/code/Magento/AdminNotification/Block/System/Messages.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ class Messages extends \Magento\Backend\Block\Template
1515
protected $_messages;
1616

1717
/**
18-
* @var \Magento\Core\Helper\Data
18+
* @var \Magento\Framework\Json\Helper\Data
1919
*/
20-
protected $_coreHelper;
20+
protected $jsonHelper;
2121

2222
/**
2323
* @param \Magento\Backend\Block\Template\Context $context
2424
* @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages
25-
* @param \Magento\Core\Helper\Data $coreHelper
25+
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
2626
* @param array $data
2727
*/
2828
public function __construct(
2929
\Magento\Backend\Block\Template\Context $context,
3030
\Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages,
31-
\Magento\Core\Helper\Data $coreHelper,
31+
\Magento\Framework\Json\Helper\Data $jsonHelper,
3232
array $data = []
3333
) {
34-
$this->_coreHelper = $coreHelper;
34+
$this->jsonHelper = $jsonHelper;
3535
parent::__construct($context, $data);
3636
$this->_messages = $messages;
3737
}
@@ -117,7 +117,7 @@ protected function _getMessagesUrl()
117117
*/
118118
public function getSystemMessageDialogJson()
119119
{
120-
return $this->_coreHelper->jsonEncode(
120+
return $this->jsonHelper->jsonEncode(
121121
[
122122
'systemMessageDialog' => [
123123
'autoOpen' => false,

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/AjaxMarkAsRead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function execute()
3131
$responseData['success'] = false;
3232
}
3333
$this->getResponse()->representJson(
34-
$this->_objectManager->create('Magento\Core\Helper\Data')->jsonEncode($responseData)
34+
$this->_objectManager->create('Magento\Framework\Json\Helper\Data')->jsonEncode($responseData)
3535
);
3636
}
3737
}

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function execute()
2525
$result[] = ['severity' => $item->getSeverity(), 'text' => $item->getText()];
2626
}
2727
$this->getResponse()->representJson(
28-
$this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result)
28+
$this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
2929
);
3030
}
3131
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\AdminNotification\Setup;
8+
9+
use Magento\Framework\Setup\InstallSchemaInterface;
10+
use Magento\Framework\Setup\ModuleContextInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
/**
14+
* @codeCoverageIgnore
15+
*/
16+
class InstallSchema implements InstallSchemaInterface
17+
{
18+
/**
19+
* {@inheritdoc}
20+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
21+
*/
22+
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
23+
{
24+
$installer = $setup;
25+
26+
$installer->startSetup();
27+
/**
28+
* Create table 'adminnotification_inbox'
29+
*/
30+
$table = $installer->getConnection()->newTable(
31+
$installer->getTable('adminnotification_inbox')
32+
)->addColumn(
33+
'notification_id',
34+
\Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
35+
null,
36+
['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
37+
'Notification id'
38+
)->addColumn(
39+
'severity',
40+
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
41+
null,
42+
['unsigned' => true, 'nullable' => false, 'default' => '0'],
43+
'Problem type'
44+
)->addColumn(
45+
'date_added',
46+
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
47+
null,
48+
['nullable' => false],
49+
'Create date'
50+
)->addColumn(
51+
'title',
52+
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
53+
255,
54+
['nullable' => false],
55+
'Title'
56+
)->addColumn(
57+
'description',
58+
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
59+
'64k',
60+
[],
61+
'Description'
62+
)->addColumn(
63+
'url',
64+
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
65+
255,
66+
[],
67+
'Url'
68+
)->addColumn(
69+
'is_read',
70+
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
71+
null,
72+
['unsigned' => true, 'nullable' => false, 'default' => '0'],
73+
'Flag if notification read'
74+
)->addColumn(
75+
'is_remove',
76+
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
77+
null,
78+
['unsigned' => true, 'nullable' => false, 'default' => '0'],
79+
'Flag if notification might be removed'
80+
)->addIndex(
81+
$installer->getIdxName('adminnotification_inbox', ['severity']),
82+
['severity']
83+
)->addIndex(
84+
$installer->getIdxName('adminnotification_inbox', ['is_read']),
85+
['is_read']
86+
)->addIndex(
87+
$installer->getIdxName('adminnotification_inbox', ['is_remove']),
88+
['is_remove']
89+
)->setComment(
90+
'Adminnotification Inbox'
91+
);
92+
$installer->getConnection()->createTable($table);
93+
94+
/**
95+
* Create table 'admin_system_messages'
96+
*/
97+
$table = $installer->getConnection()->newTable(
98+
$installer->getTable('admin_system_messages')
99+
)->addColumn(
100+
'identity',
101+
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
102+
100,
103+
['nullable' => false, 'primary' => true],
104+
'Message id'
105+
)->addColumn(
106+
'severity',
107+
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
108+
null,
109+
['unsigned' => true, 'nullable' => false, 'default' => '0'],
110+
'Problem type'
111+
)->addColumn(
112+
'created_at',
113+
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
114+
null,
115+
['nullable' => false],
116+
'Create date'
117+
)->setComment(
118+
'Admin System Messages'
119+
);
120+
$installer->getConnection()->createTable($table);
121+
122+
$installer->endSetup();
123+
124+
}
125+
}

app/code/Magento/AdminNotification/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
9-
<module name="Magento_AdminNotification" schema_version="2.0.0">
9+
<module name="Magento_AdminNotification" setup_version="2.0.0">
1010
<sequence>
1111
<module name="Magento_Core"/>
1212
<module name="Magento_Store"/>

app/code/Magento/AdminNotification/sql/adminnotification_setup/install-2.0.0.php

Lines changed: 0 additions & 112 deletions
This file was deleted.

app/code/Magento/Authorization/Model/Resource/Setup.php renamed to app/code/Magento/Authorization/Setup/AuthorizationFactory.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Authorization\Model\Resource;
6+
namespace Magento\Authorization\Setup;
77

88
/**
99
* Resource Setup Model
1010
*
11-
* @SuppressWarnings(PHPMD.LongVariable)
12-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
11+
* @codeCoverageIgnore
1312
*/
14-
class Setup extends \Magento\Framework\Module\DataSetup
13+
class AuthorizationFactory
1514
{
1615
/**
1716
* Role model factory
@@ -42,30 +41,23 @@ class Setup extends \Magento\Framework\Module\DataSetup
4241
protected $_rulesFactory;
4342

4443
/**
45-
* @param \Magento\Framework\Module\Setup\Context $context
46-
* @param string $resourceName
44+
* Init
45+
*
4746
* @param \Magento\Authorization\Model\Resource\Role\CollectionFactory $roleCollectionFactory
4847
* @param \Magento\Authorization\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory
4948
* @param \Magento\Authorization\Model\RoleFactory $roleFactory
5049
* @param \Magento\Authorization\Model\RulesFactory $rulesFactory
51-
* @param string $moduleName
52-
* @param string $connectionName
5350
*/
5451
public function __construct(
55-
\Magento\Framework\Module\Setup\Context $context,
56-
$resourceName,
5752
\Magento\Authorization\Model\Resource\Role\CollectionFactory $roleCollectionFactory,
5853
\Magento\Authorization\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory,
5954
\Magento\Authorization\Model\RoleFactory $roleFactory,
60-
\Magento\Authorization\Model\RulesFactory $rulesFactory,
61-
$moduleName = 'Magento_Authorization',
62-
$connectionName = \Magento\Framework\Module\Updater\SetupInterface::DEFAULT_SETUP_CONNECTION
55+
\Magento\Authorization\Model\RulesFactory $rulesFactory
6356
) {
6457
$this->_roleCollectionFactory = $roleCollectionFactory;
6558
$this->_rulesCollectionFactory = $rulesCollectionFactory;
6659
$this->_roleFactory = $roleFactory;
6760
$this->_rulesFactory = $rulesFactory;
68-
parent::__construct($context, $resourceName, $moduleName, $connectionName);
6961
}
7062

7163
/**

0 commit comments

Comments
 (0)