Example #1
0
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     $this->removeColumn('action');
     $this->_exportTypes = array();
     return $this;
 }
 protected function _prepareColumns()
 {
     $this->addColumn('entity_id', array('header' => Mage::helper('customer')->__('ID'), 'width' => '50px', 'index' => 'entity_id', 'type' => 'number'));
     /*$this->addColumn('firstname', array(
           'header'    => Mage::helper('customer')->__('First Name'),
           'index'     => 'firstname'
       ));
       $this->addColumn('lastname', array(
           'header'    => Mage::helper('customer')->__('Last Name'),
           'index'     => 'lastname'
       ));*/
     $this->addColumn('name', array('header' => Mage::helper('customer')->__('Name'), 'index' => 'name'));
     $this->addColumn('email', array('header' => Mage::helper('customer')->__('Email'), 'width' => '150', 'index' => 'email'));
     $groups = Mage::getResourceModel('customer/group_collection')->addFieldToFilter('customer_group_id', array('gt' => 0))->load()->toOptionHash();
     $this->addColumn('group', array('header' => Mage::helper('customer')->__('Group'), 'width' => '100', 'index' => 'group_id', 'type' => 'options', 'options' => $groups));
     $this->addColumn('Telephone', array('header' => Mage::helper('customer')->__('Telephone'), 'width' => '100', 'index' => 'billing_telephone'));
     $this->addColumn('billing_postcode', array('header' => Mage::helper('customer')->__('ZIP'), 'width' => '90', 'index' => 'billing_postcode'));
     $this->addColumn('billing_country_id', array('header' => Mage::helper('customer')->__('Country'), 'width' => '100', 'type' => 'country', 'index' => 'billing_country_id'));
     $this->addColumn('billing_region', array('header' => Mage::helper('customer')->__('State/Province'), 'width' => '100', 'index' => 'billing_region'));
     $this->addColumn('customer_since', array('header' => Mage::helper('customer')->__('Customer Since'), 'type' => 'datetime', 'align' => 'center', 'index' => 'created_at', 'gmtoffset' => true));
     if (!Mage::app()->isSingleStoreMode()) {
         $this->addColumn('website_id', array('header' => Mage::helper('customer')->__('Website'), 'align' => 'center', 'width' => '80px', 'type' => 'options', 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true), 'index' => 'website_id'));
     }
     // This is the only thing that differs from parent::
     $this->addColumn('login', array('header' => Mage::helper('customer')->__('Login as customer'), 'width' => '100', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => Mage::helper('customer')->__('Login'), 'url' => array('base' => '*/*/login'), 'field' => 'id')), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => false));
     $this->addColumn('action', array('header' => Mage::helper('customer')->__('Action'), 'width' => '100', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => Mage::helper('customer')->__('Edit'), 'url' => array('base' => '*/*/edit'), 'field' => 'id')), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true));
     $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
     $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('XML'));
     return parent::_prepareColumns();
 }
Example #3
0
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     $this->addColumn('customerlogin', array('header' => $this->__('Front End'), 'align' => 'center', 'index' => 'getId', 'width' => '50px', 'filter' => false, 'sortable' => false, 'renderer' => 'Mycloset_Membership_Block_Adminhtml_Customer_Login'));
     $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
     $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('Excel XML'));
     return $this;
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     $this->setId('customerGrid');
     $this->setUseAjax(true);
     $this->setDefaultSort('entity_id');
     $this->setSaveParametersInSession(true);
 }
Example #5
0
 protected function _prepareColumns()
 {
     $this->addColumnAfter('Mobile', array('header' => Mage::helper('customer')->__('Mobile'), 'width' => '100', 'index' => 'mobile'), 'group');
     $this->addColumnAfter('store_id', array('header' => Mage::helper('customer')->__('Store'), 'align' => 'center', 'width' => '80px', 'type' => 'options', 'options' => Mage::getSingleton('adminhtml/system_store')->getStoreOptionHash(true), 'index' => 'store_id'), 'billing_region');
     parent::_prepareColumns();
     unset($this->_columns['Telephone']);
     unset($this->_columns['website_id']);
     unset($this->_columns['billing_country_id']);
     return $this;
 }
