Esempio n. 1
0
 /**
  * @return Xcom_Mapping_Block_Adminhtml_Attribute_Set_Grid
  */
 protected function _afterLoadCollection()
 {
     /** @var $validator Xcom_Mapping_Model_Validator */
     $validator = Mage::getSingleton('xcom_mapping/validator');
     foreach ($this->getCollection() as $item) {
         $id = $item->getMappingProductTypeId();
         $attributeSetId = $item->getAttributeSetId();
         if (!$validator->validateIsRequiredAttributeHasMappedValue($id, null, $attributeSetId)) {
             $item->setProductTypeName($item->getProductTypeName() . ' (' . $this->__('Incomplete') . ')');
         }
     }
     return parent::_afterLoadCollection();
 }
 /**
  * After load collection processing
  *
  * @return Enterprise_Reward_Block_Adminhtml_Customer_Edit_Tab_Reward_Management_Balance_Grid
  */
 protected function _afterLoadCollection()
 {
     parent::_afterLoadCollection();
     /* @var $item Enterprise_Reward_Model_Reward */
     foreach ($this->getCollection() as $item) {
         $website = $item->getData('website_id');
         if ($website !== null) {
             $minBalance = Mage::helper('enterprise_reward')->getGeneralConfig('min_points_balance', (int) $website);
             $maxBalance = Mage::helper('enterprise_reward')->getGeneralConfig('max_points_balance', (int) $website);
             $item->addData(array('min_points_balance' => (int) $minBalance, 'max_points_balance' => !(int) $maxBalance ? Mage::helper('adminhtml')->__('Unlimited') : $maxBalance));
         } else {
             $this->_customerHasOrphanPoints = true;
             $item->addData(array('min_points_balance' => Mage::helper('adminhtml')->__('No Data'), 'max_points_balance' => Mage::helper('adminhtml')->__('No Data')));
         }
         $item->setCustomer($this->getCustomer());
     }
     return $this;
 }
Esempio n. 3
0
 /**
  * after collection load
  * @access protected
  * @return Ultimate_ordersBatches_Block_Adminhtml_Batche_Grid
  * @author Ultimate Module Creator
  */
 protected function _afterLoadCollection()
 {
     $this->getCollection()->walk('afterLoad');
     parent::_afterLoadCollection();
 }
Esempio n. 4
0
 protected function _afterLoadCollection()
 {
     return parent::_afterLoadCollection();
 }
Esempio n. 5
0
 /**
  * Checking the data contains the same value of data after collection
  *
  * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid
  */
 protected function _afterLoadCollection()
 {
     parent::_afterLoadCollection();
     $attributeCodes = $this->_getConfigAttributeCodes();
     if (!$attributeCodes) {
         return $this;
     }
     $disableMultiSelect = false;
     $ids = array();
     foreach ($this->_collection as $item) {
         $ids[] = $item->getId();
         $needleAttributeValues = $this->_retrieveRowData($item);
         foreach ($this->_collection as $item2) {
             // Skip the data if already checked
             if (in_array($item2->getId(), $ids)) {
                 continue;
             }
             $attributeValues = $this->_retrieveRowData($item2);
             $disableMultiSelect = $needleAttributeValues == $attributeValues;
             if ($disableMultiSelect) {
                 break;
             }
         }
         if ($disableMultiSelect) {
             break;
         }
     }
     // Disable multiselect column
     if ($disableMultiSelect) {
         $selectAll = $this->getColumn('in_products');
         if ($selectAll) {
             $selectAll->setDisabled(true);
         }
     }
     return $this;
 }
Esempio n. 6
0
 protected function _afterLoadCollection()
 {
     $this->getCollection()->addProductName();
     return parent::_afterLoadCollection();
 }
Esempio n. 7
0
 protected function _afterLoadCollection()
 {
     $this->itemsCollection = Mage::helper('M2ePro/Component_Buy')->getCollection('Order_Item')->addFieldToFilter('order_id', array('in' => $this->getCollection()->getColumnValues('id')));
     return parent::_afterLoadCollection();
 }
