Skip to content

Commit

Permalink
MAGETWO-55847: [GitHub] When tier price qty above 1000 adds a thousan…
Browse files Browse the repository at this point in the history
…d separator in the Admin Panel #5745
  • Loading branch information
igrybkov committed Sep 7, 2016
2 parents cec979e + 21d4316 commit 5b2d0bb
Show file tree
Hide file tree
Showing 125 changed files with 1,262 additions and 656 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<input class="bundle-option-<?php /* @escapeNotVerified */ echo $_option->getId() ?> checkbox product bundle option change-container-classname"
id="bundle-option-<?php /* @escapeNotVerified */ echo $_option->getId() ?>-<?php /* @escapeNotVerified */ echo $_selection->getSelectionId() ?>"
type="checkbox"
<?php if ($_option->getRequired()) echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $_option->getId() . ']&quot;]:checked\'}"'?>
<?php if ($_option->getRequired()) /* @escapeNotVerified */ echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $_option->getId() . ']&quot;]:checked\'}"'?>
name="bundle_option[<?php /* @escapeNotVerified */ echo $_option->getId() ?>][<?php /* @escapeNotVerified */ echo $_selection->getId() ?>]"
data-selector="bundle_option[<?php /* @escapeNotVerified */ echo $_option->getId() ?>][<?php /* @escapeNotVerified */ echo $_selection->getId() ?>]"
<?php if ($block->isSelected($_selection)) echo ' checked="checked"' ?>
Expand Down
15 changes: 8 additions & 7 deletions app/code/Magento/Captcha/view/adminhtml/templates/default.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

// @codingStandardsIgnoreFile

/** @var \Magento\Captcha\Block\Captcha\DefaultCaptcha $block */

