예제 #1
0
파일: Grid.php 프로젝트: AleksNesh/pandora
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     $this->removeColumn('action');
     $this->_exportTypes = array();
     return $this;
 }
예제 #2
0
 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();
 }
예제 #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;
 }
예제 #4
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;
 }
 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;
 }
예제 #6
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;
 }
예제 #7
0
 protected function _prepareColumns()
 {
     parent::_prepareColumns();
     if ($vendor = Mage::helper('smvendors')->getVendorLogin()) {
         $this->removeColumn('action');
     }
     $this->removeColumn('entity_id');
     $this->removeColumn('billing_country_id');
     $this->removeColumn('group');
     $this->addColumn('group', array('header' => Mage::helper('customer')->__('Group'), 'width' => '100', 'renderer' => 'smvendors/override_adminhtml_customer_grid_column_renderer_customGroup', 'index' => 'vendor_customer_group'));
     $this->addColumn('billing_company', array('header' => Mage::helper('customer')->__('Company Name'), 'width' => '100', 'index' => 'billing_company'));
     $this->addColumn('billing_adress', array('header' => Mage::helper('customer')->__('Address'), 'width' => '100', 'index' => 'billing_address'));
     $nameColumn = $this->getColumn('name');
     $nameColumn->setHeader('Contact Person Name');
     $groups = Mage::getResourceModel('customer/group_collection')->addFieldToFilter('customer_group_id', array('gt' => 0))->addFieldToFilter('vendor_id', 0)->load()->toOptionHash();
     $groupColumn = $this->getColumn('group');
     $groupColumn->setData('options', $groups);
     Mage::dispatchEvent('smvendors_customer_grid_prepare_columns', array('customer_grid' => $this));
     $this->addColumnsOrder('action', 'buyer_prefix');
     $this->addColumnsOrder('customer_since', 'buyer_prefix');
     $this->sortColumnsByOrder();
     return $this;
 }
예제 #8
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();
 }