Example #6
0
 protected function _prepareMassaction()
 {
     // Do not allow vendor to change customer information
     if ($vendor = Mage::helper('smvendors')->getVendorLogin()) {
         $this->setMassactionIdField('entity_id');
         $this->getMassactionBlock()->setFormFieldName('customer');
         $groups = Mage::getSingleton('eav/config')->getAttribute('customer', 'vendor_customer_group')->getSource()->getAllOptions();
         array_unshift($groups, array('label' => '', 'value' => ''));
         $this->getMassactionBlock()->addItem('assign_group', array('label' => Mage::helper('customer')->__('Assign a Customer Group'), 'url' => $this->getUrl('adminhtml/vendors_customer/massAssignVendorGroup'), 'additional' => array('visibility' => array('name' => 'vendor_group', 'type' => 'select', 'class' => 'required-entry', 'label' => Mage::helper('customer')->__('Group'), 'values' => $groups))));
         return $this;
     } else {
         return parent::_prepareMassaction();
     }
 }
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     $role = Mage::getSingleton('aitpermissions/role');
     if ($role->isPermissionsEnabled()) {
         if (!Mage::helper('aitpermissions')->isShowingAllCustomers() && isset($this->_columns['website_id'])) {
             unset($this->_columns['website_id']);
             $allowedWebsiteIds = $role->getAllowedWebsiteIds();
             if (count($allowedWebsiteIds) > 1) {
                 $websiteFilter = array();
                 foreach ($allowedWebsiteIds as $allowedWebsiteId) {
                     $website = Mage::getModel('core/website')->load($allowedWebsiteId);
                     $websiteFilter[$allowedWebsiteId] = $website->getData('name');
                 }
                 $this->addColumn('website_id', array('header' => Mage::helper('customer')->__('Website'), 'align' => 'center', 'width' => '80px', 'type' => 'options', 'options' => $websiteFilter, 'index' => 'website_id'));
             }
         }
     }
     return $this;
 }
Example #8
0
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     // will backup action column
     $actionColumn = $this->_columns['action'];
     unset($this->_columns['action']);
     foreach ($this->_attributeCollection as $attribute) {
         if ($inputType = $attribute->getFrontend()->getInputType()) {
             switch ($inputType) {
                 case 'date':
                     $this->addColumn($attribute->getAttributeCode(), array('header' => __($attribute->getFrontend()->getLabel()), 'type' => 'date', 'align' => 'center', 'index' => $attribute->getAttributeCode(), 'gmtoffset' => true));
                     break;
                 case 'text':
                 case 'textarea':
                     $this->addColumn($attribute->getAttributeCode(), array('header' => __($attribute->getFrontend()->getLabel()), 'index' => $attribute->getAttributeCode(), 'filter' => 'adminhtml/widget_grid_column_filter_text', 'sortable' => true));
                     break;
                 case 'select':
                     $options = array();
                     foreach ($attribute->getSource()->getAllOptions(false, true) as $option) {
                         $options[$option['value']] = $option['label'];
                     }
                     $this->addColumn($attribute->getAttributeCode(), array('header' => __($attribute->getFrontend()->getLabel()), 'index' => $attribute->getAttributeCode(), 'type' => 'options', 'options' => $options));
                     break;
                 case 'multiselect':
                     $options = array();
                     foreach ($attribute->getSource()->getAllOptions(false, true) as $option) {
                         $options[$option['value']] = $option['label'];
                     }
                     $this->addColumn($attribute->getAttributeCode(), array('header' => __($attribute->getFrontend()->getLabel()), 'index' => $attribute->getAttributeCode(), 'type' => 'options', 'options' => $options, 'renderer' => 'ajaxlogin/adminhtml_renderer_multiselect', 'filter' => 'ajaxlogin/adminhtml_filter_multiselect'));
                     break;
                 case 'image':
                     $this->addColumn($attribute->getAttributeCode(), array('header' => __($attribute->getFrontend()->getLabel()), 'align' => 'center', 'index' => $attribute->getAttributeCode(), 'type' => 'text', 'renderer' => 'ajaxlogin/adminhtml_renderer_file'));
                     break;
             }
         }
     }
     // restoring action column
     $this->_columns[] = $actionColumn;
     return $this;
 }
