getUrl('stemcell_sales/*/review'); } /** * Constructor * * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function _construct() { $this->_objectId = 'order_id'; $this->_controller = 'adminhtml_order'; $this->_mode = 'view'; Container::_construct(); $this->removeButton('delete'); $this->removeButton('reset'); $this->removeButton('save'); $this->setId('sales_order_view'); $order = $this->getOrder(); if (!$order) { return; } if ($this->_isAllowedAction('Magento_Sales::cancel') && $order->canCancel() && $order->getState() != Order::STATE_PROCESSING ) { $this->addButton( 'order_cancel', [ 'label' => __('Cancel'), 'class' => 'cancel', 'id' => 'order-view-cancel-button', 'data_attribute' => [ 'url' => $this->getCancelUrl() ] ] ); $this->addButton( 'order_reject', [ 'label' => __('驳回'), 'class' => 'order_reject', 'onclick' => 'orderReject()' ] ); } // if ($this->_isAllowedAction('Magento_Sales::email') && !$order->isCanceled()) { // $message = __('Are you sure you want to send an order email to customer?'); // $this->addButton( // 'send_notification', // [ // 'label' => __('Send Email'), // 'class' => 'send-email', // 'onclick' => "confirmSetLocation('{$message}', '{$this->getEmailUrl()}')" // ] // ); // } if ($this->_isAllowedAction( 'Magento_Sales::ship' ) && $order->canShip() && !$order->getForcedShipmentWithInvoice() ) { $this->addButton( 'order_ship', [ 'label' => __('Ship'), 'onclick' => 'setLocation(\'' . $this->getShipUrl() . '\')', 'class' => 'ship' ] ); if ($order->getState() != Order::STATE_PROCESSING) { $this->addButton( 'order_review', [ 'label' => __('审核'), 'class' => 'order_review', 'onclick' => 'setLocation(\'' . $this->getReviewUrl() . '\')', ] ); } } if ($this->_isAllowedAction( 'Magento_Sales::reorder' ) && $this->_reorderHelper->isAllowed( $order->getStore() ) && $order->canReorderIgnoreSalable() ) { $this->addButton( 'order_reorder', [ 'label' => __('Reorder'), 'onclick' => 'setLocation(\'' . $this->getReorderUrl() . '\')', 'class' => 'reorder' ] ); } $this->removeButton('order_edit'); $this->removeButton('order_invoice'); $this->removeButton('order_hold'); $this->removeButton('send_notification'); if ($order->getState() == Order::STATE_PROCESSING) { $this->removeButton('order_cancel'); } } }