88/**
99 * @var $block \Magento\Reports\Block\Adminhtml\Grid
1010 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
11- * @var $escaper \Magento\Framework\Escaper
1211 */
1312?>
1413<?php if ($ block ->getCollection ()): ?>
1514 <?php if ($ block ->canDisplayContainer ()): ?>
16- <div id="<?= $ escaper ->escapeHtmlAttr ($ block ->getId ()) ?> ">
17- <?php else : ?>
18- <?= $ block ->getLayout ()->getMessagesBlock ()->getGroupedHtml () ?>
19- <?php endif ; ?>
20- <?php if ($ block ->getStoreSwitcherVisibility () || $ block ->getDateFilterVisibility ()): ?>
21- <div class="admin__data-grid-header admin__data-grid-toolbar">
22- <div class="admin__data-grid-header-row">
23- <?php if ($ block ->getDateFilterVisibility ()): ?>
24- <div class="admin__filter-actions" data-role="filter-form"
25- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_range ' )) ?> ">
15+ <div id="<?= $ block ->escapeHtmlAttr ($ block ->getId ()) ?> ">
16+ <?php else : ?>
17+ <?= $ block ->getLayout ()->getMessagesBlock ()->getGroupedHtml () ?>
18+ <?php endif ; ?>
19+ <?php if ($ block ->getStoreSwitcherVisibility () || $ block ->getDateFilterVisibility ()): ?>
20+ <div class="admin__data-grid-header admin__data-grid-toolbar">
21+ <div class="admin__data-grid-header-row">
22+ <?php if ($ block ->getDateFilterVisibility ()): ?>
23+ <div class="admin__filter-actions" data-role="filter-form"
24+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_range ' )) ?> ">
2625 <span class="field-row">
27- <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
26+ <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
2827 class="admin__control-support-text">
29- <span><?= $ escaper ->escapeHtml (__ ('From ' )) ?> :</span>
28+ <span><?= $ block ->escapeHtml (__ ('From ' )) ?> :</span>
3029 </label>
3130 <input class="input-text no-changes required-entry admin__control-text"
3231 type="text"
33- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
32+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
3433 name="report_from"
35- value="<?= $ escaper ->escapeHtmlAttr ($ block ->getFilter ('report_from ' )) ?> ">
36- <span id="<?= $ escaper
37- ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from_advice ' ))?> ">
34+ value="<?= $ block ->escapeHtmlAttr ($ block ->getFilter ('report_from ' )) ?> ">
35+ <span id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from_advice ' ))?> ">
3836 </span>
3937 </span>
4038
41- <span class="field-row">
42- <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
39+ <span class="field-row">
40+ <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
4341 class="admin__control-support-text">
44- <span><?= $ escaper ->escapeHtml (__ ('To ' )) ?> :</span>
42+ <span><?= $ block ->escapeHtml (__ ('To ' )) ?> :</span>
4543 </label>
4644 <input class="input-text no-changes required-entry admin__control-text"
4745 type="text"
48- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
46+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
4947 name="report_to"
50- value="<?= $ escaper ->escapeHtmlAttr ($ block ->getFilter ('report_to ' )) ?> "/>
51- <span id="<?= $ escaper
52- ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to_advice ' )) ?> ">
48+ value="<?= $ block ->escapeHtmlAttr ($ block ->getFilter ('report_to ' )) ?> "/>
49+ <span id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to_advice ' )) ?> ">
5350 </span>
5451 </span>
5552
56- <span class="field-row admin__control-filter">
57- <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
53+ <span class="field-row admin__control-filter">
54+ <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
5855 class="admin__control-support-text">
59- <span><?= $ escaper ->escapeHtml (__ ('Show By ' )) ?> :</span>
56+ <span><?= $ block ->escapeHtml (__ ('Show By ' )) ?> :</span>
6057 </label>
6158 <select name="report_period"
62- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
59+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
6360 class="admin__control-select">
6461 <?php foreach ($ block ->getPeriods () as $ _value => $ _label ): ?>
65- <option value="<?= $ escaper ->escapeHtmlAttr ($ _value ) ?> "
62+ <option value="<?= $ block ->escapeHtmlAttr ($ _value ) ?> "
6663 <?php if ($ block ->getFilter ('report_period ' ) == $ _value ):
67- ?> selected<?php endif ; ?> ><?= $ escaper ->escapeHtml ($ _label ) ?>
64+ ?> selected<?php endif ; ?> ><?= $ block ->escapeHtml ($ _label ) ?>
6865 </option>
6966 <?php endforeach ; ?>
7067 </select>
7168 <?= $ block ->getRefreshButtonHtml () ?>
7269 </span>
73- <?php $ scriptString = <<<script
70+ <?php $ scriptString = <<<script
7471
7572 require([
7673 "jquery",
77- "mage/calendar",
78- "uiParseDataDateRange"
74+ "mage/calendar"
7975 ], function($){
8076
81- $("# {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_range ' ))}").dateRange({
82- dateFormat:" {$ escaper ->escapeJs ($ block ->getDateFormat ())}",
77+ $("# {$ block ->escapeJs ($ block ->getSuffixId ('period_date_range ' ))}").dateRange({
78+ dateFormat:" {$ block ->escapeJs ($ block ->getDateFormat ())}",
8379 buttonText:"",
8480 from:{
85- id:" {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}"
81+ id:" {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}"
8682 },
8783 to:{
88- id:" {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}"
84+ id:" {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}"
8985 }
9086 });
9187 });
9288
9389script ;
94- ?>
95- <?= /* @noEscape */ $ secureRenderer ->renderTag ('script ' , [], $ scriptString , false ) ?>
96- </div>
97- <?php endif ; ?>
98- <?php if ($ block ->getChildBlock ('grid.export ' )): ?>
99- <?= $ block ->getChildHtml ('grid.export ' ) ?>
100- <?php endif ; ?>
101- </div>
90+ ?>
91+ <?= /* @noEscape */ $ secureRenderer ->renderTag ('script ' , [], $ scriptString , false ) ?>
92+ </div>
93+ <?php endif ; ?>
94+ <?php if ($ block ->getChildBlock ('grid.export ' )): ?>
95+ <?= $ block ->getChildHtml ('grid.export ' ) ?>
96+ <?php endif ; ?>
10297 </div>
103- <?php endif ; ?>
104- <div class="admin__data-grid-wrap admin__data-grid-wrap-static">
105- <table class="data-grid" id="<?= $ escaper ->escapeHtmlAttr ($ block ->getId ()) ?> _table">
106- <?= $ block ->getChildHtml ('grid.columnSet ' ) ?>
107- </table>
10898 </div>
99+ <?php endif ; ?>
100+ <div class="admin__data-grid-wrap admin__data-grid-wrap-static">
101+ <table class="data-grid" id="<?= $ block ->escapeHtmlAttr ($ block ->getId ()) ?> _table">
102+ <?= $ block ->getChildHtml ('grid.columnSet ' ) ?>
103+ </table>
104+ </div>
109105 </div>
110106 <?php if ($ block ->canDisplayContainer ()): ?>
111107 <?php $ useAjax = '' ;
112108 if ($ block ->getUseAjax ()):
113- $ useAjax = $ escaper ->escapeJs ($ block ->getUseAjax ());
109+ $ useAjax = $ block ->escapeJs ($ block ->getUseAjax ());
114110 endif ;
115111 $ scriptString = <<<script
116112
@@ -122,25 +118,24 @@ script;
122118 ], function(jQuery){
123119
124120 //<![CDATA[
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 }';
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 }';
131126
132127script ;
133128 ?>
134- <?php if ($ block ->getDateFilterVisibility ()): ?>
135- <?php $ scriptString .= <<<script
129+ <?php if ($ block ->getDateFilterVisibility ()): ?>
130+ <?php $ scriptString .= <<<script
136131
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 ' ))}');
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 ' ))}');
140135 period_date_from.adviceContainer =
141- $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from_advice ' ))}');
136+ $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from_advice ' ))}');
142137 period_date_to.adviceContainer =
143- $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to_advice ' ))}');
138+ $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to_advice ' ))}');
144139
145140 var validateFilterDate = function() {
146141 if (period_date_from && period_date_to) {
@@ -156,10 +151,10 @@ script;
156151 }
157152
158153script ;
159- ?>
160- <?php endif ;?>
161- <?php if ($ block ->getStoreSwitcherVisibility ()): ?>
162- <?php $ scriptString .= <<<script
154+ ?>
155+ <?php endif ;?>
156+ <?php if ($ block ->getStoreSwitcherVisibility ()): ?>
157+ <?php $ scriptString .= <<<script
163158
164159 /* Overwrite function from switcher.phtml widget*/
165160 switchStore = function(obj) {
@@ -174,11 +169,11 @@ script;
174169 if (obj.switchParams) {
175170 storeParam += obj.switchParams;
176171 }
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 ' ))}');
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 ' ))}');
180175 var paramURL = '';
181- var switchURL = ' {$ escaper ->escapeJs ($ block ->getAbsoluteGridUrl (['_current ' => false ]))}'
176+ var switchURL = ' {$ block ->escapeJs ($ block ->getAbsoluteGridUrl (['_current ' => false ]))}'
182177 .replace(/(store|group|website)\/\d+\//, '');
183178
184179 for (var i = 0; i < formParam.length; i++) {
@@ -190,8 +185,8 @@ script;
190185 }
191186
192187script ;
193- ?>
194- <?php endif ; ?>
188+ ?>
189+ <?php endif ; ?>
195190 <?php $ scriptString .= <<<script
196191
197192 //]]>
0 commit comments