14 class View extends \Magento\Backend\Block\Widget\Form\Container
34 parent::__construct($context,
$data);
44 $this->_objectId =
'agreement';
45 $this->_controller =
'adminhtml_billing_agreement';
46 $this->_mode =
'view';
47 $this->_blockGroup =
'Magento_Paypal';
51 if (!$this->
_isAllowed(
'Magento_Paypal::actions_manage')) {
52 $this->buttonList->remove(
'delete');
54 $this->buttonList->remove(
'reset');
55 $this->buttonList->remove(
'save');
56 $this->setId(
'billing_agreement_view');
58 $this->buttonList->add(
61 'label' =>
__(
'Back'),
62 'onclick' =>
'setLocation(\'' . $this->
getBackUrl() .
'\')
', 68 $agreement = $this->_getBillingAgreement(); 69 if ($agreement && $agreement->canCancel() && $this->_isAllowed('Magento_Paypal::actions_manage
')) { 70 $confirmText = __('Are you sure you want to
do this?
'); 71 $this->buttonList->add( 74 'label
' => __('Cancel
'), 75 'onclick
' => "confirmSetLocation(" . "'{$confirmText}
', '{$this->
_getCancelUrl()}
'" . ")", 88 public function getHeaderText() 90 return __('Billing
Agreement #%1
', $this->_getBillingAgreement()->getReferenceId()); 98 protected function _getCancelUrl() 100 return $this->getUrl('*
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[])