8
8
/**
9
9
* @var $block \Magento\Reports\Block\Adminhtml\Grid
10
10
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
11
- * @var $escaper \Magento\Framework\Escaper
12
11
*/
13
12
?>
14
13
<?php if ($ block ->getCollection ()): ?>
15
14
<?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 ' )) ?> ">
26
25
<span class="field-row">
27
- <label for="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
26
+ <label for="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
28
27
class="admin__control-support-text">
29
- <span><?= $ escaper ->escapeHtml (__ ('From ' )) ?> :</span>
28
+ <span><?= $ block ->escapeHtml (__ ('From ' )) ?> :</span>
30
29
</label>
31
30
<input class="input-text no-changes required-entry admin__control-text"
32
31
type="text"
33
- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
32
+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_from ' )) ?> "
34
33
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 ' ))?> ">
38
36
</span>
39
37
</span>
40
38
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 ' )) ?> "
43
41
class="admin__control-support-text">
44
- <span><?= $ escaper ->escapeHtml (__ ('To ' )) ?> :</span>
42
+ <span><?= $ block ->escapeHtml (__ ('To ' )) ?> :</span>
45
43
</label>
46
44
<input class="input-text no-changes required-entry admin__control-text"
47
45
type="text"
48
- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
46
+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('period_date_to ' )) ?> "
49
47
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 ' )) ?> ">
53
50
</span>
54
51
</span>
55
52
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 ' )) ?> "
58
55
class="admin__control-support-text">
59
- <span><?= $ escaper ->escapeHtml (__ ('Show By ' )) ?> :</span>
56
+ <span><?= $ block ->escapeHtml (__ ('Show By ' )) ?> :</span>
60
57
</label>
61
58
<select name="report_period"
62
- id="<?= $ escaper ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
59
+ id="<?= $ block ->escapeHtmlAttr ($ block ->getSuffixId ('report_period ' )) ?> "
63
60
class="admin__control-select">
64
61
<?php foreach ($ block ->getPeriods () as $ _value => $ _label ): ?>
65
- <option value="<?= $ escaper ->escapeHtmlAttr ($ _value ) ?> "
62
+ <option value="<?= $ block ->escapeHtmlAttr ($ _value ) ?> "
66
63
<?php if ($ block ->getFilter ('report_period ' ) == $ _value ):
67
- ?> selected<?php endif ; ?> ><?= $ escaper ->escapeHtml ($ _label ) ?>
64
+ ?> selected<?php endif ; ?> ><?= $ block ->escapeHtml ($ _label ) ?>
68
65
</option>
69
66
<?php endforeach ; ?>
70
67
</select>
71
68
<?= $ block ->getRefreshButtonHtml () ?>
72
69
</span>
73
- <?php $ scriptString = <<<script
70
+ <?php $ scriptString = <<<script
74
71
75
72
require([
76
73
"jquery",
77
- "mage/calendar",
78
- "uiParseDataDateRange"
74
+ "mage/calendar"
79
75
], function($){
80
76
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 ())}",
83
79
buttonText:"",
84
80
from:{
85
- id:" {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}"
81
+ id:" {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from ' ))}"
86
82
},
87
83
to:{
88
- id:" {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}"
84
+ id:" {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to ' ))}"
89
85
}
90
86
});
91
87
});
92
88
93
89
script ;
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 ; ?>
102
97
</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>
108
98
</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>
109
105
</div>
110
106
<?php if ($ block ->canDisplayContainer ()): ?>
111
107
<?php $ useAjax = '' ;
112
108
if ($ block ->getUseAjax ()):
113
- $ useAjax = $ escaper ->escapeJs ($ block ->getUseAjax ());
109
+ $ useAjax = $ block ->escapeJs ($ block ->getUseAjax ());
114
110
endif ;
115
111
$ scriptString = <<<script
116
112
@@ -122,25 +118,24 @@ script;
122
118
], function(jQuery){
123
119
124
120
//<![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 }';
131
126
132
127
script ;
133
128
?>
134
- <?php if ($ block ->getDateFilterVisibility ()): ?>
135
- <?php $ scriptString .= <<<script
129
+ <?php if ($ block ->getDateFilterVisibility ()): ?>
130
+ <?php $ scriptString .= <<<script
136
131
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 ' ))}');
140
135
period_date_from.adviceContainer =
141
- $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_from_advice ' ))}');
136
+ $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_from_advice ' ))}');
142
137
period_date_to.adviceContainer =
143
- $(' {$ escaper ->escapeJs ($ block ->getSuffixId ('period_date_to_advice ' ))}');
138
+ $(' {$ block ->escapeJs ($ block ->getSuffixId ('period_date_to_advice ' ))}');
144
139
145
140
var validateFilterDate = function() {
146
141
if (period_date_from && period_date_to) {
@@ -156,10 +151,10 @@ script;
156
151
}
157
152
158
153
script ;
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
163
158
164
159
/* Overwrite function from switcher.phtml widget*/
165
160
switchStore = function(obj) {
@@ -174,11 +169,11 @@ script;
174
169
if (obj.switchParams) {
175
170
storeParam += obj.switchParams;
176
171
}
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 ' ))}');
180
175
var paramURL = '';
181
- var switchURL = ' {$ escaper ->escapeJs ($ block ->getAbsoluteGridUrl (['_current ' => false ]))}'
176
+ var switchURL = ' {$ block ->escapeJs ($ block ->getAbsoluteGridUrl (['_current ' => false ]))}'
182
177
.replace(/(store|group|website)\/\d+\//, '');
183
178
184
179
for (var i = 0; i < formParam.length; i++) {
@@ -190,8 +185,8 @@ script;
190
185
}
191
186
192
187
script ;
193
- ?>
194
- <?php endif ; ?>
188
+ ?>
189
+ <?php endif ; ?>
195
190
<?php $ scriptString .= <<<script
196
191
197
192
//]]>
0 commit comments