當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Mage_Adminhtml_Block_Widget_Grid_Column類代碼示例

本文整理匯總了PHP中Mage_Adminhtml_Block_Widget_Grid_Column的典型用法代碼示例。如果您正苦於以下問題:PHP Mage_Adminhtml_Block_Widget_Grid_Column類的具體用法?PHP Mage_Adminhtml_Block_Widget_Grid_Column怎麽用?PHP Mage_Adminhtml_Block_Widget_Grid_Column使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Mage_Adminhtml_Block_Widget_Grid_Column類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _filterPrice

 /**
  * Callback method for applying price filter.
  * @param Mage_Catalog_Model_Resource_Product_Collection $_collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $_column
  */
 public function _filterPrice($_collection, $_column)
 {
     $_field = $_column->getFilterIndex() ? $_column->getFilterIndex() : $_column->getIndex();
     $_condition = $_column->getFilter()->getCondition();
     if (!$_field || !is_array($_condition)) {
         return;
     }
     if (!array_key_exists('type', $_condition) || !is_numeric($_condition['type'])) {
         $_collection->addFieldToFilter($_field, $_condition);
     } else {
         $_storeId = (int) $this->getRequest()->getParam('store', 0);
         $_store = Mage::app()->getStore($_storeId);
         $_joinCondition = array('`e`.`entity_id` = `at_reservation_price`.`entity_id`', '`at_reservation_price`.`store_id` = ' . $_store->getId(), '`at_reservation_price`.`ptype` = ' . $_condition['type']);
         if (array_key_exists('from', $_condition)) {
             $_joinCondition[] = '`at_reservation_price`.`price` >= ' . $_condition['from'];
         }
         if (array_key_exists('to', $_condition)) {
             $_joinCondition[] = '`at_reservation_price`.`price` <= ' . $_condition['to'];
         }
         $_joinCondition[] = '`at_reservation_price`.`date_from` = \'0000-00-00 00:00:00\' OR DATE(`at_reservation_price`.`date_from`) <= DATE(\'' . date('Y-m-d H:i:s', Mage::getModel('core/date')->gmtTimestamp(time())) . '\')';
         $_joinCondition[] = '`at_reservation_price`.`date_to` = \'0000-00-00 00:00:00\' OR DATE(`at_reservation_price`.`date_to`) >= DATE(\'' . date('Y-m-d H:i:s', Mage::getModel('core/date')->gmtTimestamp(time())) . '\')';
         $_collection->getSelect()->joinInner(array('at_reservation_price' => $_collection->getTable('payperrentals/reservationprices')), '(' . implode(') AND (', $_joinCondition) . ')', array('price_type' => 'at_reservation_price.ptype', 'reservation_price' => 'at_reservation_price.price', 'reservation_number' => 'at_reservation_price.numberof'));
         /** TODO Check collection count calculation with group. I think need change join for use distinct */
         $_collection->getSelect()->group('e.entity_id');
     }
 }
開發者ID:hueyl77,項目名稱:fourwindsgear,代碼行數:31,代碼來源:Price.php

示例2: _filterStoreCondition

 /**
  * Helper function to add store filter condition
  *
  * @param Mage_Core_Model_Mysql4_Collection_Abstract $collection Data collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column Column information to be filtered
  */
 protected function _filterStoreCondition($collection, $column)
 {
     if (!($value = $column->getFilter()->getValue())) {
         return;
     }
     $this->getCollection()->addStoreFilter($value);
 }
開發者ID:TusharKDonda,項目名稱:maruti,代碼行數:13,代碼來源:Grid.php

