File tree Expand file tree Collapse file tree 5 files changed +33
-24
lines changed
app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate Expand file tree Collapse file tree 5 files changed +33
-24
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © 2015 Magento. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
7
6
namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
8
7
9
8
use Magento \Framework \App \ResponseInterface ;
10
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
+ use Magento \Framework \Controller \ResultFactory ;
11
11
12
12
class ExportCsv extends \Magento \TaxImportExport \Controller \Adminhtml \Rate
13
13
{
@@ -18,8 +18,10 @@ class ExportCsv extends \Magento\TaxImportExport\Controller\Adminhtml\Rate
18
18
*/
19
19
public function execute ()
20
20
{
21
- $ this ->_view ->loadLayout (false );
22
- $ content = $ this ->_view ->getLayout ()->getChildBlock ('adminhtml.tax.rate.grid ' , 'grid.export ' );
21
+ /** @var \Magento\Framework\View\Result\Layout $resultLayout */
22
+ $ resultLayout = $ this ->resultFactory ->create (ResultFactory::TYPE_LAYOUT );
23
+ $ content = $ resultLayout ->getLayout ()->getChildBlock ('adminhtml.tax.rate.grid ' , 'grid.export ' );
24
+
23
25
return $ this ->fileFactory ->create (
24
26
'rates.csv ' ,
25
27
$ content ->getCsvFile (),
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © 2015 Magento. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
12
11
class ExportPost extends \Magento \TaxImportExport \Controller \Adminhtml \Rate
13
12
{
14
13
/**
15
- * export action from import/export tax
14
+ * Export action from import/export tax
16
15
*
17
16
* @return ResponseInterface
18
17
*/
@@ -82,7 +81,6 @@ public function execute()
82
81
83
82
$ content .= $ rate ->toString ($ template ) . "\n" ;
84
83
}
85
- $ this ->_view ->loadLayout ();
86
84
return $ this ->fileFactory ->create ('tax_rates.csv ' , $ content , DirectoryList::VAR_DIR );
87
85
}
88
86
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © 2015 Magento. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
7
6
namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
8
7
9
8
use Magento \Framework \App \ResponseInterface ;
10
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
+ use Magento \Framework \Controller \ResultFactory ;
11
11
12
12
class ExportXml extends \Magento \TaxImportExport \Controller \Adminhtml \Rate
13
13
{
@@ -18,8 +18,10 @@ class ExportXml extends \Magento\TaxImportExport\Controller\Adminhtml\Rate
18
18
*/
19
19
public function execute ()
20
20
{
21
- $ this ->_view ->loadLayout (false );
22
- $ content = $ this ->_view ->getLayout ()->getChildBlock ('adminhtml.tax.rate.grid ' , 'grid.export ' );
21
+ /** @var \Magento\Framework\View\Result\Layout $resultLayout */
22
+ $ resultLayout = $ this ->resultFactory ->create (ResultFactory::TYPE_LAYOUT );
23
+ $ content = $ resultLayout ->getLayout ()->getChildBlock ('adminhtml.tax.rate.grid ' , 'grid.export ' );
24
+
23
25
return $ this ->fileFactory ->create (
24
26
'rates.xml ' ,
25
27
$ content ->getExcelFile (),
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © 2015 Magento. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
7
6
namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
8
7
8
+ use Magento \Framework \Controller \ResultFactory ;
9
+
9
10
class ImportExport extends \Magento \TaxImportExport \Controller \Adminhtml \Rate
10
11
{
11
12
/**
12
13
* Import and export Page
13
14
*
14
- * @return void
15
+ * @return \Magento\Backend\Model\View\Result\Page
15
16
*/
16
17
public function execute ()
17
18
{
18
- $ this ->_view ->loadLayout ();
19
- $ this ->_setActiveMenu (
20
- 'Magento_TaxImportExport::system_convert_tax '
21
- )->_addContent (
22
- $ this ->_view ->getLayout ()->createBlock ('Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExportHeader ' )
23
- )->_addContent (
24
- $ this ->_view ->getLayout ()->createBlock ('Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport ' )
19
+ /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
20
+ $ resultPage = $ this ->resultFactory ->create (ResultFactory::TYPE_PAGE );
21
+
22
+ $ resultPage ->setActiveMenu ('Magento_TaxImportExport::system_convert_tax ' );
23
+ $ resultPage ->addContent (
24
+ $ resultPage ->getLayout ()->createBlock ('Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExportHeader ' )
25
+ );
26
+ $ resultPage ->addContent (
27
+ $ resultPage ->getLayout ()->createBlock ('Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport ' )
25
28
);
26
- $ this -> _view -> getPage () ->getConfig ()->getTitle ()->prepend (__ ('Tax Zones and Rates ' ));
27
- $ this -> _view -> getPage () ->getConfig ()->getTitle ()->prepend (__ ('Import and Export Tax Rates ' ));
28
- $ this -> _view -> renderLayout () ;
29
+ $ resultPage ->getConfig ()->getTitle ()->prepend (__ ('Tax Zones and Rates ' ));
30
+ $ resultPage ->getConfig ()->getTitle ()->prepend (__ ('Import and Export Tax Rates ' ));
31
+ return $ resultPage ;
29
32
}
30
33
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © 2015 Magento. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
7
6
namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
8
7
8
+ use Magento \Framework \Controller \ResultFactory ;
9
+
9
10
class ImportPost extends \Magento \TaxImportExport \Controller \Adminhtml \Rate
10
11
{
11
12
/**
12
13
* import action from import/export tax
13
14
*
14
- * @return void
15
+ * @return \Magento\Backend\Model\View\Result\Redirect
15
16
*/
16
17
public function execute ()
17
18
{
@@ -30,6 +31,9 @@ public function execute()
30
31
} else {
31
32
$ this ->messageManager ->addError (__ ('Invalid file upload attempt ' ));
32
33
}
33
- $ this ->getResponse ()->setRedirect ($ this ->_redirect ->getRedirectUrl ($ this ->getUrl ('* ' )));
34
+ /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
35
+ $ resultRedirect = $ this ->resultFactory ->create (ResultFactory::TYPE_REDIRECT );
36
+ $ resultRedirect ->setPath ('*/*/importexport ' );
37
+ return $ resultRedirect ;
34
38
}
35
39
}
You can’t perform that action at this time.
0 commit comments