Skip to content

Commit

Permalink
Merge branch '2.4-develop' of github.com:magento/magento2 into update…
Browse files Browse the repository at this point in the history
…-product-custom-option-methods-phpdoc
  • Loading branch information
sivaschenko committed Feb 17, 2020
2 parents c3ce048 + a25c107 commit c96c312
Show file tree
Hide file tree
Showing 526 changed files with 15,423 additions and 3,313 deletions.
3 changes: 1 addition & 2 deletions app/code/Magento/AdvancedPricingImportExport/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_AdvancedPricingImportExport" >
</module>
<module name="Magento_AdvancedPricingImportExport"/>
</config>
41 changes: 15 additions & 26 deletions app/code/Magento/Backend/Block/Dashboard/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard
{
/**
* Api URL
*/
const API_URL = 'https://image-charts.com/chart';

/**
Expand Down Expand Up @@ -190,8 +187,8 @@ public function getChartUrl($directUrl = true)
$params = [
'cht' => 'lc',
'chls' => '7',
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
'chm' => 'B,f4d4b2,0,0,0',
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
'chm' => 'B,f4d4b2,0,0,0',
'chco' => 'db4814',
'chxs' => '0,0,11|1,0,11',
'chma' => '15,15,15,15'
Expand Down Expand Up @@ -237,7 +234,7 @@ public function getChartUrl($directUrl = true)
case '1y':
case '2y':
$d = $dateStart->format('Y-m');
$dateStart->modify('+1 month');
$dateStart->modify('first day of next month');
break;
default:
$d = $dateStart->format('Y-m-d H:00');
Expand Down Expand Up @@ -300,20 +297,23 @@ public function getChartUrl($directUrl = true)
$minvalue = min($localminvalue);

// default values
$yLabels = [];
$miny = 0;
$maxy = 0;
$yorigin = 0;
$xAxis = 'x';
$xAxisIndex = 0;
$yAxisIndex = 1;

if ($minvalue >= 0 && $maxvalue >= 0) {
if ($maxvalue > 10) {
$p = pow(10, $this->_getPow((int) $maxvalue));
$p = pow(10, $this->_getPow((int)$maxvalue));
$maxy = ceil($maxvalue / $p) * $p;
$yLabels = range($miny, $maxy, $p);
$yRange = "$yAxisIndex,$miny,$maxy,$p";
} else {
$maxy = ceil($maxvalue + 1);
$yLabels = range($miny, $maxy, 1);
$yRange = "$yAxisIndex,$miny,$maxy,1";
}
$params['chxr'] = $yRange;
$yorigin = 0;
}

Expand Down Expand Up @@ -341,22 +341,11 @@ public function getChartUrl($directUrl = true)

$params['chd'] .= $buffer;

$valueBuffer = [];

if (count($this->_axisLabels) > 0) {
$params['chxt'] = implode(',', array_keys($this->_axisLabels));
$indexid = 0;
foreach ($this->_axisLabels as $idx => $labels) {
if ($idx == 'x') {
$this->formatAxisLabelDate((string) $idx, (string) $timezoneLocal);
$tmpstring = implode('|', $this->_axisLabels[$idx]);
$valueBuffer[] = $indexid . ":|" . $tmpstring;
} elseif ($idx == 'y') {
$valueBuffer[] = $indexid . ":|" . implode('|', $yLabels);
}
$indexid++;
}
$params['chxl'] = implode('|', $valueBuffer);
$this->formatAxisLabelDate($xAxis, (string)$timezoneLocal);
$customAxisLabels = $xAxisIndex . ":|" . implode('|', $this->_axisLabels[$xAxis]);
$params['chxl'] = $customAxisLabels . $dataSetdelimiter;
}

// chart size
Expand All @@ -368,7 +357,7 @@ public function getChartUrl($directUrl = true)
foreach ($params as $name => $value) {
$p[] = $name . '=' . urlencode($value);
}
return (string) self::API_URL . '?' . implode('&', $p);
return (string)self::API_URL . '?' . implode('&', $p);
}
$gaData = urlencode(base64_encode(json_encode($params)));
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
Expand All @@ -392,7 +381,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
switch ($this->getDataHelper()->getParam('period')) {
case '24h':
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
$period->setTime((int) $period->format('H'), 0, 0),
$period->setTime((int)$period->format('H'), 0, 0),
\IntlDateFormatter::NONE,
\IntlDateFormatter::SHORT
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Magento\Framework\DataObject;

/**
* Produce html output using the given data source.
*
* phpcs:disable Magento2.Classes.AbstractApi
* Backend grid item abstract renderer
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
Expand Down Expand Up @@ -53,7 +56,7 @@ public function getColumn()
* Renders grid column
*
* @param DataObject $row
* @return string
* @return string
*/
public function render(DataObject $row)
{
Expand All @@ -62,7 +65,7 @@ public function render(DataObject $row)
$result .= $this->getColumn()->getEditOnly() ? ''
: '<span class="admin__grid-control-value">' . $this->_getValue($row) . '</span>';

return $result . $this->_getInputValueElement($row) . '</div>' ;
return $result . $this->_getInputValueElement($row) . '</div>';
}
return $this->_getValue($row);
}
Expand Down Expand Up @@ -90,6 +93,7 @@ protected function _getValue(DataObject $row)
if (is_string($getter)) {
return $row->{$getter}();
} elseif (is_callable($getter)) {
//phpcs:ignore Magento2.Functions.DiscouragedFunction
return call_user_func($getter, $row);
}
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginActionGroup">
<annotations>
<description>Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
<description>DEPRECATED. Please use LoginAsAdmin instead.
Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
</annotations>

