Beispiel #1
0
<?php

/**
 * Product:     Individual Promotions for Magento Enterpise Edition
 * Package:     Aitoc_Aitindividpromo_10.0.7_574525
 * Purchase ID: UjgdLvjpFE0u1HHQEOk2KNCXazbZ9kQjUnTtO4dMb0
 * Generated:   2013-05-13 06:35:45
 * File path:   app/code/local/Aitoc/Aitindividpromo/Block/Customers.php
 * Copyright:   (c) 2013 AITOC, Inc.
 */
if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitindividpromo')) {
    TUDeZrDeahhUsZri('794d3883d83c739f1c205203d6fc14ba');
    /**
     * @copyright  Copyright (c) 2009 AITOC, Inc.
     */
    class Aitoc_Aitindividpromo_Block_Customers extends Mage_Adminhtml_Block_Widget_Grid
    {
        public function __construct()
        {
            parent::__construct();
            $this->setId('customerGrid');
            $this->setSaveParametersInSession(true);
            $this->setUseAjax(true);
            $this->setDefaultSort('entity_id');
        }
        protected function _prepareCollection()
        {
            $collection = Mage::getResourceModel('customer/customer_collection')->addNameToSelect()->addAttributeToSelect('email')->addAttributeToSelect('created_at')->addAttributeToSelect('group_id');
            $this->setCollection($collection);
            return parent::_prepareCollection();
        }
<?php

/**
 * Product:     Individual Promotions for Magento Enterpise Edition
 * Package:     Aitoc_Aitindividpromo_10.0.7_574525
 * Purchase ID: UjgdLvjpFE0u1HHQEOk2KNCXazbZ9kQjUnTtO4dMb0
 * Generated:   2013-05-13 06:35:45
 * File path:   app/code/local/Aitoc/Aitindividpromo/Model/Rewrite/SalesRuleResourceRuleCollection.php
 * Copyright:   (c) 2013 AITOC, Inc.
 */
if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitindividpromo')) {
    TUDeZrDeahhUsZri('43d9c1873a11f579e3fd34c8bfcebedf');
    /**
     * @copyright  Copyright (c) 2011 AITOC, Inc. 
     */
    class Aitoc_Aitindividpromo_Model_Rewrite_SalesRuleResourceRuleCollection extends Mage_SalesRule_Model_Resource_Rule_Collection
    {
        public function getSelectCountSql()
        {
            $this->_renderFilters();
            $countSelect = clone $this->getSelect();
            $countSelect->reset(Zend_Db_Select::ORDER);
            $countSelect->reset(Zend_Db_Select::LIMIT_COUNT);
            $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
            $countSelect->reset(Zend_Db_Select::COLUMNS);
            // Count doesn't work with group by columns keep the group by
            if (count($this->getSelect()->getPart(Zend_Db_Select::GROUP)) > 0) {
                $countSelect->reset(Zend_Db_Select::GROUP);
                $countSelect->distinct(true);
                $group = $this->getSelect()->getPart(Zend_Db_Select::GROUP);
                $countSelect->columns("COUNT(DISTINCT " . implode(", ", $group) . ")");
<?php

/**
 * Product:     Individual Promotions for Magento Enterpise Edition
 * Package:     Aitoc_Aitindividpromo_10.0.7_574525
 * Purchase ID: UjgdLvjpFE0u1HHQEOk2KNCXazbZ9kQjUnTtO4dMb0
 * Generated:   2013-05-13 06:35:45
 * File path:   app/code/local/Aitoc/Aitindividpromo/Block/Rewrite/AdminhtmlPromoQuoteEditTabMain.php
 * Copyright:   (c) 2013 AITOC, Inc.
 */
if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitindividpromo')) {
    TUDeZrDeahhUsZri('18aca46d50e50ecdc806047b0f288154');
    /**
     * @copyright  Copyright (c) 2009 AITOC, Inc. 
     */
    class Aitoc_Aitindividpromo_Block_Rewrite_AdminhtmlPromoQuoteEditTabMain extends Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main
    {
        protected function _prepareForm()
        {
            $oParent = parent::_prepareForm();
            $oModel = Mage::registry('current_promo_quote_rule');
            $oForm = $oParent->getForm();
            foreach ($oForm->getElements() as $aElement) {
                $aElement->removeField('customer_group_ids');
                #            d(get_class_methods($aElement));
                #            d($aElement->getElement('customer_group_ids'));
                #            d($aElement->getElementHtml());
            }
            // set groups and individuals
            $fieldset = $oForm->addFieldset('assign_fieldset', array('legend' => Mage::helper('salesrule')->__('Assign To')));
            $oAitindividpromo = Mage::getModel('aitindividpromo/aitindividpromo');