![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/app/code/Cnc/AdminHistory/Block/Adminhtml/Customer/Edit/ |
<?php /** * Copyright (c) 2020 Kaliop Digital Commerce (https://digitalcommerce.kaliop.com) All Rights Reserved. * https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * Cnc * Radosław Stępień <[email protected]> <[email protected]> */ namespace Cnc\AdminHistory\Block\Adminhtml\Customer\Edit; use Cnc\AdminHistory\Model\ResourceModel\Customer\CollectionFactory; use Magento\Backend\Block\Template\Context; use Magento\Backend\Block\Widget\Grid\Extended; use Magento\Backend\Helper\Data; /** * Adminhtml billing agreements grid * @api * @since 100.0.2 */ class Grid extends Extended { /** * @var CollectionFactory */ protected $historyCollectionFactory; /** * @param Context $context * @param Data $backendHelper * @param CollectionFactory $historyCollectionFactory * @param array $data */ public function __construct( Context $context, Data $backendHelper, CollectionFactory $historyCollectionFactory, array $data = [] ) { parent::__construct($context, $backendHelper, $data); $this->historyCollectionFactory = $historyCollectionFactory; } /** * Set grid params * * @return void */ protected function _construct() { parent::_construct(); $this->setId('customer_history'); $this->setDefaultSort('entity_id'); $this->setDefaultDir('DESC'); } /** * Add columns to grid * * @return $this * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @throws \Exception */ protected function _prepareColumns() { $this->addColumn( 'entity_id', [ 'header' => __('ID'), 'index' => 'entity_id', 'type' => 'text', 'header_css_class' => 'col-id', 'column_css_class' => 'col-id' ] ); $this->addColumn( 'attribute_code', [ 'header' => __('Attribute'), 'index' => 'attribute_code', 'type' => 'text' ] ); $this->addColumn( 'old_value', [ 'header' => __('Old value'), 'index' => 'old_value', 'type' => 'text' ] ); $this->addColumn( 'new_value', [ 'header' => __('New value'), 'index' => 'new_value', 'type' => 'text' ] ); $this->addColumn( 'user', [ 'header' => __('Admin user'), 'index' => 'user', 'type' => 'text' ] ); $this->addColumn( 'updated_at', [ 'header' => __('Updated at'), 'index' => 'updated_at', 'type' => 'datetime', 'align' => 'center', 'default' => __('N/A'), 'html_decorators' => ['nobr'], 'header_css_class' => 'col-period', 'column_css_class' => 'col-period' ] ); return parent::_prepareColumns(); } }