* */ class Webshopapps_Wsacommon_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid { protected $_importTypes = array(); protected function _prepareMassaction() { parent::_prepareMassaction(); if (Mage::helper('wsacommon')->isModuleEnabled('Webshopapps_Importshipments', 'shipping/importshipments/active')) { $this->getMassactionBlock()->addItem('importshipments', array( 'label'=> Mage::helper('sales')->__('Create import template'), 'url' => $this->getUrl('*/sales_order_export/csvtemplateexport'), )); } if (Mage::helper('wsacommon')->isModuleEnabled('Webshopapps_Oneclickcomplete', 'sales/oneclickcomplete/active')) { $this->getMassactionBlock()->addItem('oneclickcomplete', array( 'label'=> Mage::helper('sales')->__('Create Shipment and Complete Orders'), 'url' => $this->getUrl('*/sales_order_complete/pdfcomplete'), )); } if (Mage::helper('wsacommon')->isModuleEnabled('Webshopapps_Ordermanager', 'order_export/export_orders/active')) { $this->getMassactionBlock()->addItem('ordermanager', array( 'label'=> Mage::helper('sales')->__('Export orders'), 'url' => $this->getUrl('*/sales_order_export/csvexport'), )); if (Mage::helper('wsacommon')->getNewVersion() == 11) { $this->getMassactionBlock()->setUseSelectAll(true); } } } public function getButtonHtml($label, $onclick, $class='', $id=null) { return $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( 'label'=> $label, 'onclick'=> $onclick, 'class'=> $class, 'type'=> 'button', 'id'=> $id, )) ->toHtml(); } public function getImportTypes() { return empty($this->_importTypes) ? false : $this->_importTypes; } public function addImportType($label) { $this->_importTypes[] = new Varien_Object( array( 'label' => $label ) ); return $this; } protected function _prepareColumns() { $this->addImportType('orders'); parent::_prepareColumns(); if (Mage::helper('wsacommon')->isModuleEnabled('Webshopapps_Ordermanager', 'order_export/export_orders/active') && Mage::helper('wsacommon')->getNewVersion() >= 8 ) { $this->addColumn('exported', array( 'header' => Mage::helper('sales')->__('Exported'), 'index' => 'exported', 'type' => 'options', 'width' => '10px', 'options' => Mage::getSingleton('ordermanager/options_exported')->toOptionArray(), )); } return; } protected function _prepareCollection() { if (Mage::helper('wsacommon')->getNewVersion() >= 8 ) { $collectionClass =$this->_getCollectionClass(); $collection = Mage::getResourceModel($collectionClass); //added this if (Mage::helper('wsacommon')->isModuleEnabled('Webshopapps_Ordermanager', 'order_export/export_orders/active')) { $collection->join('ordermanager/exported', 'entity_id=order_id', 'exported'); } $this->setCollection($collection); } return parent::_prepareCollection(); } } ?>