Esempio n. 8
0
 protected function _afterLoadCollection()
 {
     $this->getCollection()->addOptionsToResult();
     return parent::_afterLoadCollection();
 }
 protected function _afterLoadCollection()
 {
     $oCollection = $this->getCollection();
     $aIdHash = array();
     $aRuleCustomerHash = array();
     foreach ($oCollection->load() as $oCustomer) {
         if ($oCustomer->getId()) {
             $aIdHash[] = $oCustomer->getId();
         }
     }
     if ($aIdHash) {
         $aCustomerHash = $this->getCustomerHash();
         $oResource = Mage::getSingleton('core/resource');
         $sTable = $oResource->getTableName('aitoc_salesrule_assign_cutomer');
         $oDb = Mage::getSingleton('core/resource')->getConnection('core_write');
         $oSelect = $oDb->select()->from($sTable, array('entity_id', 'customer_id'))->where('entity_id IN (' . implode(',', $aIdHash) . ')');
         $aCustomerValues = $oDb->fetchAll($oSelect);
         if ($aCustomerValues) {
             foreach ($aCustomerValues as $aData) {
                 if (isset($aCustomerHash[$aData['customer_id']])) {
                     $aRuleCustomerHash[$aData['entity_id']][$aData['customer_id']] = $aCustomerHash[$aData['customer_id']];
                 }
             }
         }
     }
     Mage::register('aitindividpromo_data', $aRuleCustomerHash);
     return parent::_afterLoadCollection();
 }
Esempio n. 10
0
 /**
  * Allow provider and filters to alter the grid
  * 
  */
 protected function _afterLoadCollection()
 {
     parent::_afterLoadCollection();
     $this->getFilter()->afterGridLoadCollection($this);
     return $this;
 }
Esempio n. 11
0
 protected function _afterLoadCollection()
 {
     $this->removeColumn('draft_po_product_id');
     parent::_afterLoadCollection();
     $this->helper('inventorysupplyneeds')->addWarehouseStaticToCollection($this->getCollection());
     return $this;
 }
Esempio n. 12
0
 /**
  * after collection load
  * @access protected
  * @return Easylife_MageOverflow_Block_Adminhtml_Overflowuser_Grid
  * @author Marius Strajeru
  */
 protected function _afterLoadCollection()
 {
     parent::_afterLoadCollection();
     $basePath = Mage::getStoreConfig('easylife_mageoverflow/overflowuser/base_feed_link');
     $limit = Mage::getStoreConfig('easylife_mageoverflow/overflowuser/awake');
     foreach ($this->getCollection() as $item) {
         try {
             $feed = Zend_Feed_Reader::import('http://magento.stackexchange.com/feeds/user/' . $item->getUserid());
             //            echo "<pre>"; print_r($feed->entry);exit;
             $now = new DateTime();
             $lastSeen = false;
             $author = false;
             foreach ($feed as $entry) {
                 $author = $entry->getAuthor();
                 $lastDate = new DateTime();
                 $lastDate->setTimestamp($entry->getDateModified()->getTimestamp());
                 $lastSeen = $now->diff($lastDate);
                 break;
             }
             if ($author && is_array($author) && isset($author['name'])) {
                 $author = $author['name'];
             } else {
                 $author = '--';
             }
             $item->setName($author);
             if ($lastSeen) {
                 $output = $this->__('%s days, %s hours, %s minutes and %s seconds', $lastSeen->d, $lastSeen->h, $lastSeen->i, $lastSeen->s);
                 $isSleeping = $lastSeen->d > 0 || $lastSeen->h >= $limit;
                 $asleep = $isSleeping ? $this->__('Is sleeping') : $this->__('Is awake');
                 $item->setLastSeen($output);
                 $item->setStatus($asleep);
             } else {
                 $item->setLastSeen($this->__('Was never seen'));
                 $item->setStatus($this->__('Does not exist'));
             }
         } catch (Exception $e) {
             $item->setLastSeen('--');
             $item->setStatus('--');
             $item->setName('--');
         }
     }
 }