Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock:

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 ()
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 35 of file Stock.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 37 of file Stock.php.

00038     {
00039         parent::__construct();
00040 
00041         $this->setId('alertStock');
00042         $this->setDefaultSort('add_date');
00043         $this->setDefaultSort('desc');
00044         $this->setUseAjax(true);
00045         $this->setFilterVisibility(false);
00046         $this->setEmptyText(Mage::helper('catalog')->__('There are no customers for this alert'));
00047     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 49 of file Stock.php.

00050     {
00051         $productId = $this->getRequest()->getParam('id');
00052         $websiteId = 0;
00053         if ($store = $this->getRequest()->getParam('store')) {
00054             $websiteId = Mage::app()->getStore($store)->getWebsiteId();
00055         }
00056         $collection = Mage::getModel('productalert/stock')
00057             ->getCustomerCollection()
00058             ->join($productId, $websiteId);
00059         $this->setCollection($collection);
00060         return parent::_prepareCollection();
00061     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 63 of file Stock.php.

00064     {
00065         $this->addColumn('firstname', array(
00066             'header'    => Mage::helper('catalog')->__('First Name'),
00067             'index'     => 'firstname',
00068         ));
00069 
00070         $this->addColumn('lastname', array(
00071             'header'    => Mage::helper('catalog')->__('Last Name'),
00072             'index'     => 'lastname',
00073         ));
00074 
00075         $this->addColumn('email', array(
00076             'header'    => Mage::helper('catalog')->__('Email'),
00077             'index'     => 'email',
00078         ));
00079 
00080         $this->addColumn('add_date', array(
00081             'header'    => Mage::helper('catalog')->__('Date Subscribed'),
00082             'index'     => 'add_date',
00083             'type'      => 'date'
00084         ));
00085 
00086         $this->addColumn('send_date', array(
00087             'header'    => Mage::helper('catalog')->__('Last Notification'),
00088             'index'     => 'last_send_date',
00089             'type'      => 'date'
00090         ));
00091 
00092         $this->addColumn('send_count', array(
00093             'header'    => Mage::helper('catalog')->__('Send Count'),
00094             'index'     => 'send_count',
00095         ));
00096 
00097         return parent::_prepareColumns();
00098     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 100 of file Stock.php.

00101     {
00102         $productId = $this->getRequest()->getParam('id');
00103         $storeId   = $this->getRequest()->getParam('store', 0);
00104         if ($storeId) {
00105             $storeId = Mage::app()->getStore($storeId)->getId();
00106         }
00107         return $this->getUrl('*/catalog_product/alertsStockGrid', array(
00108             'id'    => $productId,
00109             'store' => $storeId
00110         ));
00111     }


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

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