protected function _checkEntityEditableField($type, $config, $params, $entity) { if (parent::_checkEntityEditableField($type, $config, $params, $entity)) { if ($config['id'] == 'type' || $entity->getId() == Mage_Customer_Model_Group::NOT_LOGGED_IN_ID) { Mage::throwException(Mage::helper('customgrid')->__('The name is not editable for this customer group')); } return true; } return false; }
protected function _checkEntityEditableField($type, $config, $params, $entity) { if (parent::_checkEntityEditableField($type, $config, $params, $entity)) { if ($config['id'] == 'qty') { if (!Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) { Mage::throwException(Mage::helper('customgrid')->__('The "Mage_CatalogInventory" module is disabled')); } if ($entity->isComposite()) { Mage::throwException(Mage::helper('customgrid')->__('The quantity is not editable for composite products')); } if ($entity->getInventoryReadonly()) { Mage::throwException(Mage::helper('customgrid')->__('The quantity is read-only for this product')); } if (!$this->_getProductInventoryData($entity, 'manage_stock', true)) { Mage::throwException(Mage::helper('customgrid')->__('The quantity is not editable for this product')); } } } return true; }
protected function _checkEntityEditableField($type, $config, $params, $entity) { if (parent::_checkEntityEditableField($type, $config, $params, $entity)) { if ($config['id'] == 'store_id') { if ($entity->getIsSystem()) { Mage::throwException(Mage::helper('customgrid')->__('This value is not editable for system rewrites')); } } elseif ($config['id'] == 'id_path' || $config['id'] == 'target_path') { if ($entity->getProductId() || $entity->getCategoryId()) { Mage::throwException(Mage::helper('customgrid')->__('This value is not editable for rewrites corresponding to a product and/or a category')); } } return true; } return false; }