Skip to content

Commit 729a208

Browse files
Merge branch 'develop' of https://github.com/magento/magento2ce into MAGETWO-66656
2 parents 8d26477 + 411a1d6 commit 729a208

File tree

717 files changed

+16402
-3737
lines changed

Some content is hidden

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

717 files changed

+16402
-3737
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2)
22
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3+
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)
34
<h2>Welcome</h2>
45
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.
56

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
name="notification_window"
1818
as="notification_window"
1919
acl="Magento_AdminNotification::show_toolbar"
20-
template="notification/window.phtml"/>
20+
template="Magento_AdminNotification::notification/window.phtml"/>
2121
</referenceContainer>
2222
<referenceContainer name="header">
23-
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="toolbar_entry.phtml"/>
23+
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="Magento_AdminNotification::toolbar_entry.phtml"/>
2424
</referenceContainer>
2525
</body>
2626
</page>

app/code/Magento/Analytics/Api/Data/LinkInterface.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,4 @@ public function getUrl();
2121
* @return string
2222
*/
2323
public function getInitializationVector();
24-
25-
/**
26-
* @param string $url
27-
* @return void
28-
*/
29-
public function setUrl($url);
30-
31-
/**
32-
* @param string $initializationVector
33-
* @return void
34-
*/
35-
public function setInitializationVector($initializationVector);
3624
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Analytics\Block\Adminhtml\System\Config;
7+
8+
/**
9+
* Provides field with additional information
10+
*/
11+
class AdditionalComment extends \Magento\Config\Block\System\Config\Form\Field
12+
{
13+
/**
14+
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
15+
* @return string
16+
*/
17+
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
18+
{
19+
$html = '<div class="config-additional-comment-title">' . $element->getLabel() . '</div>';
20+
$html .= '<div class="config-additional-comment-content">' . $element->getComment() . '</div>';
21+
return $this->decorateRowHtml($element, $html);
22+
}
23+
24+
/**
25+
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
26+
* @param string $html
27+
* @return string
28+
*/
29+
private function decorateRowHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element, $html)
30+
{
31+
return sprintf(
32+
'<tr id="row_%s"><td colspan="3"><div class="config-additional-comment">%s</div></td></tr>',
33+
$element->getHtmlId(),
34+
$html
35+
);
36+
}
37+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Analytics\Block\Adminhtml\System\Config;
7+
8+
/**
9+
* Provides label with default Time Zone
10+
*/
11+
class CollectionTimeLabel extends \Magento\Config\Block\System\Config\Form\Field
12+
{
13+
/**
14+
* Add default time zone to comment
15+
*
16+
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
17+
* @return string
18+
*/
19+
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
20+
{
21+
$timeZoneCode = $this->_localeDate->getConfigTimezone();
22+
$getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)->getDisplayName();
23+
$element->setData(
24+
'comment',
25+
sprintf("%s (%s)", $getLongTimeZoneName, $timeZoneCode)
26+
);
27+
return parent::render($element);
28+
}
29+
}

app/code/Magento/Analytics/Block/Adminhtml/System/Config/SubscriptionStatusLabel.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ public function __construct(
3939
}
4040