/** @var \Magento\Captcha\Model\DefaultModel $captcha */
$captcha = $block->getCaptchaModel();
?>
<?php /* @var $captcha \Magento\Captcha\Model\DefaultModel */ ?>
<?php /* @var $block \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?>
<?php $captcha = $block->getCaptchaModel() ?>
<div class="admin__field _required">
<label for="captcha" class="admin__field-label">
<span><?php /* @escapeNotVerified */ echo __('Please enter the letters from the image') ?></span>
<span><?php echo $block->escapeHtml(__('Please enter the letters from the image')) ?></span>
</label>
<div class="admin__field-control">
<input
Expand All @@ -23,7 +24,7 @@
data-validate="{required:true}"/>
<?php if ($captcha->isCaseSensitive()) :?>
<div class="admin__field-note">
<span><?php /* @escapeNotVerified */ echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?></span>
<span><?php echo $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?></span>
</div>
<?php endif; ?>
</div>
Expand All @@ -33,7 +34,7 @@
id="captcha-reload"
class="captcha-reload"
src="<?php echo $block->escapeUrl($block->getViewFileUrl('Magento_Captcha::reload.png')) ?>"
alt="<?php /* @escapeNotVerified */ echo __('Reload captcha') ?>"/>
alt="<?php echo $block->escapeHtmlAttr(__('Reload captcha')) ?>"/>
<img
id="<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"
width="<?php /* @noEscape */ echo (float) $block->getImgWidth() ?>"
Expand All @@ -44,7 +45,7 @@
require(["prototype", "mage/captcha"], function(){

//<![CDATA[
var captcha = new Captcha('<?php echo $block->escapeUrl($block->getRefreshUrl()) ?>', '<?php echo $block->escapeJs($block->getFormId()) ?>');
var captcha = new Captcha('<?php echo $block->escapeJs($block->escapeUrl($block->getRefreshUrl())) ?>', '<?php echo $block->escapeJs($block->escapeHtml($block->getFormId())) ?>');

$('captcha-reload').observe('click', function () {
captcha.refresh(this);
Expand Down
15 changes: 8 additions & 7 deletions app/code/Magento/Captcha/view/frontend/templates/default.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

// @codingStandardsIgnoreFile

/** @var \Magento\Captcha\Block\Captcha\DefaultCaptcha $block */

/** @var \Magento\Captcha\Model\DefaultModel $captcha */
$captcha = $block->getCaptchaModel();
?>
<?php /* @var $captcha \Magento\Captcha\Model\DefaultModel */ ?>
<?php /* @var $block \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?>
<?php $captcha = $block->getCaptchaModel() ?>
<div class="field captcha required" role="<?php echo $block->escapeHtmlAttr($block->getFormId())?>">
<label for="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Please type the letters below')?></span></label>
<label for="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?php echo $block->escapeHtml(__('Please type the letters below')) ?></span></label>
<div class="control captcha">
<input name="<?php echo $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?php echo $block->escapeHtmlAttr($block->getFormId())?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" />
<div class="nested">
Expand All @@ -22,13 +23,13 @@
"imageLoader": "<?php echo $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
"type": "<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
<div class="control captcha-image">
<img alt="<?php /* @escapeNotVerified */ echo __('Please type the letters below')?>" class="captcha-img" height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>" src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>"/>
<button type="button" class="action reload captcha-reload" title="<?php /* @escapeNotVerified */ echo __('Reload captcha') ?>"><span><?php /* @escapeNotVerified */ echo __('Reload captcha') ?></span></button>
<img alt="<?php echo $block->escapeHtmlAttr(__('Please type the letters below')) ?>" class="captcha-img" height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>" src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>"/>
<button type="button" class="action reload captcha-reload" title="<?php echo $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?php echo $block->escapeHtml(__('Reload captcha')) ?></span></button>
</div>
</div>
<?php if ($captcha->isCaseSensitive()) :?>
<div class="captcha-note note">
<?php /* @escapeNotVerified */ echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?>
<?php echo $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?>
</div>
<?php endif; ?>
</div>
Expand Down
29 changes: 14 additions & 15 deletions app/code/Magento/Contact/view/frontend/templates/form.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,48 @@
*/

// @codingStandardsIgnoreFile

/** @var \Magento\Contact\Block\ContactForm $block */
?>
<?php /** @var $block \Magento\Contact\Block\ContactForm */ ?>
<form class="form contact"
action="<?php echo $block->escapeUrl($block->getFormAction()); ?>"
id="contact-form"
method="post"
data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>"
data-hasrequired="<?php echo $block->escapeHtmlAttr(__('* Required Fields')) ?>"
data-mage-init='{"validation":{}}'>
<fieldset class="fieldset">
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Write Us') ?></span></legend><br />
<div class="field note no-label"><?php /* @escapeNotVerified */ echo __('Jot us a note and we’ll get back to you as quickly as possible.') ?></div>
<legend class="legend"><span><?php echo $block->escapeHtml(__('Write Us')) ?></span></legend><br />
<div class="field note no-label"><?php echo $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?></div>
<div class="field name required">
<label class="label" for="name"><span><?php /* @escapeNotVerified */ echo __('Name') ?></span></label>
<label class="label" for="name"><span><?php echo $block->escapeHtml(__('Name')) ?></span></label>
<div class="control">
<input name="name" id="name" title="<?php /* @escapeNotVerified */ echo __('Name') ?>" value="<?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('name') ?: $this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/>
<input name="name" id="name" title="<?php echo $block->escapeHtmlAttr(__('Name')) ?>" value="<?php echo $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('name') ?: $this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/>
</div>
</div>
<div class="field email required">
<label class="label" for="email"><span><?php /* @escapeNotVerified */ echo __('Email') ?></span></label>
<label class="label" for="email"><span><?php echo $block->escapeHtml(__('Email')) ?></span></label>
<div class="control">
<input name="email" id="email" title="<?php /* @escapeNotVerified */ echo __('Email') ?>" value="<?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('email') ?: $this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/>
<input name="email" id="email" title="<?php echo $block->escapeHtmlAttr(__('Email')) ?>" value="<?php echo $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('email') ?: $this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/>
</div>
</div>
<div class="field telephone">
<label class="label" for="telephone"><span><?php /* @escapeNotVerified */ echo __('Phone Number') ?></span></label>
<label class="label" for="telephone"><span><?php echo $block->escapeHtml(__('Phone Number')) ?></span></label>
<div class="control">
<input name="telephone" id="telephone" title="<?php /* @escapeNotVerified */ echo __('Phone Number') ?>" value="<?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('telephone')) ?>" class="input-text" type="text" />
<input name="telephone" id="telephone" title="<?php echo $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?php echo $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('telephone')) ?>" class="input-text" type="text" />
</div>
</div>
<div class="field comment required">
<label class="label" for="comment"><span><?php /* @escapeNotVerified */ echo __('What’s on your mind?') ?></span></label>
<label class="label" for="comment"><span><?php echo $block->escapeHtml(__('What’s on your mind?')) ?></span></label>
<div class="control">
<textarea name="comment" id="comment" title="<?php /* @escapeNotVerified */ echo __('What’s on your mind?') ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?></textarea>
<textarea name="comment" id="comment" title="<?php echo $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?></textarea>
</div>
</div>
<?php echo $block->getChildHtml('form.additional.info'); ?>
</fieldset>
<div class="actions-toolbar">
<div class="primary">
<input type="hidden" name="hideit" id="hideit" value="" />
<button type="submit" title="<?php /* @escapeNotVerified */ echo __('Submit') ?>" class="action submit primary">
<span><?php /* @escapeNotVerified */ echo __('Submit') ?></span>
<button type="submit" title="<?php echo $block->escapeHtmlAttr(__('Submit')) ?>" class="action submit primary">
<span><?php echo $block->escapeHtml(__('Submit')) ?></span>
</button>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion app/code/Magento/Cookie/Block/RequireCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class RequireCookie extends \Magento\Framework\View\Element\Template
*/
public function getScriptOptions()
{
$params = ['noCookieUrl' => $this->getUrl('cookie/index/noCookies/'), 'triggers' => $this->getTriggers()];
$params = [
'noCookieUrl' => $this->escapeUrl($this->getUrl('cookie/index/noCookies/')),
'triggers' => $this->escapeHtml($this->getTriggers())
];
return json_encode($params);
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Cookie/Helper/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function isUserNotAllowSaveCookie()
public function getAcceptedSaveCookiesWebsiteIds()
{
$acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites();
$acceptedSaveCookiesWebsites[$this->_website->getId()] = 1;
$acceptedSaveCookiesWebsites[(int)$this->_website->getId()] = 1;
return json_encode($acceptedSaveCookiesWebsites);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
style="display: none;">
<div role="document" class="content" tabindex="0">
<p>
<strong><?php /* @escapeNotVerified */ echo __('We use cookies to make your experience better.') ?></strong>
<span><?php /* @escapeNotVerified */ echo __('To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies.') ?></span>
<?php /* @escapeNotVerified */ echo __('<a href="%1">Learn more</a>.', $block->getPrivacyPolicyLink()) ?>
<strong><?php echo $block->escapeHtml(__('We use cookies to make your experience better.')) ?></strong>
<span><?php echo $block->escapeHtml(__('To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies.')) ?></span>
<?php echo $block->escapeHtml(__('<a href="%1">Learn more</a>.', $block->getPrivacyPolicyLink()), ['a']) ?>
</p>
<div class="actions">
<button id="btn-cookie-allow" class="action allow primary">
<span><?php /* @escapeNotVerified */ echo __('Allow Cookies');?></span>
<span><?php echo $block->escapeHtml(__('Allow Cookies')); ?></span>
</button>
</div>
</div>
Expand All @@ -35,7 +35,7 @@
"cookieName": "<?php /* @noEscape */ echo \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
"cookieValue": <?php /* @noEscape */ echo $this->helper(\Magento\Cookie\Helper\Cookie::class)->getAcceptedSaveCookiesWebsiteIds() ?>,
"cookieLifetime": <?php /* @noEscape */ echo $this->helper(\Magento\Cookie\Helper\Cookie::class)->getCookieRestrictionLifetime()?>,
"noCookiesUrl": "<?php echo $block->escapeUrl($block->getUrl('cookie/index/noCookies')) ?>"
"noCookiesUrl": "<?php echo $block->escapeJs($block->escapeUrl($block->getUrl('cookie/index/noCookies'))) ?>"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public function getJsLayout()
public function getConfig()
{
return [
'autocomplete' => $this->isAutocompleteEnabled(),
'customerRegisterUrl' => $this->getCustomerRegisterUrlUrl(),
'customerForgotPasswordUrl' => $this->getCustomerForgotPasswordUrl(),
'baseUrl' => $this->getBaseUrl()
'autocomplete' => $this->escapeHtml($this->isAutocompleteEnabled()),
'customerRegisterUrl' => $this->escapeUrl($this->getCustomerRegisterUrlUrl()),
'customerForgotPasswordUrl' => $this->escapeUrl($this->getCustomerForgotPasswordUrl()),
'baseUrl' => $this->escapeUrl($this->getBaseUrl())
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

class AuthenticationPopupTest extends \PHPUnit_Framework_TestCase
{
/** @var AuthenticationPopup */
/** @var \Magento\Customer\Block\Account\AuthenticationPopup */
private $model;

/** @var Context|\PHPUnit_Framework_MockObject_MockObject */
/** @var \Magento\Framework\View\Element\Template\Context|\PHPUnit_Framework_MockObject_MockObject */
private $contextMock;

/** @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */
Expand Down Expand Up @@ -53,6 +53,24 @@ protected function setUp()
$this->contextMock->expects($this->once())
->method('getUrlBuilder')
->willReturn($this->urlBuilderMock);
$escaperMock = $this->getMockBuilder(\Magento\Framework\Escaper::class)
->disableOriginalConstructor()
->getMock();
$escaperMock->method('escapeHtml')
->willReturnCallback(
function ($string) {
return 'escapeHtml' . $string;
}
);
$escaperMock->method('escapeUrl')
->willReturnCallback(
function ($string) {
return 'escapeUrl' . $string;
}
);
$this->contextMock->expects($this->once())
->method('getEscaper')
->willReturn($escaperMock);

$this->model = new AuthenticationPopup(
$this->contextMock
Expand Down Expand Up @@ -110,10 +128,10 @@ public function dataProviderGetConfig()
'reg',
'forgot',
[
'autocomplete' => 'off',
'customerRegisterUrl' => 'reg',
'customerForgotPasswordUrl' => 'forgot',
'baseUrl' => 'base',
'autocomplete' => 'escapeHtmloff',
'customerRegisterUrl' => 'escapeUrlreg',
'customerForgotPasswordUrl' => 'escapeUrlforgot',
'baseUrl' => 'escapeUrlbase',
],
],
[
Expand All @@ -122,10 +140,10 @@ public function dataProviderGetConfig()
'reg',
'forgot',
[
'autocomplete' => 'on',
'customerRegisterUrl' => 'reg',
'customerForgotPasswordUrl' => 'forgot',
'baseUrl' => '',
'autocomplete' => 'escapeHtmlon',
'customerRegisterUrl' => 'escapeUrlreg',
'customerForgotPasswordUrl' => 'escapeUrlforgot',
'baseUrl' => 'escapeUrl',
],
],
[
Expand All @@ -134,10 +152,10 @@ public function dataProviderGetConfig()
'',
'forgot',
[
'autocomplete' => 'off',
'customerRegisterUrl' => '',
'customerForgotPasswordUrl' => 'forgot',
'baseUrl' => 'base',
'autocomplete' => 'escapeHtmloff',
'customerRegisterUrl' => 'escapeUrl',
'customerForgotPasswordUrl' => 'escapeUrlforgot',
'baseUrl' => 'escapeUrlbase',
],
],
[
Expand All @@ -146,10 +164,10 @@ public function dataProviderGetConfig()
'reg',
'',
[
'autocomplete' => 'on',
'customerRegisterUrl' => 'reg',
'customerForgotPasswordUrl' => '',
'baseUrl' => 'base',
'autocomplete' => 'escapeHtmlon',
'customerRegisterUrl' => 'escapeUrlreg',
'customerForgotPasswordUrl' => 'escapeUrl',
'baseUrl' => 'escapeUrlbase',
],
],
];
Expand Down
Loading

0 comments on commit 5b2d0bb

Please sign in to comment.