Example #9
0
 protected function _prepareMassaction()
 {
     // Let the base class do its work
     parent::_prepareMassaction();
     $this->getMassactionBlock()->addItem('amlist', array('label' => $this->__('Email to Customers'), 'url' => $this->getUrl('amemail/adminhtml_index/index', array())));
 }
 /**
  * Add new action to customers grid.
  * @param Mage_Adminhtml_Block_Customer_Grid $block
  */
 private function doCustomerGridActionAdd(Mage_Adminhtml_Block_Customer_Grid $block)
 {
     /** validate availability & permissions */
     if (Praxigento_LoginAs_Config::cfgUiCustomersGridActionEnabled() && Praxigento_LoginAs_Config::canAccessLoginAs()) {
         /** add action link to grid */
         /** @var $cols  array */
         $cols = $block->getColumns();
         /** @var $colAction Mage_Adminhtml_Block_Widget_Grid_Column */
         $colAction = $cols['action'];
         $actions = $colAction->getData('actions');
         if (is_array($actions)) {
             /** add new action */
             $actions[] = array('caption' => Praxigento_LoginAs_Config::helper()->__('Login as...'), 'url' => array('base' => Praxigento_LoginAs_Config::XMLCFG_ROUTER_ADMIN . Praxigento_LoginAs_Config::ROUTE_REDIRECT), 'field' => Praxigento_LoginAs_Config::REQ_PARAM_LAS_ID, 'target' => '_blank');
             $colAction->setData('actions', $actions);
             /** reset default renderer */
             $colAction->setData('renderer', 'adminhtml/customer_grid_renderer_multiaction');
         }
     }
 }
Example #11
0
 protected function _prepareColumns()
 {
     $this->addColumnAfter('is_vendor', array('header' => Mage::helper('customer')->__('Is Vendor'), 'index' => 'customer_id', 'renderer' => 'Cminds_Marketplace_Block_Adminhtml_Customer_Grid_Renderer_Vendor', 'type' => 'options', 'options' => Mage::getSingleton('marketplace/source_massaction')->toFilterOptions(), 'filter_condition_callback' => array($this, '_supplierFilter')), 'email');
     return parent::_prepareColumns();
 }
 /**
  * Add the activation status column to the customer grid block.
  *
  * This is used from different events when displaying the block as well as
  * during exporting the grid to CSV or XML.
  *
  * @param Mage_Adminhtml_Block_Customer_Grid $block
  */
 protected function _addActivationStatusColumn(Mage_Adminhtml_Block_Customer_Grid $block)
 {
     /** @var $helper Netzarbeiter_CustomerActivation_Helper_Data */
     $helper = Mage::helper('customeractivation');
     // Add the attribute as a column to the grid
     $block->addColumnAfter('customer_activated', array('header' => $helper->__('Customer Activated'), 'align' => 'center', 'width' => '80px', 'type' => 'options', 'options' => array('0' => $helper->__('No'), '1' => $helper->__('Yes')), 'default' => '0', 'index' => 'customer_activated', 'renderer' => 'customeractivation/adminhtml_widget_grid_column_renderer_boolean'), 'customer_since');
     // Set the new columns order.. otherwise our column would be the last one
     $block->sortColumnsByOrder();
 }