<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}" stepKey="navigateToAdmin"/>
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@
<label>Enable Template Path Hints for Storefront</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="template_hints_storefront_show_with_parameter" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="template_hints_storefront_show_with_parameter" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable Hints for Storefront with URL Parameter</label>
<depends>
<field id="*/*/template_hints_storefront">1</field>
</depends>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Use URL parameter to enable template path hints for Storefront</comment>
</field>
<field id="template_hints_parameter_value" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="template_hints_parameter_value" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Parameter Value</label>
<depends>
<field id="*/*/template_hints_storefront">1</field>
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Backend/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,5 @@ Pagination,Pagination
"Alternative text for the next pages link in the pagination menu. If empty, default arrow image is used.","Alternative text for the next pages link in the pagination menu. If empty, default arrow image is used."
"Anchor Text for Next","Anchor Text for Next"
"Theme Name","Theme Name"
"Use URL parameter to enable template path hints for Storefront","Use URL parameter to enable template path hints for Storefront"
"Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]","Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;

/**
* Class CaptureStrategyCommand
* Braintree capture implementation.
*
* @SuppressWarnings(PHPMD)
*/
class CaptureStrategyCommand implements CommandInterface
Expand Down Expand Up @@ -84,7 +85,7 @@ class CaptureStrategyCommand implements CommandInterface
* @param FilterBuilder $filterBuilder
* @param SearchCriteriaBuilder $searchCriteriaBuilder
* @param SubjectReader $subjectReader
* @param BraintreeAdapterFactory $braintreeAdapterFactory,
* @param BraintreeAdapterFactory $braintreeAdapterFactory
* @param BraintreeSearchAdapter $braintreeSearchAdapter
*/
public function __construct(
Expand Down Expand Up @@ -112,9 +113,9 @@ public function execute(array $commandSubject)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObjectInterface $paymentDO */
$paymentDO = $this->subjectReader->readPayment($commandSubject);

$command = $this->getCommand($paymentDO);
$this->commandPool->get($command)->execute($commandSubject);

return $this->commandPool->get($command)->execute($commandSubject);
}

/**
Expand All @@ -128,11 +129,8 @@ private function getCommand(PaymentDataObjectInterface $paymentDO)
$payment = $paymentDO->getPayment();
ContextHelper::assertOrderPayment($payment);

// if auth transaction does not exist then execute authorize&capture command
// if capture transaction does not exist then execute capture command
$existsCapture = $this->isExistsCaptureTransaction($payment);
if (!$payment->getAuthorizationTransaction() && !$existsCapture) {
return self::SALE;
}

// do capture for authorization transaction
if (!$existsCapture && !$this->isExpiredAuthorization($payment, $paymentDO->getOrder())) {
Expand Down
Loading

0 comments on commit c96c312

Please sign in to comment.