示例3: _addColumnFilterToCollection

 /**
  * Filter number of customers column
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Enterprise_CustomerSegment_Block_Adminhtml_Report_Customer_Segment_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'customer_count') {
         if ($column->getFilter()->getValue() !== null) {
             $this->getCollection()->addCustomerCountFilter($column->getFilter()->getValue());
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
開發者ID:jpbender,項目名稱:mage_virtual,代碼行數:17,代碼來源:Grid.php

示例4: _filterManifesto

 /**
  *
  * @param Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection $collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column                  $column
  *
  * @return \Zitec_Dpd_Block_Adminhtml_Sales_Shipment_Grid
  */
 protected function _filterManifesto($collection, $column)
 {
     $manifestRef = $column->getFilter()->getCondition();
     if ($manifestRef) {
         $resource = Mage::getSingleton('core/resource');
         /* @var $resource Mage_Core_Model_Resource */
         $whereClause = $resource->getConnection("core_read")->quoteInto("manifest.manifest_ref like ? ", $manifestRef);
         $collection->getSelect()->where($whereClause);
         $debug = (string) $collection->getSelect();
     }
     return $this;
 }
開發者ID:GabrielCC,項目名稱:zitec-dpd-master,代碼行數:19,代碼來源:Grid.php

示例5: _filterInSetsCondition

 /**
  * @param Varien_Data_Collection $collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  */
 protected function _filterInSetsCondition($collection, $column)
 {
     $selected = $this->_getSelectedAttributeSets();
     if (empty($selected)) {
         $selected = '0';
     }
     $value = $column->getFilter()->getValue();
     if ($value) {
         $collection->addFieldToFilter('main_table.attribute_set_id', array('in' => $selected));
     } else {
         $collection->addFieldToFilter('main_table.attribute_set_id', array('nin' => $selected));
     }
 }
開發者ID:hanhpv,項目名稱:bulk-assigning-attributes,代碼行數:17,代碼來源:AttributeSets.php

示例6: _addColumnFilterToCollection

 /**
  * Add custom column filter to collection
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'assigned_user_role') {
         $userRoles = $this->_getSelectedRoles();
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('entity_id', array('in' => $userRoles));
         } elseif (!empty($userRoles)) {
             $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $userRoles));
         } else {
             $this->getCollection();
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:22,代碼來源:Roles.php

示例7: _addColumnFilterToCollection

 /**
  * Add filter
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Adminhtml_Block_Widget_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         switch ($column->getId()) {
             case 'tax_rates':
                 $this->getCollection()->joinCalculationData('rate');
                 break;
             case 'customer_tax_classes':
                 $this->getCollection()->joinCalculationData('ctc');
                 break;
             case 'product_tax_classes':
                 $this->getCollection()->joinCalculationData('ptc');
                 break;
         }
     }
     return parent::_addColumnFilterToCollection($column);
 }
開發者ID:hyhoocchan,項目名稱:mage-local,代碼行數:23,代碼來源:Grid.php

示例8: apply

 /**
  * Apply the condition to the given collection by way of the resource specified on instantiation
  *
  * @param \Cm_Mongo_Model_Resource_Collection_Abstract $collection
  * @param \Mage_Adminhtml_Block_Widget_Grid_Column $column
  */
 public function apply(Cm_Mongo_Model_Resource_Collection_Abstract $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column)
 {
     if (is_string($this->_resource)) {
         $filterCollection = Mage::getResourceModel($this->_resource);
     } else {
         $filterCollection = $this->_resource;
     }
     var_dump($filterCollection);
     if ($this->_filters) {
         $filterCollection->addFieldToFilter($this->_filters);
     }
     $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
     $cond = $column->getFilter()->getCondition();
     if ($field && isset($cond)) {
         $filterCollection->addFieldToFilter($field, $cond);
     }
     $collection->addFieldToFilter($this->_field, '$in', $filterCollection->getAllIds(TRUE));
 }
開發者ID:walexer,項目名稱:magento-mongo,代碼行數:24,代碼來源:Filter.php

