diff --git a/app/code/Magento/Backend/Block/Catalog/Product/Tab/Container.php b/app/code/Magento/Backend/Block/Catalog/Product/Tab/Container.php index 77b69e68d2696..7a073b127ca9e 100644 --- a/app/code/Magento/Backend/Block/Catalog/Product/Tab/Container.php +++ b/app/code/Magento/Backend/Block/Catalog/Product/Tab/Container.php @@ -31,9 +31,7 @@ class Container extends \Magento\Backend\Block\Template { /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -41,9 +39,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -51,9 +47,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -61,9 +55,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Backend/Block/Widget/Tab.php b/app/code/Magento/Backend/Block/Widget/Tab.php index 66fa9d45b5617..5d0bfe293b0c4 100644 --- a/app/code/Magento/Backend/Block/Widget/Tab.php +++ b/app/code/Magento/Backend/Block/Widget/Tab.php @@ -29,9 +29,7 @@ class Tab extends \Magento\Backend\Block\Template implements TabInterface { /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -39,9 +37,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -49,9 +45,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -59,9 +53,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php index 8d89f26d3f3ce..855d5b8c0698d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php @@ -77,9 +77,7 @@ public function getAccordionHtml() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/AbstractTab.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/AbstractTab.php index b9e5c1355e9a4..4c6b0351d7ddf 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/AbstractTab.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/AbstractTab.php @@ -34,9 +34,7 @@ abstract class AbstractTab implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -44,9 +42,7 @@ public function getTabLabel() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -54,9 +50,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Available.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Available.php index 3f3ea62864b9c..1245faa761121 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Available.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Available.php @@ -44,9 +44,7 @@ protected function _toHtml() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Customizations.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Customizations.php index ac9207075c11e..76a8a77a01cd6 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Customizations.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/Tab/Customizations.php @@ -42,9 +42,7 @@ protected function _construct() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php index 35265a5025449..0c483521f01b6 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php @@ -108,9 +108,7 @@ protected function _getGoogleExperiment() protected abstract function _getEntity(); /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -118,9 +116,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php index 608214523e483..c385cfdaa8e72 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php @@ -44,9 +44,7 @@ protected function _getEntity() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -54,9 +52,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php index da88a8fe8c27f..e90efc6220286 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php @@ -44,9 +44,7 @@ protected function _getEntity() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -54,9 +52,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { diff --git a/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts.php b/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts.php index 2bf5d644e64f0..7cf935c81ca2e 100644 --- a/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts.php +++ b/app/code/Magento/GroupedProduct/Block/Product/Grouped/AssociatedProducts.php @@ -36,9 +36,7 @@ protected function _construct() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { diff --git a/app/code/Magento/Payment/Model/Resource/Grid/GroupsArray.php b/app/code/Magento/Payment/Model/Resource/Grid/GroupsArray.php new file mode 100644 index 0000000000000..b8cdce504a61a --- /dev/null +++ b/app/code/Magento/Payment/Model/Resource/Grid/GroupsArray.php @@ -0,0 +1,58 @@ +_paymentData = $paymentData; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->_paymentData->getPaymentMethodList(true, true, true); + } +} diff --git a/app/code/Magento/Payment/Model/Resource/Grid/TypesArray.php b/app/code/Magento/Payment/Model/Resource/Grid/TypesArray.php new file mode 100644 index 0000000000000..f3faf71a1fae3 --- /dev/null +++ b/app/code/Magento/Payment/Model/Resource/Grid/TypesArray.php @@ -0,0 +1,58 @@ +_paymentData = $paymentData; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->_paymentData->getPaymentMethodList(true); + } +} diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index fae5615476164..09d3efaa49e37 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -64,9 +64,7 @@ public function __construct( } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -74,9 +72,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -84,9 +80,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -94,9 +88,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php index 99fb1502bc1b9..019821653589f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php @@ -34,10 +34,8 @@ class Orders extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { - /** * Initialize grid params - * */ protected function _construct() { @@ -46,9 +44,7 @@ protected function _construct() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -56,9 +52,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -66,9 +60,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -76,9 +68,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php index e0480bfd91cfe..592f879065028 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php @@ -24,176 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Block\Adminhtml\Creditmemo; + /** - * Adminhtml sales orders grid + * Adminhtml sales creditmemo grid * * @author Magento Core Team */ -namespace Magento\Sales\Block\Adminhtml\Creditmemo; - -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended +class Grid extends \Magento\Backend\Block\Widget\Grid { - /** - * @var \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory - */ - protected $_collectionFactory; - - /** - * @var \Magento\Sales\Model\Order\CreditmemoFactory - */ - protected $_creditmemoFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory - * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory, - \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory, - array $data = array() - ) { - $this->_creditmemoFactory = $creditmemoFactory; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - protected function _construct() - { - parent::_construct(); - $this->setId('sales_creditmemo_grid'); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - } - - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - - protected function _prepareColumns() - { - $this->addColumn('increment_id', array( - 'header' => __('Credit Memo'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-memo-number', - 'column_css_class' => 'col-memo-number' - )); - - $this->addColumn('created_at', array( - 'header' => __('Created'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('order_increment_id', array( - 'header' => __('Order'), - 'index' => 'order_increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-number', - 'column_css_class' => 'col-order-number' - )); - - $this->addColumn('order_created_at', array( - 'header' => __('Order Date'), - 'index' => 'order_created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('billing_name', array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - )); - - $this->addColumn('state', array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_creditmemoFactory->create()->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - )); - - $this->addColumn('grand_total', array( - 'header' => __('Refunded'), - 'index' => 'grand_total', - 'type' => 'currency', - 'currency' => 'order_currency_code', - 'header_css_class' => 'col-refunded', - 'column_css_class' => 'col-refunded' - )); - - $this->addColumn('action', - array( - 'header' => __('Action'), - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array( - array( - 'caption' => __('View'), - 'url' => array('base'=>'sales/creditmemo/view'), - 'field' => 'creditmemo_id' - ) - ), - 'filter' => false, - 'sortable' => false, - 'is_system' => true, - 'header_css_class' => 'col-actions', - 'column_css_class' => 'col-actions' - )); - - $this->addExportType('*/*/exportCsv', __('CSV')); - $this->addExportType('*/*/exportExcel', __('Excel XML')); - - return parent::_prepareColumns(); - } - - protected function _prepareMassaction() - { - $this->setMassactionIdField('entity_id'); - $this->getMassactionBlock()->setFormFieldName('creditmemo_ids'); - $this->getMassactionBlock()->setUseSelectAll(false); - - $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array( - 'label'=> __('PDF Credit Memos'), - 'url' => $this->getUrl('sales/creditmemo/pdfcreditmemos'), - )); - - return $this; - } - - public function getRowUrl($row) - { - if (!$this->_authorization->isAllowed(null)) { - return false; - } - - return $this->getUrl('sales/creditmemo/view', - array( - 'creditmemo_id'=> $row->getId(), - ) - ); - } - - public function getGridUrl() - { - return $this->getUrl('sales/*/*', array('_current' => true)); - } - - - } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index 26967cda12b08..a7475dc140525 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -89,9 +89,7 @@ protected function _construct() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -99,9 +97,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -109,9 +105,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -120,9 +114,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php index d589742d0d7a6..f79087556b25e 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php @@ -96,9 +96,7 @@ protected function _construct() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -106,9 +104,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -116,9 +112,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -126,9 +120,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Invoice.php b/app/code/Magento/Sales/Block/Adminhtml/Invoice.php index 0c8f155569209..db7d2dd492cab 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Invoice.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Invoice.php @@ -36,7 +36,6 @@ class Invoice extends \Magento\Backend\Block\Widget\Grid\Container { - protected function _construct() { $this->_controller = 'adminhtml_invoice'; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php index 5043c9b50e1fe..62f5f42173429 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php @@ -24,187 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Block\Adminhtml\Invoice; + /** - * Adminhtml sales orders grid + * Adminhtml sales invoices grid * * @author Magento Core Team */ -namespace Magento\Sales\Block\Adminhtml\Invoice; - -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended +class Grid extends \Magento\Backend\Block\Widget\Grid { - /** - * @var \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory - */ - protected $_collectionFactory; - - /** - * @var \Magento\Sales\Model\Order\InvoiceFactory - */ - protected $_invoiceFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory - * @param \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory, - \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory, - array $data = array() - ) { - $this->_invoiceFactory = $invoiceFactory; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - protected function _construct() - { - parent::_construct(); - $this->setId('sales_invoice_grid'); - $this->setUseAjax(true); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - $this->setSaveParametersInSession(true); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection'; - } - - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - protected function _prepareColumns() - { - $this->addColumn('increment_id', array( - 'header' => __('Invoice'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-invoice-number', - 'column_css_class' => 'col-invoice-number' - )); - - $this->addColumn('created_at', array( - 'header' => __('Invoice Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('order_increment_id', array( - 'header' => __('Order'), - 'index' => 'order_increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-number', - 'column_css_class' => 'col-order-number' - )); - - $this->addColumn('order_created_at', array( - 'header' => __('Order Date'), - 'index' => 'order_created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('billing_name', array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - )); - - $this->addColumn('state', array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_invoiceFactory->create()->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - )); - - $this->addColumn('grand_total', array( - 'header' => __('Amount'), - 'index' => 'grand_total', - 'type' => 'currency', - 'align' => 'right', - 'currency' => 'order_currency_code', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - )); - - $this->addColumn('action', - array( - 'header' => __('Action'), - 'width' => '50px', - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array( - array( - 'caption' => __('View'), - 'url' => array('base'=>'sales/invoice/view'), - 'field' => 'invoice_id' - ) - ), - 'filter' => false, - 'sortable' => false, - 'is_system' => true, - 'header_css_class' => 'col-actions', - 'column_css_class' => 'col-actions' - )); - - $this->addExportType('*/*/exportCsv', __('CSV')); - $this->addExportType('*/*/exportExcel', __('Excel XML')); - - return parent::_prepareColumns(); - } - - protected function _prepareMassaction() - { - $this->setMassactionIdField('entity_id'); - $this->getMassactionBlock()->setFormFieldName('invoice_ids'); - $this->getMassactionBlock()->setUseSelectAll(false); - - $this->getMassactionBlock()->addItem('pdfinvoices_order', array( - 'label'=> __('PDF Invoices'), - 'url' => $this->getUrl('sales/invoice/pdfinvoices'), - )); - - return $this; - } - - public function getRowUrl($row) - { - if (!$this->_authorization->isAllowed(null)) { - return false; - } - - return $this->getUrl('sales/invoice/view', - array( - 'invoice_id'=> $row->getId(), - ) - ); - } - - public function getGridUrl() - { - return $this->getUrl('sales/*/grid', array('_current' => true)); - } - } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php index 6cfa1ee36a42a..35a9b1299ca11 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php @@ -34,48 +34,12 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; class Creditmemos - extends \Magento\Backend\Block\Widget\Grid\Extended + extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** - * Core registry - * - * @var \Magento\Core\Model\Registry + * Initialize grid params */ - protected $_coreRegistry = null; - - /** - * @var \Magento\Sales\Model\Order\Creditmemo - */ - protected $_orderCreditmemo; - - /** - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { - $this->_coreRegistry = $coreRegistry; - $this->_orderCreditmemo = $orderCreditmemo; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - protected function _construct() { parent::_construct(); @@ -84,123 +48,32 @@ protected function _construct() } /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection'; - } - - - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create($this->_getCollectionClass()) - ->addFieldToSelect('entity_id') - ->addFieldToSelect('created_at') - ->addFieldToSelect('increment_id') - ->addFieldToSelect('order_currency_code') - ->addFieldToSelect('store_currency_code') - ->addFieldToSelect('base_currency_code') - ->addFieldToSelect('state') - ->addFieldToSelect('grand_total') - ->addFieldToSelect('base_grand_total') - ->addFieldToSelect('billing_name') - ->setOrderFilter($this->getOrder()) - ; - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - protected function _prepareColumns() - { - $this->addColumn('increment_id', array( - 'header' => __('Credit Memo'), - 'index' => 'increment_id', - 'header_css_class' => 'col-memo', - 'column_css_class' => 'col-memo' - )); - - $this->addColumn('billing_name', array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - )); - - $this->addColumn('created_at', array( - 'header' => __('Created'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('state', array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_orderCreditmemo->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - )); - - $this->addColumn('base_grand_total', array( - 'header' => __('Refunded'), - 'index' => 'base_grand_total', - 'type' => 'currency', - 'currency' => 'base_currency_code', - 'header_css_class' => 'col-refunded', - 'column_css_class' => 'col-refunded' - )); - - return parent::_prepareColumns(); - } - - /** - * Retrieve order model instance - * - * @return \Magento\Sales\Model\Order - */ - public function getOrder() - { - return $this->_coreRegistry->registry('current_order'); - } - - public function getRowUrl($row) - { - return $this->getUrl( - '*/order_creditmemo/view', - array( - 'creditmemo_id' => $row->getId(), - 'order_id' => $row->getOrderId() - )); - } - - public function getGridUrl() - { - return $this->getUrl('sales/*/creditmemos', array('_current' => true)); - } - - /** - * ######################## TAB settings ################################# + * {@inheritdoc} */ public function getTabLabel() { return __('Credit Memos'); } + /** + * {@inheritdoc} + */ public function getTabTitle() { return __('Order Credit Memos'); } + /** + * {@inheritdoc} + */ public function canShowTab() { return true; } + /** + * {@inheritdoc} + */ public function isHidden() { return false; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 45532f4183b97..95208f6da4788 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; + /** * Order history tab * @@ -31,13 +33,13 @@ * @package Magento_Sales * @author Magento Core Team */ -namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; - class History extends \Magento\Backend\Block\Template implements \Magento\Backend\Block\Widget\Tab\TabInterface { - + /** + * {@inheritdoc} + */ protected $_template = 'order/view/tab/history.phtml'; /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php index 41743203a0911..7266f7b73eb85 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php @@ -33,49 +33,12 @@ */ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; -class Invoices - extends \Magento\Backend\Block\Widget\Grid\Extended +class Invoices extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** - * Core registry - * - * @var \Magento\Core\Model\Registry + * Initialize grid params */ - protected $_coreRegistry = null; - - /** - * @var \Magento\Sales\Model\Order\Invoice - */ - protected $_orderInvoice; - - /** - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Sales\Model\Order\Invoice $orderInvoice - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Sales\Model\Order\Invoice $orderInvoice, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { - $this->_coreRegistry = $coreRegistry; - $this->_orderInvoice = $orderInvoice; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - protected function _construct() { parent::_construct(); @@ -84,124 +47,32 @@ protected function _construct() } /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection'; - } - - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create($this->_getCollectionClass()) - ->addFieldToSelect('entity_id') - ->addFieldToSelect('created_at') - ->addFieldToSelect('order_id') - ->addFieldToSelect('increment_id') - ->addFieldToSelect('state') - ->addFieldToSelect('grand_total') - ->addFieldToSelect('base_grand_total') - ->addFieldToSelect('store_currency_code') - ->addFieldToSelect('base_currency_code') - ->addFieldToSelect('order_currency_code') - ->addFieldToSelect('billing_name') - ->setOrderFilter($this->getOrder()) - ; - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - protected function _prepareColumns() - { - $this->addColumn('increment_id', array( - 'header' => __('Invoice'), - 'index' => 'increment_id', - 'header_css_class' => 'col-invoice-number', - 'column_css_class' => 'col-invoice-number' - )); - - $this->addColumn('billing_name', array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - )); - - $this->addColumn('created_at', array( - 'header' => __('Invoice Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('state', array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_orderInvoice->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - )); - - $this->addColumn('base_grand_total', array( - 'header' => __('Amount'), - 'index' => 'base_grand_total', - 'type' => 'currency', - 'currency' => 'base_currency_code', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - )); - - return parent::_prepareColumns(); - } - - /** - * Retrieve order model instance - * - * @return \Magento\Sales\Model\Order - */ - public function getOrder() - { - return $this->_coreRegistry->registry('current_order'); - } - - public function getRowUrl($row) - { - return $this->getUrl('sales/order_invoice/view', - array( - 'invoice_id'=> $row->getId(), - 'order_id' => $row->getOrderId() - ) - ); - } - - public function getGridUrl() - { - return $this->getUrl('sales/*/invoices', array('_current' => true)); - } - - - /** - * ######################## TAB settings ################################# + * {@inheritdoc} */ public function getTabLabel() { return __('Invoices'); } + /** + * {@inheritdoc} + */ public function getTabTitle() { return __('Order Invoices'); } + /** + * {@inheritdoc} + */ public function canShowTab() { return true; } + /** + * {@inheritdoc} + */ public function isHidden() { return false; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php index ca7726e567b66..8046ebd4e9c7c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php @@ -30,7 +30,7 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; class Shipments - extends \Magento\Backend\Block\Widget\Grid\Extended + extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** @@ -41,29 +41,22 @@ class Shipments protected $_coreRegistry = null; /** - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory + * @param \Magento\View\Element\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param array $data */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, + \Magento\View\Element\Context $context, \Magento\Core\Model\Registry $coreRegistry, array $data = array() ) { - $this->_coreRegistry = $coreRegistry; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); + $this->_coreRegistry = $coreRegistry; + parent::__construct($context, $data); } + /** + * Initialize grid params + */ protected function _construct() { parent::_construct(); @@ -72,62 +65,19 @@ protected function _construct() } /** - * Retrieve collection class - * - * @return string + * {@inheritdoc} */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection'; - } - - protected function _prepareCollection() + public function getTabLabel() { - $collection = $this->_collectionFactory->create($this->_getCollectionClass()) - ->addFieldToSelect('entity_id') - ->addFieldToSelect('created_at') - ->addFieldToSelect('increment_id') - ->addFieldToSelect('total_qty') - ->addFieldToSelect('shipping_name') - ->setOrderFilter($this->getOrder()) - ; - $this->setCollection($collection); - return parent::_prepareCollection(); + return __('Shipments'); } - protected function _prepareColumns() + /** + * {@inheritdoc} + */ + public function getTabTitle() { - $this->addColumn('increment_id', array( - 'header' => __('Shipment'), - 'index' => 'increment_id', - 'header_css_class' => 'col-memo', - 'column_css_class' => 'col-memo' - )); - - $this->addColumn('shipping_name', array( - 'header' => __('Ship-to Name'), - 'index' => 'shipping_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - )); - - $this->addColumn('created_at', array( - 'header' => __('Ship Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('total_qty', array( - 'header' => __('Total Quantity'), - 'index' => 'total_qty', - 'type' => 'number', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - )); - - return parent::_prepareColumns(); + return __('Order Shipments'); } /** @@ -135,47 +85,25 @@ protected function _prepareColumns() * * @return \Magento\Sales\Model\Order */ - public function getOrder() + protected function _getOrder() { return $this->_coreRegistry->registry('current_order'); } - public function getRowUrl($row) - { - return $this->getUrl( - 'adminhtml/order_shipment/view', - array( - 'shipment_id'=> $row->getId(), - 'order_id' => $row->getOrderId() - )); - } - - public function getGridUrl() - { - return $this->getUrl('sales/*/shipments', array('_current' => true)); - } - /** - * ######################## TAB settings ################################# + * {@inheritdoc} */ - public function getTabLabel() - { - return __('Shipments'); - } - - public function getTabTitle() - { - return __('Order Shipments'); - } - public function canShowTab() { - if ($this->getOrder()->getIsVirtual()) { + if ($this->_getOrder()->getIsVirtual()) { return false; } return true; } + /** + * {@inheritdoc} + */ public function isHidden() { return false; diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php index 28fca4b12bfc6..fab1714144f07 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php @@ -34,34 +34,60 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; class Transactions - extends \Magento\Sales\Block\Adminhtml\Transactions\Grid + extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { + /** + * @var \Magento\AuthorizationInterface + */ + protected $_authorization; /** - * Retrieve grid url - * - * @return string + * @param \Magento\View\Element\Context $context + * @param \Magento\AuthorizationInterface $authorization + * @param array $data */ - public function getGridUrl() - { - return $this->getUrl('sales/order/transactions', array('_current' => true)); + public function __construct( + \Magento\View\Element\Context $context, + \Magento\AuthorizationInterface $authorization, + array $data = array() + ) { + $this->_authorization = $authorization; + parent::__construct($context, $data); } +// /** +// * Retrieve grid url +// * +// * @return string +// */ +// public function getGridUrl() +// { +// return $this->getUrl('sales/order/transactions', array('_current' => true)); +// } +// +// /** +// * Retrieve grid row url +// * +// * @return string +// */ +// public function getRowUrl($item) +// { +// return $this->getUrl('sales/transactions/view', array('_current' => true, 'txn_id' => $item->getId())); +// } + /** - * Retrieve grid row url - * - * @return string + * Initialize grid params */ - public function getRowUrl($item) + protected function _construct() { - return $this->getUrl('sales/transactions/view', array('_current' => true, 'txn_id' => $item->getId())); + parent::_construct(); + $this->setId('order_transactions'); + $this->setUseAjax(true); } /** - * Retrieve tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { @@ -69,9 +95,7 @@ public function getTabLabel() } /** - * Retrieve tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -79,9 +103,7 @@ public function getTabTitle() } /** - * Check whether can show tab - * - * @return bool + * {@inheritdoc} */ public function canShowTab() { @@ -89,9 +111,7 @@ public function canShowTab() } /** - * Check whether tab is hidden - * - * @return bool + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php index 6ba615240c0e9..560e186f61bd5 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php @@ -24,200 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Block\Adminhtml\Shipment; + /** - * Adminhtml sales orders grid + * Adminhtml sales shipments grid * * @author Magento Core Team */ -namespace Magento\Sales\Block\Adminhtml\Shipment; - -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended +class Grid extends \Magento\Backend\Block\Widget\Grid { - /** - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - array $data = array() - ) { - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - - /** - * Initialization - */ - protected function _construct() - { - parent::_construct(); - $this->setId('sales_shipment_grid'); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection'; - } - - /** - * Prepare and set collection of grid - * - * @return \Magento\Backend\Block\Widget\Grid\Extended - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create($this->_getCollectionClass()); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Prepare and add columns to grid - * - * @return \Magento\Backend\Block\Widget\Grid\Extended - */ - protected function _prepareColumns() - { - $this->addColumn('increment_id', array( - 'header' => __('Shipment'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-shipment-number', - 'column_css_class' => 'col-shipment-number' - )); - - $this->addColumn('created_at', array( - 'header' => __('Ship Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('order_increment_id', array( - 'header' => __('Order'), - 'index' => 'order_increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-number', - 'column_css_class' => 'col-order-number' - )); - - $this->addColumn('order_created_at', array( - 'header' => __('Order Date'), - 'index' => 'order_created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - $this->addColumn('shipping_name', array( - 'header' => __('Ship-to Name'), - 'index' => 'shipping_name', - 'header_css_class' => 'col-memo', - 'column_css_class' => 'col-memo' - )); - - $this->addColumn('total_qty', array( - 'header' => __('Total Quantity'), - 'index' => 'total_qty', - 'type' => 'number', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - )); - - $this->addColumn('action', - array( - 'header' => __('Action'), - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array( - array( - 'caption' => __('View'), - 'url' => array('base' => 'sales/shipment/view'), - 'field' => 'shipment_id' - ) - ), - 'filter' => false, - 'sortable' => false, - 'is_system' => true, - 'header_css_class' => 'col-actions', - 'column_css_class' => 'col-actions' - )); - - $this->addExportType('*/*/exportCsv', __('CSV')); - $this->addExportType('*/*/exportExcel', __('Excel XML')); - - return parent::_prepareColumns(); - } - - /** - * Get url for row - * - * @param string $row - * @return string - */ - public function getRowUrl($row) - { - if (!$this->_authorization->isAllowed(null)) { - return false; - } - - return $this->getUrl('sales/shipment/view', - array( - 'shipment_id' => $row->getId(), - ) - ); - } - - /** - * Prepare and set options for massaction - * - * @return \Magento\Sales\Block\Adminhtml\Shipment\Grid - */ - protected function _prepareMassaction() - { - $this->setMassactionIdField('entity_id'); - $this->getMassactionBlock()->setFormFieldName('shipment_ids'); - $this->getMassactionBlock()->setUseSelectAll(false); - - $this->getMassactionBlock()->addItem('pdfshipments_order', array( - 'label' => __('PDF Packing Slips'), - 'url' => $this->getUrl('sales/shipment/pdfshipments'), - )); - - $this->getMassactionBlock()->addItem('print_shipping_label', array( - 'label' => __('Print Shipping Labels'), - 'url' => $this->getUrl('adminhtml/order_shipment/massPrintShippingLabel'), - )); - - return $this; - } - - /** - * Get url of grid - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/*', array('_current' => true)); - } - } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php index de7195575f2f7..ec51e42858bf2 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php @@ -24,206 +24,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Block\Adminhtml\Transactions; + /** - * Adminhtml transactions grid + * Adminhtml sales transactions grid * - * @category Magento - * @package Magento_Sales - * @author Magento Core Team + * @author Magento Core Team */ -namespace Magento\Sales\Block\Adminhtml\Transactions; - -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended +class Grid extends \Magento\Backend\Block\Widget\Grid { - /** - * Core registry - * - * @var \Magento\Core\Model\Registry - */ - protected $_coreRegistry = null; - - /** - * Payment data - * - * @var \Magento\Payment\Helper\Data - */ - protected $_paymentData = null; - - /** - * @var \Magento\Sales\Model\Order\Payment\Transaction - */ - protected $_transaction; - - /** - * @var \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Order\Payment\Transaction $transaction - * @param \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Order\Payment\Transaction $transaction, - \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { - $this->_coreRegistry = $coreRegistry; - $this->_paymentData = $paymentData; - $this->_transaction = $transaction; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Set grid params - * - */ - protected function _construct() - { - parent::_construct(); - $this->setId('order_transactions'); - $this->setUseAjax(true); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - $this->setSaveParametersInSession(true); - } - - /** - * Prepare collection for grid - * - * @return \Magento\Backend\Block\Widget\Grid\Extended - */ - protected function _prepareCollection() - { - $collection = $this->getCollection(); - if (!$collection) { - $collection = $this->_collectionFactory->create(); - } - $order = $this->_coreRegistry->registry('current_order'); - if ($order) { - $collection->addOrderIdFilter($order->getId()); - } - $collection->addOrderInformation(array('increment_id')); - $collection->addPaymentInformation(array('method')); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Add columns to grid - * - * @return \Magento\Backend\Block\Widget\Grid\Extended - */ - protected function _prepareColumns() - { - $this->addColumn('transaction_id', array( - 'header' => __('ID'), - 'index' => 'transaction_id', - 'type' => 'number', - 'header_css_class' => 'col-id', - 'column_css_class' => 'col-id' - )); - - $this->addColumn('increment_id', array( - 'header' => __('Order ID'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-id', - 'column_css_class' => 'col-order-id' - )); - - $this->addColumn('txn_id', array( - 'header' => __('Transaction ID'), - 'index' => 'txn_id', - 'type' => 'text', - 'header_css_class' => 'col-transaction-id', - 'column_css_class' => 'col-transaction-id' - )); - - $this->addColumn('parent_txn_id', array( - 'header' => __('Parent Transaction ID'), - 'index' => 'parent_txn_id', - 'type' => 'text', - 'header_css_class' => 'col-parent-transaction-id', - 'column_css_class' => 'col-parent-transaction-id' - )); - - $this->addColumn('method', array( - 'header' => __('Payment Method'), - 'index' => 'method', - 'type' => 'options', - 'options' => $this->_paymentData->getPaymentMethodList(true), - 'option_groups' => $this->_paymentData->getPaymentMethodList(true, true, true), - 'header_css_class' => 'col-method', - 'column_css_class' => 'col-method' - )); - - $this->addColumn('txn_type', array( - 'header' => __('Transaction Type'), - 'index' => 'txn_type', - 'type' => 'options', - 'options' => $this->_transaction->getTransactionTypes(), - 'header_css_class' => 'col-transaction-type', - 'column_css_class' => 'col-transaction-type' - )); - - $this->addColumn('is_closed', array( - 'header' => __('Closed'), - 'index' => 'is_closed', - 'width' => 1, - 'type' => 'options', - 'align' => 'center', - 'options' => array( - 1 => __('Yes'), - 0 => __('No'), - ), - 'header_css_class' => 'col-closed', - 'column_css_class' => 'col-closed' - )); - - $this->addColumn('created_at', array( - 'header' => __('Created'), - 'index' => 'created_at', - 'width' => 1, - 'type' => 'datetime', - 'align' => 'center', - 'default' => __('N/A'), - 'html_decorators' => array('nobr'), - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - )); - - return parent::_prepareColumns(); - } - - /** - * Retrieve grid url - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/grid', array('_current' => true)); - } - - /** - * Retrieve row url - * - * @param $item - * @return string - */ - public function getRowUrl($item) - { - return $this->getUrl('sales/*/view', array('txn_id' => $item->getId())); - } } + diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php index 6c9e5e4460260..473d324573ea5 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php @@ -24,41 +24,40 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Controller\Adminhtml; + /** - * Adminhtml sales orders controller + * Adminhtml sales creditmemos controller * * @author Magento Core Team */ -namespace Magento\Sales\Controller\Adminhtml; - class Creditmemo extends \Magento\Sales\Controller\Adminhtml\Creditmemo\AbstractCreditmemo { /** - * Export credit memo grid to CSV format + * Export creditmemo grid to CSV format */ public function exportCsvAction() { - $fileName = 'creditmemos.csv'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Creditmemo\Grid'); - return $this->_fileFactory->create($fileName, $grid->getCsvFile()); + $this->_view->loadLayout(); + $fileName = 'creditmemos.csv'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.creditmemo.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); } /** - * Export credit memo grid to Excel XML format + * Export creditmemo grid to Excel XML format */ public function exportExcelAction() { - $fileName = 'creditmemos.xml'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Creditmemo\Grid'); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); - } - - /** - * Index page - */ - public function indexAction() - { - $this->_title->add(__('Credit Memos')); - parent::indexAction(); + $this->_view->loadLayout(); + $fileName = 'creditmemos.xml'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.creditmemo.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getExcelFile($fileName), + \Magento\App\Filesystem::VAR_DIR + ); } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php index b87a90e317c93..4563fa37d54e4 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php @@ -64,13 +64,23 @@ protected function _initAction() return $this; } + /** + * Creditmemos grid + */ + public function gridAction() + { + $this->_view->loadLayout(false); + $this->_view->renderLayout(); + } + /** * Creditmemos grid */ public function indexAction() { - $this->_initAction() - ->_addContent($this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Creditmemo')); + $this->_title->add(__('Credit Memos')); + + $this->_initAction(); $this->_view->renderLayout(); } @@ -112,7 +122,7 @@ public function emailAction() } } - public function pdfcreditmemosAction() + public function massPrintCreditMemosAction() { $creditmemosIds = $this->getRequest()->getPost('creditmemo_ids'); if (!empty($creditmemosIds)) { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php index 884d022aabe21..dffd1a60d5b5a 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php @@ -24,13 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Controller\Adminhtml; + /** - * Adminhtml sales orders controller + * Adminhtml sales invoice controller * * @author Magento Core Team */ -namespace Magento\Sales\Controller\Adminhtml; - class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice { /** @@ -38,9 +38,11 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic */ public function exportCsvAction() { - $fileName = 'invoices.csv'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice\Grid'); - return $this->_fileFactory->create($fileName, $grid->getCsvFile()); + $this->_view->loadLayout(); + $fileName = 'invoices.csv'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.invoice.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); } /** @@ -48,8 +50,14 @@ public function exportCsvAction() */ public function exportExcelAction() { - $fileName = 'invoices.xml'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice\Grid'); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); + $this->_view->loadLayout(); + $fileName = 'invoices.xml'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.invoice.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getExcelFile($fileName), + \Magento\App\Filesystem::VAR_DIR + ); } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php index 2aa4d18f581a5..91f2a975a96f5 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php @@ -50,6 +50,7 @@ public function __construct( $this->_fileFactory = $fileFactory; parent::__construct($context); } + /** * Init layout, menu and breadcrumb * @@ -65,14 +66,12 @@ protected function _initAction() } /** - * Order grid + * Invoices grid */ public function gridAction() { - $this->_view->loadLayout(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice\Grid')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -82,8 +81,7 @@ public function indexAction() { $this->_title->add(__('Invoices')); - $this->_initAction() - ->_addContent($this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice')); + $this->_initAction(); $this->_view->renderLayout(); } @@ -142,7 +140,7 @@ public function printAction() } } - public function pdfinvoicesAction() + public function massPrintInvoicesAction() { $invoicesIds = $this->getRequest()->getPost('invoice_ids'); if (!empty($invoicesIds)) { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order.php b/app/code/Magento/Sales/Controller/Adminhtml/Order.php index f5de7c9f885b3..47df7af101c9d 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order.php @@ -134,7 +134,7 @@ public function gridAction() } /** - * View order detale + * View order details */ public function viewAction() { @@ -156,6 +156,8 @@ public function viewAction() } $this->_title->add(sprintf("#%s", $order->getRealOrderId())); $this->_view->renderLayout(); + } else { + $this->_forward('noroute'); } } @@ -181,8 +183,10 @@ public function emailAction() $this->messageManager->addError(__('We couldn\'t send the email order.')); $this->_objectManager->get('Magento\Logger')->logException($e); } + $this->_redirect('sales/order/view', array('order_id' => $order->getId())); + } else { + $this->_forward('noroute'); } - $this->_redirect('sales/order/view', array('order_id' => $order->getId())); } /** @@ -205,6 +209,8 @@ public function cancelAction() $this->_objectManager->get('Magento\Logger')->logException($e); } $this->_redirect('sales/order/view', array('order_id' => $order->getId())); + } else { + $this->_forward('noroute'); } } @@ -227,6 +233,8 @@ public function holdAction() $this->messageManager->addError(__('You have not put the order on hold.')); } $this->_redirect('sales/order/view', array('order_id' => $order->getId())); + } else { + $this->_forward('noroute'); } } @@ -249,6 +257,8 @@ public function unholdAction() $this->messageManager->addError(__('The order was not on hold.')); } $this->_redirect('sales/order/view', array('order_id' => $order->getId())); + } else { + $this->_forward('noroute'); } } @@ -259,38 +269,39 @@ public function unholdAction() */ public function reviewPaymentAction() { - try { - $order = $this->_initOrder(); - if (!$order) { - return; - } - $action = $this->getRequest()->getParam('action', ''); - switch ($action) { - case 'accept': - $order->getPayment()->accept(); - $message = __('The payment has been accepted.'); - break; - case 'deny': - $order->getPayment()->deny(); - $message = __('The payment has been denied.'); - break; - case 'update': - $order->getPayment() - ->registerPaymentReviewAction(\Magento\Sales\Model\Order\Payment::REVIEW_ACTION_UPDATE, true); - $message = __('The payment update has been made.'); - break; - default: - throw new \Exception(sprintf('Action "%s" is not supported.', $action)); + $order = $this->_initOrder(); + if ($order) { + try { + $action = $this->getRequest()->getParam('action', ''); + switch ($action) { + case 'accept': + $order->getPayment()->accept(); + $message = __('The payment has been accepted.'); + break; + case 'deny': + $order->getPayment()->deny(); + $message = __('The payment has been denied.'); + break; + case 'update': + $order->getPayment() + ->registerPaymentReviewAction(\Magento\Sales\Model\Order\Payment::REVIEW_ACTION_UPDATE, true); + $message = __('The payment update has been made.'); + break; + default: + throw new \Exception(sprintf('Action "%s" is not supported.', $action)); + } + $order->save(); + $this->messageManager->addSuccess($message); + } catch (\Magento\Core\Exception $e) { + $this->messageManager->addError($e->getMessage()); + } catch (\Exception $e) { + $this->messageManager->addError(__('We couldn\'t update the payment.')); + $this->_objectManager->get('Magento\Logger')->logException($e); } - $order->save(); - $this->messageManager->addSuccess($message); - } catch (\Magento\Core\Exception $e) { - $this->messageManager->addError($e->getMessage()); - } catch (\Exception $e) { - $this->messageManager->addError(__('We couldn\'t update the payment.')); - $this->_objectManager->get('Magento\Logger')->logException($e); + $this->_redirect('sales/order/view', array('order_id' => $order->getId())); + } else { + $this->_forward('noroute'); } - $this->_redirect('sales/order/view', array('order_id' => $order->getId())); } /** @@ -337,6 +348,8 @@ public function addCommentAction() $response = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response); $this->getResponse()->setBody($response); } + } else { + $this->_forward('noroute'); } } @@ -346,9 +359,8 @@ public function addCommentAction() public function invoicesAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -357,9 +369,8 @@ public function invoicesAction() public function shipmentsAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -368,9 +379,8 @@ public function shipmentsAction() public function creditmemosAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -487,26 +497,10 @@ public function massUnholdAction() $this->_redirect('sales/*/'); } - /** - * Change status for selected orders - */ - public function massStatusAction() - { - - } - - /** - * Print documents for selected orders - */ - public function massPrintAction() - { - - } - /** * Print invoices for selected orders */ - public function pdfinvoicesAction() + public function massPrintInvoicesAction() { $orderIds = $this->getRequest()->getPost('order_ids'); $flag = false; @@ -545,7 +539,7 @@ public function pdfinvoicesAction() /** * Print shipments for selected orders */ - public function pdfshipmentsAction() + public function massPrintShipmentsAction() { $orderIds = $this->getRequest()->getPost('order_ids'); $flag = false; @@ -584,7 +578,7 @@ public function pdfshipmentsAction() /** * Print credit memos for selected orders */ - public function pdfcreditmemosAction() + public function massPrintCreditMemosAction() { $orderIds = $this->getRequest()->getPost('order_ids'); $flag = false; @@ -623,7 +617,7 @@ public function pdfcreditmemosAction() /** * Print all documents for selected orders */ - public function pdfdocsAction() + public function massPrintAllAction() { $orderIds = $this->getRequest()->getPost('order_ids'); $flag = false; diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php index 4877d8c711c2d..6fc4e2ca883ad 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php @@ -25,7 +25,7 @@ */ /** - * Adminhtml sales order edit controller + * Adminhtml sales order invoice edit controller * * @category Magento * @package Magento_Sales @@ -78,10 +78,10 @@ protected function _getItemQtys() /** * Initialize invoice model instance * - * @param bool $update * @return \Magento\Sales\Model\Order\Invoice + * @throws \Magento\Core\Exception */ - protected function _initInvoice($update = false) + protected function _initInvoice() { $this->_title->add(__('Invoices')); @@ -411,6 +411,9 @@ public function voidAction() } } + /** + * Add comment to invoice action + */ public function addCommentAction() { try { @@ -432,14 +435,14 @@ public function addCommentAction() $response = $this->_view->getLayout()->getBlock('invoice_comments')->toHtml(); } catch (\Magento\Core\Exception $e) { $response = array( - 'error' => true, - 'message' => $e->getMessage() + 'error' => true, + 'message' => $e->getMessage() ); $response = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response); } catch (\Exception $e) { $response = array( - 'error' => true, - 'message' => __('Cannot add new comment.') + 'error' => true, + 'message' => __('Cannot add new comment.') ); $response = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php b/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php index 2f760b1ebcd41..6f6bd19de7170 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php @@ -24,13 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Controller\Adminhtml; + /** - * Adminhtml sales orders controller + * Adminhtml sales shipment controller * * @author Magento Core Team */ -namespace Magento\Sales\Controller\Adminhtml; - class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShipment { /** @@ -38,9 +38,11 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip */ public function exportCsvAction() { - $fileName = 'shipments.csv'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Shipment\Grid'); - return $this->_fileFactory->create($fileName, $grid->getCsvFile()); + $this->_view->loadLayout(); + $fileName = 'shipments.csv'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.shipment.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); } /** @@ -48,8 +50,14 @@ public function exportCsvAction() */ public function exportExcelAction() { - $fileName = 'shipments.xml'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Shipment\Grid'); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName)); + $this->_view->loadLayout(); + $fileName = 'shipments.xml'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.shipment.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getExcelFile($fileName), + \Magento\App\Filesystem::VAR_DIR + ); } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php b/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php index f17d5d245175a..d2216b4c399ba 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php @@ -24,13 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Controller\Adminhtml\Shipment; + /** * Adminhtml sales orders controller * * @author Magento Core Team */ -namespace Magento\Sales\Controller\Adminhtml\Shipment; - class AbstractShipment extends \Magento\Backend\App\Action { /** @@ -49,6 +49,7 @@ public function __construct( $this->_fileFactory = $fileFactory; parent::__construct($context); } + /** * Init layout, menu and breadcrumb * @@ -63,6 +64,15 @@ protected function _initAction() return $this; } + /** + * Shipments grid + */ + public function gridAction() + { + $this->_view->loadLayout(false); + $this->_view->renderLayout(); + } + /** * Shipments grid */ @@ -70,8 +80,7 @@ public function indexAction() { $this->_title->add(__('Shipments')); - $this->_initAction() - ->_addContent($this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Shipment')); + $this->_initAction(); $this->_view->renderLayout(); } @@ -87,7 +96,7 @@ public function viewAction() } } - public function pdfshipmentsAction() + public function massPrintShipmentsAction() { $shipmentIds = $this->getRequest()->getPost('shipment_ids'); if (!empty($shipmentIds)) { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php index 6b4c60e11e752..8d113a493986c 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php @@ -24,15 +24,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Controller\Adminhtml; + +use Magento\Backend\App\Action; + /** * Adminhtml sales transactions controller * * @author Magento Core Team */ -namespace Magento\Sales\Controller\Adminhtml; - -use Magento\Backend\App\Action; - class Transactions extends \Magento\Backend\App\Action { /** @@ -42,15 +42,23 @@ class Transactions extends \Magento\Backend\App\Action */ protected $_coreRegistry = null; + /** + * @var \Magento\App\Response\Http\FileFactory + */ + protected $_fileFactory; + /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Core\Model\Registry $coreRegistry, + \Magento\App\Response\Http\FileFactory $fileFactory ) { $this->_coreRegistry = $coreRegistry; + $this->_fileFactory = $fileFactory; parent::__construct($context); } @@ -156,4 +164,32 @@ protected function _isAllowed() break; } } + + /** + * Export transaction grid to CSV format + */ + public function exportCsvAction() + { + $this->_view->loadLayout(); + $fileName = 'transactions.csv'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.transactions.grid', 'grid.export'); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + } + + /** + * Export transaction grid to Excel XML format + */ + public function exportExcelAction() + { + $this->_view->loadLayout(); + $fileName = 'transactions.xml'; + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.transactions.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getExcelFile($fileName), + \Magento\App\Filesystem::VAR_DIR + ); + } } diff --git a/app/code/Magento/Sales/Model/Billing/Agreement/OrdersUpdater.php b/app/code/Magento/Sales/Model/Billing/Agreement/OrdersUpdater.php index 94e45f9af8e64..0ff3d1ae498e0 100644 --- a/app/code/Magento/Sales/Model/Billing/Agreement/OrdersUpdater.php +++ b/app/code/Magento/Sales/Model/Billing/Agreement/OrdersUpdater.php @@ -24,11 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * Sales orders grid massaction items updater - */ namespace Magento\Sales\Model\Billing\Agreement; +/** + * Order collection updater on orders tab of view billing agreement page + */ class OrdersUpdater implements \Magento\Core\Model\Layout\Argument\UpdaterInterface { /** @@ -37,24 +37,17 @@ class OrdersUpdater implements \Magento\Core\Model\Layout\Argument\UpdaterInterf protected $_registryManager; /** - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data - * @throws \InvalidArgumentException + * @param \Magento\Core\Model\Registry $registryManager */ - public function __construct(\Magento\Core\Model\Registry $coreRegistry, array $data = array()) + public function __construct(\Magento\Core\Model\Registry $registryManager) { - $this->_registryManager = isset($data['registry']) ? $data['registry'] : $coreRegistry; - - if (false === ($this->_registryManager instanceof \Magento\Core\Model\Registry)) { - throw new \InvalidArgumentException('registry object has to be an instance of \Magento\Core\Model\Registry'); - } + $this->_registryManager = $registryManager; } /** * Add billing agreement filter * - * @param mixed $argument - * @throws \DomainException + * @param \Magento\Sales\Model\Resource\Order\Collection $argument * @return mixed * @throws \DomainException */ diff --git a/app/code/Magento/Sales/Model/Grid/Massaction/ItemsUpdater.php b/app/code/Magento/Sales/Model/Grid/Massaction/ItemsUpdater.php new file mode 100644 index 0000000000000..fa8299a204f08 --- /dev/null +++ b/app/code/Magento/Sales/Model/Grid/Massaction/ItemsUpdater.php @@ -0,0 +1,80 @@ + + */ +namespace Magento\Sales\Model\Grid\Massaction; + +class ItemsUpdater implements \Magento\Core\Model\Layout\Argument\UpdaterInterface +{ + /** + * @var \Magento\AuthorizationInterface + */ + protected $_authorization; + + /** + * Mass actions list in the form 'mass action name' => 'acl resource name' + * + * @var array + */ + protected $_items = array( + 'print_invoices' => 'Magento_Sales::print', + 'print_shipments' => 'Magento_Sales::print', + 'print_credit_memos' => 'Magento_Sales::print', + 'print_shipping_labels' => 'Magento_Sales::print', + 'print_all' => 'Magento_Sales::print', + ); + + /** + * @param \Magento\AuthorizationInterface $authorization + */ + public function __construct(\Magento\AuthorizationInterface $authorization) + { + $this->_authorization = $authorization; + } + + /** + * Remove mass action items in case they aren't allowed for current user + * + * @param mixed $argument + * @return mixed + */ + public function update($argument) + { + foreach ($this->_items as $itemName => $aclResourceName) { + if (false === $this->_authorization->isAllowed($aclResourceName)) { + unset($argument[$itemName]); + } + } + + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Order/Grid/Row/UrlGenerator.php b/app/code/Magento/Sales/Model/Grid/Row/UrlGenerator.php similarity index 95% rename from app/code/Magento/Sales/Model/Order/Grid/Row/UrlGenerator.php rename to app/code/Magento/Sales/Model/Grid/Row/UrlGenerator.php index d04a759081e56..91b7cee668a42 100644 --- a/app/code/Magento/Sales/Model/Order/Grid/Row/UrlGenerator.php +++ b/app/code/Magento/Sales/Model/Grid/Row/UrlGenerator.php @@ -25,9 +25,9 @@ */ /** - * Sales orders grid row url generator + * Sales module grids row url generator */ -namespace Magento\Sales\Model\Order\Grid\Row; +namespace Magento\Sales\Model\Grid\Row; class UrlGenerator extends \Magento\Backend\Model\Widget\Grid\Row\UrlGenerator { @@ -48,7 +48,6 @@ public function __construct( ) { $this->_authorization = $authorization; parent::__construct($backendUrl, $args); - } /** diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index bf2d901e42611..305ef1823b35f 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model; + /** * Order model * @@ -303,11 +305,10 @@ * @method float getBaseShippingInclTax() * @method \Magento\Sales\Model\Order setBaseShippingInclTax(float $value) */ -namespace Magento\Sales\Model; - class Order extends \Magento\Sales\Model\AbstractModel { const ENTITY = 'order'; + /** * XML configuration paths */ @@ -360,6 +361,7 @@ class Order extends \Magento\Sales\Model\AbstractModel */ const REPORT_DATE_TYPE_CREATED = 'created'; const REPORT_DATE_TYPE_UPDATED = 'updated'; + /* * Identifier for history item */ diff --git a/app/code/Magento/Sales/Model/Order/CreditmemosUpdater.php b/app/code/Magento/Sales/Model/Order/CreditmemosUpdater.php new file mode 100644 index 0000000000000..20708ecb35a29 --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/CreditmemosUpdater.php @@ -0,0 +1,65 @@ +_registryManager = $registryManager; + } + + /** + * Add order filter + * + * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection $argument + * @return mixed + * @throws \DomainException + */ + public function update($argument) + { + $order = $this->_registryManager->registry('current_order'); + + if (!$order) { + throw new \DomainException('Undefined order object'); + } + + $argument->setOrderFilter($order->getId()); + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php b/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php index 8ad547a4a6d0a..840a55e9fdb29 100644 --- a/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php +++ b/app/code/Magento/Sales/Model/Order/Grid/Massaction/ItemsUpdater.php @@ -33,40 +33,26 @@ */ namespace Magento\Sales\Model\Order\Grid\Massaction; -class ItemsUpdater implements \Magento\Core\Model\Layout\Argument\UpdaterInterface +class ItemsUpdater extends \Magento\Sales\Model\Grid\Massaction\ItemsUpdater { /** - * @var \Magento\AuthorizationInterface + * Mass actions list in the form 'mass action name' => 'acl resource name' + * + * @var array */ - protected $_authorization; + protected $_orderSpecificItems = array( + 'cancel_order' => 'Magento_Sales::cancel', + 'hold_order' => 'Magento_Sales::hold', + 'unhold_order' => 'Magento_Sales::unhold', + ); /** * @param \Magento\AuthorizationInterface $authorization */ public function __construct(\Magento\AuthorizationInterface $authorization) { - $this->_authorization = $authorization; - } - - /** - * Remove massaction items in case they disallowed for user - * @param mixed $argument - * @return mixed - */ - public function update($argument) - { - if (false === $this->_authorization->isAllowed('Magento_Sales::cancel')) { - unset($argument['cancel_order']); - } - - if (false === $this->_authorization->isAllowed('Magento_Sales::hold')) { - unset($argument['hold_order']); - } - - if (false === $this->_authorization->isAllowed('Magento_Sales::unhold')) { - unset($argument['unhold_order']); - } + parent::__construct($authorization); - return $argument; + $this->_items = array_merge($this->_items, $this->_orderSpecificItems); } } diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index d16d3a411e8cf..d66482edf8983 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\Order; + /** * @method \Magento\Sales\Model\Resource\Order\Invoice _getResource() * @method \Magento\Sales\Model\Resource\Order\Invoice getResource() @@ -110,8 +112,6 @@ * @method float getBaseShippingInclTax() * @method \Magento\Sales\Model\Order\Invoice setBaseShippingInclTax(float $value) */ -namespace Magento\Sales\Model\Order; - class Invoice extends \Magento\Sales\Model\AbstractModel { /** diff --git a/app/code/Magento/Sales/Model/Order/InvoicesUpdater.php b/app/code/Magento/Sales/Model/Order/InvoicesUpdater.php new file mode 100644 index 0000000000000..2a213358e391b --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/InvoicesUpdater.php @@ -0,0 +1,65 @@ +_registryManager = $registryManager; + } + + /** + * Add order filter + * + * @param \Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection $argument + * @return mixed + * @throws \DomainException + */ + public function update($argument) + { + $order = $this->_registryManager->registry('current_order'); + + if (!$order) { + throw new \DomainException('Undefined order object'); + } + + $argument->setOrderFilter($order->getId()); + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Order/ShipmentsUpdater.php b/app/code/Magento/Sales/Model/Order/ShipmentsUpdater.php new file mode 100644 index 0000000000000..e290b3dda3549 --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/ShipmentsUpdater.php @@ -0,0 +1,65 @@ +_registryManager = $registryManager; + } + + /** + * Add order filter + * + * @param \Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection $argument + * @return mixed + * @throws \DomainException + */ + public function update($argument) + { + $order = $this->_registryManager->registry('current_order'); + + if (!$order) { + throw new \DomainException('Undefined order object'); + } + + $argument->setOrderFilter($order->getId()); + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Order/TransactionsUpdater.php b/app/code/Magento/Sales/Model/Order/TransactionsUpdater.php new file mode 100644 index 0000000000000..f0116f8927248 --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/TransactionsUpdater.php @@ -0,0 +1,71 @@ +_registryManager = $registryManager; + } + + /** + * Add order filter + * + * @param \Magento\Sales\Model\Resource\Order\Transaction\Grid\Collection $argument + * @return mixed + * @throws \DomainException + */ + public function update($argument) + { +// $order = $this->_coreRegistry->registry('current_order'); +// if ($order) { +// $collection->addOrderIdFilter($order->getId()); +// } + + + $order = $this->_registryManager->registry('current_order'); + + if (!$order) { + throw new \DomainException('Undefined order object'); + } + + $argument->setOrderFilter($order->getId()); + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Grid/StatusesArray.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Grid/StatusesArray.php new file mode 100644 index 0000000000000..13886cfbcd33d --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Grid/StatusesArray.php @@ -0,0 +1,56 @@ +_creditmemoFactory = $creditmemoFactory; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->_creditmemoFactory->create()->getStates(); + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Grid/StatusesArray.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Grid/StatusesArray.php new file mode 100644 index 0000000000000..66aede436daee --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Grid/StatusesArray.php @@ -0,0 +1,56 @@ +_invoiceFactory = $invoiceFactory; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->_invoiceFactory->create()->getStates(); + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Payment/Transaction/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Payment/Transaction/Collection.php index a3e2e348d5ad2..1fa5a513ae321 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Payment/Transaction/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Payment/Transaction/Collection.php @@ -201,9 +201,9 @@ public function addStoreFilter($storeIds) * * @return \Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection */ - protected function _beforeLoad() + protected function _renderFilters() { - parent::_beforeLoad(); + parent::_renderFilters(); if ($this->isLoaded()) { return $this; diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php index 78e8d0a2405c7..c580d1ac9c1ae 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php @@ -25,15 +25,15 @@ */ +namespace Magento\Sales\Model\Resource\Order\Shipment; + /** - * Flat sales order shipment collection + * Sales order shipment collection * * @category Magento * @package Magento_Sales * @author Magento Core Team */ -namespace Magento\Sales\Model\Resource\Order\Shipment; - class Collection extends \Magento\Sales\Model\Resource\Order\Collection\AbstractCollection { /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Transaction/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Transaction/Grid/Collection.php new file mode 100644 index 0000000000000..8e99543e6b671 --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Transaction/Grid/Collection.php @@ -0,0 +1,83 @@ + + */ +namespace Magento\Sales\Model\Resource\Order\Transaction\Grid; + +class Collection extends \Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection +{ + /** + * Event prefix + * + * @var string + */ + protected $_eventPrefix = 'sales_order_transaction_collection'; + + /** + * Event object + * + * @var string + */ + protected $_eventObject = 'order_transaction_collection'; + + /** + * Order field for setOrderFilter + * + * @var string + */ + protected $_orderField = 'order_id'; + + /** + * Model initialization + * + */ + protected function _construct() + { + parent::_construct(); + + $this->addOrderInformation(array('increment_id')); + $this->addPaymentInformation(array('method')); + } + + /** + * Used to emulate after load functionality for each item without loading them + * + * @return \Magento\Sales\Model\Resource\Order\Transaction\Grid\Collection + */ + protected function _afterLoad() + { + $this->walk('afterLoad'); + + return $this; + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Transaction/Grid/TypesArray.php b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/TypesArray.php new file mode 100644 index 0000000000000..b7099da5a60e5 --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/TypesArray.php @@ -0,0 +1,56 @@ +_transactionFactory = $transactionFactory; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->_transactionFactory->create()->getTransactionTypes(); + } +} diff --git a/app/code/Magento/Sales/etc/adminhtml/acl.xml b/app/code/Magento/Sales/etc/adminhtml/acl.xml index 0687d6c6ccbc1..2dca5f049d986 100644 --- a/app/code/Magento/Sales/etc/adminhtml/acl.xml +++ b/app/code/Magento/Sales/etc/adminhtml/acl.xml @@ -48,6 +48,7 @@ + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml new file mode 100644 index 0000000000000..f2a0f0ebc31b2 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml new file mode 100644 index 0000000000000..f2a0f0ebc31b2 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml new file mode 100644 index 0000000000000..f5d39b7e97d03 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml @@ -0,0 +1,30 @@ + + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml new file mode 100644 index 0000000000000..4fef58c8840af --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml @@ -0,0 +1,177 @@ + + + + + + + sales_creditmemo_grid + Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection + true + created_at + DESC + 1 + + 1 + + + + + entity_id + creditmemo_ids + 0 + + Magento\Sales\Model\Grid\Massaction\ItemsUpdater + + Print Packing Slips + sales/creditmemo/massPrintCreditMemos + + + + + + + + + */*/exportCsv + CSV + + + */*/exportExcel + Excel XML + + + + + + + sales_creditmemo_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/creditmemo/view + + getId + + + + + + Credit Memo + text + increment_id + real_creditmemo_id + col-memo-number + col-memo-number + + + + + Created + datetime + created_at + created_at + col-period + col-period + + + + + Order + text + order_increment_id + order_increment_id + col-order-number + col-order-number + + + + + Order Date + datetime + order_created_at + order_created_at + col-period + col-period + + + + + billing_name + Bill-to Name + billing_name + col-bill-to-name + col-bill-to-name + + + + + state + Status + options + state + + col-status + col-status + + + + + grand_total + Refunded + currency + order_currency_code + 1 + grand_total + col-refunded + col-refunded + + + + + + action + Action + action + getId + 0 + 0 + 1 + + + View + + sales/creditmemo/view + + creditmemo_id + + + col-actions + col-actions + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml new file mode 100644 index 0000000000000..71d4035ea86b7 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml new file mode 100644 index 0000000000000..925d6e696e1f4 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml new file mode 100644 index 0000000000000..925d6e696e1f4 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml new file mode 100644 index 0000000000000..cd24f1c4b6529 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml @@ -0,0 +1,30 @@ + + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml new file mode 100644 index 0000000000000..72193b3cb8c42 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml @@ -0,0 +1,177 @@ + + + + + + + sales_invoice_grid + Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection + true + created_at + DESC + 1 + + 1 + + + + + entity_id + invoice_ids + 0 + + Magento\Sales\Model\Grid\Massaction\ItemsUpdater + + Print Invoices + sales/invoice/massPrintInvoices + + + + + + + + + */*/exportCsv + CSV + + + */*/exportExcel + Excel XML + + + + + + + sales_invoice_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/invoice/view + + getId + + + + + + Invoice + text + increment_id + real_invoice_id + col-invoice-number + col-invoice-number + + + + + Invoice Date + datetime + created_at + created_at + col-period + col-period + + + + + Order + text + order_increment_id + order_increment_id + col-order-number + col-order-number + + + + + Order Date + datetime + order_created_at + order_created_at + col-period + col-period + + + + + billing_name + Bill-to Name + billing_name + col-bill-to-name + col-bill-to-name + + + + + state + Status + options + state + + col-status + col-status + + + + + grand_total + Grand Total (Purchased) + currency + invoice_currency_code + 1 + grand_total + col-gtpurchased + col-gtpurchased + + + + + + action + Action + action + getId + 0 + 0 + 1 + + + View + + sales/invoice/view + + invoice_id + + + col-actions + col-actions + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml new file mode 100644 index 0000000000000..eaac5d9c06eb5 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml new file mode 100644 index 0000000000000..2221ebd794f93 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml @@ -0,0 +1,109 @@ + + + + + + + sales_order_creditmemo_grid + + Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection + Magento\Sales\Model\Order\CreditmemosUpdater + + true + created_at + DESC + 1 + + 1 + + + + + sales_order_creditmemo_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/order_creditmemo/view + + getId + + + + + + Credit Memo + text + increment_id + real_creditmemo_id + col-memo-number + col-memo-number + + + + + billing_name + Bill-to Name + billing_name + col-bill-to-name + col-bill-to-name + + + + + Created + datetime + created_at + created_at + col-period + col-period + + + + + state + Status + options + state + + col-status + col-status + + + + + grand_total + Refunded + currency + order_currency_code + 1 + grand_total + col-refunded + col-refunded + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml new file mode 100644 index 0000000000000..bec57dfd1314d --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml index 81e89315e901c..d8a2ad6c930c3 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml @@ -62,26 +62,26 @@ Unhold sales/order/massUnhold - + Print Invoices - sales/order/pdfinvoices + sales/order/massPrintInvoices - + Print Packing Slips - sales/order/pdfshipments + sales/order/massPrintShipments - + Print Credit Memos - sales/order/pdfcreditmemos + sales/order/massPrintCreditMemos - - Print All - sales/order/pdfdocs - - + Print Shipping Labels adminhtml/order_shipment/massPrintShippingLabel + + Print All + sales/order/massPrintAll + @@ -89,11 +89,11 @@ - sales/*/exportCsv + */*/exportCsv CSV - sales/*/exportExcel + */*/exportExcel Excel XML @@ -103,7 +103,7 @@ sales_order_grid - Magento\Sales\Model\Order\Grid\Row\UrlGenerator + Magento\Sales\Model\Grid\Row\UrlGenerator sales/order/view getId @@ -188,7 +188,6 @@ status Status options - order_currency_code status col-status @@ -203,7 +202,6 @@ getId 0 0 - stores 1 diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml new file mode 100644 index 0000000000000..05b762645e820 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml @@ -0,0 +1,109 @@ + + + + + + + sales_order_invoice_grid + + Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection + Magento\Sales\Model\Order\InvoicesUpdater + + true + created_at + DESC + 1 + + 1 + + + + + sales_order_invoice_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/order_invoice/view + + getId + + + + + + Invoice + text + increment_id + real_invoice_id + col-invoice-number + col-invoice-number + + + + + billing_name + Bill-to Name + billing_name + col-bill-to-name + col-bill-to-name + + + + + Invoice Date + datetime + created_at + created_at + col-period + col-period + + + + + state + Status + options + state + + col-status + col-status + + + + + base_grand_total + Amount + currency + invoice_currency_code + 1 + base_grand_total + col-qty + col-qty + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml new file mode 100644 index 0000000000000..ccf0329dcf717 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml new file mode 100644 index 0000000000000..3b8e7e316f1d2 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml @@ -0,0 +1,96 @@ + + + + + + + sales_order_shipment_grid + + Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection + Magento\Sales\Model\Order\ShipmentsUpdater + + true + created_at + DESC + 1 + + 1 + + + + + sales_order_shipment_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/order_shipment/view + + getId + + + + + + Shipment + text + increment_id + real_shipment_id + col-shipment-number + col-shipment-number + + + + + shipping_name + Ship-to Name + shipping_name + col-ship-to-name + col-ship-to-name + + + + + Ship Date + datetime + created_at + created_at + col-period + col-period + + + + + total_qty + Total Quantity + number + total_qty + col-qty + col-qty + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml new file mode 100644 index 0000000000000..6ef7b0b48ecb4 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml index f575e6b99156f..520ab7d7c0658 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml @@ -24,5 +24,6 @@ */ --> - + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml new file mode 100644 index 0000000000000..e832793d644ab --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml @@ -0,0 +1,121 @@ + + + + + + + sales_transactions_grid + + Magento\Sales\Model\Resource\Order\Transaction\Grid\Collection + Magento\Sales\Model\Order\TransactionsUpdater + + Magento\Sales\Model\Resource\Order\Transaction\Grid\Collection + true + created_at + DESC + 1 + + 1 + + + + + sales_transactions_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/transactions/view + + getId + + + + + + ID + number + transaction_id + transaction_id + col-id + col-id + + + + + Transaction ID + text + txn_id + txn_id + col-transaction-id + col-transaction-id + + + + + Parent Transaction ID + text + parent_txn_id + parent_txn_id + col-parent-transaction-id + col-parent-transaction-id + + + + + method + Payment Method + options + method + + + col-method + col-method + + + + + Transaction Type + options + txn_type + txn_type + + col-transaction-type + col-transaction-type + + + + + Created + datetime + created_at + created_at + col-period + col-period + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml index b32df85183b4b..fb5b6378b2900 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml @@ -39,6 +39,10 @@ + + + + @@ -63,25 +67,29 @@ order_info order_tab_info + order_invoices - Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices + sales_order_invoice.grid.container + order_creditmemos - Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos + sales_order_creditmemo.grid.container + order_shipments - Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments + sales_order_shipment.grid.container order_history Magento\Sales\Block\Adminhtml\Order\View\Tab\History + order_transactions - Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions + sales_order_transactions.grid.container diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml new file mode 100644 index 0000000000000..f77ae19aa69a0 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml new file mode 100644 index 0000000000000..f77ae19aa69a0 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid.xml new file mode 100644 index 0000000000000..f5514b87121cd --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid.xml @@ -0,0 +1,30 @@ + + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml new file mode 100644 index 0000000000000..9bcb5d5e930f7 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml @@ -0,0 +1,168 @@ + + + + + + + sales_shipment_grid + Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection + true + created_at + DESC + 1 + + 1 + + + + + entity_id + shipment_ids + 0 + + Magento\Sales\Model\Grid\Massaction\ItemsUpdater + + Print Packing Slips + sales/shipment/massPrintShipments + + + Print Shipping Labels + adminhtml/order_shipment/massPrintShippingLabel + + + + + + + + + */*/exportCsv + CSV + + + */*/exportExcel + Excel XML + + + + + + + sales_shipment_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/shipment/view + + getId + + + + + + Shipment + text + increment_id + real_shipment_id + col-shipment-number + col-shipment-number + + + + + Ship Date + datetime + created_at + created_at + col-period + col-period + + + + + Order + text + order_increment_id + order_increment_id + col-order-number + col-order-number + + + + + Order Date + datetime + order_created_at + order_created_at + col-period + col-period + + + + + shipping_name + Ship-to Name + billing_name + col-ship-to-name + col-ship-to-name + + + + + total_qty + Total Quantity + number + total_qty + col-qty + col-qty + + + + + + action + Action + action + getId + 0 + 0 + 1 + + + View + + sales/shipment/view + + shipment_id + + + col-actions + col-actions + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml new file mode 100644 index 0000000000000..1380180f1f97b --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_exportcsv.xml new file mode 100644 index 0000000000000..a7f8244e2121b --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_exportcsv.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_exportexcel.xml new file mode 100644 index 0000000000000..a7f8244e2121b --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_exportexcel.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml index f575e6b99156f..be4114526f05d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml @@ -24,5 +24,7 @@ */ --> - + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml new file mode 100644 index 0000000000000..b915e274f1dc9 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml @@ -0,0 +1,164 @@ + + + + + + + sales_transactions_grid + Magento\Sales\Model\Resource\Order\Transaction\Grid\Collection + true + created_at + DESC + 1 + + 1 + + + + + + + */*/exportCsv + CSV + + + */*/exportExcel + Excel XML + + + + + + + sales_transactions_grid + + Magento\Sales\Model\Grid\Row\UrlGenerator + sales/transactions/view + + getId + + + + + + ID + number + transaction_id + transaction_id + col-id + col-id + + + + + Order ID + text + increment_id + increment_id + col-order-id + col-order-id + + + + + Transaction ID + text + txn_id + txn_id + col-transaction-id + col-transaction-id + + + + + Parent Transaction ID + text + parent_txn_id + parent_txn_id + col-parent-transaction-id + col-parent-transaction-id + + + + + method + Payment Method + options + method + + + col-method + col-method + + + + + Transaction Type + options + txn_type + txn_type + + col-transaction-type + col-transaction-type + + + + + Created + datetime + created_at + created_at + col-period + col-period + + + + + + action + Action + action + getId + 0 + 0 + 1 + + + View + + sales/transactions/view + + transactions_id + + + col-actions + col-actions + + + + + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml index 3afd37cd73ade..c2ea63f53f217 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml @@ -24,6 +24,7 @@ */ --> + diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php index 3ea830b4f8e44..8460e6a6c5834 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php @@ -660,7 +660,7 @@ public function massPrintShippingLabelAction() $this->_redirect('sales/order/index'); } else { $this->messageManager->addError(__('There are no shipping labels related to selected shipments.')); - $this->_redirect('adminhtml/order_shipment/index'); + $this->_redirect('sales/shipment/index'); } } diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php index 91bdc425faf8d..1e06d8956f05f 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php @@ -77,9 +77,7 @@ protected function _getCurrentTheme() } /** - * Return Tab title - * - * @return string + * {@inheritdoc} */ public function getTabTitle() { @@ -87,9 +85,7 @@ public function getTabTitle() } /** - * Can show tab in tabs - * - * @return boolean + * {@inheritdoc} */ public function canShowTab() { @@ -97,9 +93,7 @@ public function canShowTab() } /** - * Tab is hidden - * - * @return boolean + * {@inheritdoc} */ public function isHidden() { diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php index 3e25716156469..6c7b636b5821a 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php @@ -288,9 +288,7 @@ protected function _getAdditionalElementTypes() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php index 40f967ce6e3a7..f373ca260e5d7 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Js.php @@ -102,9 +102,7 @@ protected function _getAdditionalElementTypes() } /** - * Return Tab label - * - * @return string + * {@inheritdoc} */ public function getTabLabel() { diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php index cc8cb9c625f06..0e0fea64d4338 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Tab; + /** * Widget Instance Properties tab block * @@ -31,8 +33,6 @@ * @package Magento_Widget * @author Magento Core Team */ -namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Tab; - class Properties extends \Magento\Widget\Block\Adminhtml\Widget\Options implements \Magento\Backend\Block\Widget\Tab\TabInterface @@ -58,7 +58,7 @@ public function getTabTitle() } /** - * Returns status flag about this tab can be showen or not + * Returns status flag about this tab can be shown or not * * @return true */