Mage_Adminhtml_Block_Sales_Creditmemo_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Creditmemo_Grid:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getRowUrl ($row)
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()
 _prepareMassaction ()


Detailed Description

Adminhtml sales orders grid

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 35 of file Grid.php.

00036     {
00037         parent::__construct();
00038         $this->setId('sales_creditmemo_grid');
00039         $this->setDefaultSort('created_at');
00040         $this->setDefaultDir('DESC');
00041     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 43 of file Grid.php.

00044     {
00045         //TODO: add full name logic
00046         $collection = Mage::getResourceModel('sales/order_Creditmemo_collection')
00047             ->addAttributeToSelect('increment_id')
00048             ->addAttributeToSelect('created_at')
00049             ->addAttributeToSelect('order_currency_code')
00050             ->addAttributeToSelect('state')
00051             ->addAttributeToSelect('grand_total')
00052             ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')
00053             ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')
00054             ->joinAttribute('order_increment_id', 'order/increment_id', 'order_id', null, 'left')
00055             ->joinAttribute('order_created_at', 'order/created_at', 'order_id', null, 'left')
00056         ;
00057         $this->setCollection($collection);
00058         return parent::_prepareCollection();
00059     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 61 of file Grid.php.

00062     {
00063         $this->addColumn('increment_id', array(
00064             'header'    => Mage::helper('sales')->__('Credit Memo #'),
00065             'index'     => 'increment_id',
00066             'type'      => 'number',
00067         ));
00068 
00069         $this->addColumn('created_at', array(
00070             'header'    => Mage::helper('sales')->__('Created At'),
00071             'index'     => 'created_at',
00072             'type'      => 'datetime',
00073         ));
00074 
00075         $this->addColumn('order_increment_id', array(
00076             'header'    => Mage::helper('sales')->__('Order #'),
00077             'index'     => 'order_increment_id',
00078             'type'      => 'number',
00079         ));
00080 
00081         $this->addColumn('order_created_at', array(
00082             'header'    => Mage::helper('sales')->__('Order Date'),
00083             'index'     => 'order_created_at',
00084             'type'      => 'datetime',
00085         ));
00086 
00087         $this->addColumn('billing_firstname', array(
00088             'header' => Mage::helper('sales')->__('Bill to First name'),
00089             'index' => 'billing_firstname',
00090         ));
00091 
00092         $this->addColumn('billing_lastname', array(
00093             'header' => Mage::helper('sales')->__('Bill to Last name'),
00094             'index' => 'billing_lastname',
00095         ));
00096 
00097         $this->addColumn('state', array(
00098             'header'    => Mage::helper('sales')->__('Status'),
00099             'index'     => 'state',
00100             'type'      => 'options',
00101             'options'   => Mage::getModel('sales/order_creditmemo')->getStates(),
00102         ));
00103 
00104         $this->addColumn('grand_total', array(
00105             'header'    => Mage::helper('customer')->__('Refunded'),
00106             'index'     => 'grand_total',
00107             'type'      => 'currency',
00108             'align'     => 'right',
00109             'currency'  => 'order_currency_code',
00110         ));
00111 
00112         $this->addColumn('action',
00113             array(
00114                 'header'    => Mage::helper('sales')->__('Action'),
00115                 'width'     => '50px',
00116                 'type'      => 'action',
00117                 'getter'     => 'getId',
00118                 'actions'   => array(
00119                     array(
00120                         'caption' => Mage::helper('sales')->__('View'),
00121                         'url'     => array('base'=>'*/*/view'),
00122                         'field'   => 'creditmemo_id'
00123                     )
00124                 ),
00125                 'filter'    => false,
00126                 'sortable'  => false,
00127                 'is_system' => true
00128         ));
00129 
00130         return parent::_prepareColumns();
00131     }

_prepareMassaction (  )  [protected]

Prepare grid massaction actions

Returns:
Mage_Adminhtml_Block_Widget_Grid

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 133 of file Grid.php.

00134     {
00135         $this->setMassactionIdField('entity_id');
00136         $this->getMassactionBlock()->setFormFieldName('creditmemo_ids');
00137 
00138         $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
00139              'label'=> Mage::helper('sales')->__('PDF Credit Memos'),
00140              'url'  => $this->getUrl('*/*/pdfcreditmemos'),
00141         ));
00142 
00143         return $this;
00144     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 155 of file Grid.php.

00156     {
00157         return $this->getUrl('*/*/*', array('_current' => true));
00158     }

getRowUrl ( row  ) 

Definition at line 146 of file Grid.php.

00147     {
00148         return $this->getUrl('*/*/view',
00149             array(
00150                 'creditmemo_id'=> $row->getId(),
00151             )
00152         );
00153     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:58 2009 for Magento by  doxygen 1.5.8