Report.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Paypal\Block\Adminhtml\Settlement;
  7. /**
  8. * Adminhtml paypal settlement reports grid block
  9. *
  10. * @api
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. * @since 100.0.2
  13. */
  14. class Report extends \Magento\Backend\Block\Widget\Grid\Container
  15. {
  16. /**
  17. * Prepare grid container, add additional buttons
  18. *
  19. * @return void
  20. */
  21. protected function _construct()
  22. {
  23. $this->_blockGroup = 'Magento_Paypal';
  24. $this->_controller = 'adminhtml_settlement_report';
  25. $this->_headerText = __('PayPal Settlement Reports');
  26. parent::_construct();
  27. $this->buttonList->remove('add');
  28. $message = __(
  29. 'We are connecting to the PayPal SFTP server to retrieve new reports. Are you sure you want to continue?'
  30. );
  31. if (true == $this->_authorization->isAllowed('Magento_Paypal::fetch')) {
  32. $this->buttonList->add(
  33. 'fetch',
  34. [
  35. 'label' => __('Fetch Updates'),
  36. 'onclick' => "confirmSetLocation('{$message}', '{$this->getUrl('*/*/fetch')}')",
  37. 'class' => 'task'
  38. ]
  39. );
  40. }
  41. }
  42. }