示例9: _addColumnFilterToCollection

 /**
  * Add column filter to collection
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Enterprise_Reward_Block_Adminhtml_Customer_Edit_Tab_Reward_History_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($this->getCollection()) {
         $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
         if ($field == 'website_id' || $field == 'points_balance') {
             $cond = $column->getFilter()->getCondition();
             if ($field && isset($cond)) {
                 $this->getCollection()->addFieldToFilter('main_table.' . $field, $cond);
             }
         } else {
             parent::_addColumnFilterToCollection($column);
         }
     }
     return $this;
 }
開發者ID:barneydesmond,項目名稱:propitious-octo-tribble,代碼行數:21,代碼來源:Grid.php

示例10: _addColumnFilterToCollection

 /**
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Api2_Block_Adminhtml_Roles_Tab_Users
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'filter_in_role_users') {
         $inRoleIds = $this->getUsers();
         if (empty($inRoleIds)) {
             $inRoleIds = 0;
         }
         if ($column->getFilter()->getValue()) {
             $this->getCollection()->addFieldToFilter('user_id', array('in' => $inRoleIds));
         } else {
             if ($inRoleIds) {
                 $this->getCollection()->addFieldToFilter('user_id', array('nin' => $inRoleIds));
             }
         }
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
開發者ID:par-orillonsoft,項目名稱:Magento,代碼行數:23,代碼來源:Users.php

示例11: _addColumnFilterToCollection

 /**
  * Add store filter
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column  $column
  * @return Enterprise_Banner_Block_Adminhtml_Banner_Grid
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getIndex() == 'stores') {
         $this->getCollection()->addStoreFilter($column->getFilter()->getCondition(), false);
     } else {
         parent::_addColumnFilterToCollection($column);
     }
     return $this;
 }
開發者ID:hyhoocchan,項目名稱:mage-local,代碼行數:15,代碼來源:Grid.php

示例12: decorateUserType

 /**
  * Decorate user type column
  *
  * @param string $value
  * @param Mage_Oauth_Model_Token $row
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @param bool $isExport
  * @return mixed
  */
 public function decorateUserType($value, $row, $column, $isExport)
 {
     $options = $column->getOptions();
     $value = $row->getCustomerId() ? $options[1] : $options[0];
     $cell = $value;
     return $cell;
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:16,代碼來源:Grid.php

示例13: _filterStoreCondition

 /**
  * Filter store column
  *
  * @param Esendex_Sms_Model_Resource_Trigger_Collection $collection
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return self
  */
 protected function _filterStoreCondition(Esendex_Sms_Model_Resource_Trigger_Collection $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column)
 {
     if (!($value = $column->getFilter()->getValue())) {
         return;
     }
     $collection->addStoreFilter($value);
     return $this;
 }
開發者ID:WeareJH,項目名稱:esendex-magento-extension,代碼行數:15,代碼來源:Grid.php

示例14: _setCollectionOrder

 /**
  * Sets sorting order by some column
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist
  */
 protected function _setCollectionOrder($column)
 {
     $collection = $this->getCollection();
     if ($collection) {
         switch ($column->getId()) {
             case 'product_name':
                 $collection->setOrderByProductName($column->getDir());
                 break;
             default:
                 parent::_setCollectionOrder($column);
                 break;
         }
     }
     return $this;
 }
開發者ID:cewolf2002,項目名稱:magento,代碼行數:21,代碼來源:Wishlist.php

示例15: _addColumnFilterToCollection

 /**
  * Add column filter to collection
  *
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist
  */
 protected function _addColumnFilterToCollection($column)
 {
     if ($column->getId() == 'store') {
         $this->getCollection()->addFieldToFilter('item_store_id', $column->getFilter()->getCondition());
         return $this;
     }
     if ($this->getCollection() && $column->getFilter()->getValue()) {
         $this->getCollection()->addFieldToFilter($column->getIndex(), $column->getFilter()->getCondition());
     }
     return $this;
 }
開發者ID:hunnybohara,項目名稱:magento-chinese-localization,代碼行數:17,代碼來源:Wishlist.php


注:本文中的Mage_Adminhtml_Block_Widget_Grid_Column類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。