adminhtmlのグリッドでモデレートできる注文を一覧表示するモジュールを作成しました。
グリッドビューから詳細ビューにorderIdを渡す必要がありますが、その方法がわかりません。
これが私のGrid.php
{
public function __construct() {
parent::__construct();
$this->setId('moderationGrid');
// This is the primary key of the database
$this->setDefaultSort('increment_id');
$this->setDefaultDir('ASC');
$this->setSaveParametersInSession(true);
}
protected function _prepareCollection() {
$collection = Mage::getModel('sales/order')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns() {
$this->addColumn('increment_id', array(
'header' => Mage::helper('sales')->__('Order Number'),
'align' =>'center',
'index' => 'increment_id',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Purchase Date'),
'align' => 'center',
'index' => 'created_at',
'type' => 'datetime',
));
$this->addColumn('action', array(
'header' => Mage::helper('moderation')->__('Action'),
'align' => 'center',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('sales')->__('Review'),
'url' => array('base'=>'*/adminhtml_moderation/view'),
'field' => 'increment_id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
return parent::_prepareColumns();
}
そして、これが私の見解ですForm.php
class Moderation_Block_Adminhtml_Moderation_View_Form extends Mage_Adminhtml_Block_Widget_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('moderation/form.phtml');
}
public function getOrder()
{
$moderationId = $this->getRequest()->getParam('increment_id');
$order = Mage::getModel('sales/order')->load();
}
}