4141
/**
42-
* Unset some non-related element parameters
42+
* Add Subscription status to comment
4343
*
4444
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
4545
* @return string
4646
*/
4747
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
4848
{
49-
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
5049
$element->setData(
51-
'value',
50+
'comment',
5251
$this->prepareLabelValue()
5352
);
5453
return parent::render($element);

app/code/Magento/Analytics/Controller/Adminhtml/BasicTier/SignUp.php renamed to app/code/Magento/Analytics/Controller/Adminhtml/BIEssentials/SignUp.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,38 @@
33
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Analytics\Controller\Adminhtml\BasicTier;
6+
namespace Magento\Analytics\Controller\Adminhtml\BIEssentials;
77

88
use Magento\Backend\App\Action;
9-
use Magento\Config\Model\Config;
109
use Magento\Backend\App\Action\Context;
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
1111

1212
/**
1313
* Class SignUp
1414
*
15-
* Provides link to Basic Tier signup
15+
* Provides link to BI Essentials signup
1616
*/
1717
class SignUp extends Action
1818
{
1919
/**
20+
* Path to config value with URL to BI Essentials sign-up page.
21+
*
2022
* @var string
2123
*/
22-
private $basicTierUrlPath = 'analytics/url/basic_tier';
24+
private $urlBIEssentialsConfigPath = 'analytics/url/bi_essentials';
2325

2426
/**
25-
* @var Config
27+
* @var ScopeConfigInterface
2628
*/
2729
private $config;
2830

2931
/**
3032
* @param Context $context
31-
* @param Config $config
33+
* @param ScopeConfigInterface $config
3234
*/
3335
public function __construct(
3436
Context $context,
35-
Config $config
37+
ScopeConfigInterface $config
3638
) {
3739
$this->config = $config;
3840
parent::__construct($context);
@@ -45,18 +47,18 @@ public function __construct(
4547
*/
4648
protected function _isAllowed()
4749
{
48-
return $this->_authorization->isAllowed('Magento_Analytics::report_basic_tier');
50+
return $this->_authorization->isAllowed('Magento_Analytics::bi_essentials');
4951
}
5052

5153
/**
52-
* Provides link to Basic Tier signup
54+
* Provides link to BI Essentials signup
5355
*
5456
* @return \Magento\Framework\Controller\AbstractResult
5557
*/
5658
public function execute()
5759
{
5860
return $this->resultRedirectFactory->create()->setUrl(
59-
$this->config->getConfigDataValue($this->basicTierUrlPath)
61+
$this->config->getValue($this->urlBIEssentialsConfigPath)
6062
);
6163
}
6264
}

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Activate.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
use Psr\Log\LoggerInterface;
1717

1818
/**
19-
* Class Activate
20-
*
21-
* Activates subscription with Free Tier program
19+
* Activates subscription to Magento BI Advanced Reporting.
2220
*/
2321
class Activate extends Action
2422
{
2523
/**
26-
* Resource for managing subscription to Magento Analytics.
24+
* Resource for managing subscription to Magento BI.
2725
*
2826
* @var Subscription
2927
*/
@@ -35,7 +33,7 @@ class Activate extends Action
3533
private $logger;
3634

3735
/**
38-
* Resource for managing last notification time about subscription to Magento Analytics.
36+
* Resource for managing last notification time about subscription to Magento BI.
3937
*
4038
* @var NotificationTime
4139
*/
@@ -79,7 +77,7 @@ protected function _isAllowed()
7977
}
8078

8179
/**
82-
* Activate subscription to Magento Analytics via AJAX.
80+
* Activate subscription to Magento BI via AJAX.
8381
*
8482
* @return Json
8583
*/

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
use Psr\Log\LoggerInterface;
1717

1818
/**
19-
* Class Postpone
20-
*
21-
* Postpones notification about Free Tier program
19+
* Postpones notification about subscription to Magento BI Advanced Reporting.
2220
*/
2321
class Postpone extends Action
2422
{
@@ -38,8 +36,6 @@ class Postpone extends Action
3836
private $logger;
3937

4038
/**
41-
* Postpone constructor.
42-
*
4339
* @param Context $context
4440
* @param DateTimeFactory $dateTimeFactory
4541
* @param NotificationTime $notificationTime
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Analytics\Controller\Adminhtml\Subscription;
8+
9+
use Magento\Analytics\Model\Subscription;
10+
use Magento\Backend\App\Action;
11+
use Magento\Backend\App\Action\Context;
12+
use Magento\Framework\Controller\Result\Redirect;
13+
use Magento\Framework\Controller\ResultFactory;
14+
use Magento\Framework\Exception\LocalizedException;
15+
16+
/**
17+
* Retry subscription to Magento BI Advanced Reporting.
18+
*/
19+
class Retry extends Action
20+
{
21+
/**
22+
* Resource for managing subscription to Magento Analytics.
23+
*
24+
* @var Subscription
25+
*/
26+
private $subscription;
27+
28+
/**
29+
* @param Context $context
30+
* @param Subscription $subscription
31+
*/
32+
public function __construct(
33+
Context $context,
34+
Subscription $subscription
35+
) {
36+
$this->subscription = $subscription;
37+
parent::__construct($context);
38+
}
39+
40+
/**
41+
* Check admin permissions for this controller
42+
*
43+
* @return boolean
44+
*/
45+
protected function _isAllowed()
46+
{
47+
return $this->_authorization->isAllowed('Magento_Analytics::analytics_settings');
48+
}
49+
50+
/**
51+
* Retry process of subscription.
52+
*
53+
* @return Redirect
54+
*/
55+
public function execute()
56+
{
57+
/** @var Redirect $resultRedirect */
58+
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
59+
try {
60+
$resultRedirect->setPath('adminhtml');
61+
$this->subscription->retry();
62+
} catch (LocalizedException $e) {
63+
$this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
64+
} catch (\Exception $e) {
65+
$this->getMessageManager()->addExceptionMessage(
66+
$e,
67+
__('Sorry, there has been an error processing your request. Please try again later.')
68+
);
69+
}
70+
71+
return $resultRedirect;
72+
}
73+
}

0 commit comments

Comments
 (0)