-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'm2origin/develop' into MAGETWO-66470
- Loading branch information
Showing
565 changed files
with
8,659 additions
and
2,839 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/code/Magento/Analytics/Block/Adminhtml/System/Config/AdditionalComment.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Analytics\Block\Adminhtml\System\Config; | ||
|
||
/** | ||
* Provides field with additional information | ||
*/ | ||
class AdditionalComment extends \Magento\Config\Block\System\Config\Form\Field | ||
{ | ||
/** | ||
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element | ||
* @return string | ||
*/ | ||
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | ||
{ | ||
$html = '<div class="config-additional-comment-title">' . $element->getLabel() . '</div>'; | ||
$html .= '<div class="config-additional-comment-content">' . $element->getComment() . '</div>'; | ||
return $this->decorateRowHtml($element, $html); | ||
} | ||
|
||
/** | ||
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element | ||
* @param string $html | ||
* @return string | ||
*/ | ||
private function decorateRowHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element, $html) | ||
{ | ||
return sprintf( | ||
'<tr id="row_%s"><td colspan="3"><div class="config-additional-comment">%s</div></td></tr>', | ||
$element->getHtmlId(), | ||
$html | ||
); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
app/code/Magento/Analytics/Block/Adminhtml/System/Config/CollectionTimeLabel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Analytics\Block\Adminhtml\System\Config; | ||
|
||
/** | ||
* Provides label with default Time Zone | ||
*/ | ||
class CollectionTimeLabel extends \Magento\Config\Block\System\Config\Form\Field | ||
{ | ||
/** | ||
* Add default time zone to comment | ||
* | ||
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element | ||
* @return string | ||
*/ | ||
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | ||
{ | ||
$timeZoneCode = $this->_localeDate->getConfigTimezone(); | ||
$getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)->getDisplayName(); | ||
$element->setData( | ||
'comment', | ||
sprintf("%s (%s)", $getLongTimeZoneName, $timeZoneCode) | ||
); | ||
return parent::render($element); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Retry.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Analytics\Controller\Adminhtml\Subscription; | ||
|
||
use Magento\Analytics\Model\Subscription; | ||
use Magento\Backend\App\Action; | ||
use Magento\Backend\App\Action\Context; | ||
use Magento\Framework\Controller\Result\Redirect; | ||
use Magento\Framework\Controller\ResultFactory; | ||
use Magento\Framework\Exception\LocalizedException; | ||
|
||
/** | ||
* Retry subscription to Magento BI Advanced Reporting. | ||
*/ | ||
class Retry extends Action | ||
{ | ||
/** | ||
* Resource for managing subscription to Magento Analytics. | ||
* | ||
* @var Subscription | ||
*/ | ||
private $subscription; | ||
|
||
/** | ||
* @param Context $context | ||
* @param Subscription $subscription | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
Subscription $subscription | ||
) { | ||
$this->subscription = $subscription; | ||
parent::__construct($context); | ||
} | ||
|
||
/** | ||
* Check admin permissions for this controller | ||
* | ||
* @return boolean | ||
*/ | ||
protected function _isAllowed() | ||
{ | ||
return $this->_authorization->isAllowed('Magento_Analytics::analytics_settings'); | ||
} | ||
|
||
/** | ||
* Retry process of subscription. | ||
* | ||
* @return Redirect | ||
*/ | ||
public function execute() | ||
{ | ||
/** @var Redirect $resultRedirect */ | ||
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); | ||
try { | ||
$resultRedirect->setPath('adminhtml'); | ||
$this->subscription->retry(); | ||
} catch (LocalizedException $e) { | ||
$this->getMessageManager()->addExceptionMessage($e, $e->getMessage()); | ||
} catch (\Exception $e) { | ||
$this->getMessageManager()->addExceptionMessage( | ||
$e, | ||
__('Sorry, there has been an error processing your request. Please try again later.') | ||
); | ||
} | ||
|
||
return $resultRedirect; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.