View.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
  8. class View extends \Magento\Paypal\Controller\Adminhtml\Billing\Agreement
  9. {
  10. /**
  11. * Authorization level of a basic admin session
  12. *
  13. * @see _isAllowed()
  14. */
  15. const ADMIN_RESOURCE = 'Magento_Paypal::billing_agreement_actions_view';
  16. /**
  17. * View billing agreement action
  18. *
  19. * @return void
  20. */
  21. public function execute()
  22. {
  23. $agreementModel = $this->_initBillingAgreement();
  24. if ($agreementModel) {
  25. $this->_view->loadLayout();
  26. $this->_setActiveMenu('Magento_Paypal::paypal_billing_agreement');
  27. $this->_view->getPage()->getConfig()->getTitle()->prepend(
  28. sprintf("#%s", $agreementModel->getReferenceId())
  29. );
  30. $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Billing Agreements'));
  31. $this->_view->renderLayout();
  32. return;
  33. }
  34. $this->_redirect('paypal/*/');
  35. return;
  36. }
  37. }