88/**
99 * @var $block \Magento\Reports\Block\Adminhtml\Grid
1010 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
11+ * @var $escaper \Magento\Framework\Escaper
1112 */
1213?>
1314<?php if ($ block ->getCollection ()): ?>
1415 <?php if ($ block ->canDisplayContainer ()): ?>
15- <div id="<?= $ block ->escapeHtmlAttr ($ block ->getId ()) ?> ">
16+ <div id="<?= $ escaper ->escapeHtmlAttr ($ block ->getId ()) ?> ">
1617 <?php else : ?>
1718 <?= $ block ->getLayout ()->getMessagesBlock ()->getGroupedHtml () ?>
1819 <?php endif ; ?>
2122 <div class="admin__data-grid-header-row">
2223 <?php if ($ block ->getDateFilterVisibility ()): ?>
2324 <div class="admin__filter-actions" data-role="filter-form"
24- id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_range ' )) ?> ">
25+ id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_range ' )) ?> ">
2526 <span class="field-row">
26- <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
27+ <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
2728 class="admin__control-support-text">
28- <span><?= $ block ->escapeHtml (__ ('From ' )) ?> :</span>
29+ <span><?= $ escaper ->escapeHtml (__ ('From ' )) ?> :</span>
2930 </label>
3031 <input class="input-text no-changes required-entry admin__control-text"
3132 type="text"
32- id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
33+ id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
3334 name="report_from"
34- value="<?= $ block ->escapeHtmlAttr ($ block ->getFilter ('report_from ' )) ?> ">
35- <span id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from_advice ' ))?> ">
35+ value="<?= $ escaper ->escapeHtmlAttr ($ block ->getFilter ('report_from ' )) ?> ">
36+ <span id="<?= $ escaper
37+ ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from_advice ' ))?> ">
3638 </span>
3739 </span>
3840
3941 <span class="field-row">
40- <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
42+ <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
4143 class="admin__control-support-text">
42- <span><?= $ block ->escapeHtml (__ ('To ' )) ?> :</span>
44+ <span><?= $ escaper ->escapeHtml (__ ('To ' )) ?> :</span>
4345 </label>
4446 <input class="input-text no-changes required-entry admin__control-text"
4547 type="text"
46- id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
48+ id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
4749 name="report_to"
48- value="<?= $ block ->escapeHtmlAttr ($ block ->getFilter ('report_to ' )) ?> "/>
49- <span id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to_advice ' )) ?> ">
50+ value="<?= $ escaper ->escapeHtmlAttr ($ block ->getFilter ('report_to ' )) ?> "/>
51+ <span id="<?= $ escaper
52+ ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to_advice ' )) ?> ">
5053 </span>
5154 </span>
5255
5356 <span class="field-row admin__control-filter">
54- <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
57+ <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
5558 class="admin__control-support-text">
56- <span><?= $ block ->escapeHtml (__ ('Show By ' )) ?> :</span>
59+ <span><?= $ escaper ->escapeHtml (__ ('Show By ' )) ?> :</span>
5760 </label>
5861 <select name="report_period"
59- id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
62+ id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
6063 class="admin__control-select">
6164 <?php foreach ($ block ->getPeriods () as $ _value => $ _label ): ?>
62- <option value="<?= $ block ->escapeHtmlAttr ($ _value ) ?> "
65+ <option value="<?= $ escaper ->escapeHtmlAttr ($ _value ) ?> "
6366 <?php if ($ block ->getFilter ('report_period ' ) == $ _value ):
64- ?> selected<?php endif ; ?> ><?= $ block ->escapeHtml ($ _label ) ?>
67+ ?> selected<?php endif ; ?> ><?= $ escaper ->escapeHtml ($ _label ) ?>
6568 </option>
6669 <?php endforeach ; ?>
6770 </select>
7174
7275 require([
7376 "jquery",
74- "mage/calendar"
77+ "mage/calendar",
78+ "uiParseDataDateRange"
7579 ], function($){
7680
77- $("# {$ block ->escapeJs ($ block ->getSuffixId ('period_date_range ' ))}").dateRange({
78- dateFormat:" {$ block ->escapeJs ($ block ->getDateFormat ())}",
81+ $("# {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_range ' ))}").dateRange({
82+ dateFormat:" {$ escaper ->escapeJs ($ block ->getDateFormat ())}",
7983 buttonText:"",
8084 from:{
81- id:" {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}"
85+ id:" {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}"
8286 },
8387 to:{
84- id:" {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}"
88+ id:" {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}"
8589 }
8690 });
8791 });
@@ -98,15 +102,15 @@ script;
98102 </div>
99103 <?php endif ; ?>
100104 <div class="admin__data-grid-wrap admin__data-grid-wrap-static">
101- <table class="data-grid" id="<?= $ block ->escapeHtmlAttr ($ block ->getId ()) ?> _table">
105+ <table class="data-grid" id="<?= $ escaper ->escapeHtmlAttr ($ block ->getId ()) ?> _table">
102106 <?= $ block ->getChildHtml ('grid.columnSet ' ) ?>
103107 </table>
104108 </div>
105109 </div>
106110 <?php if ($ block ->canDisplayContainer ()): ?>
107111 <?php $ useAjax = '' ;
108112 if ($ block ->getUseAjax ()):
109- $ useAjax = $ block ->escapeJs ($ block ->getUseAjax ());
113+ $ useAjax = $ escaper ->escapeJs ($ block ->getUseAjax ());
110114 endif ;
111115 $ scriptString = <<<script
112116
@@ -118,24 +122,25 @@ script;
118122 ], function(jQuery){
119123
120124 //<![CDATA[
121- {$ block ->escapeJs ($ block ->getJsObjectName ())} = new varienGrid(' {$ block ->escapeJs ($ block ->getId ())}',
122- ' {$ block ->escapeJs ($ block ->getGridUrl ())}', ' {$ block ->escapeJs ($ block ->getVarNamePage ())}',
123- ' {$ block ->escapeJs ($ block ->getVarNameSort ())}', ' {$ block ->escapeJs ($ block ->getVarNameDir ())}',
124- ' {$ block ->escapeJs ($ block ->getVarNameFilter ())}');
125- {$ block ->escapeJs ($ block ->getJsObjectName ())}.useAjax = ' {$ useAjax }';
125+ {$ escaper ->escapeJs ($ block ->getJsObjectName ())} = new varienGrid(' {$ escaper ->escapeJs (
126+ $ block ->getId ())}',
127+ ' {$ escaper ->escapeJs ($ block ->getGridUrl ())}', ' {$ escaper ->escapeJs ($ block ->getVarNamePage ())}',
128+ ' {$ escaper ->escapeJs ($ block ->getVarNameSort ())}', ' {$ escaper ->escapeJs ($ block ->getVarNameDir ())}',
129+ ' {$ escaper ->escapeJs ($ block ->getVarNameFilter ())}');
130+ {$ escaper ->escapeJs ($ block ->getJsObjectName ())}.useAjax = ' {$ useAjax }';
126131
127132script ;
128133 ?>
129134 <?php if ($ block ->getDateFilterVisibility ()): ?>
130135 <?php $ scriptString .= <<<script
131136
132- {$ block ->escapeJs ($ block ->getJsObjectName ())}.doFilterCallback = validateFilterDate;
133- var period_date_from = $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}');
134- var period_date_to = $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}');
137+ {$ escaper ->escapeJs ($ block ->getJsObjectName ())}.doFilterCallback = validateFilterDate;
138+ var period_date_from = $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}');
139+ var period_date_to = $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}');
135140 period_date_from.adviceContainer =
136- $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from_advice ' ))}');
141+ $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from_advice ' ))}');
137142 period_date_to.adviceContainer =
138- $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to_advice ' ))}');
143+ $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to_advice ' ))}');
139144
140145 var validateFilterDate = function() {
141146 if (period_date_from && period_date_to) {
@@ -169,11 +174,11 @@ script;
169174 if (obj.switchParams) {
170175 storeParam += obj.switchParams;
171176 }
172- var formParam = new Array(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}',
173- ' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}',
174- ' {$ block ->escapeJs ($ block ->getSuffixId ('report_period ' ))}');
177+ var formParam = new Array(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}',
178+ ' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}',
179+ ' {$ escaper ->escapeJs ($ block ->getSuffixId ('report_period ' ))}');
175180 var paramURL = '';
176- var switchURL = ' {$ block ->escapeJs ($ block ->getAbsoluteGridUrl (['_current ' => false ]))}'
181+ var switchURL = ' {$ escaper ->escapeJs ($ block ->getAbsoluteGridUrl (['_current ' => false ]))}'
177182 .replace(/(store|group|website)\/\d+\//, '');
178183
179184 for (var i = 0; i < formParam.length; i++) {
0 commit comments