Etatvasoft_Dynamic_Image_Slider - Version 1.5.4

Version Notes

All features are configurable from admin like width, height, auto slideshow, display next previous arrow, show caption, show navigation images, max number of slides to display, display slide content, time between two slides.

Download this release

Release Info

Developer Etatvasoft
Extension Etatvasoft_Dynamic_Image_Slider
Version 1.5.4
Comparing to
See all releases


Code changes from version 1.5.3 to 1.5.4

Files changed (73) hide show
  1. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Attribute/Edit/Main/Abstract.php +238 -0
  2. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customer/Grid.php +341 -0
  3. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress.php +12 -0
  4. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit.php +68 -0
  5. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Form.php +19 -0
  6. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Front.php +106 -0
  7. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Main.php +205 -0
  8. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Options.php +36 -0
  9. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/System.php +134 -0
  10. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tabs.php +38 -0
  11. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Grid.php +58 -0
  12. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/New/Product/Attributes.php +94 -0
  13. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/New/Product/Created.php +90 -0
  14. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes.php +12 -0
  15. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit.php +68 -0
  16. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Form.php +19 -0
  17. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Front.php +106 -0
  18. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Main.php +208 -0
  19. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Options.php +36 -0
  20. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/System.php +134 -0
  21. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tabs.php +38 -0
  22. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Grid.php +58 -0
  23. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/New/Product/Attributes.php +94 -0
  24. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/New/Product/Created.php +90 -0
  25. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Grid/Renderer/Image.php +19 -0
  26. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Multiselectattributes.php +35 -0
  27. app/code/local/Tatva/Customerattributes/Helper/Data.php +27 -0
  28. app/code/local/Tatva/Customerattributes/Model/Adminhtml/Resource/Eav/Attribute.php +390 -0
  29. app/code/local/Tatva/Customerattributes/Model/Adminhtml/System/Config/Source/Inputtype.php +39 -0
  30. app/code/local/Tatva/Customerattributes/Model/Attribute.php +77 -0
  31. app/code/local/Tatva/Customerattributes/Model/Customerattributes.php +42 -0
  32. app/code/local/Tatva/Customerattributes/Model/Mysql4/Customerattributes.php +50 -0
  33. app/code/local/Tatva/Customerattributes/Model/Status.php +15 -0
  34. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerController_old.php +818 -0
  35. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomeraddressController.php +383 -0
  36. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerattributeController_old.php +16 -0
  37. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerattributesController.php +433 -0
  38. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/ProductController.php +16 -0
  39. app/code/local/Tatva/Customerattributes/etc/adminhtml.xml +57 -0
  40. app/code/local/Tatva/Customerattributes/etc/adminhtml_old.xml +57 -0
  41. app/code/local/Tatva/Customerattributes/etc/config.xml +188 -0
  42. app/code/local/Tatva/Customerattributes/etc/config_old.xml +161 -0
  43. app/code/local/Tatva/Customerattributes/etc/system.xml +43 -0
  44. app/code/local/Tatva/Customerattributes/etc/system_old.xml +43 -0
  45. app/code/local/Tatva/Customerattributes/sql/customerattributes_setup/mysql4-install-0.1.0.php +13 -0
  46. app/code/local/Tatva/Exportallimage/Model/Convert/Adapter/Product.php +256 -0
  47. app/code/local/Tatva/Exportallimage/Model/Convert/Parser/Csv.php +77 -0
  48. app/code/local/Tatva/Exportallimage/etc/config.xml +22 -0
  49. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs.php +12 -0
  50. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit.php +55 -0
  51. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Form.php +19 -0
  52. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Tab/Form.php +72 -0
  53. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Tabs.php +24 -0
  54. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Grid.php +138 -0
  55. app/code/local/Tatva/Faqs/Block/Faqs.php +39 -0
  56. app/code/local/Tatva/Faqs/Helper/Data.php +26 -0
  57. app/code/local/Tatva/Faqs/Model/Faqs.php +36 -0
  58. app/code/local/Tatva/Faqs/Model/Mysql4/Faqs.php +60 -0
  59. app/code/local/Tatva/Faqs/Model/Mysql4/Faqs/Collection.php +65 -0
  60. app/code/local/Tatva/Faqs/Model/Status.php +15 -0
  61. app/code/local/Tatva/Faqs/controllers/Adminhtml/FaqsController.php +214 -0
  62. app/code/local/Tatva/Faqs/controllers/IndexController.php +25 -0
  63. app/code/local/Tatva/Faqs/etc/adminhtml.xml +38 -0
  64. app/code/local/Tatva/Faqs/etc/config.xml +136 -0
  65. app/code/local/Tatva/Faqs/sql/faqs_setup/mysql4-install-0.1.0.php +29 -0
  66. app/code/local/Tatva/Faqs/sql/faqs_setup/mysql4-upgrade-0.1.0-0.2.0.php +32 -0
  67. app/code/local/Tatva/Note.txt +92 -0
  68. app/code/local/Tatva/Slider/Block/Adminhtml/Slider/Edit/Tabs.php +1 -1
  69. app/code/local/Tatva/Slider/etc/adminhtml.xml +1 -1
  70. app/code/local/Tatva/Slider/etc/config.xml +3 -2
  71. app/code/local/Tatva/Slider/etc/system.xml +11 -2
  72. app/design/frontend/default/default/template/slider/slider.phtml +3 -2
  73. package.xml +4 -4
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Attribute/Edit/Main/Abstract.php ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Eav
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Product attribute add/edit form main tab
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Eav
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+
36
+ abstract class Tatva_Customerattributes_Block_Adminhtml_Attribute_Edit_Main_Abstract extends Mage_Adminhtml_Block_Widget_Form
37
+ {
38
+ protected $_attribute = null;
39
+
40
+ public function setAttributeObject($attribute)
41
+ {
42
+ $this->_attribute = $attribute;
43
+ return $this;
44
+ }
45
+
46
+ public function getAttributeObject()
47
+ {
48
+ if (null === $this->_attribute) {
49
+ return Mage::registry('entity_attribute');
50
+ }
51
+ return $this->_attribute;
52
+ }
53
+
54
+ /**
55
+ * Preparing default form elements for editing attribute
56
+ *
57
+ * @return Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract
58
+ */
59
+ protected function _prepareForm()
60
+ {
61
+ $attributeObject = $this->getAttributeObject();
62
+
63
+ $form = new Varien_Data_Form(array(
64
+ 'id' => 'edit_form',
65
+ 'action' => $this->getData('action'),
66
+ 'method' => 'post'
67
+ ));
68
+
69
+ $fieldset = $form->addFieldset('base_fieldset',
70
+ array('legend'=>Mage::helper('eav')->__('Attribute Properties'))
71
+ );
72
+ if ($attributeObject->getAttributeId()) {
73
+ $fieldset->addField('attribute_id', 'hidden', array(
74
+ 'name' => 'attribute_id',
75
+ ));
76
+ }
77
+
78
+ $this->_addElementTypes($fieldset);
79
+
80
+ $yesno = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
81
+
82
+ $validateClass = sprintf('validate-code validate-length maximum-length-%d',
83
+ Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH);
84
+ $fieldset->addField('attribute_code', 'text', array(
85
+ 'name' => 'attribute_code',
86
+ 'label' => Mage::helper('eav')->__('Attribute Code'),
87
+ 'title' => Mage::helper('eav')->__('Attribute Code'),
88
+ 'note' => Mage::helper('eav')->__('For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols', Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH),
89
+ 'class' => $validateClass,
90
+ 'required' => true,
91
+ ));
92
+
93
+ $inputTypes = Mage::getModel('eav/adminhtml_system_config_source_inputtype')->toOptionArray();
94
+
95
+ $fieldset->addField('frontend_input', 'select', array(
96
+ 'name' => 'frontend_input',
97
+ 'label' => Mage::helper('eav')->__('Catalog Input Type for Store Owner'),
98
+ 'title' => Mage::helper('eav')->__('Catalog Input Type for Store Owner'),
99
+ 'value' => 'text',
100
+ 'values'=> $inputTypes
101
+ ));
102
+
103
+ $fieldset->addField('default_value_text', 'text', array(
104
+ 'name' => 'default_value_text',
105
+ 'label' => Mage::helper('eav')->__('Default Value'),
106
+ 'title' => Mage::helper('eav')->__('Default Value'),
107
+ 'value' => $attributeObject->getDefaultValue(),
108
+ ));
109
+
110
+ $fieldset->addField('default_value_yesno', 'select', array(
111
+ 'name' => 'default_value_yesno',
112
+ 'label' => Mage::helper('eav')->__('Default Value'),
113
+ 'title' => Mage::helper('eav')->__('Default Value'),
114
+ 'values' => $yesno,
115
+ 'value' => $attributeObject->getDefaultValue(),
116
+ ));
117
+
118
+ $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
119
+ $fieldset->addField('default_value_date', 'date', array(
120
+ 'name' => 'default_value_date',
121
+ 'label' => Mage::helper('eav')->__('Default Value'),
122
+ 'title' => Mage::helper('eav')->__('Default Value'),
123
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
124
+ 'value' => $attributeObject->getDefaultValue(),
125
+ 'format' => $dateFormatIso
126
+ ));
127
+
128
+ $fieldset->addField('default_value_textarea', 'textarea', array(
129
+ 'name' => 'default_value_textarea',
130
+ 'label' => Mage::helper('eav')->__('Default Value'),
131
+ 'title' => Mage::helper('eav')->__('Default Value'),
132
+ 'value' => $attributeObject->getDefaultValue(),
133
+ ));
134
+
135
+ $fieldset->addField('is_unique', 'select', array(
136
+ 'name' => 'is_unique',
137
+ 'label' => Mage::helper('eav')->__('Unique Value'),
138
+ 'title' => Mage::helper('eav')->__('Unique Value (not shared with other products)'),
139
+ 'note' => Mage::helper('eav')->__('Not shared with other products'),
140
+ 'values' => $yesno,
141
+ ));
142
+
143
+ $fieldset->addField('is_required', 'select', array(
144
+ 'name' => 'is_required',
145
+ 'label' => Mage::helper('eav')->__('Values Required'),
146
+ 'title' => Mage::helper('eav')->__('Values Required'),
147
+ 'values' => $yesno,
148
+ ));
149
+
150
+ $fieldset->addField('frontend_class', 'select', array(
151
+ 'name' => 'frontend_class',
152
+ 'label' => Mage::helper('eav')->__('Input Validation for Store Owner'),
153
+ 'title' => Mage::helper('eav')->__('Input Validation for Store Owner'),
154
+ 'values'=> Mage::helper('eav')->getFrontendClasses($attributeObject->getEntityType()->getEntityTypeCode())
155
+ ));
156
+
157
+ if ($attributeObject->getId()) {
158
+ $form->getElement('attribute_code')->setDisabled(1);
159
+ $form->getElement('frontend_input')->setDisabled(1);
160
+ if (!$attributeObject->getIsUserDefined()) {
161
+ $form->getElement('is_unique')->setDisabled(1);
162
+ }
163
+ }
164
+
165
+ $this->setForm($form);
166
+
167
+ return parent::_prepareForm();
168
+ }
169
+
170
+ /**
171
+ * Initialize form fileds values
172
+ *
173
+ * @return Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract
174
+ */
175
+ protected function _initFormValues()
176
+ {
177
+ Mage::dispatchEvent('adminhtml_block_eav_attribute_edit_form_init', array('form' => $this->getForm()));
178
+ //$type = $this->getAttributeObject()->getEntityTypeId();
179
+ if($this->getAttributeObject()->getEntityTypeId() == 1 || $this->getAttributeObject()->getEntityTypeId() == 2)
180
+ {
181
+ $attr = $this->getAttributeObject()->getAttributeId();
182
+ $resource = Mage::getSingleton('core/resource');
183
+ $readConnection = $resource->getConnection('core_read');
184
+ $query = "select * from customer_form_attribute where attribute_id='".$attr."'";
185
+ $results = $readConnection->fetchAll($query);
186
+ foreach($results as $res)
187
+ {
188
+ $array[] = $res['form_code'];
189
+ }
190
+ }
191
+ $a = $this->getAttributeObject();
192
+ $a['used_in_forms']=$array;
193
+
194
+ $this->getForm()
195
+ ->addValues($a->getData());
196
+ return parent::_initFormValues();
197
+ }
198
+
199
+ /**
200
+ * This method is called before rendering HTML
201
+ *
202
+ * @return Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract
203
+ */
204
+ protected function _beforeToHtml()
205
+ {
206
+ parent::_beforeToHtml();
207
+ $attributeObject = $this->getAttributeObject();
208
+ if ($attributeObject->getId()) {
209
+ $form = $this->getForm();
210
+ $disableAttributeFields = Mage::helper('eav')
211
+ ->getAttributeLockedFields($attributeObject->getEntityType()->getEntityTypeCode());
212
+ if (isset($disableAttributeFields[$attributeObject->getAttributeCode()])) {
213
+ foreach ($disableAttributeFields[$attributeObject->getAttributeCode()] as $field) {
214
+ if ($elm = $form->getElement($field)) {
215
+ $elm->setDisabled(1);
216
+ $elm->setReadonly(1);
217
+ }
218
+ }
219
+ }
220
+ }
221
+ return $this;
222
+ }
223
+
224
+ /**
225
+ * Processing block html after rendering
226
+ * Adding js block to the end of this block
227
+ *
228
+ * @param string $html
229
+ * @return string
230
+ */
231
+ protected function _afterToHtml($html)
232
+ {
233
+ $jsScripts = $this->getLayout()
234
+ ->createBlock('eav/adminhtml_attribute_edit_js')->toHtml();
235
+ return $html.$jsScripts;
236
+ }
237
+
238
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customer/Grid.php ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Adminhtml customer grid block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Tatva_Customerattributes_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
35
+ {
36
+
37
+ public function __construct()
38
+ {
39
+ parent::__construct();
40
+ $this->setId('customerGrid');
41
+ $this->setUseAjax(true);
42
+ $this->setDefaultSort('entity_id');
43
+ $this->setSaveParametersInSession(true);
44
+ }
45
+
46
+ protected function _getStore()
47
+ {
48
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
49
+ return Mage::app()->getStore($storeId);
50
+ }
51
+
52
+ protected function _prepareCollection()
53
+ {
54
+ $collection = Mage::getResourceModel('customer/customer_collection')
55
+ ->addNameToSelect()
56
+ ->addAttributeToSelect('email')
57
+ ->addAttributeToSelect('created_at')
58
+ ->addAttributeToSelect('group_id')
59
+ ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
60
+ ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
61
+ ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
62
+ ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
63
+ ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
64
+ $attribute = Mage::getStoreConfig('customerattributes/config/customer_attribute');
65
+ $attr_array = explode(',',$attribute);
66
+ $count = count($attr_array);
67
+ for($i=0;$i<$count;$i++)
68
+ {
69
+ $attribute1 = Mage::getModel('catalog/resource_eav_attribute')->load($attr_array[$i]);
70
+ $collection->addAttributeToSelect($attribute1->getAttributeCode());
71
+ }
72
+ $this->setCollection($collection);
73
+
74
+ return parent::_prepareCollection();
75
+ }
76
+
77
+ protected function _prepareColumns()
78
+ {
79
+ $this->addColumn('entity_id', array(
80
+ 'header' => Mage::helper('customer')->__('ID'),
81
+ 'width' => '50px',
82
+ 'index' => 'entity_id',
83
+ 'type' => 'number',
84
+ ));
85
+ /*$this->addColumn('firstname', array(
86
+ 'header' => Mage::helper('customer')->__('First Name'),
87
+ 'index' => 'firstname'
88
+ ));
89
+ $this->addColumn('lastname', array(
90
+ 'header' => Mage::helper('customer')->__('Last Name'),
91
+ 'index' => 'lastname'
92
+ ));*/
93
+ $this->addColumn('name', array(
94
+ 'header' => Mage::helper('customer')->__('Name'),
95
+ 'index' => 'name'
96
+ ));
97
+ $this->addColumn('email', array(
98
+ 'header' => Mage::helper('customer')->__('Email'),
99
+ 'width' => '150',
100
+ 'index' => 'email'
101
+ ));
102
+
103
+ $groups = Mage::getResourceModel('customer/group_collection')
104
+ ->addFieldToFilter('customer_group_id', array('gt'=> 0))
105
+ ->load()
106
+ ->toOptionHash();
107
+
108
+ $this->addColumn('group', array(
109
+ 'header' => Mage::helper('customer')->__('Group'),
110
+ 'width' => '100',
111
+ 'index' => 'group_id',
112
+ 'type' => 'options',
113
+ 'options' => $groups,
114
+ ));
115
+
116
+ $this->addColumn('Telephone', array(
117
+ 'header' => Mage::helper('customer')->__('Telephone'),
118
+ 'width' => '100',
119
+ 'index' => 'billing_telephone',
120
+ ));
121
+
122
+ $attribute = Mage::getStoreConfig('customerattributes/config/customer_attribute');
123
+ $attr_array = explode(',',$attribute);
124
+ $count = count($attr_array);
125
+ if($count > 0)
126
+ {
127
+ for($i=0;$i<$count;$i++)
128
+ {
129
+ $attribute1 = Mage::getModel('catalog/resource_eav_attribute')->load($attr_array[$i]);
130
+ //echo "<pre>";print_r($attribute1->getData());
131
+ if($attribute1->getFrontendInput() == 'select')
132
+ {
133
+ $attribute_code = Mage::getModel('eav/config')->getAttribute('customer', $attribute1->getAttributeCode());
134
+ $options = $attribute_code->getSource()->getAllOptions(false);
135
+ $options = array();
136
+ foreach( $attribute_code->getSource()->getAllOptions(true, true) as $option ) {
137
+ if($option['label'] == '')
138
+ {
139
+ continue;
140
+ }
141
+ else
142
+ {
143
+ $options[$option['value']] = $option['label'];
144
+ }
145
+ }
146
+ $this->addColumn($attribute1->getAttributeCode(),
147
+ array(
148
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
149
+ 'type'=>'options',
150
+ 'index'=>$attribute1->getAttributeCode(),
151
+ 'options' => $options,
152
+ ));
153
+ }/*else if($attribute1->getFrontendInput() == 'price')
154
+ {
155
+ $store = $this->_getStore();
156
+
157
+ $this->addColumn($attribute1->getAttributeCode(),
158
+ array(
159
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
160
+ 'type'=>'price',
161
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
162
+ 'index'=>$attribute1->getAttributeCode(),
163
+ ));
164
+ }*/else if($attribute1->getFrontendInput() == 'boolean')
165
+ {
166
+ $this->addColumn($attribute1->getAttributeCode(),
167
+ array(
168
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
169
+ 'type'=>'options',
170
+ 'index'=>$attribute1->getAttributeCode(),
171
+ 'options'=>Mage::getModel('customerattributes/customerattributes')->getOptionArray(),
172
+ ));
173
+ }else if($attribute1->getFrontendInput() == 'date')
174
+ {
175
+ $this->addColumn($attribute1->getAttributeCode(),
176
+ array(
177
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
178
+ 'type'=>'date',
179
+ 'index'=>$attribute1->getAttributeCode(),
180
+ ));
181
+ }else if($attribute1->getFrontendInput() == 'image')
182
+ {
183
+ $this->addColumn($attribute1->getAttributeCode(),
184
+ array(
185
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
186
+ 'type'=>'image',
187
+ 'width'=>'80px',
188
+ 'index'=>$attribute1->getAttributeCode(),
189
+ 'escape' => true,
190
+ 'sortable' => false,
191
+ 'filter' => false,
192
+ 'renderer' => new Tatva_Customerattributes_Block_Adminhtml_Grid_Renderer_Image,
193
+ ));
194
+ }else if($attribute1->getFrontendInput() == 'multiselect')
195
+ {
196
+ $this->addColumn($attribute1->getAttributeCode(),
197
+ array(
198
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
199
+ 'type'=>'options',
200
+ 'index'=>$attribute1->getAttributeCode(),
201
+ 'options' =>Mage::getModel('customerattributes/customerattributes')->getOption($attr_array[$i]),
202
+ 'renderer' => 'Tatva_Customerattributes_Block_Adminhtml_Widget_Grid_Column_Renderer_Multiselectattributes',
203
+ 'filter_condition_callback' => array($this, '_filterMultiSelectAttribue'),
204
+ ));
205
+ }
206
+ else
207
+ {
208
+ $type = $attribute1->getFrontendInput();
209
+ if($type != "")
210
+ {
211
+ $this->addColumn($attribute1->getAttributeCode(),
212
+ array(
213
+ 'header'=>Mage::helper('customer')->__($attribute1->getFrontendLabel()),
214
+ 'type'=>$attribute1->getFrontendType(),
215
+ 'index'=>$attribute1->getAttributeCode(),
216
+ ));
217
+ }
218
+ }
219
+ }
220
+ }
221
+
222
+ $this->addColumn('billing_postcode', array(
223
+ 'header' => Mage::helper('customer')->__('ZIP'),
224
+ 'width' => '90',
225
+ 'index' => 'billing_postcode',
226
+ ));
227
+
228
+ $this->addColumn('billing_country_id', array(
229
+ 'header' => Mage::helper('customer')->__('Country'),
230
+ 'width' => '100',
231
+ 'type' => 'country',
232
+ 'index' => 'billing_country_id',
233
+ ));
234
+
235
+ $this->addColumn('billing_region', array(
236
+ 'header' => Mage::helper('customer')->__('State/Province'),
237
+ 'width' => '100',
238
+ 'index' => 'billing_region',
239
+ ));
240
+
241
+ $this->addColumn('customer_since', array(
242
+ 'header' => Mage::helper('customer')->__('Customer Since'),
243
+ 'type' => 'datetime',
244
+ 'align' => 'center',
245
+ 'index' => 'created_at',
246
+ 'gmtoffset' => true
247
+ ));
248
+
249
+ if (!Mage::app()->isSingleStoreMode()) {
250
+ $this->addColumn('website_id', array(
251
+ 'header' => Mage::helper('customer')->__('Website'),
252
+ 'align' => 'center',
253
+ 'width' => '80px',
254
+ 'type' => 'options',
255
+ 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true),
256
+ 'index' => 'website_id',
257
+ ));
258
+ }
259
+
260
+ $this->addColumn('action',
261
+ array(
262
+ 'header' => Mage::helper('customer')->__('Action'),
263
+ 'width' => '100',
264
+ 'type' => 'action',
265
+ 'getter' => 'getId',
266
+ 'actions' => array(
267
+ array(
268
+ 'caption' => Mage::helper('customer')->__('Edit'),
269
+ 'url' => array('base'=> '*/*/edit'),
270
+ 'field' => 'id'
271
+ )
272
+ ),
273
+ 'filter' => false,
274
+ 'sortable' => false,
275
+ 'index' => 'stores',
276
+ 'is_system' => true,
277
+ ));
278
+
279
+ $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
280
+ $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('Excel XML'));
281
+ return parent::_prepareColumns();
282
+ }
283
+
284
+ protected function _prepareMassaction()
285
+ {
286
+ $this->setMassactionIdField('entity_id');
287
+ $this->getMassactionBlock()->setFormFieldName('customer');
288
+
289
+ $this->getMassactionBlock()->addItem('delete', array(
290
+ 'label' => Mage::helper('customer')->__('Delete'),
291
+ 'url' => $this->getUrl('*/*/massDelete'),
292
+ 'confirm' => Mage::helper('customer')->__('Are you sure?')
293
+ ));
294
+
295
+ $this->getMassactionBlock()->addItem('newsletter_subscribe', array(
296
+ 'label' => Mage::helper('customer')->__('Subscribe to Newsletter'),
297
+ 'url' => $this->getUrl('*/*/massSubscribe')
298
+ ));
299
+
300
+ $this->getMassactionBlock()->addItem('newsletter_unsubscribe', array(
301
+ 'label' => Mage::helper('customer')->__('Unsubscribe from Newsletter'),
302
+ 'url' => $this->getUrl('*/*/massUnsubscribe')
303
+ ));
304
+
305
+ $groups = $this->helper('customer')->getGroups()->toOptionArray();
306
+
307
+ array_unshift($groups, array('label'=> '', 'value'=> ''));
308
+ $this->getMassactionBlock()->addItem('assign_group', array(
309
+ 'label' => Mage::helper('customer')->__('Assign a Customer Group'),
310
+ 'url' => $this->getUrl('*/*/massAssignGroup'),
311
+ 'additional' => array(
312
+ 'visibility' => array(
313
+ 'name' => 'group',
314
+ 'type' => 'select',
315
+ 'class' => 'required-entry',
316
+ 'label' => Mage::helper('customer')->__('Group'),
317
+ 'values' => $groups
318
+ )
319
+ )
320
+ ));
321
+
322
+ return $this;
323
+ }
324
+
325
+ public function getGridUrl()
326
+ {
327
+ return $this->getUrl('*/*/grid', array('_current'=> true));
328
+ }
329
+
330
+ public function getRowUrl($row)
331
+ {
332
+ return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
333
+ }
334
+
335
+ protected function _filterMultiSelectAttribue($collection, $column)
336
+ {
337
+ $value = $column->getFilter()->getValue();
338
+ //echo "<pre>";print_r($column->getData());
339
+ $this->getCollection()->addFieldToFilter($column['index'], array(array('finset'=>$value)));
340
+ }
341
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_customeraddress';
7
+ $this->_blockGroup = 'customerattributes';
8
+ $this->_headerText = Mage::helper('customerattributes')->__('Manage Customer Address Attributes');
9
+ $this->_addButtonLabel = Mage::helper('customerattributes')->__('Add New Customer Address Attribute');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ $this->_objectId = 'attribute_id';
8
+ $this->_blockGroup = 'customerattributes';
9
+ $this->_controller = 'adminhtml_customeraddress';
10
+
11
+ parent::__construct();
12
+
13
+ if($this->getRequest()->getParam('popup')) {
14
+ $this->_removeButton('back');
15
+ $this->_addButton(
16
+ 'close',
17
+ array(
18
+ 'label' => Mage::helper('customerattributes')->__('Close Window'),
19
+ 'class' => 'cancel',
20
+ 'onclick' => 'window.close()',
21
+ 'level' => -1
22
+ )
23
+ );
24
+ } else {
25
+ $this->_addButton(
26
+ 'save_and_edit_button',
27
+ array(
28
+ 'label' => Mage::helper('customerattributes')->__('Save and Continue Edit'),
29
+ 'onclick' => 'saveAndContinueEdit()',
30
+ 'class' => 'save'
31
+ ),
32
+ 100
33
+ );
34
+ }
35
+
36
+ $this->_updateButton('save', 'label', Mage::helper('customerattributes')->__('Save Attribute'));
37
+ $this->_updateButton('save', 'onclick', 'saveAttribute()');
38
+ if (! Mage::registry('entity_attribute')->getIsUserDefined()) {
39
+ $this->_removeButton('delete');
40
+ } else {
41
+ $this->_updateButton('delete', 'label', Mage::helper('customerattributes')->__('Delete Attribute'));
42
+ }
43
+ }
44
+
45
+ public function getHeaderText()
46
+ {
47
+ if (Mage::registry('entity_attribute')->getId()) {
48
+ $frontendLabel = Mage::registry('entity_attribute')->getFrontendLabel();
49
+ if (is_array($frontendLabel)) {
50
+ $frontendLabel = $frontendLabel[0];
51
+ }
52
+ return Mage::helper('customerattributes')->__('Edit Customer Address Attribute "%s"', $this->htmlEscape($frontendLabel));
53
+ }
54
+ else {
55
+ return Mage::helper('customerattributes')->__('New Customer Address Attribute');
56
+ }
57
+ }
58
+
59
+ public function getValidationUrl()
60
+ {
61
+ return $this->getUrl('*/*/validate', array('_current'=>true));
62
+ }
63
+
64
+ public function getSaveUrl()
65
+ {
66
+ return $this->getUrl('*/'.$this->_controller.'/save', array('_current'=>true, 'back'=>null));
67
+ }
68
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('attribute_id' => $this->getRequest()->getParam('attribute_id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Front.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attribute add/edit form main tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit_Tab_Front extends Mage_Adminhtml_Block_Widget_Form
36
+ {
37
+
38
+ protected function _prepareForm()
39
+ {
40
+ $model = Mage::registry('entity_attribute');
41
+
42
+ $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
43
+
44
+ $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('customerattributes')->__('Frontend Properties')));
45
+
46
+ $yesno = array(
47
+ array(
48
+ 'value' => 0,
49
+ 'label' => Mage::helper('customerattributes')->__('No')
50
+ ),
51
+ array(
52
+ 'value' => 1,
53
+ 'label' => Mage::helper('customerattributes')->__('Yes')
54
+ ));
55
+
56
+
57
+ $fieldset->addField('is_searchable', 'select', array(
58
+ 'name' => 'is_searchable',
59
+ 'label' => Mage::helper('customerattributes')->__('Use in Quick Search'),
60
+ 'title' => Mage::helper('customerattributes')->__('Use in Quick Search'),
61
+ 'values' => $yesno,
62
+ ));
63
+
64
+ $fieldset->addField('is_visible_in_advanced_search', 'select', array(
65
+ 'name' => 'is_visible_in_advanced_search',
66
+ 'label' => Mage::helper('customerattributes')->__('Use in Advanced Search'),
67
+ 'title' => Mage::helper('customerattributes')->__('Use in Advanced Search'),
68
+ 'values' => $yesno,
69
+ ));
70
+
71
+ $fieldset->addField('is_comparable', 'select', array(
72
+ 'name' => 'is_comparable',
73
+ 'label' => Mage::helper('customerattributes')->__('Comparable on the Frontend'),
74
+ 'title' => Mage::helper('customerattributes')->__('Comparable on the Frontend'),
75
+ 'values' => $yesno,
76
+ ));
77
+
78
+
79
+ $fieldset->addField('is_filterable', 'select', array(
80
+ 'name' => 'is_filterable',
81
+ 'label' => Mage::helper('customerattributes')->__("Use in Layered Navigation<br/>(Can be used only with catalog input type 'Dropdown')"),
82
+ 'title' => Mage::helper('customerattributes')->__('Can be used only with catalog input type Dropdown'),
83
+ 'values' => array(
84
+ array('value' => '0', 'label' => Mage::helper('customerattributes')->__('No')),
85
+ array('value' => '1', 'label' => Mage::helper('customerattributes')->__('Filterable (with results)')),
86
+ array('value' => '2', 'label' => Mage::helper('customerattributes')->__('Filterable (no results)')),
87
+ ),
88
+ ));
89
+
90
+ // if ($model->getIsUserDefined() || !$model->getId()) {
91
+ $fieldset->addField('is_visible_on_front', 'select', array(
92
+ 'name' => 'is_visible_on_front',
93
+ 'label' => Mage::helper('customerattributes')->__('Visible on Catalog Pages on Front-end'),
94
+ 'title' => Mage::helper('customerattributes')->__('Visible on Catalog Pages on Front-end'),
95
+ 'values' => $yesno,
96
+ ));
97
+ // }
98
+
99
+ $form->setValues($model->getData());
100
+
101
+ $this->setForm($form);
102
+
103
+ return parent::_prepareForm();
104
+ }
105
+
106
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Main.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Product attribute add/edit form main tab
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Adminhtml
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit_Tab_Main extends Tatva_Customerattributes_Block_Adminhtml_Attribute_Edit_Main_Abstract
36
+ {
37
+ /**
38
+ * Adding product form elements for editing attribute
39
+ *
40
+ * @return Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Main
41
+ */
42
+ protected function _prepareForm()
43
+ {
44
+ parent::_prepareForm();
45
+ $attributeObject = $this->getAttributeObject();
46
+ //echo "<pre>";print_r($attributeObject->getData());
47
+
48
+ /* @var $form Varien_Data_Form */
49
+ $form = $this->getForm();
50
+ /* @var $fieldset Varien_Data_Form_Element_Fieldset */
51
+ $fieldset = $form->getElement('base_fieldset');
52
+
53
+ $frontendInputElm = $form->getElement('frontend_input');
54
+ $additionalTypes = array(
55
+ /*array(
56
+ 'value' => 'price',
57
+ 'label' => Mage::helper('customerattributes')->__('Price')
58
+ ),*/
59
+ /*array(
60
+ 'value' => 'media_image',
61
+ 'label' => Mage::helper('customerattributes')->__('Media Image')
62
+ )*/
63
+ );
64
+ if ($attributeObject->getFrontendInput() == 'gallery') {
65
+ $additionalTypes[] = array(
66
+ 'value' => 'gallery',
67
+ 'label' => Mage::helper('customerattributes')->__('Gallery')
68
+ );
69
+ }
70
+
71
+ $response = new Varien_Object();
72
+ $response->setTypes(array());
73
+ //Mage::dispatchEvent('adminhtml_product_attribute_types', array('response'=>$response));
74
+ $_disabledTypes = array();
75
+ $_hiddenFields = array();
76
+ foreach ($response->getTypes() as $type) {
77
+ $additionalTypes[] = $type;
78
+ if (isset($type['hide_fields'])) {
79
+ $_hiddenFields[$type['value']] = $type['hide_fields'];
80
+ }
81
+ if (isset($type['disabled_types'])) {
82
+ $_disabledTypes[$type['value']] = $type['disabled_types'];
83
+ }
84
+ }
85
+ /* Mage::register('customer_attribute_type_hidden_fields', $_hiddenFields);
86
+ Mage::register('customer_attribute_type_disabled_types', $_disabledTypes);*/
87
+
88
+ $frontendInputValues = array_merge($frontendInputElm->getValues(), $additionalTypes);
89
+ $frontendInputElm->setValues($frontendInputValues);
90
+
91
+ $yesnoSource = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
92
+
93
+
94
+ $scopes = array(
95
+ array(
96
+ 'value'=>'0',
97
+ 'label'=>'Store View',
98
+ ),
99
+ array(
100
+ 'value'=>'1',
101
+ 'label'=>'global',
102
+ ),
103
+ array(
104
+ 'value'=>'2',
105
+ 'label'=>'website',
106
+ ),
107
+ );
108
+
109
+
110
+ $fieldset->addField('is_global', 'select', array(
111
+ 'name' => 'is_global',
112
+ 'label' => Mage::helper('customerattributes')->__('Scope'),
113
+ 'title' => Mage::helper('customerattributes')->__('Scope'),
114
+ 'note' => Mage::helper('customerattributes')->__('Declare attribute value saving scope'),
115
+ 'values'=> $scopes,
116
+ 'disabled' => true,
117
+ ), 'attribute_code');
118
+
119
+ $fieldset->addField('apply_to', 'select', array(
120
+ 'name' => 'apply_to[]',
121
+ 'label' => Mage::helper('customerattributes')->__('Apply To'),
122
+ 'values' => array(
123
+ array(
124
+ 'value' => 0,
125
+ 'label' => Mage::helper('customerattributes')->__('All Customers')
126
+ ),
127
+ ),
128
+ 'disabled' => true,
129
+ ), 'frontend_class');
130
+
131
+ $fieldset->addField('used_in_forms', 'multiselect', array(
132
+ 'name' => 'used_in_forms[]',
133
+ 'label' => 'Use in froms',
134
+ 'values'=> array(
135
+
136
+ array(
137
+ 'value' => 'adminhtml_customer_address',
138
+ 'label' => 'adminhtml_customer_address'
139
+ ),
140
+ array(
141
+ 'value' => 'customer_address_edit',
142
+ 'label' => 'customer_address_edit'
143
+ ),
144
+ array(
145
+ 'value' => 'customer_register_address',
146
+ 'label' => 'customer_register_address'
147
+ ),
148
+ ),
149
+ ));
150
+ // frontend properties fieldset
151
+ $fieldset = $form->addFieldset('front_fieldset', array('legend'=>Mage::helper('customerattributes')->__('Frontend Properties')));
152
+
153
+
154
+ $fieldset->addField('is_wysiwyg_enabled', 'select', array(
155
+ 'name' => 'is_wysiwyg_enabled',
156
+ 'label' => Mage::helper('customerattributes')->__('Enable WYSIWYG'),
157
+ 'title' => Mage::helper('customerattributes')->__('Enable WYSIWYG'),
158
+ 'values' => $yesnoSource,
159
+ ));
160
+
161
+ $htmlAllowed = $fieldset->addField('is_html_allowed_on_front', 'select', array(
162
+ 'name' => 'is_html_allowed_on_front',
163
+ 'label' => Mage::helper('customerattributes')->__('Allow HTML Tags on Frontend'),
164
+ 'title' => Mage::helper('customerattributes')->__('Allow HTML Tags on Frontend'),
165
+ 'values' => $yesnoSource,
166
+ ));
167
+ if (!$attributeObject->getId() || $attributeObject->getIsWysiwygEnabled()) {
168
+ $attributeObject->setIsHtmlAllowedOnFront(1);
169
+ }
170
+
171
+
172
+ //$form->getElement('apply_to')->setSize(5);
173
+
174
+
175
+
176
+ // define field dependencies
177
+ $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
178
+ ->addFieldMap("is_wysiwyg_enabled", 'wysiwyg_enabled')
179
+ ->addFieldMap("is_html_allowed_on_front", 'html_allowed_on_front')
180
+ ->addFieldMap("frontend_input", 'frontend_input_type')
181
+ ->addFieldDependence('wysiwyg_enabled', 'frontend_input_type', 'textarea')
182
+ ->addFieldDependence('html_allowed_on_front', 'wysiwyg_enabled', '0')
183
+ );
184
+
185
+ /* Mage::dispatchEvent('adminhtml_catalog_product_attribute_edit_prepare_form', array(
186
+ 'form' => $form,
187
+ 'attribute' => $attributeObject
188
+ ));*/
189
+
190
+ return $this;
191
+
192
+ }
193
+
194
+ /**
195
+ * Retrieve additional element types for product attributes
196
+ *
197
+ * @return array
198
+ */
199
+ protected function _getAdditionalElementTypes()
200
+ {
201
+ return array(
202
+ 'apply' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_apply'),
203
+ );
204
+ }
205
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Options.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attribute add/edit form options tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit_Tab_Options extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
35
+ {
36
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/System.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attribute add/edit form system tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit_Tab_System extends Mage_Adminhtml_Block_Widget_Form
36
+ {
37
+
38
+ protected function _prepareForm()
39
+ {
40
+ $model = Mage::registry('entity_attribute');
41
+
42
+ $form = new Varien_Data_Form();
43
+ $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('customerattributes')->__('System Properties')));
44
+
45
+ if ($model->getAttributeId()) {
46
+ $fieldset->addField('attribute_id', 'hidden', array(
47
+ 'name' => 'attribute_id',
48
+ ));
49
+ }
50
+
51
+ $yesno = array(
52
+ array(
53
+ 'value' => 0,
54
+ 'label' => Mage::helper('customerattributes')->__('No')
55
+ ),
56
+ array(
57
+ 'value' => 1,
58
+ 'label' => Mage::helper('customerattributes')->__('Yes')
59
+ ));
60
+
61
+ /*$fieldset->addField('attribute_model', 'text', array(
62
+ 'name' => 'attribute_model',
63
+ 'label' => Mage::helper('catalog')->__('Attribute Model'),
64
+ 'title' => Mage::helper('catalog')->__('Attribute Model'),
65
+ ));
66
+
67
+ $fieldset->addField('backend_model', 'text', array(
68
+ 'name' => 'backend_model',
69
+ 'label' => Mage::helper('catalog')->__('Backend Model'),
70
+ 'title' => Mage::helper('catalog')->__('Backend Model'),
71
+ ));*/
72
+
73
+ $fieldset->addField('backend_type', 'select', array(
74
+ 'name' => 'backend_type',
75
+ 'label' => Mage::helper('customerattributes')->__('Data Type for Saving in Database'),
76
+ 'title' => Mage::helper('customerattributes')->__('Data Type for Saving in Database'),
77
+ 'options' => array(
78
+ 'text' => Mage::helper('customerattributes')->__('Text'),
79
+ 'varchar' => Mage::helper('customerattributes')->__('Varchar'),
80
+ 'static' => Mage::helper('customerattributes')->__('Static'),
81
+ 'datetime' => Mage::helper('customerattributes')->__('Datetime'),
82
+ 'decimal' => Mage::helper('customerattributes')->__('Decimal'),
83
+ 'int' => Mage::helper('customerattributes')->__('Integer'),
84
+ ),
85
+ ));
86
+
87
+ /*$fieldset->addField('backend_table', 'text', array(
88
+ 'name' => 'backend_table',
89
+ 'label' => Mage::helper('catalog')->__('Backend Table'),
90
+ 'title' => Mage::helper('catalog')->__('Backend Table Title'),
91
+ ));
92
+
93
+ $fieldset->addField('frontend_model', 'text', array(
94
+ 'name' => 'frontend_model',
95
+ 'label' => Mage::helper('catalog')->__('Frontend Model'),
96
+ 'title' => Mage::helper('catalog')->__('Frontend Model'),
97
+ ));*/
98
+
99
+ /*$fieldset->addField('is_visible', 'select', array(
100
+ 'name' => 'is_visible',
101
+ 'label' => Mage::helper('catalog')->__('Visible'),
102
+ 'title' => Mage::helper('catalog')->__('Visible'),
103
+ 'values' => $yesno,
104
+ ));*/
105
+
106
+ /*$fieldset->addField('source_model', 'text', array(
107
+ 'name' => 'source_model',
108
+ 'label' => Mage::helper('catalog')->__('Source Model'),
109
+ 'title' => Mage::helper('catalog')->__('Source Model'),
110
+ ));*/
111
+
112
+ $fieldset->addField('is_global', 'select', array(
113
+ 'name' => 'is_global',
114
+ 'label' => Mage::helper('customerattributes')->__('Globally Editable'),
115
+ 'title' => Mage::helper('customerattributes')->__('Globally Editable'),
116
+ 'values'=> $yesno,
117
+ ));
118
+
119
+ $form->setValues($model->getData());
120
+
121
+ if ($model->getAttributeId()) {
122
+ $form->getElement('backend_type')->setDisabled(1);
123
+ if ($model->getIsGlobal()) {
124
+ #$form->getElement('is_global')->setDisabled(1);
125
+ }
126
+ } else {
127
+ }
128
+
129
+ $this->setForm($form);
130
+
131
+ return parent::_prepareForm();
132
+ }
133
+
134
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tabs.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('product_attribute_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('customerattributes')->__('Customer Address Attribute Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('main', array(
17
+ 'label' => Mage::helper('customerattributes')->__('Properties'),
18
+ 'title' => Mage::helper('customerattributes')->__('Properties'),
19
+ 'content' => $this->getLayout()->createBlock('customerattributes/adminhtml_customeraddress_edit_tab_main')->toHtml(),
20
+ ));
21
+
22
+ $model = Mage::registry('entity_attribute');
23
+
24
+ $this->addTab('labels', array(
25
+ 'label' => Mage::helper('customerattributes')->__('Manage Label / Options'),
26
+ 'title' => Mage::helper('customerattributes')->__('Manage Label / Options'),
27
+ 'content' => $this->getLayout()->createBlock('customerattributes/adminhtml_customeraddress_edit_tab_options')->toHtml(),
28
+ ));
29
+ /*$model = Mage::registry('entity_attribute');
30
+
31
+ $this->addTab('labels', array(
32
+ 'label' => Mage::helper('customerattributes')->__('Manage Label / Options'),
33
+ 'title' => Mage::helper('customerattributes')->__('Manage Label / Options'),
34
+ 'content' => $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit_tab_form_options')->toHtml(),
35
+ ));*/
36
+ return parent::_beforeToHtml();
37
+ }
38
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Grid.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_Grid extends Mage_Eav_Block_Adminhtml_Attribute_Grid_Abstract
4
+ {
5
+ protected function _prepareCollection()
6
+ {
7
+ $collection = Mage::getResourceModel('customer/address_attribute_collection');
8
+ $this->setCollection($collection);
9
+ return parent::_prepareCollection();
10
+ }
11
+
12
+ protected function _prepareColumns()
13
+ {
14
+ $this->addColumn('attribute_code', array(
15
+ 'header' => Mage::helper('customer')->__('Attribute Code'),
16
+ 'align' =>'right',
17
+ 'width' => '50px',
18
+ 'index' => 'attribute_code',
19
+ 'align' => 'left',
20
+ ));
21
+
22
+ $this->addColumn('frontend_label', array(
23
+ 'header' => Mage::helper('customer')->__('Attribute Label'),
24
+ 'align' =>'left',
25
+ 'index' => 'frontend_label',
26
+ 'align' => 'left',
27
+ ));
28
+
29
+ $this->addColumn('is_required', array(
30
+ 'header' => Mage::helper('customer')->__('Required'),
31
+ 'align' => 'left',
32
+ 'width' => '80px',
33
+ 'index' => 'is_required',
34
+ 'type' => 'options',
35
+ 'options' => array(
36
+ 1 => Mage::helper('customer')->__('Yes'),
37
+ 0 => Mage::helper('customer')->__('No'),
38
+ ),
39
+ 'align' => 'center',
40
+ ));
41
+
42
+ $this->addColumn('is_user_defined', array(
43
+ 'header' => Mage::helper('customer')->__('System'),
44
+ 'align' => 'left',
45
+ 'width' => '80px',
46
+ 'index' => 'is_user_defined',
47
+ 'type' => 'options',
48
+ 'options' => array(
49
+ 1 => Mage::helper('customer')->__('No'),
50
+ 0 => Mage::helper('customer')->__('Yes'),
51
+ ),
52
+ 'align' => 'center',
53
+ ));
54
+
55
+ return $this;
56
+ }
57
+
58
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/New/Product/Attributes.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attributes tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_New_Product_Attributes extends Mage_Adminhtml_Block_Catalog_Form
35
+ {
36
+ protected function _prepareForm()
37
+ {
38
+
39
+ $form = new Varien_Data_Form();
40
+ /**
41
+ * Initialize product object as form property
42
+ * for using it in elements generation
43
+ */
44
+ $form->setDataObject(Mage::registry('product'));
45
+
46
+ $fieldset = $form->addFieldset('group_fields', array());
47
+
48
+ $attributes = $this->getGroupAttributes();
49
+
50
+ $this->_setFieldset($attributes, $fieldset, array('gallery'));
51
+
52
+ $values = Mage::registry('product')->getData();
53
+ /**
54
+ * Set attribute default values for new product
55
+ */
56
+ if (!Mage::registry('product')->getId()) {
57
+ foreach ($attributes as $attribute) {
58
+ if (!isset($values[$attribute->getAttributeCode()])) {
59
+ $values[$attribute->getAttributeCode()] = $attribute->getDefaultValue();
60
+ }
61
+ }
62
+ }
63
+
64
+ Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form'=>$form));
65
+ $form->addValues($values);
66
+ $form->setFieldNameSuffix('product');
67
+ $this->setForm($form);
68
+ }
69
+
70
+ protected function _getAdditionalElementTypes()
71
+ {
72
+ $result = array(
73
+ 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'),
74
+ 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'),
75
+ 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean')
76
+ );
77
+
78
+ $response = new Varien_Object();
79
+ $response->setTypes(array());
80
+ Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response'=>$response));
81
+
82
+ foreach ($response->getTypes() as $typeName=>$typeClass) {
83
+ $result[$typeName] = $typeClass;
84
+ }
85
+
86
+ return $result;
87
+ }
88
+
89
+ protected function _toHtml()
90
+ {
91
+ parent::_toHtml();
92
+ return $this->getForm()->getElement('group_fields')->getChildrenHtml();
93
+ }
94
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/New/Product/Created.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * New product attribute created on product edit page
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customeraddress_New_Product_Created extends Mage_Adminhtml_Block_Widget
36
+ {
37
+ public function __construct()
38
+ {
39
+ parent::__construct();
40
+ //$this->setTemplate('customerattributes/customer/attribute/new/created.phtml');
41
+ }
42
+
43
+ protected function _prepareLayout()
44
+ {
45
+
46
+ $this->setChild(
47
+ 'attributes',
48
+ $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_new_product_attributes')
49
+ ->setGroupAttributes($this->_getGroupAttributes())
50
+ );
51
+
52
+ $this->setChild(
53
+ 'close_button',
54
+ $this->getLayout()->createBlock('adminhtml/widget_button')
55
+ ->setData(array(
56
+ 'label' => Mage::helper('customerattributes')->__('Close Window'),
57
+ 'onclick' => 'addAttribute(true)'
58
+ ))
59
+ );
60
+
61
+ }
62
+
63
+ protected function _getGroupAttributes()
64
+ {
65
+ $attributes = array();
66
+ $product = Mage::registry('product');
67
+ /* @var $product Mage_Catalog_Model_Product */
68
+ foreach($product->getAttributes($this->getRequest()->getParam('group')) as $attribute) {
69
+ /* @var $attribute Mage_Eav_Model_Entity_Attribute */
70
+ if ($attribute->getId() == $this->getRequest()->getParam('attribute')) {
71
+ $attributes[] = $attribute;
72
+ }
73
+ }
74
+ return $attributes;
75
+ }
76
+
77
+ public function getCloseButtonHtml()
78
+ {
79
+ return $this->getChildHtml('close_button');
80
+ }
81
+
82
+ public function getAttributesBlockJson()
83
+ {
84
+ $result = array(
85
+ $this->getRequest()->getParam('tab') => $this->getChildHtml('attributes')
86
+ );
87
+
88
+ return Mage::helper('core')->jsonEncode($result);
89
+ }
90
+ } // Class Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Created End
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_customerattributes';
7
+ $this->_blockGroup = 'customerattributes';
8
+ $this->_headerText = Mage::helper('customerattributes')->__('Manage Customer Attributes');
9
+ $this->_addButtonLabel = Mage::helper('customerattributes')->__('Add New Customer Attribute');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ $this->_objectId = 'attribute_id';
8
+ $this->_blockGroup = 'customerattributes';
9
+ $this->_controller = 'adminhtml_customerattributes';
10
+
11
+ parent::__construct();
12
+
13
+ if($this->getRequest()->getParam('popup')) {
14
+ $this->_removeButton('back');
15
+ $this->_addButton(
16
+ 'close',
17
+ array(
18
+ 'label' => Mage::helper('customerattributes')->__('Close Window'),
19
+ 'class' => 'cancel',
20
+ 'onclick' => 'window.close()',
21
+ 'level' => -1
22
+ )
23
+ );
24
+ } else {
25
+ $this->_addButton(
26
+ 'save_and_edit_button',
27
+ array(
28
+ 'label' => Mage::helper('customerattributes')->__('Save and Continue Edit'),
29
+ 'onclick' => 'saveAndContinueEdit()',
30
+ 'class' => 'save'
31
+ ),
32
+ 100
33
+ );
34
+ }
35
+
36
+ $this->_updateButton('save', 'label', Mage::helper('customerattributes')->__('Save Attribute'));
37
+ $this->_updateButton('save', 'onclick', 'saveAttribute()');
38
+ if (! Mage::registry('entity_attribute')->getIsUserDefined()) {
39
+ $this->_removeButton('delete');
40
+ } else {
41
+ $this->_updateButton('delete', 'label', Mage::helper('customerattributes')->__('Delete Attribute'));
42
+ }
43
+ }
44
+
45
+ public function getHeaderText()
46
+ {
47
+ if (Mage::registry('entity_attribute')->getId()) {
48
+ $frontendLabel = Mage::registry('entity_attribute')->getFrontendLabel();
49
+ if (is_array($frontendLabel)) {
50
+ $frontendLabel = $frontendLabel[0];
51
+ }
52
+ return Mage::helper('customerattributes')->__('Edit Customer Attribute "%s"', $this->htmlEscape($frontendLabel));
53
+ }
54
+ else {
55
+ return Mage::helper('customerattributes')->__('New Customer Attribute');
56
+ }
57
+ }
58
+
59
+ public function getValidationUrl()
60
+ {
61
+ return $this->getUrl('*/*/validate', array('_current'=>true));
62
+ }
63
+
64
+ public function getSaveUrl()
65
+ {
66
+ return $this->getUrl('*/'.$this->_controller.'/save', array('_current'=>true, 'back'=>null));
67
+ }
68
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('attribute_id' => $this->getRequest()->getParam('attribute_id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Front.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attribute add/edit form main tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit_Tab_Front extends Mage_Adminhtml_Block_Widget_Form
36
+ {
37
+
38
+ protected function _prepareForm()
39
+ {
40
+ $model = Mage::registry('entity_attribute');
41
+
42
+ $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
43
+
44
+ $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('customerattributes')->__('Frontend Properties')));
45
+
46
+ $yesno = array(
47
+ array(
48
+ 'value' => 0,
49
+ 'label' => Mage::helper('customerattributes')->__('No')
50
+ ),
51
+ array(
52
+ 'value' => 1,
53
+ 'label' => Mage::helper('customerattributes')->__('Yes')
54
+ ));
55
+
56
+
57
+ $fieldset->addField('is_searchable', 'select', array(
58
+ 'name' => 'is_searchable',
59
+ 'label' => Mage::helper('customerattributes')->__('Use in Quick Search'),
60
+ 'title' => Mage::helper('customerattributes')->__('Use in Quick Search'),
61
+ 'values' => $yesno,
62
+ ));
63
+
64
+ $fieldset->addField('is_visible_in_advanced_search', 'select', array(
65
+ 'name' => 'is_visible_in_advanced_search',
66
+ 'label' => Mage::helper('customerattributes')->__('Use in Advanced Search'),
67
+ 'title' => Mage::helper('customerattributes')->__('Use in Advanced Search'),
68
+ 'values' => $yesno,
69
+ ));
70
+
71
+ $fieldset->addField('is_comparable', 'select', array(
72
+ 'name' => 'is_comparable',
73
+ 'label' => Mage::helper('customerattributes')->__('Comparable on the Frontend'),
74
+ 'title' => Mage::helper('customerattributes')->__('Comparable on the Frontend'),
75
+ 'values' => $yesno,
76
+ ));
77
+
78
+
79
+ $fieldset->addField('is_filterable', 'select', array(
80
+ 'name' => 'is_filterable',
81
+ 'label' => Mage::helper('customerattributes')->__("Use in Layered Navigation<br/>(Can be used only with catalog input type 'Dropdown')"),
82
+ 'title' => Mage::helper('customerattributes')->__('Can be used only with catalog input type Dropdown'),
83
+ 'values' => array(
84
+ array('value' => '0', 'label' => Mage::helper('customerattributes')->__('No')),
85
+ array('value' => '1', 'label' => Mage::helper('customerattributes')->__('Filterable (with results)')),
86
+ array('value' => '2', 'label' => Mage::helper('customerattributes')->__('Filterable (no results)')),
87
+ ),
88
+ ));
89
+
90
+ // if ($model->getIsUserDefined() || !$model->getId()) {
91
+ $fieldset->addField('is_visible_on_front', 'select', array(
92
+ 'name' => 'is_visible_on_front',
93
+ 'label' => Mage::helper('customerattributes')->__('Visible on Catalog Pages on Front-end'),
94
+ 'title' => Mage::helper('customerattributes')->__('Visible on Catalog Pages on Front-end'),
95
+ 'values' => $yesno,
96
+ ));
97
+ // }
98
+
99
+ $form->setValues($model->getData());
100
+
101
+ $this->setForm($form);
102
+
103
+ return parent::_prepareForm();
104
+ }
105
+
106
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Main.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Product attribute add/edit form main tab
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Adminhtml
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit_Tab_Main extends Tatva_Customerattributes_Block_Adminhtml_Attribute_Edit_Main_Abstract
36
+ {
37
+ /**
38
+ * Adding product form elements for editing attribute
39
+ *
40
+ * @return Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Main
41
+ */
42
+ protected function _prepareForm()
43
+ {
44
+ parent::_prepareForm();
45
+ $attributeObject = $this->getAttributeObject();
46
+ //echo "<pre>";print_r($attributeObject->getData());
47
+
48
+ /* @var $form Varien_Data_Form */
49
+ $form = $this->getForm();
50
+ /* @var $fieldset Varien_Data_Form_Element_Fieldset */
51
+ $fieldset = $form->getElement('base_fieldset');
52
+
53
+ $frontendInputElm = $form->getElement('frontend_input');
54
+ $additionalTypes = array(
55
+ /*array(
56
+ 'value' => 'price',
57
+ 'label' => Mage::helper('customerattributes')->__('Price')
58
+ ),*/
59
+ /*array(
60
+ 'value' => 'media_image',
61
+ 'label' => Mage::helper('customerattributes')->__('Media Image')
62
+ )*/
63
+ );
64
+ if ($attributeObject->getFrontendInput() == 'gallery') {
65
+ $additionalTypes[] = array(
66
+ 'value' => 'gallery',
67
+ 'label' => Mage::helper('customerattributes')->__('Gallery')
68
+ );
69
+ }
70
+
71
+ $response = new Varien_Object();
72
+ $response->setTypes(array());
73
+ //Mage::dispatchEvent('adminhtml_product_attribute_types', array('response'=>$response));
74
+ $_disabledTypes = array();
75
+ $_hiddenFields = array();
76
+ foreach ($response->getTypes() as $type) {
77
+ $additionalTypes[] = $type;
78
+ if (isset($type['hide_fields'])) {
79
+ $_hiddenFields[$type['value']] = $type['hide_fields'];
80
+ }
81
+ if (isset($type['disabled_types'])) {
82
+ $_disabledTypes[$type['value']] = $type['disabled_types'];
83
+ }
84
+ }
85
+ /* Mage::register('customer_attribute_type_hidden_fields', $_hiddenFields);
86
+ Mage::register('customer_attribute_type_disabled_types', $_disabledTypes);*/
87
+
88
+ $frontendInputValues = array_merge($frontendInputElm->getValues(), $additionalTypes);
89
+ $frontendInputElm->setValues($frontendInputValues);
90
+
91
+ $yesnoSource = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
92
+
93
+
94
+ $scopes = array(
95
+ array(
96
+ 'value'=>'0',
97
+ 'label'=>'Store View',
98
+ ),
99
+ array(
100
+ 'value'=>'1',
101
+ 'label'=>'global',
102
+ ),
103
+ array(
104
+ 'value'=>'2',
105
+ 'label'=>'website',
106
+ ),
107
+ );
108
+
109
+
110
+ $fieldset->addField('is_global', 'select', array(
111
+ 'name' => 'is_global',
112
+ 'label' => Mage::helper('customerattributes')->__('Scope'),
113
+ 'title' => Mage::helper('customerattributes')->__('Scope'),
114
+ 'note' => Mage::helper('customerattributes')->__('Declare attribute value saving scope'),
115
+ 'values'=> $scopes,
116
+ 'disabled' => true,
117
+ ), 'attribute_code');
118
+
119
+ $fieldset->addField('apply_to', 'select', array(
120
+ 'name' => 'apply_to[]',
121
+ 'label' => Mage::helper('customerattributes')->__('Apply To'),
122
+ 'values' => array(
123
+ array(
124
+ 'value' => 0,
125
+ 'label' => Mage::helper('customerattributes')->__('All Customers')
126
+ ),
127
+ ),
128
+ 'disabled' => true,
129
+ ), 'frontend_class');
130
+
131
+ $fieldset->addField('used_in_forms', 'multiselect', array(
132
+ 'name' => 'used_in_forms[]',
133
+ 'label' => 'Use in froms',
134
+ 'values'=> array(
135
+ array(
136
+ 'value' => 'adminhtml_customer',
137
+ 'label' => 'adminhtml_customer'
138
+ ),
139
+ array(
140
+ 'value' => 'customer_account_create',
141
+ 'label' => 'customer_account_create'
142
+ ),
143
+ array(
144
+ 'value' => 'customer_account_edit',
145
+ 'label' => 'customer_account_edit'
146
+ ),
147
+ array(
148
+ 'value' => 'checkout_register',
149
+ 'label' => 'checkout_register'
150
+ ),
151
+ ),
152
+ ));
153
+ // frontend properties fieldset
154
+ $fieldset = $form->addFieldset('front_fieldset', array('legend'=>Mage::helper('customerattributes')->__('Frontend Properties')));
155
+
156
+
157
+ $fieldset->addField('is_wysiwyg_enabled', 'select', array(
158
+ 'name' => 'is_wysiwyg_enabled',
159
+ 'label' => Mage::helper('customerattributes')->__('Enable WYSIWYG'),
160
+ 'title' => Mage::helper('customerattributes')->__('Enable WYSIWYG'),
161
+ 'values' => $yesnoSource,
162
+ ));
163
+
164
+ $htmlAllowed = $fieldset->addField('is_html_allowed_on_front', 'select', array(
165
+ 'name' => 'is_html_allowed_on_front',
166
+ 'label' => Mage::helper('customerattributes')->__('Allow HTML Tags on Frontend'),
167
+ 'title' => Mage::helper('customerattributes')->__('Allow HTML Tags on Frontend'),
168
+ 'values' => $yesnoSource,
169
+ ));
170
+ if (!$attributeObject->getId() || $attributeObject->getIsWysiwygEnabled()) {
171
+ $attributeObject->setIsHtmlAllowedOnFront(1);
172
+ }
173
+
174
+
175
+ //$form->getElement('apply_to')->setSize(5);
176
+
177
+
178
+
179
+ // define field dependencies
180
+ $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
181
+ ->addFieldMap("is_wysiwyg_enabled", 'wysiwyg_enabled')
182
+ ->addFieldMap("is_html_allowed_on_front", 'html_allowed_on_front')
183
+ ->addFieldMap("frontend_input", 'frontend_input_type')
184
+ ->addFieldDependence('wysiwyg_enabled', 'frontend_input_type', 'textarea')
185
+ ->addFieldDependence('html_allowed_on_front', 'wysiwyg_enabled', '0')
186
+ );
187
+
188
+ /* Mage::dispatchEvent('adminhtml_catalog_product_attribute_edit_prepare_form', array(
189
+ 'form' => $form,
190
+ 'attribute' => $attributeObject
191
+ ));*/
192
+
193
+ return $this;
194
+
195
+ }
196
+
197
+ /**
198
+ * Retrieve additional element types for product attributes
199
+ *
200
+ * @return array
201
+ */
202
+ protected function _getAdditionalElementTypes()
203
+ {
204
+ return array(
205
+ 'apply' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_apply'),
206
+ );
207
+ }
208
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Options.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attribute add/edit form options tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit_Tab_Options extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
35
+ {
36
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/System.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attribute add/edit form system tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit_Tab_System extends Mage_Adminhtml_Block_Widget_Form
36
+ {
37
+
38
+ protected function _prepareForm()
39
+ {
40
+ $model = Mage::registry('entity_attribute');
41
+
42
+ $form = new Varien_Data_Form();
43
+ $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('customerattributes')->__('System Properties')));
44
+
45
+ if ($model->getAttributeId()) {
46
+ $fieldset->addField('attribute_id', 'hidden', array(
47
+ 'name' => 'attribute_id',
48
+ ));
49
+ }
50
+
51
+ $yesno = array(
52
+ array(
53
+ 'value' => 0,
54
+ 'label' => Mage::helper('customerattributes')->__('No')
55
+ ),
56
+ array(
57
+ 'value' => 1,
58
+ 'label' => Mage::helper('customerattributes')->__('Yes')
59
+ ));
60
+
61
+ /*$fieldset->addField('attribute_model', 'text', array(
62
+ 'name' => 'attribute_model',
63
+ 'label' => Mage::helper('catalog')->__('Attribute Model'),
64
+ 'title' => Mage::helper('catalog')->__('Attribute Model'),
65
+ ));
66
+
67
+ $fieldset->addField('backend_model', 'text', array(
68
+ 'name' => 'backend_model',
69
+ 'label' => Mage::helper('catalog')->__('Backend Model'),
70
+ 'title' => Mage::helper('catalog')->__('Backend Model'),
71
+ ));*/
72
+
73
+ $fieldset->addField('backend_type', 'select', array(
74
+ 'name' => 'backend_type',
75
+ 'label' => Mage::helper('customerattributes')->__('Data Type for Saving in Database'),
76
+ 'title' => Mage::helper('customerattributes')->__('Data Type for Saving in Database'),
77
+ 'options' => array(
78
+ 'text' => Mage::helper('customerattributes')->__('Text'),
79
+ 'varchar' => Mage::helper('customerattributes')->__('Varchar'),
80
+ 'static' => Mage::helper('customerattributes')->__('Static'),
81
+ 'datetime' => Mage::helper('customerattributes')->__('Datetime'),
82
+ 'decimal' => Mage::helper('customerattributes')->__('Decimal'),
83
+ 'int' => Mage::helper('customerattributes')->__('Integer'),
84
+ ),
85
+ ));
86
+
87
+ /*$fieldset->addField('backend_table', 'text', array(
88
+ 'name' => 'backend_table',
89
+ 'label' => Mage::helper('catalog')->__('Backend Table'),
90
+ 'title' => Mage::helper('catalog')->__('Backend Table Title'),
91
+ ));
92
+
93
+ $fieldset->addField('frontend_model', 'text', array(
94
+ 'name' => 'frontend_model',
95
+ 'label' => Mage::helper('catalog')->__('Frontend Model'),
96
+ 'title' => Mage::helper('catalog')->__('Frontend Model'),
97
+ ));*/
98
+
99
+ /*$fieldset->addField('is_visible', 'select', array(
100
+ 'name' => 'is_visible',
101
+ 'label' => Mage::helper('catalog')->__('Visible'),
102
+ 'title' => Mage::helper('catalog')->__('Visible'),
103
+ 'values' => $yesno,
104
+ ));*/
105
+
106
+ /*$fieldset->addField('source_model', 'text', array(
107
+ 'name' => 'source_model',
108
+ 'label' => Mage::helper('catalog')->__('Source Model'),
109
+ 'title' => Mage::helper('catalog')->__('Source Model'),
110
+ ));*/
111
+
112
+ $fieldset->addField('is_global', 'select', array(
113
+ 'name' => 'is_global',
114
+ 'label' => Mage::helper('customerattributes')->__('Globally Editable'),
115
+ 'title' => Mage::helper('customerattributes')->__('Globally Editable'),
116
+ 'values'=> $yesno,
117
+ ));
118
+
119
+ $form->setValues($model->getData());
120
+
121
+ if ($model->getAttributeId()) {
122
+ $form->getElement('backend_type')->setDisabled(1);
123
+ if ($model->getIsGlobal()) {
124
+ #$form->getElement('is_global')->setDisabled(1);
125
+ }
126
+ } else {
127
+ }
128
+
129
+ $this->setForm($form);
130
+
131
+ return parent::_prepareForm();
132
+ }
133
+
134
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tabs.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('product_attribute_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('customerattributes')->__('Customer Attribute Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('main', array(
17
+ 'label' => Mage::helper('customerattributes')->__('Properties'),
18
+ 'title' => Mage::helper('customerattributes')->__('Properties'),
19
+ 'content' => $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit_tab_main')->toHtml(),
20
+ ));
21
+
22
+ $model = Mage::registry('entity_attribute');
23
+
24
+ $this->addTab('labels', array(
25
+ 'label' => Mage::helper('customerattributes')->__('Manage Label / Options'),
26
+ 'title' => Mage::helper('customerattributes')->__('Manage Label / Options'),
27
+ 'content' => $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit_tab_options')->toHtml(),
28
+ ));
29
+ /*$model = Mage::registry('entity_attribute');
30
+
31
+ $this->addTab('labels', array(
32
+ 'label' => Mage::helper('customerattributes')->__('Manage Label / Options'),
33
+ 'title' => Mage::helper('customerattributes')->__('Manage Label / Options'),
34
+ 'content' => $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit_tab_form_options')->toHtml(),
35
+ ));*/
36
+ return parent::_beforeToHtml();
37
+ }
38
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Grid.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_Grid extends Mage_Eav_Block_Adminhtml_Attribute_Grid_Abstract
4
+ {
5
+ protected function _prepareCollection()
6
+ {
7
+ $collection = Mage::getResourceModel('customer/attribute_collection');
8
+ $this->setCollection($collection);
9
+ return parent::_prepareCollection();
10
+ }
11
+
12
+ protected function _prepareColumns()
13
+ {
14
+ $this->addColumn('attribute_code', array(
15
+ 'header' => Mage::helper('customer')->__('Attribute Code'),
16
+ 'align' =>'right',
17
+ 'width' => '50px',
18
+ 'index' => 'attribute_code',
19
+ 'align' => 'left',
20
+ ));
21
+
22
+ $this->addColumn('frontend_label', array(
23
+ 'header' => Mage::helper('customer')->__('Attribute Label'),
24
+ 'align' =>'left',
25
+ 'index' => 'frontend_label',
26
+ 'align' => 'left',
27
+ ));
28
+
29
+ $this->addColumn('is_required', array(
30
+ 'header' => Mage::helper('customer')->__('Required'),
31
+ 'align' => 'left',
32
+ 'width' => '80px',
33
+ 'index' => 'is_required',
34
+ 'type' => 'options',
35
+ 'options' => array(
36
+ 1 => Mage::helper('customer')->__('Yes'),
37
+ 0 => Mage::helper('customer')->__('No'),
38
+ ),
39
+ 'align' => 'center',
40
+ ));
41
+
42
+ $this->addColumn('is_user_defined', array(
43
+ 'header' => Mage::helper('customer')->__('System'),
44
+ 'align' => 'left',
45
+ 'width' => '80px',
46
+ 'index' => 'is_user_defined',
47
+ 'type' => 'options',
48
+ 'options' => array(
49
+ 1 => Mage::helper('customer')->__('No'),
50
+ 0 => Mage::helper('customer')->__('Yes'),
51
+ ),
52
+ 'align' => 'center',
53
+ ));
54
+
55
+ return $this;
56
+ }
57
+
58
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/New/Product/Attributes.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product attributes tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_New_Product_Attributes extends Mage_Adminhtml_Block_Catalog_Form
35
+ {
36
+ protected function _prepareForm()
37
+ {
38
+
39
+ $form = new Varien_Data_Form();
40
+ /**
41
+ * Initialize product object as form property
42
+ * for using it in elements generation
43
+ */
44
+ $form->setDataObject(Mage::registry('product'));
45
+
46
+ $fieldset = $form->addFieldset('group_fields', array());
47
+
48
+ $attributes = $this->getGroupAttributes();
49
+
50
+ $this->_setFieldset($attributes, $fieldset, array('gallery'));
51
+
52
+ $values = Mage::registry('product')->getData();
53
+ /**
54
+ * Set attribute default values for new product
55
+ */
56
+ if (!Mage::registry('product')->getId()) {
57
+ foreach ($attributes as $attribute) {
58
+ if (!isset($values[$attribute->getAttributeCode()])) {
59
+ $values[$attribute->getAttributeCode()] = $attribute->getDefaultValue();
60
+ }
61
+ }
62
+ }
63
+
64
+ Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form'=>$form));
65
+ $form->addValues($values);
66
+ $form->setFieldNameSuffix('product');
67
+ $this->setForm($form);
68
+ }
69
+
70
+ protected function _getAdditionalElementTypes()
71
+ {
72
+ $result = array(
73
+ 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'),
74
+ 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'),
75
+ 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean')
76
+ );
77
+
78
+ $response = new Varien_Object();
79
+ $response->setTypes(array());
80
+ Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response'=>$response));
81
+
82
+ foreach ($response->getTypes() as $typeName=>$typeClass) {
83
+ $result[$typeName] = $typeClass;
84
+ }
85
+
86
+ return $result;
87
+ }
88
+
89
+ protected function _toHtml()
90
+ {
91
+ parent::_toHtml();
92
+ return $this->getForm()->getElement('group_fields')->getChildrenHtml();
93
+ }
94
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/New/Product/Created.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * New product attribute created on product edit page
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Tatva_Customerattributes_Block_Adminhtml_Customerattributes_New_Product_Created extends Mage_Adminhtml_Block_Widget
36
+ {
37
+ public function __construct()
38
+ {
39
+ parent::__construct();
40
+ $this->setTemplate('customerattributes/customer/attribute/new/created.phtml');
41
+ }
42
+
43
+ protected function _prepareLayout()
44
+ {
45
+
46
+ $this->setChild(
47
+ 'attributes',
48
+ $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_new_product_attributes')
49
+ ->setGroupAttributes($this->_getGroupAttributes())
50
+ );
51
+
52
+ $this->setChild(
53
+ 'close_button',
54
+ $this->getLayout()->createBlock('adminhtml/widget_button')
55
+ ->setData(array(
56
+ 'label' => Mage::helper('customerattributes')->__('Close Window'),
57
+ 'onclick' => 'addAttribute(true)'
58
+ ))
59
+ );
60
+
61
+ }
62
+
63
+ protected function _getGroupAttributes()
64
+ {
65
+ $attributes = array();
66
+ $product = Mage::registry('product');
67
+ /* @var $product Mage_Catalog_Model_Product */
68
+ foreach($product->getAttributes($this->getRequest()->getParam('group')) as $attribute) {
69
+ /* @var $attribute Mage_Eav_Model_Entity_Attribute */
70
+ if ($attribute->getId() == $this->getRequest()->getParam('attribute')) {
71
+ $attributes[] = $attribute;
72
+ }
73
+ }
74
+ return $attributes;
75
+ }
76
+
77
+ public function getCloseButtonHtml()
78
+ {
79
+ return $this->getChildHtml('close_button');
80
+ }
81
+
82
+ public function getAttributesBlockJson()
83
+ {
84
+ $result = array(
85
+ $this->getRequest()->getParam('tab') => $this->getChildHtml('attributes')
86
+ );
87
+
88
+ return Mage::helper('core')->jsonEncode($result);
89
+ }
90
+ } // Class Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Created End
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Grid/Renderer/Image.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Customerattributes_Block_Adminhtml_Grid_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ if($row->getData($this->getColumn()->getIndex())==""){
7
+ return "";
8
+ }
9
+ else{
10
+ $html = '<img ';
11
+ $html .= 'id="' . $this->getColumn()->getId() . '" ';
12
+ /*$html .= 'width="45" ';
13
+ $html .= 'height="35" ';*/
14
+ $html .= 'src="' . Mage::getBaseUrl("media")."customer" . $row->getData($this->getColumn()->getIndex()) . '"';
15
+ $html .= 'class="grid-image ' . $this->getColumn()->getInlineCss() . '"/>';
16
+ return $html;
17
+ }
18
+ }
19
+ }
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Multiselectattributes.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Customerattributes_Block_Adminhtml_Widget_Grid_Column_Renderer_Multiselectattributes extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $options = $this->getColumn()->getOptions();
7
+ $showMissingOptionValues = (bool)$this->getColumn()->getShowMissingOptionValues();
8
+ if (!empty($options) && is_array($options)) {
9
+ $value = $row->getData($this->getColumn()->getIndex());
10
+ if (is_array($value)) {
11
+ $res = array();
12
+ foreach ($value as $item) {
13
+ if (isset($options[$item])) {
14
+ $res[] = $options[$item];
15
+ }
16
+ elseif ($showMissingOptionValues) {
17
+ $res[] = $item;
18
+ }
19
+ }
20
+ return implode(', ', $res);
21
+ }
22
+ elseif (isset($options[$value])) {
23
+ return $options[$value];
24
+ } elseif (is_string($value)) { // <--- MY CHANGES HERE
25
+ $values = explode(',', $value);
26
+ $returnOptions = "";
27
+ foreach($values as $k=>$v) {
28
+ $returnOptions .= $options[$v]. ", ";
29
+ }
30
+ return substr($returnOptions, 0, -2);
31
+ }
32
+ return '';
33
+ }
34
+ }
35
+ }
app/code/local/Tatva/Customerattributes/Helper/Data.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getAttributeHiddenFields()
6
+ {
7
+ if (Mage::registry('customer_attribute_type_hidden_fields')) {
8
+ return Mage::registry('customer_attribute_type_hidden_fields');
9
+ } else {
10
+ return array();
11
+ }
12
+ }
13
+
14
+ /**
15
+ * Retrieve attribute disabled types
16
+ *
17
+ * @return array
18
+ */
19
+ public function getAttributeDisabledTypes()
20
+ {
21
+ if (Mage::registry('customer_attribute_type_disabled_types')) {
22
+ return Mage::registry('customer_attribute_type_disabled_types');
23
+ } else {
24
+ return array();
25
+ }
26
+ }
27
+ }
app/code/local/Tatva/Customerattributes/Model/Adminhtml/Resource/Eav/Attribute.php ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Catalog
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Catalog attribute model
29
+ *
30
+ * @method Mage_Catalog_Model_Resource_Attribute _getResource()
31
+ * @method Mage_Catalog_Model_Resource_Attribute getResource()
32
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getFrontendInputRenderer()
33
+ * @method string setFrontendInputRenderer(string $value)
34
+ * @method int setIsGlobal(int $value)
35
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsVisible()
36
+ * @method int setIsVisible(int $value)
37
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsSearchable()
38
+ * @method int setIsSearchable(int $value)
39
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getSearchWeight()
40
+ * @method int setSearchWeight(int $value)
41
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsFilterable()
42
+ * @method int setIsFilterable(int $value)
43
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsComparable()
44
+ * @method int setIsComparable(int $value)
45
+ * @method int setIsVisibleOnFront(int $value)
46
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsHtmlAllowedOnFront()
47
+ * @method int setIsHtmlAllowedOnFront(int $value)
48
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsUsedForPriceRules()
49
+ * @method int setIsUsedForPriceRules(int $value)
50
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsFilterableInSearch()
51
+ * @method int setIsFilterableInSearch(int $value)
52
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getUsedInProductListing()
53
+ * @method int setUsedInProductListing(int $value)
54
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getUsedForSortBy()
55
+ * @method int setUsedForSortBy(int $value)
56
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsConfigurable()
57
+ * @method int setIsConfigurable(int $value)
58
+ * @method string setApplyTo(string $value)
59
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsVisibleInAdvancedSearch()
60
+ * @method int setIsVisibleInAdvancedSearch(int $value)
61
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getPosition()
62
+ * @method int setPosition(int $value)
63
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsWysiwygEnabled()
64
+ * @method int setIsWysiwygEnabled(int $value)
65
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsUsedForPromoRules()
66
+ * @method int setIsUsedForPromoRules(int $value)
67
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsUsedForCustomerSegment()
68
+ * @method int setIsUsedForCustomerSegment(int $value)
69
+ * @method Mage_Catalog_Model_Resource_Eav_Attribute getIsUsedForTargetRules()
70
+ * @method int setIsUsedForTargetRules(int $value)
71
+ *
72
+ * @category Mage
73
+ * @package Mage_Catalog
74
+ * @author Magento Core Team <core@magentocommerce.com>
75
+ */
76
+ class Tatva_Customerattributes_Model_Adminhtml_Resource_Eav_Attribute extends Mage_Eav_Model_Entity_Attribute
77
+ {
78
+ const SCOPE_STORE = 0;
79
+ const SCOPE_GLOBAL = 1;
80
+ const SCOPE_WEBSITE = 2;
81
+
82
+ const MODULE_NAME = 'Mage_Catalog';
83
+ const ENTITY = 'catalog_eav_attribute';
84
+
85
+ /**
86
+ * Event prefix
87
+ *
88
+ * @var string
89
+ */
90
+ protected $_eventPrefix = 'catalog_entity_attribute';
91
+ /**
92
+ * Event object name
93
+ *
94
+ * @var string
95
+ */
96
+ protected $_eventObject = 'attribute';
97
+
98
+ /**
99
+ * Array with labels
100
+ *
101
+ * @var array
102
+ */
103
+ static protected $_labels = null;
104
+
105
+ protected function _construct()
106
+ {
107
+ $this->_init('catalog/attribute');
108
+ }
109
+
110
+ /**
111
+ * Processing object before save data
112
+ *
113
+ * @throws Mage_Core_Exception
114
+ * @return Mage_Core_Model_Abstract
115
+ */
116
+ protected function _beforeSave()
117
+ {
118
+ $this->setData('modulePrefix', self::MODULE_NAME);
119
+ if (isset($this->_origData['is_global'])) {
120
+ if (!isset($this->_data['is_global'])) {
121
+ $this->_data['is_global'] = self::SCOPE_GLOBAL;
122
+ }
123
+ if (($this->_data['is_global'] != $this->_origData['is_global'])
124
+ && $this->_getResource()->isUsedBySuperProducts($this)) {
125
+ Mage::throwException(Mage::helper('catalog')->__('Scope must not be changed, because the attribute is used in configurable products.'));
126
+ }
127
+ }
128
+ if ($this->getFrontendInput() == 'price') {
129
+ if (!$this->getBackendModel()) {
130
+ $this->setBackendModel('catalog/product_attribute_backend_price');
131
+ }
132
+ }
133
+ if ($this->getFrontendInput() == 'textarea') {
134
+ if ($this->getIsWysiwygEnabled()) {
135
+ $this->setIsHtmlAllowedOnFront(1);
136
+ }
137
+ }
138
+ return parent::_beforeSave();
139
+ }
140
+
141
+ /**
142
+ * Processing object after save data
143
+ *
144
+ * @return Mage_Core_Model_Abstract
145
+ */
146
+ protected function _afterSave()
147
+ {
148
+ /**
149
+ * Fix saving attribute in admin
150
+ */
151
+ Mage::getSingleton('eav/config')->clear();
152
+
153
+ Mage::getSingleton('index/indexer')->processEntityAction(
154
+ $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE
155
+ );
156
+ return parent::_afterSave();
157
+ }
158
+
159
+ /**
160
+ * Register indexing event before delete catalog eav attribute
161
+ *
162
+ * @return Mage_Catalog_Model_Resource_Eav_Attribute
163
+ */
164
+ protected function _beforeDelete()
165
+ {
166
+ if ($this->_getResource()->isUsedBySuperProducts($this)) {
167
+ Mage::throwException(Mage::helper('catalog')->__('This attribute is used in configurable products.'));
168
+ }
169
+ Mage::getSingleton('index/indexer')->logEvent(
170
+ $this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE
171
+ );
172
+ return parent::_beforeDelete();
173
+ }
174
+
175
+ /**
176
+ * Init indexing process after catalog eav attribute delete commit
177
+ *
178
+ * @return Mage_Catalog_Model_Resource_Eav_Attribute
179
+ */
180
+ protected function _afterDeleteCommit()
181
+ {
182
+ parent::_afterDeleteCommit();
183
+ Mage::getSingleton('index/indexer')->indexEvents(
184
+ self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE
185
+ );
186
+ return $this;
187
+ }
188
+
189
+ /**
190
+ * Return is attribute global
191
+ *
192
+ * @return integer
193
+ */
194
+ public function getIsGlobal()
195
+ {
196
+ return $this->_getData('is_global');
197
+ }
198
+
199
+ /**
200
+ * Retrieve attribute is global scope flag
201
+ *
202
+ * @return bool
203
+ */
204
+ public function isScopeGlobal()
205
+ {
206
+ return $this->getIsGlobal() == self::SCOPE_GLOBAL;
207
+ }
208
+
209
+ /**
210
+ * Retrieve attribute is website scope website
211
+ *
212
+ * @return bool
213
+ */
214
+ public function isScopeWebsite()
215
+ {
216
+ return $this->getIsGlobal() == self::SCOPE_WEBSITE;
217
+ }
218
+
219
+ /**
220
+ * Retrieve attribute is store scope flag
221
+ *
222
+ * @return bool
223
+ */
224
+ public function isScopeStore()
225
+ {
226
+ return !$this->isScopeGlobal() && !$this->isScopeWebsite();
227
+ }
228
+
229
+ /**
230
+ * Retrieve store id
231
+ *
232
+ * @return int
233
+ */
234
+ public function getStoreId()
235
+ {
236
+ $dataObject = $this->getDataObject();
237
+ if ($dataObject) {
238
+ return $dataObject->getStoreId();
239
+ }
240
+ return $this->getData('store_id');
241
+ }
242
+
243
+ /**
244
+ * Retrieve apply to products array
245
+ * Return empty array if applied to all products
246
+ *
247
+ * @return array
248
+ */
249
+ public function getApplyTo()
250
+ {
251
+ if ($this->getData('apply_to')) {
252
+ if (is_array($this->getData('apply_to'))) {
253
+ return $this->getData('apply_to');
254
+ }
255
+ return explode(',', $this->getData('apply_to'));
256
+ } else {
257
+ return array();
258
+ }
259
+ }
260
+
261
+ /**
262
+ * Retrieve source model
263
+ *
264
+ * @return Mage_Eav_Model_Entity_Attribute_Source_Abstract
265
+ */
266
+ public function getSourceModel()
267
+ {
268
+ $model = $this->getData('source_model');
269
+ if (empty($model)) {
270
+ if ($this->getBackendType() == 'int' && $this->getFrontendInput() == 'select') {
271
+ return $this->_getDefaultSourceModel();
272
+ }
273
+ }
274
+ return $model;
275
+ }
276
+
277
+ /**
278
+ * Check is allow for rule condition
279
+ *
280
+ * @return bool
281
+ */
282
+ public function isAllowedForRuleCondition()
283
+ {
284
+ $allowedInputTypes = array('text', 'multiselect', 'textarea', 'date', 'datetime', 'select', 'boolean', 'price');
285
+ return $this->getIsVisible() && in_array($this->getFrontendInput(), $allowedInputTypes);
286
+ }
287
+
288
+ /**
289
+ * Retrieve don't translated frontend label
290
+ *
291
+ * @return string
292
+ */
293
+ public function getFrontendLabel()
294
+ {
295
+ return $this->_getData('frontend_label');
296
+ }
297
+
298
+ /**
299
+ * Get Attribute translated label for store
300
+ *
301
+ * @deprecated
302
+ * @return string
303
+ */
304
+ protected function _getLabelForStore()
305
+ {
306
+ return $this->getFrontendLabel();
307
+ }
308
+
309
+ /**
310
+ * Initialize store Labels for attributes
311
+ *
312
+ * @deprecated
313
+ * @param int $storeId
314
+ */
315
+ public static function initLabels($storeId = null)
316
+ {
317
+ if (is_null(self::$_labels)) {
318
+ if (is_null($storeId)) {
319
+ $storeId = Mage::app()->getStore()->getId();
320
+ }
321
+ $attributeLabels = array();
322
+ $attributes = Mage::getResourceSingleton('catalog/product')->getAttributesByCode();
323
+ foreach ($attributes as $attribute) {
324
+ if (strlen($attribute->getData('frontend_label')) > 0) {
325
+ $attributeLabels[] = $attribute->getData('frontend_label');
326
+ }
327
+ }
328
+
329
+ self::$_labels = Mage::app()->getTranslator()->getResource()
330
+ ->getTranslationArrayByStrings($attributeLabels, $storeId);
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Get default attribute source model
336
+ *
337
+ * @return string
338
+ */
339
+ public function _getDefaultSourceModel()
340
+ {
341
+ return 'eav/entity_attribute_source_table';
342
+ }
343
+
344
+ /**
345
+ * Check is an attribute used in EAV index
346
+ *
347
+ * @return bool
348
+ */
349
+ public function isIndexable()
350
+ {
351
+ // exclude price attribute
352
+ if ($this->getAttributeCode() == 'price') {
353
+ return false;
354
+ }
355
+
356
+ if (!$this->getIsFilterableInSearch() && !$this->getIsVisibleInAdvancedSearch() && !$this->getIsFilterable()) {
357
+ return false;
358
+ }
359
+
360
+ $backendType = $this->getBackendType();
361
+ $frontendInput = $this->getFrontendInput();
362
+
363
+ if ($backendType == 'int' && $frontendInput == 'select') {
364
+ return true;
365
+ } else if ($backendType == 'varchar' && $frontendInput == 'multiselect') {
366
+ return true;
367
+ } else if ($backendType == 'decimal') {
368
+ return true;
369
+ }
370
+
371
+ return false;
372
+ }
373
+
374
+ /**
375
+ * Retrieve index type for indexable attribute
376
+ *
377
+ * @return string|false
378
+ */
379
+ public function getIndexType()
380
+ {
381
+ if (!$this->isIndexable()) {
382
+ return false;
383
+ }
384
+ if ($this->getBackendType() == 'decimal') {
385
+ return 'decimal';
386
+ }
387
+
388
+ return 'source';
389
+ }
390
+ }
app/code/local/Tatva/Customerattributes/Model/Adminhtml/System/Config/Source/Inputtype.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Eav
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Tatva_Customerattributes_Model_Adminhtml_System_Config_Source_Inputtype
27
+ {
28
+ public function toOptionArray()
29
+ {
30
+ return array(
31
+ array('value' => 'text', 'label' => Mage::helper('eav')->__('Text Field')),
32
+ array('value' => 'textarea', 'label' => Mage::helper('eav')->__('Text Area')),
33
+ array('value' => 'date', 'label' => Mage::helper('eav')->__('Date')),
34
+ array('value' => 'boolean', 'label' => Mage::helper('eav')->__('Yes/No')),
35
+ array('value' => 'multiselect', 'label' => Mage::helper('eav')->__('Multiple Select')),
36
+ array('value' => 'select', 'label' => Mage::helper('eav')->__('Dropdown'))
37
+ );
38
+ }
39
+ }
app/code/local/Tatva/Customerattributes/Model/Attribute.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Customer
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Customer attribute model
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Customer
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Tatva_Customerattributes_Model_Attribute extends Mage_Eav_Model_Attribute
35
+ {
36
+ /**
37
+ * Name of the module
38
+ */
39
+ const MODULE_NAME = 'Mage_Customer';
40
+
41
+ /**
42
+ * Prefix of model events names
43
+ *
44
+ * @var string
45
+ */
46
+ protected $_eventPrefix = 'customer_entity_attribute';
47
+
48
+ /**
49
+ * Prefix of model events object
50
+ *
51
+ * @var string
52
+ */
53
+ protected $_eventObject = 'attribute';
54
+
55
+ /**
56
+ * Init resource model
57
+ */
58
+ protected function _construct()
59
+ {
60
+ $this->_init('customer/attribute');
61
+ }
62
+ public function getSourceModel()
63
+ {
64
+ $model = $this->getData('source_model');
65
+ if (empty($model)) {
66
+ if ($this->getBackendType() == 'int' && $this->getFrontendInput() == 'select') {
67
+ return $this->_getDefaultSourceModel();
68
+ }
69
+ }
70
+ return $model;
71
+ }
72
+
73
+ public function _getDefaultSourceModel()
74
+ {
75
+ return 'eav/entity_attribute_source_table';
76
+ }
77
+ }
app/code/local/Tatva/Customerattributes/Model/Customerattributes.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Model_Customerattributes extends Mage_Eav_Model_Entity_Attribute
4
+ {
5
+ const CUSTOMER_YES = 1;
6
+ const CUSTOMER_NO = 0;
7
+ public function _construct()
8
+ {
9
+ parent::_construct();
10
+ $this->_init('customerattributes/customerattributes');
11
+ }
12
+ public function toOptionArray()
13
+ {
14
+ $attributes = Mage::getResourceModel('customer/attribute_collection')
15
+ ->addFieldToFilter('is_user_defined',array("eq" => 1));
16
+
17
+ foreach($attributes as $_attribute)
18
+ {
19
+ $collection[]=array('label'=>$_attribute->getName(),'value'=>$_attribute->getId());
20
+ }
21
+ //print_r ($collection);exit;
22
+ return $collection;
23
+ }
24
+ public function getOption($i)
25
+ {
26
+ $attribute1 = Mage::getModel('catalog/resource_eav_attribute')->load($i);
27
+ $attribute_code = Mage::getSingleton('eav/config')->getAttribute('customer', $attribute1->getAttributeCode());
28
+ $prodCodeOptions = $attribute_code->getSource()->getAllOptions(false);
29
+ $prodOptions = array();
30
+ foreach($prodCodeOptions as $k)
31
+ $prodOptions[$k['value']] = $k['label'];
32
+ return $prodOptions;
33
+ }
34
+ static public function getOptionArray()
35
+ {
36
+ return array(
37
+ self::CUSTOMER_YES => Mage::helper('catalog')->__('Yes'),
38
+ self::CUSTOMER_NO => Mage::helper('catalog')->__('No')
39
+ );
40
+ }
41
+
42
+ }
app/code/local/Tatva/Customerattributes/Model/Mysql4/Customerattributes.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Model_Mysql4_Customerattributes extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the catalogextensions_id refers to the key field in your database table.
8
+ $this->_init('customerattributes/customerattributes', 'customerattributes_id');
9
+ }
10
+
11
+ public function makeNewQuoteAttr($attrcode)
12
+ {
13
+ $read = $this->_getReadAdapter();
14
+ $write = $this->_getWriteAdapter();
15
+ $resource = Mage::getSingleton('core/resource');
16
+ $tableName1 = $resource->getTableName('sales/quote');
17
+ $write->query("Alter table ".$tableName1." Add Column ".$attrcode." varchar(255) Default Null;");
18
+ }
19
+
20
+ public function makeNewQuoteAddAttr($attrcode)
21
+ {
22
+ $read = $this->_getReadAdapter();
23
+ $write = $this->_getWriteAdapter();
24
+ $resource = Mage::getSingleton('core/resource');
25
+ $tableName1 = $resource->getTableName('sales/quote_address');
26
+ $tableName2 = $resource->getTableName('sales/order_address');
27
+ $write->query("Alter table ".$tableName1." Add Column ".$attrcode." varchar(255) Default Null;");
28
+ $write->query("Alter table ".$tableName2." Add Column ".$attrcode." varchar(255) Default Null;");
29
+ }
30
+
31
+ public function deleteQuoteAttr($attrcode)
32
+ {
33
+ $read = $this->_getReadAdapter();
34
+ $write = $this->_getWriteAdapter();
35
+ $resource = Mage::getSingleton('core/resource');
36
+ $tableName1 = $resource->getTableName('sales/quote');
37
+ $write->query("Alter table ".$tableName1." Drop Column ".$attrcode.";");
38
+ }
39
+
40
+ public function deleteQuoteAddrAttr($attrcode)
41
+ {
42
+ $read = $this->_getReadAdapter();
43
+ $write = $this->_getWriteAdapter();
44
+ $resource = Mage::getSingleton('core/resource');
45
+ $tableName1 = $resource->getTableName('sales/quote_address');
46
+ $tableName2 = $resource->getTableName('sales/order_address');
47
+ $write->query("Alter table ".$tableName1." Drop Column ".$attrcode.";");
48
+ $write->query("Alter table ".$tableName2." Drop Column ".$attrcode.";");
49
+ }
50
+ }
app/code/local/Tatva/Customerattributes/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('customerattributes')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('customerattributes')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerController_old.php ADDED
@@ -0,0 +1,818 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once "Mage/Adminhtml/controllers/CustomerController.php";
4
+
5
+ class Tatva_Customerattributes_Adminhtml_CustomerController extends Mage_Adminhtml_CustomerController
6
+ {
7
+ protected function _initCustomer($idFieldName = 'id')
8
+ {
9
+ $this->_title($this->__('Customers'))->_title($this->__('Manage Customers'));
10
+
11
+ $customerId = (int) $this->getRequest()->getParam($idFieldName);
12
+ $customer = Mage::getModel('customer/customer');
13
+
14
+ if ($customerId) {
15
+ $customer->load($customerId);
16
+ }
17
+
18
+ Mage::register('current_customer', $customer);
19
+ return $this;
20
+ }
21
+
22
+ /**
23
+ * Customers list action
24
+ */
25
+ public function indexAction()
26
+ {
27
+ $this->_title($this->__('Customers'))->_title($this->__('Manage Customers'));
28
+
29
+ if ($this->getRequest()->getQuery('ajax')) {
30
+ $this->_forward('grid');
31
+ return;
32
+ }
33
+ $this->loadLayout();
34
+
35
+ /**
36
+ * Set active menu item
37
+ */
38
+ $this->_setActiveMenu('customer/manage');
39
+
40
+ /**
41
+ * Append customers block to content
42
+ */
43
+ $this->_addContent(
44
+ $this->getLayout()->createBlock('adminhtml/customer', 'customer')
45
+ );
46
+
47
+ /**
48
+ * Add breadcrumb item
49
+ */
50
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Customers'), Mage::helper('adminhtml')->__('Customers'));
51
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Manage Customers'), Mage::helper('adminhtml')->__('Manage Customers'));
52
+
53
+ $this->renderLayout();
54
+ }
55
+
56
+ public function gridAction()
57
+ {
58
+ $this->loadLayout();
59
+ $this->renderLayout();
60
+ }
61
+
62
+ /**
63
+ * Customer edit action
64
+ */
65
+ public function editAction()
66
+ {
67
+ $this->_initCustomer();
68
+ $this->loadLayout();
69
+
70
+ /* @var $customer Mage_Customer_Model_Customer */
71
+ $customer = Mage::registry('current_customer');
72
+
73
+ // set entered data if was error when we do save
74
+ $data = Mage::getSingleton('adminhtml/session')->getCustomerData(true);
75
+ // restore data from SESSION
76
+ if ($data) {
77
+ $request = clone $this->getRequest();
78
+ $request->setParams($data);
79
+
80
+ if (isset($data['account'])) {
81
+ /* @var $customerForm Mage_Customer_Model_Form */
82
+ $customerForm = Mage::getModel('customer/form');
83
+ $customerForm->setEntity($customer)
84
+ ->setFormCode('adminhtml_customer')
85
+ ->setIsAjaxRequest(true);
86
+ $formData = $customerForm->extractData($request, 'account');
87
+ $customerForm->restoreData($formData);
88
+ }
89
+
90
+ if (isset($data['address']) && is_array($data['address'])) {
91
+ /* @var $addressForm Mage_Customer_Model_Form */
92
+ $addressForm = Mage::getModel('customer/form');
93
+ $addressForm->setFormCode('adminhtml_customer_address');
94
+
95
+ foreach (array_keys($data['address']) as $addressId) {
96
+ if ($addressId == '_template_') {
97
+ continue;
98
+ }
99
+
100
+ $address = $customer->getAddressItemById($addressId);
101
+ if (!$address) {
102
+ $address = Mage::getModel('customer/address');
103
+ $customer->addAddress($address);
104
+ }
105
+
106
+ $formData = $addressForm->setEntity($address)
107
+ ->extractData($request);
108
+ $addressForm->restoreData($formData);
109
+ }
110
+ }
111
+ }
112
+
113
+ $this->_title($customer->getId() ? $customer->getName() : $this->__('New Customer'));
114
+
115
+ /**
116
+ * Set active menu item
117
+ */
118
+ $this->_setActiveMenu('customer/new');
119
+
120
+ $this->renderLayout();
121
+ }
122
+
123
+ /**
124
+ * Create new customer action
125
+ */
126
+ public function newAction()
127
+ {
128
+ $this->_forward('edit');
129
+ }
130
+
131
+ /**
132
+ * Delete customer action
133
+ */
134
+ public function deleteAction()
135
+ {
136
+ $this->_initCustomer();
137
+ $customer = Mage::registry('current_customer');
138
+ if ($customer->getId()) {
139
+ try {
140
+ $customer->load($customer->getId());
141
+ $customer->delete();
142
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('The customer has been deleted.'));
143
+ }
144
+ catch (Exception $e){
145
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
146
+ }
147
+ }
148
+ $this->_redirect('*/customer');
149
+ }
150
+
151
+ /**
152
+ * Save customer action
153
+ */
154
+ public function saveAction()
155
+ {
156
+ $data = $this->getRequest()->getPost();
157
+
158
+ foreach($_FILES as $account=>$file)
159
+ {
160
+ foreach($file['name'] as $key=>$value)
161
+ {
162
+ if($value != '')
163
+ {
164
+ $data[$key] = $value;
165
+ }
166
+ }
167
+ }
168
+
169
+ if ($data) {
170
+ $redirectBack = $this->getRequest()->getParam('back', false);
171
+ $this->_initCustomer('customer_id');
172
+
173
+ /** @var $customer Mage_Customer_Model_Customer */
174
+ $customer = Mage::registry('current_customer');
175
+
176
+ /** @var $customerForm Mage_Customer_Model_Form */
177
+ $customerForm = Mage::getModel('customer/form');
178
+ $customerForm->setEntity($customer)
179
+ ->setFormCode('adminhtml_customer')
180
+ ->ignoreInvisible(false)
181
+ ;
182
+
183
+ $formData = $customerForm->extractData($this->getRequest(), 'account');
184
+
185
+ // Handle 'disable auto_group_change' attribute
186
+ if (isset($formData['disable_auto_group_change'])) {
187
+ $formData['disable_auto_group_change'] = empty($formData['disable_auto_group_change']) ? '0' : '1';
188
+ }
189
+
190
+ $errors = $customerForm->validateData($formData);
191
+ if ($errors !== true) {
192
+ foreach ($errors as $error) {
193
+ $this->_getSession()->addError($error);
194
+ }
195
+ $this->_getSession()->setCustomerData($data);
196
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id' => $customer->getId())));
197
+ return;
198
+ }
199
+
200
+ $customerForm->compactData($formData);
201
+
202
+ // Unset template data
203
+ if (isset($data['address']['_template_'])) {
204
+ unset($data['address']['_template_']);
205
+ }
206
+
207
+ $modifiedAddresses = array();
208
+ if (!empty($data['address'])) {
209
+ /** @var $addressForm Mage_Customer_Model_Form */
210
+ $addressForm = Mage::getModel('customer/form');
211
+ $addressForm->setFormCode('adminhtml_customer_address')->ignoreInvisible(false);
212
+
213
+ foreach (array_keys($data['address']) as $index) {
214
+ $address = $customer->getAddressItemById($index);
215
+ if (!$address) {
216
+ $address = Mage::getModel('customer/address');
217
+ }
218
+
219
+ $requestScope = sprintf('address/%s', $index);
220
+ $formData = $addressForm->setEntity($address)
221
+ ->extractData($this->getRequest(), $requestScope);
222
+
223
+ // Set default billing and shipping flags to address
224
+ $isDefaultBilling = isset($data['account']['default_billing'])
225
+ && $data['account']['default_billing'] == $index;
226
+ $address->setIsDefaultBilling($isDefaultBilling);
227
+ $isDefaultShipping = isset($data['account']['default_shipping'])
228
+ && $data['account']['default_shipping'] == $index;
229
+ $address->setIsDefaultShipping($isDefaultShipping);
230
+
231
+ $errors = $addressForm->validateData($formData);
232
+ if ($errors !== true) {
233
+ foreach ($errors as $error) {
234
+ $this->_getSession()->addError($error);
235
+ }
236
+ $this->_getSession()->setCustomerData($data);
237
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array(
238
+ 'id' => $customer->getId())
239
+ ));
240
+ return;
241
+ }
242
+
243
+ $addressForm->compactData($formData);
244
+
245
+ // Set post_index for detect default billing and shipping addresses
246
+ $address->setPostIndex($index);
247
+
248
+ if ($address->getId()) {
249
+ $modifiedAddresses[] = $address->getId();
250
+ } else {
251
+ $customer->addAddress($address);
252
+ }
253
+ }
254
+ }
255
+
256
+ // Default billing and shipping
257
+ if (isset($data['account']['default_billing'])) {
258
+ $customer->setData('default_billing', $data['account']['default_billing']);
259
+ }
260
+ if (isset($data['account']['default_shipping'])) {
261
+ $customer->setData('default_shipping', $data['account']['default_shipping']);
262
+ }
263
+ if (isset($data['account']['confirmation'])) {
264
+ $customer->setData('confirmation', $data['account']['confirmation']);
265
+ }
266
+
267
+ // Mark not modified customer addresses for delete
268
+ foreach ($customer->getAddressesCollection() as $customerAddress) {
269
+ if ($customerAddress->getId() && !in_array($customerAddress->getId(), $modifiedAddresses)) {
270
+ $customerAddress->setData('_deleted', true);
271
+ }
272
+ }
273
+
274
+ if (Mage::getSingleton('admin/session')->isAllowed('customer/newsletter')) {
275
+ $customer->setIsSubscribed(isset($data['subscription']));
276
+ }
277
+
278
+ if (isset($data['account']['sendemail_store_id'])) {
279
+ $customer->setSendemailStoreId($data['account']['sendemail_store_id']);
280
+ }
281
+
282
+ $isNewCustomer = $customer->isObjectNew();
283
+ try {
284
+ $sendPassToEmail = false;
285
+ // Force new customer confirmation
286
+ if ($isNewCustomer) {
287
+ $customer->setPassword($data['account']['password']);
288
+ $customer->setForceConfirmed(true);
289
+ if ($customer->getPassword() == 'auto') {
290
+ $sendPassToEmail = true;
291
+ $customer->setPassword($customer->generatePassword());
292
+ }
293
+ }
294
+
295
+ Mage::dispatchEvent('adminhtml_customer_prepare_save', array(
296
+ 'customer' => $customer,
297
+ 'request' => $this->getRequest()
298
+ ));
299
+
300
+ $customer->save();
301
+
302
+ // Send welcome email
303
+ if ($customer->getWebsiteId() && (isset($data['account']['sendemail']) || $sendPassToEmail)) {
304
+ $storeId = $customer->getSendemailStoreId();
305
+ if ($isNewCustomer) {
306
+ $customer->sendNewAccountEmail('registered', '', $storeId);
307
+ } elseif ((!$customer->getConfirmation())) {
308
+ // Confirm not confirmed customer
309
+ $customer->sendNewAccountEmail('confirmed', '', $storeId);
310
+ }
311
+ }
312
+
313
+ if (!empty($data['account']['new_password'])) {
314
+ $newPassword = $data['account']['new_password'];
315
+ if ($newPassword == 'auto') {
316
+ $newPassword = $customer->generatePassword();
317
+ }
318
+ $customer->changePassword($newPassword);
319
+ $customer->sendPasswordReminderEmail();
320
+ }
321
+
322
+ Mage::getSingleton('adminhtml/session')->addSuccess(
323
+ Mage::helper('adminhtml')->__('The customer has been saved.')
324
+ );
325
+ Mage::dispatchEvent('adminhtml_customer_save_after', array(
326
+ 'customer' => $customer,
327
+ 'request' => $this->getRequest()
328
+ ));
329
+
330
+ if ($redirectBack) {
331
+ $this->_redirect('*/*/edit', array(
332
+ 'id' => $customer->getId(),
333
+ '_current' => true
334
+ ));
335
+ return;
336
+ }
337
+ } catch (Mage_Core_Exception $e) {
338
+ $this->_getSession()->addError($e->getMessage());
339
+ $this->_getSession()->setCustomerData($data);
340
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id' => $customer->getId())));
341
+ } catch (Exception $e) {
342
+ $this->_getSession()->addException($e,
343
+ Mage::helper('adminhtml')->__('An error occurred while saving the customer.'));
344
+ $this->_getSession()->setCustomerData($data);
345
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id'=>$customer->getId())));
346
+ return;
347
+ }
348
+ }
349
+ $this->getResponse()->setRedirect($this->getUrl('*/customer'));
350
+ }
351
+
352
+ /**
353
+ * Export customer grid to CSV format
354
+ */
355
+ public function exportCsvAction()
356
+ {
357
+ $fileName = 'customers.csv';
358
+ $content = $this->getLayout()->createBlock('adminhtml/customer_grid')
359
+ ->getCsvFile();
360
+
361
+ $this->_prepareDownloadResponse($fileName, $content);
362
+ }
363
+
364
+ /**
365
+ * Export customer grid to XML format
366
+ */
367
+ public function exportXmlAction()
368
+ {
369
+ $fileName = 'customers.xml';
370
+ $content = $this->getLayout()->createBlock('adminhtml/customer_grid')
371
+ ->getExcelFile();
372
+
373
+ $this->_prepareDownloadResponse($fileName, $content);
374
+ }
375
+
376
+ /**
377
+ * Prepare file download response
378
+ *
379
+ * @todo remove in 1.3
380
+ * @deprecated please use $this->_prepareDownloadResponse()
381
+ * @see Mage_Adminhtml_Controller_Action::_prepareDownloadResponse()
382
+ * @param string $fileName
383
+ * @param string $content
384
+ * @param string $contentType
385
+ */
386
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
387
+ {
388
+ $this->_prepareDownloadResponse($fileName, $content, $contentType);
389
+ }
390
+
391
+ /**
392
+ * Customer orders grid
393
+ *
394
+ */
395
+ public function ordersAction() {
396
+ $this->_initCustomer();
397
+ $this->loadLayout();
398
+ $this->renderLayout();
399
+ }
400
+
401
+ /**
402
+ * Customer last orders grid for ajax
403
+ *
404
+ */
405
+ public function lastOrdersAction() {
406
+ $this->_initCustomer();
407
+ $this->loadLayout();
408
+ $this->renderLayout();
409
+ }
410
+
411
+ /**
412
+ * Customer newsletter grid
413
+ *
414
+ */
415
+ public function newsletterAction()
416
+ {
417
+ $this->_initCustomer();
418
+ $subscriber = Mage::getModel('newsletter/subscriber')
419
+ ->loadByCustomer(Mage::registry('current_customer'));
420
+
421
+ Mage::register('subscriber', $subscriber);
422
+ $this->loadLayout();
423
+ $this->renderLayout();
424
+ }
425
+
426
+ public function wishlistAction()
427
+ {
428
+ $this->_initCustomer();
429
+ $customer = Mage::registry('current_customer');
430
+ if ($customer->getId()) {
431
+ if($itemId = (int) $this->getRequest()->getParam('delete')) {
432
+ try {
433
+ Mage::getModel('wishlist/item')->load($itemId)
434
+ ->delete();
435
+ }
436
+ catch (Exception $e) {
437
+ Mage::logException($e);
438
+ }
439
+ }
440
+ }
441
+
442
+ $this->getLayout()->getUpdate()
443
+ ->addHandle(strtolower($this->getFullActionName()));
444
+ $this->loadLayoutUpdates()->generateLayoutXml()->generateLayoutBlocks();
445
+
446
+ $this->renderLayout();
447
+ }
448
+
449
+ /**
450
+ * Customer last view wishlist for ajax
451
+ *
452
+ */
453
+ public function viewWishlistAction()
454
+ {
455
+ $this->_initCustomer();
456
+ $this->loadLayout();
457
+ $this->renderLayout();
458
+ }
459
+
460
+ /**
461
+ * [Handle and then] get a cart grid contents
462
+ *
463
+ * @return string
464
+ */
465
+ public function cartAction()
466
+ {
467
+ $this->_initCustomer();
468
+ $websiteId = $this->getRequest()->getParam('website_id');
469
+
470
+ // delete an item from cart
471
+ $deleteItemId = $this->getRequest()->getPost('delete');
472
+ if ($deleteItemId) {
473
+ $quote = Mage::getModel('sales/quote')
474
+ ->setWebsite(Mage::app()->getWebsite($websiteId))
475
+ ->loadByCustomer(Mage::registry('current_customer'));
476
+ $item = $quote->getItemById($deleteItemId);
477
+ if ($item && $item->getId()) {
478
+ $quote->removeItem($deleteItemId);
479
+ $quote->collectTotals()->save();
480
+ }
481
+ }
482
+
483
+ $this->loadLayout();
484
+ $this->getLayout()->getBlock('admin.customer.view.edit.cart')->setWebsiteId($websiteId);
485
+ $this->renderLayout();
486
+ }
487
+
488
+ /**
489
+ * Get shopping cart to view only
490
+ *
491
+ */
492
+ public function viewCartAction()
493
+ {
494
+ $this->_initCustomer();
495
+ $layout = $this->loadLayout()
496
+ ->getLayout()
497
+ ->getBlock('admin.customer.view.cart')
498
+ ->setWebsiteId();
499
+ $this->renderLayout();
500
+ }
501
+
502
+ /**
503
+ * Get shopping carts from all websites for specified client
504
+ *
505
+ */
506
+ public function cartsAction()
507
+ {
508
+ $this->_initCustomer();
509
+ $this->loadLayout();
510
+ $this->renderLayout();
511
+ }
512
+
513
+ /**
514
+ * Get customer's product reviews list
515
+ *
516
+ */
517
+ public function productReviewsAction()
518
+ {
519
+ $this->_initCustomer();
520
+ $this->loadLayout()
521
+ ->getLayout()
522
+ ->getBlock('admin.customer.reviews')
523
+ ->setCustomerId(Mage::registry('current_customer')->getId())
524
+ ->setUseAjax(true);
525
+ $this->renderLayout();
526
+ }
527
+
528
+ /**
529
+ * Get customer's tags list
530
+ *
531
+ */
532
+ public function productTagsAction()
533
+ {
534
+ $this->_initCustomer();
535
+ $this->loadLayout()
536
+ ->getLayout()
537
+ ->getBlock('admin.customer.tags')
538
+ ->setCustomerId(Mage::registry('current_customer')->getId())
539
+ ->setUseAjax(true);
540
+ $this->renderLayout();
541
+ }
542
+
543
+ public function tagGridAction()
544
+ {
545
+ $this->_initCustomer();
546
+ $this->loadLayout();
547
+ $this->getLayout()->getBlock('admin.customer.tags')->setCustomerId(
548
+ Mage::registry('current_customer')
549
+ );
550
+ $this->renderLayout();
551
+ }
552
+
553
+ public function validateAction()
554
+ {
555
+ $response = new Varien_Object();
556
+ $response->setError(0);
557
+ $websiteId = Mage::app()->getStore()->getWebsiteId();
558
+ $accountData = $this->getRequest()->getPost('account');
559
+
560
+ $customer = Mage::getModel('customer/customer');
561
+ $customerId = $this->getRequest()->getParam('id');
562
+ if ($customerId) {
563
+ $customer->load($customerId);
564
+ $websiteId = $customer->getWebsiteId();
565
+ } else if (isset($accountData['website_id'])) {
566
+ $websiteId = $accountData['website_id'];
567
+ }
568
+
569
+ /* @var $customerForm Mage_Customer_Model_Form */
570
+ $customerForm = Mage::getModel('customer/form');
571
+ $customerForm->setEntity($customer)
572
+ ->setFormCode('adminhtml_customer')
573
+ ->setIsAjaxRequest(true)
574
+ ->ignoreInvisible(false)
575
+ ;
576
+
577
+ $data = $customerForm->extractData($this->getRequest(), 'account');
578
+ $errors = $customerForm->validateData($data);
579
+ if ($errors !== true) {
580
+ foreach ($errors as $error) {
581
+ $this->_getSession()->addError($error);
582
+ }
583
+ $response->setError(1);
584
+ }
585
+
586
+ # additional validate email
587
+ if (!$response->getError()) {
588
+ # Trying to load customer with the same email and return error message
589
+ # if customer with the same email address exisits
590
+ $checkCustomer = Mage::getModel('customer/customer')
591
+ ->setWebsiteId($websiteId);
592
+ $checkCustomer->loadByEmail($accountData['email']);
593
+ if ($checkCustomer->getId() && ($checkCustomer->getId() != $customer->getId())) {
594
+ $response->setError(1);
595
+ $this->_getSession()->addError(
596
+ Mage::helper('adminhtml')->__('Customer with the same email already exists.')
597
+ );
598
+ }
599
+ }
600
+
601
+ $addressesData = $this->getRequest()->getParam('address');
602
+ if (is_array($addressesData)) {
603
+ /* @var $addressForm Mage_Customer_Model_Form */
604
+ $addressForm = Mage::getModel('customer/form');
605
+ $addressForm->setFormCode('adminhtml_customer_address')->ignoreInvisible(false);
606
+ foreach (array_keys($addressesData) as $index) {
607
+ if ($index == '_template_') {
608
+ continue;
609
+ }
610
+ $address = $customer->getAddressItemById($index);
611
+ if (!$address) {
612
+ $address = Mage::getModel('customer/address');
613
+ }
614
+
615
+ $requestScope = sprintf('address/%s', $index);
616
+ $formData = $addressForm->setEntity($address)
617
+ ->extractData($this->getRequest(), $requestScope);
618
+
619
+ $errors = $addressForm->validateData($formData);
620
+ if ($errors !== true) {
621
+ foreach ($errors as $error) {
622
+ $this->_getSession()->addError($error);
623
+ }
624
+ $response->setError(1);
625
+ }
626
+ }
627
+ }
628
+
629
+ if ($response->getError()) {
630
+ $this->_initLayoutMessages('adminhtml/session');
631
+ $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml());
632
+ }
633
+
634
+ $this->getResponse()->setBody($response->toJson());
635
+ }
636
+
637
+ public function massSubscribeAction()
638
+ {
639
+ $customersIds = $this->getRequest()->getParam('customer');
640
+ if(!is_array($customersIds)) {
641
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
642
+
643
+ } else {
644
+ try {
645
+ foreach ($customersIds as $customerId) {
646
+ $customer = Mage::getModel('customer/customer')->load($customerId);
647
+ $customer->setIsSubscribed(true);
648
+ $customer->save();
649
+ }
650
+ Mage::getSingleton('adminhtml/session')->addSuccess(
651
+ Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds))
652
+ );
653
+ } catch (Exception $e) {
654
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
655
+ }
656
+ }
657
+ $this->_redirect('*/*/index');
658
+ }
659
+
660
+ public function massUnsubscribeAction()
661
+ {
662
+ $customersIds = $this->getRequest()->getParam('customer');
663
+ if(!is_array($customersIds)) {
664
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
665
+ } else {
666
+ try {
667
+ foreach ($customersIds as $customerId) {
668
+ $customer = Mage::getModel('customer/customer')->load($customerId);
669
+ $customer->setIsSubscribed(false);
670
+ $customer->save();
671
+ }
672
+ Mage::getSingleton('adminhtml/session')->addSuccess(
673
+ Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds))
674
+ );
675
+ } catch (Exception $e) {
676
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
677
+ }
678
+ }
679
+
680
+ $this->_redirect('*/*/index');
681
+ }
682
+
683
+ public function massDeleteAction()
684
+ {
685
+ $customersIds = $this->getRequest()->getParam('customer');
686
+ if(!is_array($customersIds)) {
687
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
688
+ } else {
689
+ try {
690
+ $customer = Mage::getModel('customer/customer');
691
+ foreach ($customersIds as $customerId) {
692
+ $customer->reset()
693
+ ->load($customerId)
694
+ ->delete();
695
+ }
696
+ Mage::getSingleton('adminhtml/session')->addSuccess(
697
+ Mage::helper('adminhtml')->__('Total of %d record(s) were deleted.', count($customersIds))
698
+ );
699
+ } catch (Exception $e) {
700
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
701
+ }
702
+ }
703
+
704
+ $this->_redirect('*/*/index');
705
+ }
706
+
707
+ public function massAssignGroupAction()
708
+ {
709
+ $customersIds = $this->getRequest()->getParam('customer');
710
+ if(!is_array($customersIds)) {
711
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
712
+ } else {
713
+ try {
714
+ foreach ($customersIds as $customerId) {
715
+ $customer = Mage::getModel('customer/customer')->load($customerId);
716
+ $customer->setGroupId($this->getRequest()->getParam('group'));
717
+ $customer->save();
718
+ }
719
+ Mage::getSingleton('adminhtml/session')->addSuccess(
720
+ Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds))
721
+ );
722
+ } catch (Exception $e) {
723
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
724
+ }
725
+ }
726
+
727
+ $this->_redirect('*/*/index');
728
+ }
729
+
730
+ public function viewfileAction()
731
+ {
732
+ $file = null;
733
+ $plain = false;
734
+ if ($this->getRequest()->getParam('file')) {
735
+ // download file
736
+ $file = Mage::helper('core')->urlDecode($this->getRequest()->getParam('file'));
737
+ } else if ($this->getRequest()->getParam('image')) {
738
+ // show plain image
739
+ $file = Mage::helper('core')->urlDecode($this->getRequest()->getParam('image'));
740
+ $plain = true;
741
+ } else {
742
+ return $this->norouteAction();
743
+ }
744
+
745
+ $path = Mage::getBaseDir('media') . DS . 'customer';
746
+
747
+ $ioFile = new Varien_Io_File();
748
+ $ioFile->open(array('path' => $path));
749
+ $fileName = $ioFile->getCleanPath($path . $file);
750
+ $path = $ioFile->getCleanPath($path);
751
+
752
+ if ((!$ioFile->fileExists($fileName) || strpos($fileName, $path) !== 0)
753
+ && !Mage::helper('core/file_storage')->processStorageFile(str_replace('/', DS, $fileName))
754
+ ) {
755
+ return $this->norouteAction();
756
+ }
757
+
758
+ if ($plain) {
759
+ $extension = pathinfo($fileName, PATHINFO_EXTENSION);
760
+ switch (strtolower($extension)) {
761
+ case 'gif':
762
+ $contentType = 'image/gif';
763
+ break;
764
+ case 'jpg':
765
+ $contentType = 'image/jpeg';
766
+ break;
767
+ case 'png':
768
+ $contentType = 'image/png';
769
+ break;
770
+ default:
771
+ $contentType = 'application/octet-stream';
772
+ break;
773
+ }
774
+
775
+ $ioFile->streamOpen($fileName, 'r');
776
+ $contentLength = $ioFile->streamStat('size');
777
+ $contentModify = $ioFile->streamStat('mtime');
778
+
779
+ $this->getResponse()
780
+ ->setHttpResponseCode(200)
781
+ ->setHeader('Pragma', 'public', true)
782
+ ->setHeader('Content-type', $contentType, true)
783
+ ->setHeader('Content-Length', $contentLength)
784
+ ->setHeader('Last-Modified', date('r', $contentModify))
785
+ ->clearBody();
786
+ $this->getResponse()->sendHeaders();
787
+
788
+ while (false !== ($buffer = $ioFile->streamRead())) {
789
+ echo $buffer;
790
+ }
791
+ } else {
792
+ $name = pathinfo($fileName, PATHINFO_BASENAME);
793
+ $this->_prepareDownloadResponse($name, array(
794
+ 'type' => 'filename',
795
+ 'value' => $fileName
796
+ ));
797
+ }
798
+
799
+ exit();
800
+ }
801
+
802
+ protected function _isAllowed()
803
+ {
804
+ return Mage::getSingleton('admin/session')->isAllowed('customer/manage');
805
+ }
806
+
807
+ /**
808
+ * Filtering posted data. Converting localized data if needed
809
+ *
810
+ * @param array
811
+ * @return array
812
+ */
813
+ protected function _filterPostData($data)
814
+ {
815
+ $data['account'] = $this->_filterDates($data['account'], array('dob'));
816
+ return $data;
817
+ }
818
+ }
app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomeraddressController.php ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Adminhtml_CustomeraddressController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected $_entityTypeId;
6
+
7
+ public function preDispatch()
8
+ {
9
+ parent::preDispatch();
10
+ $this->_entityTypeId = Mage::getModel('eav/entity')->setType('customer_address')->getTypeId();
11
+ }
12
+ protected function _initAction() {
13
+ $this->loadLayout()
14
+ ->_setActiveMenu('customer/items')
15
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
16
+
17
+ return $this;
18
+ }
19
+
20
+ public function indexAction() {
21
+ $this->_initAction()
22
+ ->renderLayout();
23
+ }
24
+
25
+ public function newAction() {
26
+ $this->_forward('edit');
27
+ }
28
+
29
+ public function editAction() {
30
+ $id = $this->getRequest()->getParam('attribute_id');
31
+ $model = Mage::getModel('catalog/resource_eav_attribute')
32
+ ->setEntityTypeId($this->_entityTypeId);
33
+
34
+ if ($id) {
35
+ $model->load($id);
36
+ //echo "<prE>";print_r($model->getData());die;
37
+
38
+ if (! $model->getId()) {
39
+ Mage::getSingleton('adminhtml/session')->addError(
40
+ Mage::helper('customerattributes')->__('This attribute no longer exists'));
41
+ $this->_redirect('*/*/');
42
+ return;
43
+ }
44
+
45
+ // entity type check
46
+ if ($model->getEntityTypeId() != $this->_entityTypeId) {
47
+ Mage::getSingleton('adminhtml/session')->addError(
48
+ Mage::helper('customerattributes')->__('This attribute cannot be edited.'));
49
+ $this->_redirect('*/*/');
50
+ return;
51
+ }
52
+ }
53
+
54
+ // set entered data if was error when we do save
55
+ $data = Mage::getSingleton('adminhtml/session')->getAttributeData(true);
56
+ if (! empty($data)) {
57
+ $model->addData($data);
58
+ }
59
+ Mage::register('entity_attribute', $model);
60
+ // Mage::register('customerattributes_data', $model);
61
+
62
+ $this->loadLayout();
63
+
64
+ $this->_title($id ? $model->getName() : $this->__('New Attribute'));
65
+ $this->_setActiveMenu('customer/items');
66
+
67
+ $item = $id ? Mage::helper('catalog')->__('Edit Customer Attribute')
68
+ : Mage::helper('catalog')->__('New Customer Attribute');
69
+
70
+ $this->_addBreadcrumb($item, $item);
71
+
72
+ /* $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
73
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));*/
74
+
75
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
76
+
77
+ $this->getLayout()->getBlock('attribute_edit_js')
78
+ ->setIsPopup((bool)$this->getRequest()->getParam('popup'));
79
+
80
+ /*$this->_addContent($this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit'))
81
+ ->_addLeft($this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit_tabs'));*/
82
+
83
+ $this->renderLayout();
84
+ //else {
85
+ // Mage::getSingleton('adminhtml/session')->addError(Mage::helper('customerattributes')->__('Item does not exist'));
86
+ // $this->_redirect('*/*/');
87
+ // }
88
+ }
89
+
90
+ public function validateAction()
91
+ {
92
+ $response = new Varien_Object();
93
+ $response->setError(false);
94
+
95
+ $attributeCode = $this->getRequest()->getParam('attribute_code');
96
+ $attributeId = $this->getRequest()->getParam('attribute_id');
97
+ $attribute = Mage::getModel('catalog/resource_eav_attribute')
98
+ ->loadByCode($this->_entityTypeId, $attributeCode);
99
+
100
+ if ($attribute->getId() && !$attributeId) {
101
+ Mage::getSingleton('adminhtml/session')->addError(
102
+ Mage::helper('customerattributes')->__('Attribute with the same code already exists'));
103
+ $this->_initLayoutMessages('adminhtml/session');
104
+ $response->setError(true);
105
+ $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml());
106
+ }
107
+
108
+ $this->getResponse()->setBody($response->toJson());
109
+ }
110
+
111
+ protected function _filterPostData($data)
112
+ {
113
+ if ($data) {
114
+ /** @var $helperCatalog Mage_Catalog_Helper_Data */
115
+ $helperCatalog = Mage::helper('catalog');
116
+ //labels
117
+ foreach ($data['frontend_label'] as & $value) {
118
+ if ($value) {
119
+ $value = $helperCatalog->stripTags($value);
120
+ }
121
+ }
122
+ }
123
+ return $data;
124
+ }
125
+
126
+ public function saveAction()
127
+ {
128
+ $data = $this->getRequest()->getPost();
129
+ //echo "<prE>";print_r($data);die;
130
+ if ($data) {
131
+ /** @var $session Mage_Admin_Model_Session */
132
+ $session = Mage::getSingleton('adminhtml/session');
133
+
134
+ $redirectBack = $this->getRequest()->getParam('back', false);
135
+ /* @var $model Mage_Catalog_Model_Entity_Attribute */
136
+ $model = Mage::getModel('catalog/resource_eav_attribute');
137
+ /* @var $helper Mage_Catalog_Helper_Product */
138
+ $helper = Mage::helper('catalog/product');
139
+
140
+ $id = $this->getRequest()->getParam('attribute_id');
141
+
142
+ //validate attribute_code
143
+ if (isset($data['attribute_code'])) {
144
+ $validatorAttrCode = new Zend_Validate_Regex(array('pattern' => '/^[a-z][a-z_0-9]{1,254}$/'));
145
+ if (!$validatorAttrCode->isValid($data['attribute_code'])) {
146
+ $session->addError(
147
+ Mage::helper('customerattributes')->__('Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.')
148
+ );
149
+ $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));
150
+ return;
151
+ }
152
+ }
153
+
154
+
155
+ //validate frontend_input
156
+ if (isset($data['frontend_input'])) {
157
+ /** @var $validatorInputType Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype_Validator */
158
+ $validatorInputType = Mage::getModel('eav/adminhtml_system_config_source_inputtype_validator');
159
+ if (!$validatorInputType->isValid($data['frontend_input'])) {
160
+ foreach ($validatorInputType->getMessages() as $message) {
161
+ $session->addError($message);
162
+ }
163
+ $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));
164
+ return;
165
+ }
166
+ }
167
+
168
+ if ($id) {
169
+ $model->load($id);
170
+
171
+ if (!$model->getId()) {
172
+ $session->addError(
173
+ Mage::helper('customerattributes')->__('This Attribute no longer exists'));
174
+ $this->_redirect('*/*/');
175
+ return;
176
+ }
177
+
178
+ // entity type check
179
+ if ($model->getEntityTypeId() != $this->_entityTypeId) {
180
+ $session->addError(
181
+ Mage::helper('customerattributes')->__('This attribute cannot be updated.'));
182
+ $session->setAttributeData($data);
183
+ $this->_redirect('*/*/');
184
+ return;
185
+ }
186
+
187
+ $data['attribute_code'] = $model->getAttributeCode();
188
+ $data['is_user_defined'] = $model->getIsUserDefined();
189
+ $data['frontend_input'] = $model->getFrontendInput();
190
+ } else {
191
+ /**
192
+ * @todo add to helper and specify all relations for properties
193
+ */
194
+ $data['source_model'] = $helper->getAttributeSourceModelByInputType($data['frontend_input']);
195
+ $data['backend_model'] = $helper->getAttributeBackendModelByInputType($data['frontend_input']);
196
+ }
197
+
198
+ // echo "<pre>";print_r($data);die;
199
+ $data['visible_on_front'] = 1;
200
+ if (!isset($data['is_configurable'])) {
201
+ $data['is_configurable'] = 0;
202
+ }
203
+ if (!isset($data['is_filterable'])) {
204
+ $data['is_filterable'] = 0;
205
+ }
206
+ if (!isset($data['is_filterable_in_search'])) {
207
+ $data['is_filterable_in_search'] = 0;
208
+ }
209
+
210
+ if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {
211
+ $data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
212
+ }
213
+
214
+ $defaultValueField = $model->getDefaultValueByInput($data['frontend_input']);
215
+ if ($defaultValueField) {
216
+ $data['default_value'] = $this->getRequest()->getParam($defaultValueField);
217
+ }
218
+
219
+ if(!isset($data['apply_to'])) {
220
+ $data['apply_to'] = array();
221
+ }
222
+
223
+ //filter
224
+ $data = $this->_filterPostData($data);
225
+ $model->addData($data);
226
+
227
+ $flag = 0;
228
+ if (!$id) {
229
+ $model->setEntityTypeId($this->_entityTypeId);
230
+ $model->setIsUserDefined(1);
231
+ $flag = 1;
232
+ }
233
+
234
+
235
+ if ($this->getRequest()->getParam('set') && $this->getRequest()->getParam('group')) {
236
+ // For creating product attribute on product page we need specify attribute set and group
237
+ $model->setAttributeSetId($this->getRequest()->getParam('set'));
238
+ $model->setAttributeGroupId($this->getRequest()->getParam('group'));
239
+ }
240
+
241
+ try {
242
+ //echo "<pre>";print_r($data);die;
243
+ $model->save();
244
+ if($data['frontend_input'] == 'media_image')
245
+ {
246
+ $model->setFrontendInput('image');
247
+ $model->save();
248
+ }
249
+
250
+ if(isset($data['used_in_forms']))
251
+ {
252
+ /*$use_in_froms = implode(',',$data['used_in_forms']);
253
+ Mage::getSingleton('eav/config')
254
+ ->getAttribute('customer', $data['attribute_code'])
255
+ ->setData('used_in_forms', $data['used_in_forms'])
256
+ ->save();*/
257
+ //echo "<pre>";print_r($customer);die;
258
+
259
+ $use_in_froms = implode(',',$customer);
260
+ Mage::getSingleton('eav/config')
261
+ ->getAttribute('customer_address', $data['attribute_code'])
262
+ ->setData('used_in_forms', $data['used_in_forms'])
263
+ ->save();
264
+
265
+
266
+ }
267
+ else
268
+ {
269
+ Mage::getSingleton('eav/config')
270
+ ->getAttribute('customer', $data['attribute_code'])
271
+ ->setData('used_in_forms', array())
272
+ ->save();
273
+ }
274
+
275
+
276
+ $session->addSuccess(
277
+ Mage::helper('customerattributes')->__('The customer attribute has been saved.'));
278
+
279
+ if($flag == 1)
280
+ {
281
+ Mage::getResourceModel("customerattributes/customerattributes")->makeNewQuoteAddAttr($data['attribute_code']);
282
+ }
283
+
284
+ /**
285
+ * Clear translation cache because attribute labels are stored in translation
286
+ */
287
+ Mage::app()->cleanCache(array(Mage_Core_Model_Translate::CACHE_TAG));
288
+ $session->setAttributeData(false);
289
+ if ($this->getRequest()->getParam('popup')) {
290
+ $this->_redirect('customerattributes/adminhtml_product/addAttribute', array(
291
+ 'id' => $this->getRequest()->getParam('product'),
292
+ 'attribute'=> $model->getId(),
293
+ '_current' => true
294
+ ));
295
+ } elseif ($redirectBack) {
296
+ $this->_redirect('*/*/edit', array('attribute_id' => $model->getId(),'_current'=>true));
297
+ } else {
298
+ $this->_redirect('*/*/', array());
299
+ }
300
+ return;
301
+ } catch (Exception $e) {
302
+ $session->addError($e->getMessage());
303
+ $session->setAttributeData($data);
304
+ $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));
305
+ return;
306
+ }
307
+ }
308
+
309
+ $this->_redirect('*/*/');
310
+ }
311
+
312
+ public function deleteAction() {
313
+
314
+ if ($id = $this->getRequest()->getParam('attribute_id')) {
315
+ $model = Mage::getModel('catalog/resource_eav_attribute');
316
+
317
+ // entity type check
318
+ $model->load($id);
319
+ if ($model->getEntityTypeId() != $this->_entityTypeId) {
320
+ Mage::getSingleton('adminhtml/session')->addError(
321
+ Mage::helper('customerattributes')->__('This attribute cannot be deleted.'));
322
+ $this->_redirect('*/*/');
323
+ return;
324
+ }
325
+
326
+ try {
327
+ if($model->getIsUserDefined())
328
+ {
329
+ Mage::getResourceModel("customerattributes/customerattributes")->deleteQuoteAddrAttr($model->getAttributeCode());
330
+ $model->delete();
331
+ }
332
+ Mage::getSingleton('adminhtml/session')->addSuccess(
333
+ Mage::helper('customerattributes')->__('The product attribute has been deleted.'));
334
+ $this->_redirect('*/*/');
335
+ return;
336
+ }
337
+ catch (Exception $e) {
338
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
339
+ $this->_redirect('*/*/edit', array('attribute_id' => $this->getRequest()->getParam('attribute_id')));
340
+ return;
341
+ }
342
+ }
343
+ Mage::getSingleton('adminhtml/session')->addError(
344
+ Mage::helper('customerattributes')->__('Unable to find an attribute to delete.'));
345
+ $this->_redirect('*/*/');
346
+
347
+
348
+ }
349
+
350
+ public function exportCsvAction()
351
+ {
352
+ $fileName = 'customerattributes.csv';
353
+ $content = $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_grid')
354
+ ->getCsv();
355
+
356
+ $this->_sendUploadResponse($fileName, $content);
357
+ }
358
+
359
+ public function exportXmlAction()
360
+ {
361
+ $fileName = 'customerattributes.xml';
362
+ $content = $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_grid')
363
+ ->getXml();
364
+
365
+ $this->_sendUploadResponse($fileName, $content);
366
+ }
367
+
368
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
369
+ {
370
+ $response = $this->getResponse();
371
+ $response->setHeader('HTTP/1.1 200 OK','');
372
+ $response->setHeader('Pragma', 'public', true);
373
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
374
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
375
+ $response->setHeader('Last-Modified', date('r'));
376
+ $response->setHeader('Accept-Ranges', 'bytes');
377
+ $response->setHeader('Content-Length', strlen($content));
378
+ $response->setHeader('Content-type', $contentType);
379
+ $response->setBody($content);
380
+ $response->sendResponse();
381
+ die;
382
+ }
383
+ }
app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerattributeController_old.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Customerattributes_Adminhtml_CustomerattributeController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function addAttributeAction()
5
+ {
6
+ $this->_getSession()->addNotice(
7
+ Mage::helper('Customerattributes')->__('Please click on the Close Window button if it is not closed automatically.')
8
+ );
9
+ $this->loadLayout('popup');
10
+ $this->_initProduct();
11
+ $this->_addContent(
12
+ $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_new_product_created')
13
+ );
14
+ $this->renderLayout();
15
+ }
16
+ }
app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerattributesController.php ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Customerattributes_Adminhtml_CustomerattributesController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected $_entityTypeId;
6
+
7
+ public function preDispatch()
8
+ {
9
+ parent::preDispatch();
10
+ $this->_entityTypeId = Mage::getModel('eav/entity')->setType('customer')->getTypeId();
11
+ }
12
+ protected function _initAction() {
13
+ $this->loadLayout()
14
+ ->_setActiveMenu('customer/items')
15
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
16
+
17
+ return $this;
18
+ }
19
+
20
+ public function indexAction() {
21
+ $this->_initAction()
22
+ ->renderLayout();
23
+ }
24
+
25
+ public function newAction() {
26
+ $this->_forward('edit');
27
+ }
28
+
29
+ public function editAction() {
30
+ $id = $this->getRequest()->getParam('attribute_id');
31
+ $model = Mage::getModel('catalog/resource_eav_attribute')
32
+ ->setEntityTypeId($this->_entityTypeId);
33
+
34
+ if ($id) {
35
+ $model->load($id);
36
+
37
+ if (! $model->getId()) {
38
+ Mage::getSingleton('adminhtml/session')->addError(
39
+ Mage::helper('customerattributes')->__('This attribute no longer exists'));
40
+ $this->_redirect('*/*/');
41
+ return;
42
+ }
43
+
44
+ // entity type check
45
+ if ($model->getEntityTypeId() != $this->_entityTypeId) {
46
+ Mage::getSingleton('adminhtml/session')->addError(
47
+ Mage::helper('customerattributes')->__('This attribute cannot be edited.'));
48
+ $this->_redirect('*/*/');
49
+ return;
50
+ }
51
+ }
52
+
53
+ // set entered data if was error when we do save
54
+ $data = Mage::getSingleton('adminhtml/session')->getAttributeData(true);
55
+ if (! empty($data)) {
56
+ $model->addData($data);
57
+ }
58
+ Mage::register('entity_attribute', $model);
59
+ // Mage::register('customerattributes_data', $model);
60
+
61
+ $this->loadLayout();
62
+
63
+ $this->_title($id ? $model->getName() : $this->__('New Attribute'));
64
+ $this->_setActiveMenu('customer/items');
65
+
66
+ $item = $id ? Mage::helper('catalog')->__('Edit Customer Attribute')
67
+ : Mage::helper('catalog')->__('New Customer Attribute');
68
+
69
+ $this->_addBreadcrumb($item, $item);
70
+
71
+ /* $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
72
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));*/
73
+
74
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
75
+
76
+ $this->getLayout()->getBlock('attribute_edit_js')
77
+ ->setIsPopup((bool)$this->getRequest()->getParam('popup'));
78
+
79
+ /*$this->_addContent($this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit'))
80
+ ->_addLeft($this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_edit_tabs'));*/
81
+
82
+ $this->renderLayout();
83
+ //else {
84
+ // Mage::getSingleton('adminhtml/session')->addError(Mage::helper('customerattributes')->__('Item does not exist'));
85
+ // $this->_redirect('*/*/');
86
+ // }
87
+ }
88
+
89
+ public function validateAction()
90
+ {
91
+ $response = new Varien_Object();
92
+ $response->setError(false);
93
+
94
+ $attributeCode = $this->getRequest()->getParam('attribute_code');
95
+ $attributeId = $this->getRequest()->getParam('attribute_id');
96
+ $attribute = Mage::getModel('catalog/resource_eav_attribute')
97
+ ->loadByCode($this->_entityTypeId, $attributeCode);
98
+
99
+ if ($attribute->getId() && !$attributeId) {
100
+ Mage::getSingleton('adminhtml/session')->addError(
101
+ Mage::helper('customerattributes')->__('Attribute with the same code already exists'));
102
+ $this->_initLayoutMessages('adminhtml/session');
103
+ $response->setError(true);
104
+ $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml());
105
+ }
106
+
107
+ $this->getResponse()->setBody($response->toJson());
108
+ }
109
+
110
+ protected function _filterPostData($data)
111
+ {
112
+ if ($data) {
113
+ /** @var $helperCatalog Mage_Catalog_Helper_Data */
114
+ $helperCatalog = Mage::helper('catalog');
115
+ //labels
116
+ foreach ($data['frontend_label'] as & $value) {
117
+ if ($value) {
118
+ $value = $helperCatalog->stripTags($value);
119
+ }
120
+ }
121
+ }
122
+ return $data;
123
+ }
124
+
125
+ public function saveAction()
126
+ {
127
+ $data = $this->getRequest()->getPost();
128
+
129
+ if ($data) {
130
+ /** @var $session Mage_Admin_Model_Session */
131
+ $session = Mage::getSingleton('adminhtml/session');
132
+
133
+ $redirectBack = $this->getRequest()->getParam('back', false);
134
+ /* @var $model Mage_Catalog_Model_Entity_Attribute */
135
+ $model = Mage::getModel('catalog/resource_eav_attribute');
136
+ /* @var $helper Mage_Catalog_Helper_Product */
137
+ $helper = Mage::helper('catalog/product');
138
+
139
+ $id = $this->getRequest()->getParam('attribute_id');
140
+
141
+ //validate attribute_code
142
+ if (isset($data['attribute_code'])) {
143
+ $validatorAttrCode = new Zend_Validate_Regex(array('pattern' => '/^[a-z][a-z_0-9]{1,254}$/'));
144
+ if (!$validatorAttrCode->isValid($data['attribute_code'])) {
145
+ $session->addError(
146
+ Mage::helper('customerattributes')->__('Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.')
147
+ );
148
+ $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));
149
+ return;
150
+ }
151
+ }
152
+
153
+
154
+ //validate frontend_input
155
+ if (isset($data['frontend_input'])) {
156
+ /** @var $validatorInputType Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype_Validator */
157
+ $validatorInputType = Mage::getModel('eav/adminhtml_system_config_source_inputtype_validator');
158
+ if (!$validatorInputType->isValid($data['frontend_input'])) {
159
+ foreach ($validatorInputType->getMessages() as $message) {
160
+ $session->addError($message);
161
+ }
162
+ $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));
163
+ return;
164
+ }
165
+ }
166
+
167
+ if ($id) {
168
+ $model->load($id);
169
+
170
+ if (!$model->getId()) {
171
+ $session->addError(
172
+ Mage::helper('customerattributes')->__('This Attribute no longer exists'));
173
+ $this->_redirect('*/*/');
174
+ return;
175
+ }
176
+
177
+ // entity type check
178
+ if ($model->getEntityTypeId() != $this->_entityTypeId) {
179
+ $session->addError(
180
+ Mage::helper('customerattributes')->__('This attribute cannot be updated.'));
181
+ $session->setAttributeData($data);
182
+ $this->_redirect('*/*/');
183
+ return;
184
+ }
185
+
186
+ $data['attribute_code'] = $model->getAttributeCode();
187
+ $data['is_user_defined'] = $model->getIsUserDefined();
188
+ $data['frontend_input'] = $model->getFrontendInput();
189
+ } else {
190
+ /**
191
+ * @todo add to helper and specify all relations for properties
192
+ */
193
+ $data['source_model'] = $helper->getAttributeSourceModelByInputType($data['frontend_input']);
194
+ $data['backend_model'] = $helper->getAttributeBackendModelByInputType($data['frontend_input']);
195
+ }
196
+
197
+ // echo "<pre>";print_r($data);die;
198
+ $data['visible_on_front'] = 1;
199
+ if (!isset($data['is_configurable'])) {
200
+ $data['is_configurable'] = 0;
201
+ }
202
+ if (!isset($data['is_filterable'])) {
203
+ $data['is_filterable'] = 0;
204
+ }
205
+ if (!isset($data['is_filterable_in_search'])) {
206
+ $data['is_filterable_in_search'] = 0;
207
+ }
208
+
209
+ if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {
210
+ $data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
211
+ }
212
+
213
+ $defaultValueField = $model->getDefaultValueByInput($data['frontend_input']);
214
+ if ($defaultValueField) {
215
+ $data['default_value'] = $this->getRequest()->getParam($defaultValueField);
216
+ }
217
+
218
+ if(!isset($data['apply_to'])) {
219
+ $data['apply_to'] = array();
220
+ }
221
+ $flag = 0;
222
+ //filter
223
+ $data = $this->_filterPostData($data);
224
+ $model->addData($data);
225
+
226
+ if (!$id) {
227
+ $model->setEntityTypeId($this->_entityTypeId);
228
+ $model->setIsUserDefined(1);
229
+ $flag = 1;
230
+ }
231
+
232
+
233
+ if ($this->getRequest()->getParam('set') && $this->getRequest()->getParam('group')) {
234
+ // For creating product attribute on product page we need specify attribute set and group
235
+ $model->setAttributeSetId($this->getRequest()->getParam('set'));
236
+ $model->setAttributeGroupId($this->getRequest()->getParam('group'));
237
+ }
238
+
239
+ try {
240
+ //echo "<pre>";print_r($data);die;
241
+ $model->save();
242
+ if($data['frontend_input'] == 'media_image')
243
+ {
244
+ $model->setFrontendInput('image');
245
+ $model->save();
246
+ }
247
+
248
+ if(isset($data['used_in_forms']))
249
+ {
250
+ $use_in_froms = implode(',',$customer);
251
+ Mage::getSingleton('eav/config')
252
+ ->getAttribute('customer', $data['attribute_code'])
253
+ ->setData('used_in_forms', $data['used_in_forms'])
254
+ ->save();
255
+ }
256
+ else
257
+ {
258
+ Mage::getSingleton('eav/config')
259
+ ->getAttribute('customer', $data['attribute_code'])
260
+ ->setData('used_in_forms', array())
261
+ ->save();
262
+ }
263
+
264
+
265
+ $session->addSuccess(
266
+ Mage::helper('customerattributes')->__('The customer attribute has been saved.'));
267
+
268
+ if($flag == 1)
269
+ {
270
+ Mage::getResourceModel("customerattributes/customerattributes")->makeNewQuoteAttr($data['attribute_code']);
271
+ }
272
+
273
+ /**
274
+ * Clear translation cache because attribute labels are stored in translation
275
+ */
276
+ Mage::app()->cleanCache(array(Mage_Core_Model_Translate::CACHE_TAG));
277
+ $session->setAttributeData(false);
278
+ if ($this->getRequest()->getParam('popup')) {
279
+ $this->_redirect('customerattributes/adminhtml_product/addAttribute', array(
280
+ 'id' => $this->getRequest()->getParam('product'),
281
+ 'attribute'=> $model->getId(),
282
+ '_current' => true
283
+ ));
284
+ } elseif ($redirectBack) {
285
+ $this->_redirect('*/*/edit', array('attribute_id' => $model->getId(),'_current'=>true));
286
+ } else {
287
+ $this->_redirect('*/*/', array());
288
+ }
289
+ return;
290
+ } catch (Exception $e) {
291
+ $session->addError($e->getMessage());
292
+ $session->setAttributeData($data);
293
+ $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));
294
+ return;
295
+ }
296
+ }
297
+
298
+ $this->_redirect('*/*/');
299
+ }
300
+
301
+ /* public function saveAction() {
302
+ if ($data = $this->getRequest()->getPost()) {
303
+
304
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
305
+ try {
306
+
307
+ $uploader = new Varien_File_Uploader('filename');
308
+
309
+
310
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
311
+ $uploader->setAllowRenameFiles(false);
312
+
313
+
314
+ $uploader->setFilesDispersion(false);
315
+
316
+
317
+ $path = Mage::getBaseDir('media') . DS ;
318
+ $uploader->save($path, $_FILES['filename']['name'] );
319
+
320
+ } catch (Exception $e) {
321
+
322
+ }
323
+
324
+
325
+ $data['filename'] = $_FILES['filename']['name'];
326
+ }
327
+
328
+
329
+ $model = Mage::getModel('customerattributes/customerattributes');
330
+ $model->setData($data)
331
+ ->setId($this->getRequest()->getParam('attribute_id'));
332
+
333
+ try {
334
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
335
+ $model->setCreatedTime(now())
336
+ ->setUpdateTime(now());
337
+ } else {
338
+ $model->setUpdateTime(now());
339
+ }
340
+
341
+ $model->save();
342
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('customerattributes')->__('Item was successfully saved'));
343
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
344
+
345
+ if ($this->getRequest()->getParam('back')) {*/
346
+ // $this->_redirect('*/*/edit', array('attribute_id' => $model->getId()));
347
+ /* return;
348
+ }*/
349
+ // $this->_redirect('*/*/');
350
+ /*return;
351
+ } catch (Exception $e) {
352
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
353
+ Mage::getSingleton('adminhtml/session')->setFormData($data);*/
354
+ // $this->_redirect('*/*/edit', array('attribute_id' => $this->getRequest()->getParam('attribute_id')));
355
+ /*return;
356
+ }
357
+ }
358
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('customerattributes')->__('Unable to find item to save'));*/
359
+ //$this->_redirect('*/*/');
360
+ /* } */
361
+
362
+ public function deleteAction() {
363
+
364
+ if ($id = $this->getRequest()->getParam('attribute_id')) {
365
+ $model = Mage::getModel('catalog/resource_eav_attribute');
366
+
367
+ // entity type check
368
+ $model->load($id);
369
+ if ($model->getEntityTypeId() != $this->_entityTypeId) {
370
+ Mage::getSingleton('adminhtml/session')->addError(
371
+ Mage::helper('customerattributes')->__('This attribute cannot be deleted.'));
372
+ $this->_redirect('*/*/');
373
+ return;
374
+ }
375
+
376
+ try {
377
+ if($model->getIsUserDefined())
378
+ {
379
+ Mage::getResourceModel("customerattributes/customerattributes")->deleteQuoteAttr($model->getAttributeCode());
380
+ $model->delete();
381
+ }
382
+ Mage::getSingleton('adminhtml/session')->addSuccess(
383
+ Mage::helper('customerattributes')->__('The product attribute has been deleted.'));
384
+ $this->_redirect('*/*/');
385
+ return;
386
+ }
387
+ catch (Exception $e) {
388
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
389
+ $this->_redirect('*/*/edit', array('attribute_id' => $this->getRequest()->getParam('attribute_id')));
390
+ return;
391
+ }
392
+ }
393
+ Mage::getSingleton('adminhtml/session')->addError(
394
+ Mage::helper('customerattributes')->__('Unable to find an attribute to delete.'));
395
+ $this->_redirect('*/*/');
396
+
397
+
398
+ }
399
+
400
+ public function exportCsvAction()
401
+ {
402
+ $fileName = 'customerattributes.csv';
403
+ $content = $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_grid')
404
+ ->getCsv();
405
+
406
+ $this->_sendUploadResponse($fileName, $content);
407
+ }
408
+
409
+ public function exportXmlAction()
410
+ {
411
+ $fileName = 'customerattributes.xml';
412
+ $content = $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_grid')
413
+ ->getXml();
414
+
415
+ $this->_sendUploadResponse($fileName, $content);
416
+ }
417
+
418
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
419
+ {
420
+ $response = $this->getResponse();
421
+ $response->setHeader('HTTP/1.1 200 OK','');
422
+ $response->setHeader('Pragma', 'public', true);
423
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
424
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
425
+ $response->setHeader('Last-Modified', date('r'));
426
+ $response->setHeader('Accept-Ranges', 'bytes');
427
+ $response->setHeader('Content-Length', strlen($content));
428
+ $response->setHeader('Content-type', $contentType);
429
+ $response->setBody($content);
430
+ $response->sendResponse();
431
+ die;
432
+ }
433
+ }
app/code/local/Tatva/Customerattributes/controllers/Adminhtml/ProductController.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Customerattributes_Adminhtml_ProductController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function addAttributeAction()
5
+ {
6
+ $this->_getSession()->addNotice(
7
+ Mage::helper('Customerattributes')->__('Please click on the Close Window button if it is not closed automatically.')
8
+ );
9
+ $this->loadLayout('popup');
10
+ $this->_initProduct();
11
+ $this->_addContent(
12
+ $this->getLayout()->createBlock('customerattributes/adminhtml_customerattributes_new_product_created')
13
+ );
14
+ $this->renderLayout();
15
+ }
16
+ }
app/code/local/Tatva/Customerattributes/etc/adminhtml.xml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <adminhtml>
3
+ <menu>
4
+ <customer module="customer">
5
+ <children>
6
+ <items module="customer">
7
+ <title>Manage Customer Attributes</title>
8
+ <children>
9
+ <items1>
10
+ <title>Customer Attribute</title>
11
+ <sort_order>150</sort_order>
12
+ <action>customerattributes/adminhtml_customerattributes</action>
13
+ </items1>
14
+ <items2>
15
+ <title>Customer Address Attribute</title>
16
+ <sort_order>151</sort_order>
17
+ <action>customerattributes/adminhtml_customeraddress</action>
18
+ </items2>
19
+ </children>
20
+ </items>
21
+ </children>
22
+ </customer>
23
+ </menu>
24
+ <acl>
25
+ <resources>
26
+ <all>
27
+ <title>Allow Everything</title>
28
+ </all>
29
+ <admin>
30
+ <children>
31
+ <system>
32
+ <children>
33
+ <config>
34
+ <children>
35
+ <customerattributes translate="title" module="customerattributes">
36
+ <title>CustomerAttributes Configuration</title>
37
+ </customerattributes>
38
+ </children>
39
+ </config>
40
+ </children>
41
+ </system>
42
+ <Tatva_customerattributes>
43
+ <title>Customerattributes</title>
44
+ <sort_order>11</sort_order>
45
+ </Tatva_customerattributes>
46
+ </children>
47
+ </admin>
48
+ </resources>
49
+ </acl>
50
+ <!--<layout>
51
+ <updates>
52
+ <customerattributes>
53
+ <file>customerattributes.xml</file>
54
+ </customerattributes>
55
+ </updates>
56
+ </layout>-->
57
+ </adminhtml>
app/code/local/Tatva/Customerattributes/etc/adminhtml_old.xml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <adminhtml>
3
+ <menu>
4
+ <customer module="customer">
5
+ <children>
6
+ <items module="customer">
7
+ <title>Manage Customer Attributes</title>
8
+ <children>
9
+ <items1>
10
+ <title>Customer Attribute</title>
11
+ <sort_order>150</sort_order>
12
+ <action>customerattributes/adminhtml_customerattributes</action>
13
+ </items1>
14
+ <items2>
15
+ <title>Customer Address Attribute</title>
16
+ <sort_order>151</sort_order>
17
+ <action>customerattributes/adminhtml_customeraddress</action>
18
+ </items2>
19
+ </children>
20
+ </items>
21
+ </children>
22
+ </customer>
23
+ </menu>
24
+ <acl>
25
+ <resources>
26
+ <all>
27
+ <title>Allow Everything</title>
28
+ </all>
29
+ <admin>
30
+ <children>
31
+ <system>
32
+ <children>
33
+ <config>
34
+ <children>
35
+ <customerattributes translate="title" module="customerattributes">
36
+ <title>CustomerAttributes Configuration</title>
37
+ </customerattributes>
38
+ </children>
39
+ </config>
40
+ </children>
41
+ </system>
42
+ <Tatva_customerattributes>
43
+ <title>Customerattributes</title>
44
+ <sort_order>11</sort_order>
45
+ </Tatva_customerattributes>
46
+ </children>
47
+ </admin>
48
+ </resources>
49
+ </acl>
50
+ <!--<layout>
51
+ <updates>
52
+ <customerattributes>
53
+ <file>customerattributes.xml</file>
54
+ </customerattributes>
55
+ </updates>
56
+ </layout>-->
57
+ </adminhtml>
app/code/local/Tatva/Customerattributes/etc/config.xml ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Customerattributes>
5
+ <version>0.1.0</version>
6
+ </Tatva_Customerattributes>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <customerattributes>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Tatva_Customerattributes</module>
14
+ <frontName>customerattributes</frontName>
15
+ </args>
16
+ </customerattributes>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <customerattributes>
21
+ <file>customerattributes.xml</file>
22
+ </customerattributes>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <customerattributes>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Tatva_Customerattributes</module>
32
+ <frontName>customerattributes</frontName>
33
+ </args>
34
+ </customerattributes>
35
+ <adminhtml>
36
+ <args>
37
+ <modules>
38
+ <Tatva_Customerattributes before="Mage_Adminhtml">Tatva_Customerattributes_Adminhtml</Tatva_Customerattributes>
39
+ </modules>
40
+ </args>
41
+ </adminhtml>
42
+ </routers>
43
+ </admin>
44
+ <adminhtml>
45
+ <layout>
46
+ <updates>
47
+ <customerattributes>
48
+ <file>customerattributes.xml</file>
49
+ </customerattributes>
50
+ </updates>
51
+ </layout>
52
+ </adminhtml>
53
+ <global>
54
+ <models>
55
+ <customerattributes>
56
+ <class>Tatva_Customerattributes_Model</class>
57
+ <resourceModel>customerattributes_mysql4</resourceModel>
58
+ </customerattributes>
59
+ <customerattributes_mysql4>
60
+ <class>Tatva_Customerattributes_Model_Mysql4</class>
61
+ <!--<entities>
62
+ <customerattributes>
63
+ <table>customerattributes</table>
64
+ </customerattributes>
65
+ </entities>-->
66
+ </customerattributes_mysql4>
67
+ <customer>
68
+ <rewrite>
69
+ <attribute>Tatva_Customerattributes_Model_Attribute</attribute>
70
+ </rewrite>
71
+ </customer>
72
+ </models>
73
+ <resources>
74
+ <customerattributes_setup>
75
+ <setup>
76
+ <module>Tatva_Customerattributes</module>
77
+ </setup>
78
+ <connection>
79
+ <use>core_setup</use>
80
+ </connection>
81
+ </customerattributes_setup>
82
+ <customerattributes_write>
83
+ <connection>
84
+ <use>core_write</use>
85
+ </connection>
86
+ </customerattributes_write>
87
+ <customerattributes_read>
88
+ <connection>
89
+ <use>core_read</use>
90
+ </connection>
91
+ </customerattributes_read>
92
+ </resources>
93
+ <blocks>
94
+ <customerattributes>
95
+ <class>Tatva_Customerattributes_Block</class>
96
+ </customerattributes>
97
+ <adminhtml>
98
+ <rewrite>
99
+ <customer_grid>Tatva_Customerattributes_Block_Adminhtml_Customer_Grid</customer_grid>
100
+ </rewrite>
101
+ </adminhtml>
102
+ </blocks>
103
+ <helpers>
104
+ <customerattributes>
105
+ <class>Tatva_Customerattributes_Helper</class>
106
+ </customerattributes>
107
+ </helpers>
108
+ <!--<rewrite>
109
+ <customerattributes_customer>
110
+ <from><![CDATA[#^/adminhtml/customer_save/#]]></from>
111
+ <to>/customerattributes/customer_save/</to>
112
+ </customerattributes_customer>
113
+ </rewrite>-->
114
+ <!--<routers>
115
+ <adminhtml>
116
+ <rewrite>
117
+ <customer>
118
+ <from><![CDATA[#^/admin/customer/$#]]></from>
119
+ <to>/customerattributes/adminhtml/customer/</to>
120
+ </customer>
121
+ </rewrite>
122
+ </adminhtml>
123
+ </routers>-->
124
+ <fieldsets>
125
+ <!--<customer_account>
126
+ <coupon_details><create>1</create><update>1</update><name>1</name></coupon_details>
127
+ </customer_account>-->
128
+ <!--<checkout_onepage_quote>
129
+ <coupon_details>
130
+ <to_customer>coupon_details</to_customer>
131
+ </coupon_details>
132
+ </checkout_onepage_quote>
133
+ <customer_account>
134
+ <coupon_details>
135
+ <to_quote>coupon_details</to_quote>
136
+ </coupon_details>
137
+ </customer_account>-->
138
+
139
+
140
+ <sales_convert_quote_address>
141
+ <testtext>
142
+ <to_order_address>*</to_order_address>
143
+ <to_customer_address>*</to_customer_address>
144
+ </testtext>
145
+ <testtextarea>
146
+ <to_order_address>*</to_order_address>
147
+ <to_customer_address>*</to_customer_address>
148
+ </testtextarea>
149
+ <testdate>
150
+ <to_order_address>*</to_order_address>
151
+ <to_customer_address>*</to_customer_address>
152
+ </testdate>
153
+ <testboolean>
154
+ <to_order_address>*</to_order_address>
155
+ <to_customer_address>*</to_customer_address>
156
+ </testboolean>
157
+ <testdropdown>
158
+ <to_order_address>*</to_order_address>
159
+ <to_customer_address>*</to_customer_address>
160
+ </testdropdown>
161
+ <testmultiselect>
162
+ <to_order_address>*</to_order_address>
163
+ <to_customer_address>*</to_customer_address>
164
+ </testmultiselect>
165
+ </sales_convert_quote_address>
166
+ <customer_address>
167
+ <testtext>
168
+ <to_quote_address>*</to_quote_address>
169
+ </testtext>
170
+ <testtextarea>
171
+ <to_quote_address>*</to_quote_address>
172
+ </testtextarea>
173
+ <testdate>
174
+ <to_quote_address>*</to_quote_address>
175
+ </testdate>
176
+ <testboolean>
177
+ <to_quote_address>*</to_quote_address>
178
+ </testboolean>
179
+ <testdropdown>
180
+ <to_quote_address>*</to_quote_address>
181
+ </testdropdown>
182
+ <testmultiselect>
183
+ <to_quote_address>*</to_quote_address>
184
+ </testmultiselect>
185
+ </customer_address>
186
+ </fieldsets>
187
+ </global>
188
+ </config>
app/code/local/Tatva/Customerattributes/etc/config_old.xml ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Customerattributes>
5
+ <version>0.1.0</version>
6
+ </Tatva_Customerattributes>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <customerattributes>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Tatva_Customerattributes</module>
14
+ <frontName>customerattributes</frontName>
15
+ </args>
16
+ </customerattributes>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <customerattributes>
21
+ <file>customerattributes.xml</file>
22
+ </customerattributes>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <customerattributes>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Tatva_Customerattributes</module>
32
+ <frontName>customerattributes</frontName>
33
+ </args>
34
+ </customerattributes>
35
+ <adminhtml>
36
+ <args>
37
+ <modules>
38
+ <Tatva_Customerattributes before="Mage_Adminhtml">Tatva_Customerattributes_Adminhtml</Tatva_Customerattributes>
39
+ </modules>
40
+ </args>
41
+ </adminhtml>
42
+ </routers>
43
+ </admin>
44
+ <adminhtml>
45
+ <layout>
46
+ <updates>
47
+ <customerattributes>
48
+ <file>customerattributes.xml</file>
49
+ </customerattributes>
50
+ </updates>
51
+ </layout>
52
+ </adminhtml>
53
+ <global>
54
+ <models>
55
+ <customerattributes>
56
+ <class>Tatva_Customerattributes_Model</class>
57
+ <resourceModel>customerattributes_mysql4</resourceModel>
58
+ </customerattributes>
59
+ <customerattributes_mysql4>
60
+ <class>Tatva_Customerattributes_Model_Mysql4</class>
61
+
62
+ </customerattributes_mysql4>
63
+ <customer>
64
+ <rewrite>
65
+ <attribute>Tatva_Customerattributes_Model_Attribute</attribute>
66
+ </rewrite>
67
+ </customer>
68
+ </models>
69
+ <resources>
70
+ <customerattributes_setup>
71
+ <setup>
72
+ <module>Tatva_Customerattributes</module>
73
+ </setup>
74
+ <connection>
75
+ <use>core_setup</use>
76
+ </connection>
77
+ </customerattributes_setup>
78
+ <customerattributes_write>
79
+ <connection>
80
+ <use>core_write</use>
81
+ </connection>
82
+ </customerattributes_write>
83
+ <customerattributes_read>
84
+ <connection>
85
+ <use>core_read</use>
86
+ </connection>
87
+ </customerattributes_read>
88
+ </resources>
89
+ <blocks>
90
+ <customerattributes>
91
+ <class>Tatva_Customerattributes_Block</class>
92
+ </customerattributes>
93
+ <adminhtml>
94
+ <rewrite>
95
+ <customer_grid>Tatva_Customerattributes_Block_Adminhtml_Customer_Grid</customer_grid>
96
+ </rewrite>
97
+ </adminhtml>
98
+ </blocks>
99
+ <helpers>
100
+ <customerattributes>
101
+ <class>Tatva_Customerattributes_Helper</class>
102
+ </customerattributes>
103
+ </helpers>
104
+
105
+ <fieldsets>
106
+ <!-- Replace test_attribute with your customer attribute_code -->
107
+
108
+ <sales_convert_quote_address>
109
+ <testtext>
110
+ <to_order_address>*</to_order_address>
111
+ <to_customer_address>*</to_customer_address>
112
+ </testtext>
113
+ </sales_convert_quote_address>
114
+ <customer_address>
115
+ <testtext>
116
+ <to_quote_address>*</to_quote_address>
117
+ </test_attribute>
118
+ </testtext>
119
+
120
+ <!--<sales_convert_quote_address>
121
+ <testboolean>
122
+ <to_order_address>*</to_order_address>
123
+ <to_customer_address>*</to_customer_address>
124
+ </testboolean>
125
+ <testmultiselect>
126
+ <to_order_address>*</to_order_address>
127
+ <to_customer_address>*</to_customer_address>
128
+ </testmultiselect>
129
+ <testtext>
130
+ <to_order_address>*</to_order_address>
131
+ <to_customer_address>*</to_customer_address>
132
+ </testtext>
133
+ <testtextarea>
134
+ <to_order_address>*</to_order_address>
135
+ <to_customer_address>*</to_customer_address>
136
+ </testtextarea>
137
+ <testdate>
138
+ <to_order_address>*</to_order_address>
139
+ <to_customer_address>*</to_customer_address>
140
+ </testdate>
141
+ </sales_convert_quote_address>
142
+ <customer_address>
143
+ <testboolean>
144
+ <to_quote_address>*</to_quote_address>
145
+ </testboolean>
146
+ <testmultiselect>
147
+ <to_quote_address>*</to_quote_address>
148
+ </testmultiselect>
149
+ <testtext>
150
+ <to_quote_address>*</to_quote_address>
151
+ </testtext>
152
+ <testtextarea>
153
+ <to_quote_address>*</to_quote_address>
154
+ </testtextarea>
155
+ <testdate>
156
+ <to_quote_address>*</to_quote_address>
157
+ </testdate>
158
+ </customer_address>-->
159
+ </fieldsets>
160
+ </global>
161
+ </config>
app/code/local/Tatva/Customerattributes/etc/system.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <customerattributes translate="label" module="customerattributes">
5
+ <label>Customer Attributes</label>
6
+ <sort_order>11</sort_order>
7
+ </customerattributes>
8
+ </tabs>
9
+ <sections>
10
+ <customerattributes translate="label" module="customerattributes">
11
+ <class>separator-top</class>
12
+ <label>Customer Attributes</label>
13
+ <tab>customerattributes</tab>
14
+ <frontend_type>multiselect</frontend_type>
15
+ <sort_order>11</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <config translate="label" module="customerattributes">
21
+ <label>Customer Attributes</label>
22
+ <frontend_type>multiselect</frontend_type>
23
+ <sort_order>11</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <customer_attribute translate="label" module="customerattributes">
29
+ <label>Select Attributes</label>
30
+ <frontend_type>multiselect</frontend_type>
31
+ <source_model>customerattributes/customerattributes</source_model>
32
+ <sort_order>11</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <can_be_empty>1</can_be_empty>
37
+ </customer_attribute>
38
+ </fields>
39
+ </config>
40
+ </groups>
41
+ </customerattributes>
42
+ </sections>
43
+ </config>
app/code/local/Tatva/Customerattributes/etc/system_old.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <customerattributes translate="label" module="customerattributes">
5
+ <label>Customer Attributes</label>
6
+ <sort_order>11</sort_order>
7
+ </customerattributes>
8
+ </tabs>
9
+ <sections>
10
+ <customerattributes translate="label" module="customerattributes">
11
+ <class>separator-top</class>
12
+ <label>Customer Attributes</label>
13
+ <tab>customerattributes</tab>
14
+ <frontend_type>multiselect</frontend_type>
15
+ <sort_order>11</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <config translate="label" module="customerattributes">
21
+ <label>Customer Attributes</label>
22
+ <frontend_type>multiselect</frontend_type>
23
+ <sort_order>11</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <customer_attribute translate="label" module="customerattributes">
29
+ <label>Select Attributes</label>
30
+ <frontend_type>multiselect</frontend_type>
31
+ <source_model>customerattributes/customerattributes</source_model>
32
+ <sort_order>11</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <can_be_empty>1</can_be_empty>
37
+ </customer_attribute>
38
+ </fields>
39
+ </config>
40
+ </groups>
41
+ </customerattributes>
42
+ </sections>
43
+ </config>
app/code/local/Tatva/Customerattributes/sql/customerattributes_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $tablequote = $this->getTable('sales/quote_address');
8
+ $installer->run("ALTER TABLE $tablequote ADD `test_attribute` varchar(255) NOT NULL");
9
+
10
+ $tablequote = $this->getTable('sales/order_address');
11
+ $installer->run("ALTER TABLE $tablequote ADD `test_attribute` varchar(255) NOT NULL");
12
+
13
+ $installer->endSetup();
app/code/local/Tatva/Exportallimage/Model/Convert/Adapter/Product.php ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Tatva_Exportallimage_Model_Convert_Adapter_Product extends Mage_Catalog_Model_Convert_Adapter_Product
5
+ {
6
+ /**
7
+ * Save product (import)
8
+ *
9
+ * @param array $importData
10
+ * @throws Mage_Core_Exception
11
+ * @return bool
12
+ */
13
+ public function saveRow(array $importData)
14
+ {
15
+ $product = $this->getProductModel()
16
+ ->reset();
17
+
18
+ if (empty($importData['store'])) {
19
+ if (!is_null($this->getBatchParams('store'))) {
20
+ $store = $this->getStoreById($this->getBatchParams('store'));
21
+ } else {
22
+ $message = Mage::helper('catalog')->__('Skipping import row, required field "%s" is not defined.', 'store');
23
+ Mage::throwException($message);
24
+ }
25
+ } else {
26
+ $store = $this->getStoreByCode($importData['store']);
27
+ }
28
+
29
+ if ($store === false) {
30
+ $message = Mage::helper('catalog')->__('Skipping import row, store "%s" field does not exist.', $importData['store']);
31
+ Mage::throwException($message);
32
+ }
33
+
34
+ if (empty($importData['sku'])) {
35
+ $message = Mage::helper('catalog')->__('Skipping import row, required field "%s" is not defined.', 'sku');
36
+ Mage::throwException($message);
37
+ }
38
+ $product->setStoreId($store->getId());
39
+ $productId = $product->getIdBySku($importData['sku']);
40
+
41
+ if ($productId) {
42
+ $product->load($productId);
43
+ } else {
44
+ $productTypes = $this->getProductTypes();
45
+ $productAttributeSets = $this->getProductAttributeSets();
46
+
47
+ /**
48
+ * Check product define type
49
+ */
50
+ if (empty($importData['type']) || !isset($productTypes[strtolower($importData['type'])])) {
51
+ $value = isset($importData['type']) ? $importData['type'] : '';
52
+ $message = Mage::helper('catalog')->__('Skip import row, is not valid value "%s" for field "%s"', $value, 'type');
53
+ Mage::throwException($message);
54
+ }
55
+ $product->setTypeId($productTypes[strtolower($importData['type'])]);
56
+ /**
57
+ * Check product define attribute set
58
+ */
59
+ if (empty($importData['attribute_set']) || !isset($productAttributeSets[$importData['attribute_set']])) {
60
+ $value = isset($importData['attribute_set']) ? $importData['attribute_set'] : '';
61
+ $message = Mage::helper('catalog')->__('Skip import row, the value "%s" is invalid for field "%s"', $value, 'attribute_set');
62
+ Mage::throwException($message);
63
+ }
64
+ $product->setAttributeSetId($productAttributeSets[$importData['attribute_set']]);
65
+
66
+ foreach ($this->_requiredFields as $field) {
67
+ $attribute = $this->getAttribute($field);
68
+ if (!isset($importData[$field]) && $attribute && $attribute->getIsRequired()) {
69
+ $message = Mage::helper('catalog')->__('Skipping import row, required field "%s" for new products is not defined.', $field);
70
+ Mage::throwException($message);
71
+ }
72
+ }
73
+ }
74
+
75
+ $this->setProductTypeInstance($product);
76
+
77
+ if (isset($importData['category_ids'])) {
78
+ $product->setCategoryIds($importData['category_ids']);
79
+ }
80
+
81
+ foreach ($this->_ignoreFields as $field) {
82
+ if (isset($importData[$field])) {
83
+ unset($importData[$field]);
84
+ }
85
+ }
86
+
87
+ if ($store->getId() != 0) {
88
+ $websiteIds = $product->getWebsiteIds();
89
+ if (!is_array($websiteIds)) {
90
+ $websiteIds = array();
91
+ }
92
+ if (!in_array($store->getWebsiteId(), $websiteIds)) {
93
+ $websiteIds[] = $store->getWebsiteId();
94
+ }
95
+ $product->setWebsiteIds($websiteIds);
96
+ }
97
+
98
+ if (isset($importData['websites'])) {
99
+ $websiteIds = $product->getWebsiteIds();
100
+ if (!is_array($websiteIds) || !$store->getId()) {
101
+ $websiteIds = array();
102
+ }
103
+ $websiteCodes = explode(',', $importData['websites']);
104
+ foreach ($websiteCodes as $websiteCode) {
105
+ try {
106
+ $website = Mage::app()->getWebsite(trim($websiteCode));
107
+ if (!in_array($website->getId(), $websiteIds)) {
108
+ $websiteIds[] = $website->getId();
109
+ }
110
+ } catch (Exception $e) {}
111
+ }
112
+ $product->setWebsiteIds($websiteIds);
113
+ unset($websiteIds);
114
+ }
115
+
116
+ foreach ($importData as $field => $value) {
117
+ if (in_array($field, $this->_inventoryFields)) {
118
+ continue;
119
+ }
120
+ if (is_null($value)) {
121
+ continue;
122
+ }
123
+
124
+ $attribute = $this->getAttribute($field);
125
+ if (!$attribute) {
126
+ continue;
127
+ }
128
+
129
+ $isArray = false;
130
+ $setValue = $value;
131
+
132
+ if ($attribute->getFrontendInput() == 'multiselect') {
133
+ $value = explode(self::MULTI_DELIMITER, $value);
134
+ $isArray = true;
135
+ $setValue = array();
136
+ }
137
+
138
+ if ($value && $attribute->getBackendType() == 'decimal') {
139
+ $setValue = $this->getNumber($value);
140
+ }
141
+
142
+ if ($attribute->usesSource()) {
143
+ $options = $attribute->getSource()->getAllOptions(false);
144
+
145
+ if ($isArray) {
146
+ foreach ($options as $item) {
147
+ if (in_array($item['label'], $value)) {
148
+ $setValue[] = $item['value'];
149
+ }
150
+ }
151
+ } else {
152
+ $setValue = false;
153
+ foreach ($options as $item) {
154
+ if (is_array($item['value'])) {
155
+ foreach ($item['value'] as $subValue) {
156
+ if (isset($subValue['value']) && $subValue['value'] == $value) {
157
+ $setValue = $value;
158
+ }
159
+ }
160
+ } else if ($item['label'] == $value) {
161
+ $setValue = $item['value'];
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ $product->setData($field, $setValue);
168
+ }
169
+
170
+ if (!$product->getVisibility()) {
171
+ $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
172
+ }
173
+
174
+ $stockData = array();
175
+ $inventoryFields = isset($this->_inventoryFieldsProductTypes[$product->getTypeId()])
176
+ ? $this->_inventoryFieldsProductTypes[$product->getTypeId()]
177
+ : array();
178
+ foreach ($inventoryFields as $field) {
179
+ if (isset($importData[$field])) {
180
+ if (in_array($field, $this->_toNumber)) {
181
+ $stockData[$field] = $this->getNumber($importData[$field]);
182
+ } else {
183
+ $stockData[$field] = $importData[$field];
184
+ }
185
+ }
186
+ }
187
+ $product->setStockData($stockData);
188
+
189
+ $mediaGalleryBackendModel = $this->getAttribute('media_gallery')->getBackend();
190
+
191
+ $arrayToMassAdd = array();
192
+
193
+ foreach ($product->getMediaAttributes() as $mediaAttributeCode => $mediaAttribute) {
194
+ if (isset($importData[$mediaAttributeCode])) {
195
+ $file = trim($importData[$mediaAttributeCode]);
196
+ if (!empty($file) && !$mediaGalleryBackendModel->getImage($product, $file)) {
197
+ $arrayToMassAdd[] = array('file' => trim($file), 'mediaAttribute' => $mediaAttributeCode);
198
+ }
199
+ }
200
+ }
201
+
202
+ $addedFilesCorrespondence = $mediaGalleryBackendModel->addImagesWithDifferentMediaAttributes(
203
+ $product,
204
+ $arrayToMassAdd, Mage::getBaseDir('media') . DS . 'import',
205
+ false,
206
+ false
207
+ );
208
+
209
+ if ($importData['add_images']) {
210
+ $additionalImages = explode(';',$importData['add_images']);
211
+ foreach ($additionalImages as $image) {
212
+ if (!empty($image) && !$mediaGalleryBackendModel->getImage($product, $image)) {
213
+ $arrayToMassAdd2[] = array('file' => trim($image));
214
+ }
215
+ }
216
+ }
217
+
218
+ $addedFilesCorrespondence = $mediaGalleryBackendModel->addImagesWithDifferentMediaAttributes(
219
+ $product,
220
+ $arrayToMassAdd2, Mage::getBaseDir('media') . DS . 'import',
221
+ false,
222
+ false
223
+ );
224
+
225
+ foreach ($product->getMediaAttributes() as $mediaAttributeCode => $mediaAttribute) {
226
+ $addedFile = '';
227
+ if (isset($importData[$mediaAttributeCode . '_label'])) {
228
+ $fileLabel = trim($importData[$mediaAttributeCode . '_label']);
229
+ if (isset($importData[$mediaAttributeCode])) {
230
+ $keyInAddedFile = array_search($importData[$mediaAttributeCode],
231
+ $addedFilesCorrespondence['alreadyAddedFiles']);
232
+ if ($keyInAddedFile !== false) {
233
+ $addedFile = $addedFilesCorrespondence['alreadyAddedFilesNames'][$keyInAddedFile];
234
+ }
235
+ }
236
+
237
+ if (!$addedFile) {
238
+ $addedFile = $product->getData($mediaAttributeCode);
239
+ }
240
+ if ($fileLabel && $addedFile) {
241
+ $mediaGalleryBackendModel->updateImage($product, $addedFile, array('label' => $fileLabel));
242
+ }
243
+ }
244
+ }
245
+
246
+ $product->setIsMassupdate(true);
247
+ $product->setExcludeUrlRewrite(true);
248
+
249
+ $product->save();
250
+
251
+ // Store affected products ids
252
+ $this->_addAffectedEntityIds($product->getId());
253
+
254
+ return true;
255
+ }
256
+ }
app/code/local/Tatva/Exportallimage/Model/Convert/Parser/Csv.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Exportallimage_Model_Convert_Parser_Csv extends Mage_Dataflow_Model_Convert_Parser_Csv
3
+ {
4
+
5
+ /**
6
+ * Read data collection and write to temporary file
7
+ *
8
+ * @return Mage_Dataflow_Model_Convert_Parser_Csv
9
+ */
10
+ public function unparse()
11
+ {
12
+ $batchExport = $this->getBatchExportModel()->setBatchId($this->getBatchModel()->getId());
13
+ $fieldList = $this->getBatchModel()->getFieldList();
14
+ $fieldList['add_images'] = 'add_images';
15
+ $batchExportIds = $batchExport->getIdCollection();
16
+
17
+ $io = $this->getBatchModel()->getIoAdapter();
18
+ $io->open();
19
+
20
+ if (!$batchExportIds)
21
+ {
22
+ $io->write("");
23
+ $io->close();
24
+ return $this;
25
+ }
26
+
27
+ if ($this->getVar('fieldnames'))
28
+ {
29
+ $csvData = $this->getCsvString($fieldList);
30
+ $io->write($csvData);
31
+ }
32
+
33
+ $product = new Mage_Catalog_Model_Product();
34
+
35
+ foreach ($batchExportIds as $batchExportId)
36
+ {
37
+ $csvData = array();
38
+ $batchExport->load($batchExportId);
39
+ $row = $batchExport->getBatchData();
40
+ //$product->setSku($row['sku']);
41
+
42
+ $productid = Mage::getModel('catalog/product')->getIdBySku($row['sku']);
43
+
44
+ // Initiate product model
45
+ $product = Mage::getModel('catalog/product');
46
+
47
+ // Load specific product whose tier price want to update
48
+ $product->load($productid);
49
+ $smallImage = $product->getSmallImage();
50
+ $image = $product->getImage();
51
+ $thumb = $product->getThumbnail();
52
+ $mediaGallery = $product->getMediaGallery();
53
+ $mediaGallery = $mediaGallery['images'];
54
+
55
+ $add_images = '';
56
+
57
+ foreach ($mediaGallery as $add_image)
58
+ {
59
+ if ($add_image['file'] != $smallImage && $add_image['file'] != $image && $add_image['file'] != $thumb)
60
+ $add_images .= $add_image['file'].';';
61
+ }
62
+
63
+ $row['add_images'] = $add_images;
64
+
65
+ foreach ($fieldList as $field) {
66
+ $csvData[] = isset($row[$field]) ? $row[$field] : '';
67
+ }
68
+
69
+ $csvData = $this->getCsvString($csvData);
70
+ $io->write($csvData);
71
+ }
72
+
73
+ $io->close();
74
+ return $this;
75
+ }
76
+
77
+ }
app/code/local/Tatva/Exportallimage/etc/config.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Exportallimage>
5
+ <version>0.1.0</version>
6
+ </Tatva_Exportallimage>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <dataflow>
11
+ <rewrite>
12
+ <convert_parser_csv>Tatva_Exportallimage_Model_Convert_Parser_Csv</convert_parser_csv>
13
+ </rewrite>
14
+ </dataflow>
15
+ <catalog>
16
+ <rewrite>
17
+ <convert_adapter_product>Tatva_Exportallimage_Model_Convert_Adapter_Product</convert_adapter_product>
18
+ </rewrite>
19
+ </catalog>
20
+ </models>
21
+ </global>
22
+ </config>
app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Faqs_Block_Adminhtml_Faqs extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_faqs';
7
+ $this->_blockGroup = 'faqs';
8
+ $this->_headerText = Mage::helper('faqs')->__('Item Manager');
9
+ $this->_addButtonLabel = Mage::helper('faqs')->__('Add Item');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Block_Adminhtml_Faqs_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+
6
+ protected function _prepareLayout()
7
+ {
8
+ parent::_prepareLayout();
9
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled())
10
+ {
11
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
12
+ }
13
+ }
14
+
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'id';
20
+ $this->_blockGroup = 'faqs';
21
+ $this->_controller = 'adminhtml_faqs';
22
+
23
+ $this->_updateButton('save', 'label', Mage::helper('faqs')->__('Save Item'));
24
+ $this->_updateButton('delete', 'label', Mage::helper('faqs')->__('Delete Item'));
25
+
26
+ $this->_addButton('saveandcontinue', array(
27
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
28
+ 'onclick' => 'saveAndContinueEdit()',
29
+ 'class' => 'save',
30
+ ), -100);
31
+
32
+ $this->_formScripts[] = "
33
+ function toggleEditor() {
34
+ if (tinyMCE.getInstanceById('faqs_content') == null) {
35
+ tinyMCE.execCommand('mceAddControl', false, 'faqs_content');
36
+ } else {
37
+ tinyMCE.execCommand('mceRemoveControl', false, 'faqs_content');
38
+ }
39
+ }
40
+
41
+ function saveAndContinueEdit(){
42
+ editForm.submit($('edit_form').action+'back/edit/');
43
+ }
44
+ ";
45
+ }
46
+
47
+ public function getHeaderText()
48
+ {
49
+ if( Mage::registry('faqs_data') && Mage::registry('faqs_data')->getId() ) {
50
+ return Mage::helper('faqs')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('faqs_data')->getTitle()));
51
+ } else {
52
+ return Mage::helper('faqs')->__('Add Item');
53
+ }
54
+ }
55
+ }
app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Block_Adminhtml_Faqs_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Tab/Form.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Block_Adminhtml_Faqs_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('faqs_form', array('legend'=>Mage::helper('faqs')->__('Item information')));
10
+
11
+ $fieldset->addField('question', 'text', array(
12
+ 'label' => Mage::helper('faqs')->__('Questions'),
13
+ 'class' => 'required-entry',
14
+ 'required' => true,
15
+ 'name' => 'question',
16
+ ));
17
+
18
+ if (!Mage::app()->isSingleStoreMode())
19
+ {
20
+ $fieldset->addField('store_id', 'multiselect', array(
21
+ 'name' => 'stores[]',
22
+ 'label' => Mage::helper('cms')->__('Store View'),
23
+ 'title' => Mage::helper('cms')->__('Store View'),
24
+ 'required' => true,
25
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
26
+ ));
27
+ }
28
+ else {
29
+ $fieldset->addField('store_id', 'hidden', array(
30
+ 'name' => 'stores[]',
31
+ 'value' => Mage::app()->getStore(true)->getId()
32
+ ));
33
+ $model->setStoreId(Mage::app()->getStore(true)->getId());
34
+ }
35
+
36
+ $fieldset->addField('status', 'select', array(
37
+ 'label' => Mage::helper('faqs')->__('Status'),
38
+ 'name' => 'status',
39
+ 'values' => array(
40
+ array(
41
+ 'value' => 1,
42
+ 'label' => Mage::helper('faqs')->__('Enabled'),
43
+ ),
44
+
45
+ array(
46
+ 'value' => 2,
47
+ 'label' => Mage::helper('faqs')->__('Disabled'),
48
+ ),
49
+ ),
50
+ ));
51
+
52
+ $fieldset->addField('answer', 'editor', array(
53
+ 'name' => 'answer',
54
+ 'label' => Mage::helper('faqs')->__('Answer'),
55
+ 'title' => Mage::helper('faqs')->__('Answer'),
56
+ 'style' => 'width:700px; height:500px;',
57
+ 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
58
+ 'wysiwyg' => true,
59
+ 'required' => true,
60
+ ));
61
+
62
+
63
+ if ( Mage::getSingleton('adminhtml/session')->getFaqsData() )
64
+ {
65
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getFaqsData());
66
+ Mage::getSingleton('adminhtml/session')->setFaqsData(null);
67
+ } elseif ( Mage::registry('faqs_data') ) {
68
+ $form->setValues(Mage::registry('faqs_data')->getData());
69
+ }
70
+ return parent::_prepareForm();
71
+ }
72
+ }
app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Block_Adminhtml_Faqs_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('faqs_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('faqs')->__('Item Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('faqs')->__('Item Information'),
18
+ 'title' => Mage::helper('faqs')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('faqs/adminhtml_faqs_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Grid.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Block_Adminhtml_Faqs_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('faqsGrid');
9
+ $this->setDefaultSort('faqs_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('faqs/faqs')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('faqs_id', array(
24
+ 'header' => Mage::helper('faqs')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'faqs_id',
28
+ ));
29
+
30
+ $this->addColumn('question', array(
31
+ 'header' => Mage::helper('faqs')->__('Question'),
32
+ 'align' =>'left',
33
+ 'index' => 'question',
34
+ ));
35
+
36
+ if (!Mage::app()->isSingleStoreMode())
37
+ {
38
+ $this->addColumn('store_id',
39
+ array (
40
+ 'header' => Mage::helper('cms')->__('Store view'),
41
+ 'index' => 'store_id',
42
+ 'type' => 'store',
43
+ 'store_all' => true,
44
+ 'store_view' => true,
45
+ 'sortable' => false,
46
+ 'filter_condition_callback' => array (
47
+ $this,
48
+ '_filterStoreCondition' ) ));
49
+ }
50
+
51
+ $this->addColumn('status', array(
52
+ 'header' => Mage::helper('faqs')->__('Status'),
53
+ 'align' => 'left',
54
+ 'width' => '80px',
55
+ 'index' => 'status',
56
+ 'type' => 'options',
57
+ 'options' => array(
58
+ 1 => 'Enabled',
59
+ 2 => 'Disabled',
60
+ ),
61
+ ));
62
+
63
+ $this->addColumn('action',
64
+ array(
65
+ 'header' => Mage::helper('faqs')->__('Action'),
66
+ 'width' => '100',
67
+ 'type' => 'action',
68
+ 'getter' => 'getId',
69
+ 'actions' => array(
70
+ array(
71
+ 'caption' => Mage::helper('faqs')->__('Edit'),
72
+ 'url' => array('base'=> '*/*/edit'),
73
+ 'field' => 'id'
74
+ )
75
+ ),
76
+ 'filter' => false,
77
+ 'sortable' => false,
78
+ 'index' => 'stores',
79
+ 'is_system' => true,
80
+ ));
81
+
82
+ $this->addExportType('*/*/exportCsv', Mage::helper('faqs')->__('CSV'));
83
+ $this->addExportType('*/*/exportXml', Mage::helper('faqs')->__('XML'));
84
+
85
+ return parent::_prepareColumns();
86
+ }
87
+
88
+ protected function _prepareMassaction()
89
+ {
90
+ $this->setMassactionIdField('faqs_id');
91
+ $this->getMassactionBlock()->setFormFieldName('faqs');
92
+
93
+ $this->getMassactionBlock()->addItem('delete', array(
94
+ 'label' => Mage::helper('faqs')->__('Delete'),
95
+ 'url' => $this->getUrl('*/*/massDelete'),
96
+ 'confirm' => Mage::helper('faqs')->__('Are you sure?')
97
+ ));
98
+
99
+ $statuses = Mage::getSingleton('faqs/status')->getOptionArray();
100
+
101
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
102
+ $this->getMassactionBlock()->addItem('status', array(
103
+ 'label'=> Mage::helper('faqs')->__('Change status'),
104
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
105
+ 'additional' => array(
106
+ 'visibility' => array(
107
+ 'name' => 'status',
108
+ 'type' => 'select',
109
+ 'class' => 'required-entry',
110
+ 'label' => Mage::helper('faqs')->__('Status'),
111
+ 'values' => $statuses
112
+ )
113
+ )
114
+ ));
115
+ return $this;
116
+ }
117
+
118
+ public function getRowUrl($row)
119
+ {
120
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
121
+ }
122
+
123
+ protected function _afterLoadCollection()
124
+ {
125
+ $this->getCollection()->walk('afterLoad');
126
+ parent::_afterLoadCollection();
127
+ }
128
+
129
+ protected function _filterStoreCondition($collection, $column)
130
+ {
131
+ if (!$value = $column->getFilter()->getValue()) {
132
+ return;
133
+ }
134
+
135
+ $this->getCollection()->addStoreFilter($value);
136
+ }
137
+
138
+ }
app/code/local/Tatva/Faqs/Block/Faqs.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Faqs_Block_Faqs extends Mage_Core_Block_Template
3
+ {
4
+ protected function _prepareLayout()
5
+ {
6
+
7
+ if ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs')) {
8
+ $breadcrumbsBlock->addCrumb('home', array(
9
+ 'label'=>Mage::helper('catalog')->__('Home'),
10
+ 'title'=>Mage::helper('catalog')->__('Go to Home Page'),
11
+ 'link'=>Mage::getBaseUrl()
12
+ ));
13
+ }
14
+
15
+ parent::_prepareLayout();
16
+
17
+ }
18
+
19
+ /*
20
+ * Load featured products collection
21
+ * */
22
+ protected function _getfaqsCollection()
23
+ {
24
+ $storeId = Mage::app()->getStore()->getId();
25
+ $_faqids = Mage::getModel('faqs/faqs')->_getfaqId($storeId);
26
+ $_data = Mage::getModel('faqs/faqs')->_getfaqdata($_faqids);
27
+ return $_data;
28
+ }
29
+
30
+ /**
31
+ * Retrieve loaded featured products collection
32
+ *
33
+ * @return Mage_Eav_Model_Entity_Collection_Abstract
34
+ */
35
+ public function getfaqsCollection()
36
+ {
37
+ return $this->_getfaqsCollection();
38
+ }
39
+ }
app/code/local/Tatva/Faqs/Helper/Data.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ const PATH_PAGE_HEADING = 'faqs/general/heading';
6
+ const PATH_CMS_HEADING = 'faqs/general/heading_block';
7
+ const PATH_PAGE_HEADING_COMMENT = 'faqs/general/headingcomment';
8
+ const DEFAULT_LABEL = 'Frequently Asked Questions';
9
+
10
+ public function getCmsBlockLabel()
11
+ {
12
+ $configValue = Mage::getStoreConfig(self::PATH_CMS_HEADING);
13
+ return strlen($configValue) > 0 ? $configValue : self::DEFAULT_LABEL;
14
+ }
15
+
16
+ public function getPageLabel()
17
+ {
18
+ $configValue = Mage::getStoreConfig(self::PATH_PAGE_HEADING);
19
+ return strlen($configValue) > 0 ? $configValue : self::DEFAULT_LABEL;
20
+ }
21
+ public function getLabelComment()
22
+ {
23
+ $configValue = Mage::getStoreConfig(self::PATH_PAGE_HEADING_COMMENT);
24
+ return ($configValue) > 0 ? $configValue : "";
25
+ }
26
+ }
app/code/local/Tatva/Faqs/Model/Faqs.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Model_Faqs extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('faqs/faqs');
9
+ }
10
+
11
+ public function _getfaqId($id)
12
+ {
13
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
14
+ $qry = "select distinct(faqs_id) from faqs_store where store_id='".$id."' OR store_id=0";
15
+ $res = $read->fetchAll($qry);
16
+ $final_array = array();
17
+ foreach($res as $_read)
18
+ {
19
+ $final_aray[] = $_read['faqs_id'];
20
+ }
21
+ return $final_aray;
22
+ }
23
+ public function _getfaqdata($faqids)
24
+ {
25
+ //$count = count($faqids);
26
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
27
+ $res = array();
28
+ foreach($faqids as $faq_id)
29
+ {
30
+ $query = "select question,answer from faqs where faqs_id='".$faq_id."' And status=1";
31
+ $res[] = $read->fetchAll($query);
32
+ }
33
+ return $res;
34
+ }
35
+
36
+ }
app/code/local/Tatva/Faqs/Model/Mysql4/Faqs.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Model_Mysql4_Faqs extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the faqs_id refers to the key field in your database table.
8
+ $this->_init('faqs/faqs', 'faqs_id');
9
+ }
10
+
11
+ /* protected function _getLoadSelect($field, $value, $object) {
12
+
13
+ $select = parent::_getLoadSelect($field, $value, $object);
14
+
15
+ if ($object->getStoreId()) {
16
+ $select->join(
17
+ array('nns' => $this->getTable('faqs_store')),
18
+ $this->getMainTable() . '.item_id = `nns`.faqs_id'
19
+ )->where('status=1 AND `nns`.store_id in (0, ?) ',
20
+ $object->getStoreId())->order('created_time DESC')->limit(1);
21
+ }
22
+
23
+ return $select;
24
+ }*/
25
+
26
+ protected function _afterSave(Mage_Core_Model_Abstract $object)
27
+ {
28
+ $condition = $this->_getWriteAdapter()->quoteInto('faqs_id = ?', $object->getId());
29
+
30
+ // process slider item to store relation
31
+ $this->_getWriteAdapter()->delete($this->getTable('faqs_store'), $condition);
32
+ foreach ((array) $object->getData('stores') as $store) {
33
+ $storeArray = array ();
34
+ $storeArray['faqs_id'] = $object->getId();
35
+ $storeArray['store_id'] = $store;
36
+ $this->_getWriteAdapter()->insert(
37
+ $this->getTable('faqs_store'), $storeArray
38
+ );
39
+ }
40
+ return parent::_afterSave($object);
41
+ }
42
+
43
+ protected function _afterLoad(Mage_Core_Model_Abstract $object)
44
+ {
45
+ // process slider item to store relation
46
+ $select = $this->_getReadAdapter()->select()->from(
47
+ $this->getTable('faqs_store')
48
+ )->where('faqs_id = ?', $object->getId());
49
+
50
+ if ($data = $this->_getReadAdapter()->fetchAll($select)) {
51
+ $storesArray = array ();
52
+ foreach ($data as $row) {
53
+ $storesArray[] = $row['store_id'];
54
+ }
55
+ $object->setData('store_id', $storesArray);
56
+ }
57
+
58
+ return parent::_afterLoad($object);
59
+ }
60
+ }
app/code/local/Tatva/Faqs/Model/Mysql4/Faqs/Collection.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Model_Mysql4_Faqs_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('faqs/faqs');
9
+ }
10
+
11
+ public function addStoreFilter($store)
12
+ {
13
+ if ($store instanceof Mage_Core_Model_Store) {
14
+ $store = array (
15
+ $store->getId()
16
+ );
17
+ }
18
+
19
+ $this->getSelect()->join(
20
+ array('store_table' => $this->getTable('faqs_store')),
21
+ 'main_table.faqs_id = store_table.faqs_id',
22
+ array ()
23
+ )->where('store_table.store_id in (?)', array (
24
+ 0,
25
+ $store
26
+ ))->group('main_table.faqs_id');
27
+
28
+ return $this;
29
+ }
30
+
31
+ /* protected function _afterLoad()
32
+ {
33
+ if ($this->_previewFlag) {
34
+ $items = $this->getColumnValues('faqs_id');
35
+ if (count($items)) {
36
+ $select = $this->getConnection()->select()->from(
37
+ $this->getTable('faqs_store')
38
+ )->where(
39
+ $this->getTable('faqs_store') . '.faqs_id IN (?)',
40
+ $items
41
+ );
42
+ if ($result = $this->getConnection()->fetchPairs($select)) {
43
+ foreach ($this as $item) {
44
+ if (!isset($result[$item->getData('faqs_id')])) {
45
+ continue;
46
+ }
47
+ if ($result[$item->getData('faqs_id')] == 0) {
48
+ $stores = Mage::app()->getStores(false, true);
49
+ $storeId = current($stores)->getId();
50
+ $storeCode = key($stores);
51
+ }
52
+ else {
53
+ $storeId = $result[$item->getData('faqs_id')];
54
+ $storeCode = Mage::app()->getStore($storeId)->getCode();
55
+ }
56
+ $item->setData('_first_store_id', $storeId);
57
+ $item->setData('store_code', $storeCode);
58
+ }
59
+ }
60
+ }
61
+ }
62
+
63
+ parent::_afterLoad();
64
+ }*/
65
+ }
app/code/local/Tatva/Faqs/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('faqs')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('faqs')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Tatva/Faqs/controllers/Adminhtml/FaqsController.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Tatva_Faqs_Adminhtml_FaqsController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('faqs/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ $model = Mage::getModel('faqs/faqs')->load($id);
22
+
23
+ if ($model->getId() || $id == 0) {
24
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
25
+ if (!empty($data)) {
26
+ $model->setData($data);
27
+ }
28
+
29
+ Mage::register('faqs_data', $model);
30
+
31
+ $this->loadLayout();
32
+ $this->_setActiveMenu('faqs/items');
33
+
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
36
+
37
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
38
+
39
+ $this->_addContent($this->getLayout()->createBlock('faqs/adminhtml_faqs_edit'))
40
+ ->_addLeft($this->getLayout()->createBlock('faqs/adminhtml_faqs_edit_tabs'));
41
+
42
+ $this->renderLayout();
43
+ } else {
44
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faqs')->__('Item does not exist'));
45
+ $this->_redirect('*/*/');
46
+ }
47
+ }
48
+
49
+ public function newAction() {
50
+ $this->_forward('edit');
51
+ }
52
+
53
+ public function saveAction() {
54
+ if ($data = $this->getRequest()->getPost()) {
55
+
56
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
57
+ try {
58
+ /* Starting upload */
59
+ $uploader = new Varien_File_Uploader('filename');
60
+
61
+ // Any extention would work
62
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
63
+ $uploader->setAllowRenameFiles(false);
64
+
65
+ // Set the file upload mode
66
+ // false -> get the file directly in the specified folder
67
+ // true -> get the file in the product like folders
68
+ // (file.jpg will go in something like /media/f/i/file.jpg)
69
+ $uploader->setFilesDispersion(false);
70
+
71
+ // We set media as the upload dir
72
+ $path = Mage::getBaseDir('media') . DS ;
73
+ $uploader->save($path, $_FILES['filename']['name'] );
74
+
75
+ } catch (Exception $e) {
76
+
77
+ }
78
+
79
+ //this way the name is saved in DB
80
+ $data['filename'] = $_FILES['filename']['name'];
81
+ }
82
+
83
+
84
+ $model = Mage::getModel('faqs/faqs');
85
+ $model->setData($data)
86
+ ->setId($this->getRequest()->getParam('id'));
87
+
88
+ try {
89
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
90
+ $model->setCreatedTime(now())
91
+ ->setUpdateTime(now());
92
+ } else {
93
+ $model->setUpdateTime(now());
94
+ }
95
+
96
+ $model->save();
97
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faqs')->__('Item was successfully saved'));
98
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
99
+
100
+ if ($this->getRequest()->getParam('back')) {
101
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
102
+ return;
103
+ }
104
+ $this->_redirect('*/*/');
105
+ return;
106
+ } catch (Exception $e) {
107
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
108
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
109
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
110
+ return;
111
+ }
112
+ }
113
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faqs')->__('Unable to find item to save'));
114
+ $this->_redirect('*/*/');
115
+ }
116
+
117
+ public function deleteAction() {
118
+ if( $this->getRequest()->getParam('id') > 0 ) {
119
+ try {
120
+ $model = Mage::getModel('faqs/faqs');
121
+
122
+ $model->setId($this->getRequest()->getParam('id'))
123
+ ->delete();
124
+
125
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
126
+ $this->_redirect('*/*/');
127
+ } catch (Exception $e) {
128
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
129
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
130
+ }
131
+ }
132
+ $this->_redirect('*/*/');
133
+ }
134
+
135
+ public function massDeleteAction() {
136
+ $faqsIds = $this->getRequest()->getParam('faqs');
137
+ if(!is_array($faqsIds)) {
138
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
+ } else {
140
+ try {
141
+ foreach ($faqsIds as $faqsId) {
142
+ $faqs = Mage::getModel('faqs/faqs')->load($faqsId);
143
+ $faqs->delete();
144
+ }
145
+ Mage::getSingleton('adminhtml/session')->addSuccess(
146
+ Mage::helper('adminhtml')->__(
147
+ 'Total of %d record(s) were successfully deleted', count($faqsIds)
148
+ )
149
+ );
150
+ } catch (Exception $e) {
151
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
152
+ }
153
+ }
154
+ $this->_redirect('*/*/index');
155
+ }
156
+
157
+ public function massStatusAction()
158
+ {
159
+ $faqsIds = $this->getRequest()->getParam('faqs');
160
+ if(!is_array($faqsIds)) {
161
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
+ } else {
163
+ try {
164
+ foreach ($faqsIds as $faqsId) {
165
+ $faqs = Mage::getSingleton('faqs/faqs')
166
+ ->load($faqsId)
167
+ ->setStatus($this->getRequest()->getParam('status'))
168
+ ->setIsMassupdate(true)
169
+ ->save();
170
+ }
171
+ $this->_getSession()->addSuccess(
172
+ $this->__('Total of %d record(s) were successfully updated', count($faqsIds))
173
+ );
174
+ } catch (Exception $e) {
175
+ $this->_getSession()->addError($e->getMessage());
176
+ }
177
+ }
178
+ $this->_redirect('*/*/index');
179
+ }
180
+
181
+ public function exportCsvAction()
182
+ {
183
+ $fileName = 'faqs.csv';
184
+ $content = $this->getLayout()->createBlock('faqs/adminhtml_faqs_grid')
185
+ ->getCsv();
186
+
187
+ $this->_sendUploadResponse($fileName, $content);
188
+ }
189
+
190
+ public function exportXmlAction()
191
+ {
192
+ $fileName = 'faqs.xml';
193
+ $content = $this->getLayout()->createBlock('faqs/adminhtml_faqs_grid')
194
+ ->getXml();
195
+
196
+ $this->_sendUploadResponse($fileName, $content);
197
+ }
198
+
199
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
200
+ {
201
+ $response = $this->getResponse();
202
+ $response->setHeader('HTTP/1.1 200 OK','');
203
+ $response->setHeader('Pragma', 'public', true);
204
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
205
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
206
+ $response->setHeader('Last-Modified', date('r'));
207
+ $response->setHeader('Accept-Ranges', 'bytes');
208
+ $response->setHeader('Content-Length', strlen($content));
209
+ $response->setHeader('Content-type', $contentType);
210
+ $response->setBody($content);
211
+ $response->sendResponse();
212
+ die;
213
+ }
214
+ }
app/code/local/Tatva/Faqs/controllers/IndexController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Tatva_Faqs_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $template = Mage::getConfig()->getNode('global/page/layouts/'.Mage::getStoreConfig("faqs/general/layout").'/template');
7
+
8
+ $this->loadLayout();
9
+
10
+ // $this->getLayout()->getBlock('root')->setTemplate($template);
11
+ $this->getLayout()->getBlock('head')->setTitle($this->__(Mage::getStoreConfig("faqs/general/meta_title")));
12
+ $this->getLayout()->getBlock('head')->setDescription($this->__(Mage::getStoreConfig("faqs/general/meta_description")));
13
+ $this->getLayout()->getBlock('head')->setKeywords($this->__(Mage::getStoreConfig("faqs/general/meta_keywords")));
14
+
15
+ $breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs');
16
+ $breadcrumbsBlock->addCrumb('faqs', array(
17
+ 'label'=>Mage::helper('faqs')->__(Mage::helper('faqs')->getPageLabel()),
18
+ 'title'=>Mage::helper('faqs')->__(Mage::helper('faqs')->getPageLabel()),
19
+ ));
20
+
21
+
22
+
23
+ $this->renderLayout();
24
+ }
25
+ }
app/code/local/Tatva/Faqs/etc/adminhtml.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <adminhtml>
3
+ <menu>
4
+ <faqs module="faqs">
5
+ <title>Faqs</title>
6
+ <sort_order>71</sort_order>
7
+ <children>
8
+ <items module="faqs">
9
+ <title>Manage Items</title>
10
+ <sort_order>0</sort_order>
11
+ <action>faqs/adminhtml_faqs</action>
12
+ </items>
13
+ </children>
14
+ </faqs>
15
+ </menu>
16
+ <acl>
17
+ <resources>
18
+ <all>
19
+ <title>Allow Everything</title>
20
+ </all>
21
+ <admin>
22
+ <children>
23
+ <Tatva_Faqs>
24
+ <title>Faqs Module</title>
25
+ <sort_order>10</sort_order>
26
+ </Tatva_Faqs>
27
+ </children>
28
+ </admin>
29
+ </resources>
30
+ </acl>
31
+ <layout>
32
+ <updates>
33
+ <faqs>
34
+ <file>faqs.xml</file>
35
+ </faqs>
36
+ </updates>
37
+ </layout>
38
+ </adminhtml>
app/code/local/Tatva/Faqs/etc/config.xml ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Tatva_Faqs>
5
+ <version>0.1.0</version>
6
+ </Tatva_Faqs>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <faqs>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Tatva_Faqs</module>
14
+ <frontName>faqs</frontName>
15
+ </args>
16
+ </faqs>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <faqs>
21
+ <file>faqs.xml</file>
22
+ </faqs>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <faqs>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Tatva_Faqs</module>
32
+ <frontName>faqs</frontName>
33
+ </args>
34
+ </faqs>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <menu>
39
+ <faqs module="faqs">
40
+ <title>Faqs</title>
41
+ <sort_order>71</sort_order>
42
+ <children>
43
+ <items module="faqs">
44
+ <title>Manage Items</title>
45
+ <sort_order>0</sort_order>
46
+ <action>faqs/adminhtml_faqs</action>
47
+ </items>
48
+ </children>
49
+ </faqs>
50
+ </menu>
51
+ <acl>
52
+ <resources>
53
+ <all>
54
+ <title>Allow Everything</title>
55
+ </all>
56
+ <admin>
57
+ <children>
58
+ <Tatva_Faqs>
59
+ <title>Faqs Module</title>
60
+ <sort_order>10</sort_order>
61
+ </Tatva_Faqs>
62
+ </children>
63
+ </admin>
64
+ </resources>
65
+ </acl>
66
+ <layout>
67
+ <updates>
68
+ <faqs>
69
+ <file>faqs.xml</file>
70
+ </faqs>
71
+ </updates>
72
+ </layout>
73
+ </adminhtml>
74
+ <global>
75
+ <models>
76
+ <faqs>
77
+ <class>Tatva_Faqs_Model</class>
78
+ <resourceModel>faqs_mysql4</resourceModel>
79
+ </faqs>
80
+ <faqs_mysql4>
81
+ <class>Tatva_Faqs_Model_Mysql4</class>
82
+ <entities>
83
+ <faqs>
84
+ <table>faqs</table>
85
+ </faqs>
86
+ <faqs_store>
87
+ <table>faqs_store</table>
88
+ </faqs_store>
89
+ </entities>
90
+ </faqs_mysql4>
91
+ </models>
92
+ <resources>
93
+ <faqs_setup>
94
+ <setup>
95
+ <module>Tatva_Faqs</module>
96
+ </setup>
97
+ <connection>
98
+ <use>core_setup</use>
99
+ </connection>
100
+ </faqs_setup>
101
+ <faqs_write>
102
+ <connection>
103
+ <use>core_write</use>
104
+ </connection>
105
+ </faqs_write>
106
+ <faqs_read>
107
+ <connection>
108
+ <use>core_read</use>
109
+ </connection>
110
+ </faqs_read>
111
+ </resources>
112
+ <blocks>
113
+ <faqs>
114
+ <class>Tatva_Faqs_Block</class>
115
+ </faqs>
116
+ </blocks>
117
+ <helpers>
118
+ <faqs>
119
+ <class>Tatva_Faqs_Helper</class>
120
+ </faqs>
121
+ </helpers>
122
+ </global>
123
+ <default>
124
+ <faqs>
125
+ <general>
126
+ <heading>Frequently Asked Questions</heading>
127
+ <headingcomment>Check here for answer to some of the more common questions we get form customers everyday. If you have a question and can't find the answer here, please feel free to Contact Us or start Live Chat now.</headingcomment>
128
+ <heading_block>Frequently Asked Questions</heading_block>
129
+ <meta_title>Frequently Asked Questions</meta_title>
130
+ <meta_description>Check out our great collection of Frequently Asked Questions</meta_description>
131
+ <meta_keywords>Frequently,Asked,Questions</meta_keywords>
132
+ <layout>three_columns</layout>
133
+ </general>
134
+ </faqs>
135
+ </default>
136
+ </config>
app/code/local/Tatva/Faqs/sql/faqs_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ -- DROP TABLE IF EXISTS {$this->getTable('faqs')};
9
+ CREATE TABLE IF NOT EXISTS {$this->getTable('faqs')} (
10
+ `faqs_id` int(10) unsigned NOT NULL auto_increment,
11
+ `question` tinytext NOT NULL default '',
12
+ `answer` text NOT NULL default '',
13
+ `creation_time` datetime default NULL,
14
+ `update_time` datetime default NULL,
15
+ `status` tinyint(1) NOT NULL default '1',
16
+ PRIMARY KEY (`faqs_id`)
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items' AUTO_INCREMENT=1 ;
18
+
19
+ -- DROP TABLE IF EXISTS {$this->getTable('faqs_store')};
20
+ CREATE TABLE `{$this->getTable('faqs_store')}` (
21
+ `faqs_id` int(10) unsigned NOT NULL,
22
+ `store_id` smallint(5) unsigned NOT NULL,
23
+ PRIMARY KEY (`faqs_id`,`store_id`),
24
+ CONSTRAINT `FK_FAQ_FAQ_STORE_FAQ` FOREIGN KEY (`faqs_id`) REFERENCES `{$this->getTable('faqs')}` (`faqs_id`) ON UPDATE CASCADE ON DELETE CASCADE,
25
+ CONSTRAINT `FK_FAQ_FAQ_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
26
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items to Stores';
27
+ ");
28
+
29
+ $installer->endSetup();
app/code/local/Tatva/Faqs/sql/faqs_setup/mysql4-upgrade-0.1.0-0.2.0.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('faqs')};
10
+ CREATE TABLE IF NOT EXISTS {$this->getTable('faqs')} (
11
+ `faqs_id` int(11) unsigned NOT NULL auto_increment,
12
+ `question` varchar(255) NOT NULL default '',
13
+ `status` smallint(6) NOT NULL default '0',
14
+ `answer` text NULL default '',
15
+ `created_time` datetime NULL,
16
+ `update_time` datetime NULL,
17
+ PRIMARY KEY (`faqs_id`)
18
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
19
+
20
+ -- DROP TABLE IF EXISTS `{$this->getTable('faqs_store')}`;
21
+ CREATE TABLE `{$this->getTable('faqs_store')}` (
22
+ `faqs_id` int(10) unsigned NOT NULL,
23
+ `store_id` smallint(5) unsigned NOT NULL,
24
+ PRIMARY KEY (`faqs_id`,`store_id`),
25
+ CONSTRAINT `FK_FAQ_FAQ_STORE_STORE` FOREIGN KEY (`faqs_id`) REFERENCES `{$this->getTable('faq')}` (`faqs_id`) ON UPDATE CASCADE ON DELETE CASCADE,
26
+ CONSTRAINT `FK_FAQ_FAQ_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
27
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items to Stores';
28
+
29
+
30
+ ");
31
+
32
+ $installer->endSetup();
app/code/local/Tatva/Note.txt ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ For Customer Attribute :: create attribute from the "Customer Attribute."
2
+ For Customer Address related attribute :: create attribute from "Customer Address Attribute.'
3
+
4
+ For Saving customer attribute on checkout register step:: attribute code is "coupon_details"
5
+
6
+ 1. Edit module config.xml file
7
+ <fieldsets>
8
+ <checkout_onepage_quote>
9
+ <customer_coupon>
10
+ <to_customer>coupon_details</to_customer>
11
+ </customer_coupon>
12
+ </checkout_onepage_quote>
13
+ <customer_account>
14
+ <coupon_details>
15
+ <to_quote>customer_coupon</to_quote>
16
+ </coupon_details>
17
+ </customer_account>
18
+ </fieldsets>
19
+
20
+ 2. Execute the query.
21
+ Alter table `sales_flat_quote` Add Column `coupon_details` varchar(255) Default Null;
22
+
23
+ 3. persistent\customer\form\register.phtml and Add below code.
24
+
25
+ <li>
26
+ <label for="coupon_details" class="required"><em>*</em><?php echo $this->__('Coupon Details') ?></label>
27
+ <div class="input-box">
28
+ <input type="text" name="coupon_details" id="coupon_details" value="<?php echo $this->escapeHtml($this->getFormData()->getCouponDetails()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry" />
29
+ </div>
30
+ </li>
31
+
32
+ For saving new customer address attribute on checkout step :: attribute code is "test_attribute"
33
+
34
+ 1. Edit module config.xml file
35
+ <fieldsets>
36
+ <sales_convert_quote_address>
37
+ <test_attribute>
38
+ <to_order_address>*</to_order_address>
39
+ <to_customer_address>*</to_customer_address>
40
+ </test_attribute>
41
+ </sales_convert_quote_address>
42
+ <customer_address>
43
+ <test_attribute>
44
+ <to_quote_address>*</to_quote_address>
45
+ </test_attribute>
46
+ </customer_address>
47
+ </fieldsets>
48
+
49
+ 2. Execute the query.
50
+ Alter Table `sales_flat_quote_address` Add Column `test_attribute` varchar(255) Default Null;
51
+ Alter Table `sales_flat_order_address` Add Column `test_attribute` varchar(255) Default Null;
52
+
53
+ 3. persistent\checkout\onepage\billing.phtml and Add below code.
54
+
55
+ <div class="field">
56
+ <label for="billing:test_attribute"><?php echo $this->__('Test Attribute') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" name="billing[test_attribute]" value="<?php echo $this->escapeHtml($this->getAddress()->getTestAttribute()) ?>" title="<?php echo $this->__('Test Attribute') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('Test Attribute') ?>" id="billing:test_attribute" />
59
+ </div>
60
+ </div>
61
+
62
+ 4. checkout\onepage\shipping.phtml and Add below code.
63
+
64
+ <div class="field">
65
+ <label for="shipping:test_attribute"><?php echo $this->__('Test Attribute') ?></label>
66
+ <div class="input-box">
67
+ <input type="text" name="shipping[test_attribute]" value="<?php echo $this->escapeHtml($this->getAddress()->getTestAttribute()) ?>" title="<?php echo $this->__('Test Attribute') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('Test Attribute') ?>" id="shipping:test_attribute" />
68
+ </div>
69
+ </div>
70
+
71
+ 5. For display Attribute value in address template:
72
+ go to System -> Configuration -> Customer Configuration -> Address Template
73
+
74
+ Text
75
+
76
+ {{depend test_attribute}}Test Attribute# {{var test_attribute}}{{/depend}}
77
+
78
+ Text One line
79
+
80
+ {{depend test_attribute}}Test Attribute# {{var test_attribute}}{{/depend}}
81
+
82
+ HTML
83
+
84
+ {{depend test_attribute}}Test Attribute# {{var test_attribute}}{{/depend}}
85
+
86
+ PDF
87
+
88
+ {{depend test_attribute}}Test Attribute# {{var test_attribute}}{{/depend}}
89
+
90
+ Javascript Template
91
+
92
+ Test Attribute#{test_attribute}
app/code/local/Tatva/Slider/Block/Adminhtml/Slider/Edit/Tabs.php CHANGED
@@ -24,7 +24,7 @@ class Tatva_Slider_Block_Adminhtml_Slider_Edit_Tabs extends Mage_Adminhtml_Block
24
  'active' => true,
25
  )
26
  );
27
-
28
  return $return;
29
  }
30
  }
24
  'active' => true,
25
  )
26
  );
27
+
28
  return $return;
29
  }
30
  }
app/code/local/Tatva/Slider/etc/adminhtml.xml CHANGED
@@ -36,7 +36,7 @@
36
  <config>
37
  <children>
38
  <slider translate="title" module="slider">
39
- <title>Slider</title>
40
  </slider>
41
  </children>
42
  </config>
36
  <config>
37
  <children>
38
  <slider translate="title" module="slider">
39
+ <title>Tatvasoft</title>
40
  </slider>
41
  </children>
42
  </config>
app/code/local/Tatva/Slider/etc/config.xml CHANGED
@@ -34,7 +34,7 @@
34
  </slider>
35
  </routers>
36
  </admin>
37
- <adminhtml>
38
  <menu>
39
  <slider module="slider">
40
  <title>Slider</title>
@@ -88,7 +88,7 @@
88
  </slider>
89
  </updates>
90
  </layout>
91
- </adminhtml>
92
  <global>
93
  <models>
94
  <slider>
@@ -153,6 +153,7 @@
153
  <imagewidth>900</imagewidth>
154
  <imageheight>450</imageheight>
155
  <left>740</left>
 
156
  </slider>
157
  </slider>
158
  </default>
34
  </slider>
35
  </routers>
36
  </admin>
37
+ <!--<adminhtml>
38
  <menu>
39
  <slider module="slider">
40
  <title>Slider</title>
88
  </slider>
89
  </updates>
90
  </layout>
91
+ </adminhtml>-->
92
  <global>
93
  <models>
94
  <slider>
153
  <imagewidth>900</imagewidth>
154
  <imageheight>450</imageheight>
155
  <left>740</left>
156
+ <top>370</top>
157
  </slider>
158
  </slider>
159
  </default>
app/code/local/Tatva/Slider/etc/system.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <tabs>
4
  <slider translate="label" module="slider">
5
- <label>Slider</label>
6
  <sort_order>101</sort_order>
7
  </slider>
8
  </tabs>
@@ -12,7 +12,7 @@
12
  <class>separator-top</class>
13
  <tab>slider</tab>
14
  <frontend_type>text</frontend_type>
15
- <sort_order>10001</sort_order>
16
  <show_in_default>1</show_in_default>
17
  <show_in_website>1</show_in_website>
18
  <show_in_store>1</show_in_store>
@@ -134,6 +134,15 @@
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>1</show_in_store>
136
  </left>
 
 
 
 
 
 
 
 
 
137
  </fields>
138
  </slider>
139
  </groups>
2
  <config>
3
  <tabs>
4
  <slider translate="label" module="slider">
5
+ <label>Tatvasoft</label>
6
  <sort_order>101</sort_order>
7
  </slider>
8
  </tabs>
12
  <class>separator-top</class>
13
  <tab>slider</tab>
14
  <frontend_type>text</frontend_type>
15
+ <sort_order>10</sort_order>
16
  <show_in_default>1</show_in_default>
17
  <show_in_website>1</show_in_website>
18
  <show_in_store>1</show_in_store>
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>1</show_in_store>
136
  </left>
137
+ <top translate="label" module="slider">
138
+ <label>Top Position For Squares</label>
139
+ <frontend_type>text</frontend_type>
140
+ <validate>validate-digits validate-greater-than-zero</validate>
141
+ <sort_order>13</sort_order>
142
+ <show_in_default>1</show_in_default>
143
+ <show_in_website>1</show_in_website>
144
+ <show_in_store>1</show_in_store>
145
+ </top>
146
  </fields>
147
  </slider>
148
  </groups>
app/design/frontend/default/default/template/slider/slider.phtml CHANGED
@@ -13,6 +13,7 @@
13
  $content = Mage::getStoreConfig('slider/slider/content') ? Mage::getStoreConfig('slider/slider/content') : false;
14
  $auto = Mage::getStoreConfig('slider/slider/auto') ? Mage::getStoreConfig('slider/slider/time') : 0;
15
  $left = Mage::getStoreConfig('slider/slider/left') ? Mage::getStoreConfig('slider/slider/left') : 590;
 
16
  $left = ($left > $width) ? 590 : $left;
17
  if(!$content)
18
  {
@@ -108,7 +109,7 @@
108
  <?php if($item->getSliderUrl()){ ?>
109
  <a href="<?php echo $item->getSliderUrl() ?>" target="_blank">
110
  <?php } ?>
111
- <img src="<?php echo Mage::getBaseUrl('media') . 'customerslider/' . $item->getFilename(); ?>" height="<?php echo $imageheight?>" width="<?php echo $imagewidth?>"/>
112
  <?php if($item->getSliderUrl()){ ?>
113
  </a>
114
  <?php } ?>
@@ -128,7 +129,7 @@
128
  </div>
129
 
130
  <?php if($square) { ?>
131
- <ul id="primopiano_menu" style="left: <?php echo $left?>px;">
132
  <?php $i=1;foreach($slider as $item):?>
133
  <li id="link_primopiano_<?php echo $i?>">
134
  <a rel="<?php echo $i?>" href="#">&nbsp;</a>
13
  $content = Mage::getStoreConfig('slider/slider/content') ? Mage::getStoreConfig('slider/slider/content') : false;
14
  $auto = Mage::getStoreConfig('slider/slider/auto') ? Mage::getStoreConfig('slider/slider/time') : 0;
15
  $left = Mage::getStoreConfig('slider/slider/left') ? Mage::getStoreConfig('slider/slider/left') : 590;
16
+ $top = Mage::getStoreConfig('slider/slider/top') ? Mage::getStoreConfig('slider/slider/top') : 370;
17
  $left = ($left > $width) ? 590 : $left;
18
  if(!$content)
19
  {
109
  <?php if($item->getSliderUrl()){ ?>
110
  <a href="<?php echo $item->getSliderUrl() ?>" target="_blank">
111
  <?php } ?>
112
+ <img src="<?php echo Mage::getBaseUrl('media') . 'customerslider/slider/' . $item->getFilename(); ?>" height="<?php echo $imageheight?>" width="<?php echo $imagewidth?>"/>
113
  <?php if($item->getSliderUrl()){ ?>
114
  </a>
115
  <?php } ?>
129
  </div>
130
 
131
  <?php if($square) { ?>
132
+ <ul id="primopiano_menu" style="left: <?php echo $left?>px; top:<?php echo $top?>px;">
133
  <?php $i=1;foreach($slider as $item):?>
134
  <li id="link_primopiano_<?php echo $i?>">
135
  <a rel="<?php echo $i?>" href="#">&nbsp;</a>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Etatvasoft_Dynamic_Image_Slider</name>
4
- <version>1.5.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -14,9 +14,9 @@ All features are configurable from admin like width, height, auto slideshow, dis
14
  </description>
15
  <notes>All features are configurable from admin like width, height, auto slideshow, display next previous arrow, show caption, show navigation images, max number of slides to display, display slide content, time between two slides.</notes>
16
  <authors><author><name>Etatvasoft</name><user>Etatvasoft</user><email>etatvasoft.magentodevelopment@gmail.com</email></author></authors>
17
- <date>2013-05-07</date>
18
- <time>12:45:22</time>
19
- <contents><target name="magelocal"><dir name="Tatva"><dir name="Attachpdf"><dir name="Block"><dir name="Adminhtml"><dir name="Attachpdf"><dir name="Edit"><file name="Form.php" hash="71167307526c08ac0542e614bf415563"/><dir name="Tab"><file name="Form.php" hash="272a88df27d0745a088eb7dda2647060"/></dir><file name="Tabs.php" hash="61752efa8f219f6d22ac8ec9740a3968"/></dir><file name="Edit.php" hash="21344666f3a8cc6e60614540c22aea11"/><file name="Grid.php" hash="051c12d5151e5fd7939c5d79f489ef06"/></dir><file name="Attachpdf.php" hash="b675e659432cb6ce42c414d1b6dddd09"/></dir><file name="Attachpdf.php" hash="d4cc880be6d6569787690b9654080e53"/></dir><dir name="Helper"><file name="Data.php" hash="818f669b000506a41788c47598172a9e"/></dir><dir name="Model"><file name="Attachpdf.php" hash="b372e4490e204c4ae9780ca9ea5dd254"/><dir name="Mysql4"><dir name="Attachpdf"><file name="Collection.php" hash="30c06057b8aec69132ff63d28a68ca6b"/></dir><file name="Attachpdf.php" hash="dba497e0be600334ebbf4902aab1b3be"/></dir><file name="Status.php" hash="e7daf4fcf69f842287557b19c4661c98"/></dir><dir name="controllers"><file name="IndexController.php" hash="ca68cf7e84ac470188da10b2b12453cb"/></dir><dir name="etc"><file name="config.xml" hash="46e807981c33a144220b7efd79b8283c"/></dir></dir><dir name="Catalogextensions"><dir name="Block"><dir name="Allproducts"><file name="List.php" hash="23bb783bec9a95377cf7d7bfeebc82e5"/></dir><dir name="Bestsellers"><dir name="Home"><file name="List.php" hash="2ca6ba90bc5f94b767208e9744f2378d"/></dir><file name="List.php" hash="fd407b80b108662fbf3455551f500fd9"/></dir><file name="Catalogextensions.php" hash="c8db46ed313124e15f4547cd23481805"/><dir name="Featured"><dir name="Home"><file name="List.php" hash="821b6fd6ef9beabddb9c74d1d1da26cd"/></dir><file name="List.php" hash="216bff6d57edeb08ec1fbe113f171b61"/></dir><dir name="Mostviewed"><dir name="Home"><file name="List.php" hash="acae4de506c8c106912fc1bbdedd6be0"/></dir><file name="List.php" hash="0b107893f3ac3b0b41308a2a115bb8fd"/></dir><dir name="Newproduct"><dir name="Home"><file name="List.php" hash="3fb45a68a9634e88de44a729caca32da"/></dir><file name="List.php" hash="9585d810fcf72d9df1157510900e6219"/></dir><dir name="Promotional"><dir name="Home"><file name="List.php" hash="60824f9318b57f2ee2cd50f0133b1461"/></dir><file name="List.php" hash="cc021c39e82f12208c86f9f6ac4b043d"/></dir><dir name="lastordered"><dir name="Home"><file name="List.php" hash="f335f13d27a151867e186600a3ba21a3"/></dir><file name="List.php" hash="03fefd64e05776599af96d286c01b48a"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b611bd4cc8fcfbb18474ae0f7abbb92f"/></dir><dir name="Model"><file name="Catalogextensions.php" hash="d13d2010207ce2a98c7aa4d105ab0c89"/><dir name="Mysql4"><dir name="Catalogextensions"><file name="Collection.php" hash="78c860170f8a69d2853dd244d30c3086"/></dir><file name="Catalogextensions.php" hash="19ccf69401d4e2f68c84a99b1fa12e02"/></dir><file name="Status.php" hash="0544078ffbda9356571152f217b4728c"/></dir><dir name="controllers"><file name="IndexController.php" hash="77345a6fd4f3d432d751e98156e8f448"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d049baa4bd9d3ea71f2ea01176344c74"/><file name="config.xml" hash="8f1a67cb30208b1fd87c0d56c9a4cc19"/><file name="system.xml" hash="a7f9c330c14972c0b0052055df509f91"/></dir><dir name="sql"><dir name="catalogextensions_setup"><file name="mysql4-install-0.1.0.php" hash="da1797c1b3d77ae8a140dfd894f139bb"/></dir></dir></dir><dir name="Customtab"><dir name="Block"><dir name="Adminhtml"><dir name="Customtab"><dir name="Edit"><file name="Form.php" hash="a27a450cc8ce6b145d06468cac3ba3f8"/><dir name="Tab"><file name="Form.php" hash="399f13d1a51f86d12a2d733f01e1dc40"/></dir><file name="Tabs.php" hash="48a3e22f77cfcde64c3ebee60a8af70c"/></dir><file name="Edit.php" hash="e6e9e7b54118284776d21d11f368b0eb"/><file name="Grid.php" hash="f68a7102ed5b038de920016f1a9a62a4"/></dir><file name="Customtab.php" hash="8374194529bd3d00abba9b658f822a44"/></dir><file name="Customtab.php" hash="0b25a63f0d60ec41a0171af08f480974"/></dir><dir name="Helper"><file name="Data.php" hash="5817a9110e741c8da224f94037312499"/></dir><dir name="Model"><file name="Customtab.php" hash="3b5a1bab02e19b9f48d11119a4f04e3d"/><dir name="Mysql4"><dir name="Customtab"><file name="Collection.php" hash="98ed0e74ebf3930ebdd6d85bbc5c64ed"/></dir><file name="Customtab.php" hash="f59ba37df980f9abd111bf1a2290540e"/></dir><file name="Status.php" hash="0e63b9babd2e6dc60637f0717a0b046b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomtabController.php" hash="707f3257de821187d43e7f52bfb62bcc"/></dir><file name="IndexController.php" hash="2c7d48dfed058bf9c79e1f7a8720917a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="565b3f92e130c2175159552065f962ec"/><file name="config.xml" hash="b15eb3ea2bc472f29ddf5565c1ae19b0"/></dir><dir name="sql"><dir name="customtab_setup"><file name="mysql4-install-0.1.0.php" hash="5ed7f3c185e049eba0efb22303c195e5"/></dir></dir></dir><dir name="Downloadablereport"><dir name="Block"><dir name="Adminhtml"><dir name="Downloadablereport"><dir name="Edit"><file name="Form.php" hash="8e486535367fb8b8b3b431aa2c64a050"/><dir name="Tab"><file name="Form.php" hash="241d2d7ef04444dd253acc702a286fc7"/></dir><file name="Tabs.php" hash="9c0ae1b8c9e3257759d575dbf876ac47"/></dir><file name="Edit.php" hash="dcf3612a607c6e08c29b3e53f053a520"/><file name="Grid.php" hash="ed36d34c00177e41bf3c57e21cfcfd45"/></dir><file name="Downloadablereport.php" hash="fea6eca807b63b7813db8d58e41b24b7"/></dir><file name="Downloadablereport.php" hash="a6db01454924d3ee9bc8ea1b88ae62b0"/></dir><dir name="Helper"><file name="Data.php" hash="a8567da03125b258ae13dde552118f3c"/></dir><dir name="Model"><file name="Downloadablereport.php" hash="9f4592bf8caf9bc1ebc1aa387c9c4d7a"/><dir name="Mysql4"><dir name="Downloadablereport"><file name="Collection.php" hash="8ebc1996d41159142652791735d96225"/></dir><file name="Downloadablereport.php" hash="388f77f380fd1e22a377b0439e43e911"/></dir><file name="Status.php" hash="ba59c744ba717cb713d3c67f579ea1ac"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DownloadablereportController.php" hash="04471a8ce129922af0c629aa3d042dec"/></dir><file name="IndexController.php" hash="6e708f36f0628fc91d6caeecbc4bc5b2"/></dir><dir name="etc"><file name="config.xml" hash="d2677f82ab837de646108d57205506f0"/></dir><dir name="sql"><dir name="downloadablereport_setup"><file name="mysql4-install-0.1.0.php" hash="e02faa1ca822edb64bf1cd02d83b27a7"/></dir></dir></dir><dir name="Editorder"><dir name="Block"><dir name="Adminhtml"><dir name="Editorder"><dir name="Edit"><file name="Form.php" hash="24d23ddeee1f132dde30407d69523bbb"/><dir name="Tab"><file name="Form.php" hash="768011f9321589a1018bcc8653d19fd9"/></dir><file name="Tabs.php" hash="594bde9dce29e9bd60db741cf102d21f"/></dir><file name="Edit.php" hash="13fa1426a81aa9d6a0ff7ee5fa48c4b2"/><file name="Grid.php" hash="8041cf4361ec8e84ed224284987917b7"/></dir><file name="Editorder.php" hash="651996a53ecb91b759d6b937962c218a"/></dir><file name="Editorder.php" hash="9b2366cdc3baa4f00c285a38c818908b"/></dir><dir name="Helper"><file name="Data.php" hash="69b0ba17775a86ba95415332bedf1768"/></dir><dir name="Model"><file name="Editorder.php" hash="9e86db74abd40b12bbf00d90f5373477"/><dir name="Mysql4"><dir name="Editorder"><file name="Collection.php" hash="f7a8e6120bf723190a71d6b37d042a05"/></dir><file name="Editorder.php" hash="695a5f549da0d85232b5860fab073e9a"/></dir><file name="Status.php" hash="d12f6f0cae84ff593e296aeaa8c1da0b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="EditorderController.php" hash="44b3802cb3f5ddd363a4d92c1d7a4df9"/></dir><file name="IndexController.php" hash="74d20f383e4ce6fbd78b087f1c6318e9"/></dir><dir name="etc"><file name="config.xml" hash="1a1d59d9c278c92acdffdd05fd5137af"/></dir><dir name="sql"><dir name="editorder_setup"><file name="mysql4-install-0.1.0.php" hash="d639f02f96de3943512f901cae138f39"/></dir></dir></dir><dir name="Gallery"><dir name="Block"><dir name="Adminhtml"><dir name="Gallery"><dir name="Edit"><file name="Form.php" hash="b047a0629a42e3cfa3e5eeeac6a6c3d9"/><dir name="Tab"><file name="Form.php" hash="d4f9838af84fda33f03ea489030f7a57"/></dir><file name="Tabs.php" hash="b6438d98d47e5e4f572905f9886656c2"/></dir><file name="Edit.php" hash="7a74dd0d4a8c5a353878d2bd44d4327c"/><file name="Grid.php" hash="afe3be9f4f0fd71bd19dc25e7ac6d4c4"/></dir><file name="Gallery.php" hash="78f7fc7238a648725e89269ab1b1bc6b"/></dir><file name="Gallery.php" hash="7623e5a0dac8a8e8f40c825ce1bcd766"/></dir><dir name="Helper"><file name="Data.php" hash="6e19ac429a5976e5a6d7a68312d1aaf4"/></dir><dir name="Model"><file name="Gallery.php" hash="d393f48bd826e8072b452ed84ff50f91"/><dir name="Mysql4"><dir name="Gallery"><file name="Collection.php" hash="c761a1c1673411aafed6bbc63a91147b"/></dir><file name="Gallery.php" hash="adb807b4b4d196a81fca68eb1d88f2fb"/></dir><file name="Status.php" hash="61c9752a5e8aa3caa7b5f0068f9f8285"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="GalleryController.php" hash="92735e71c216f8ecdd0d2492f954b9eb"/></dir><file name="IndexController.php" hash="9ce7a896d4d640cbf836570a0cc725e3"/></dir><dir name="etc"><file name="config.xml" hash="45cdc67502af19cda3ad945cd8042fde"/></dir><dir name="sql"><dir name="gallery_setup"><file name="mysql4-install-0.1.0.php" hash="f48b3e51c84af8f0a2993f8d7f5c0376"/></dir></dir></dir><dir name="Orderreport"><dir name="Block"><dir name="Adminhtml"><dir name="Orderreport"><dir name="Edit"><file name="Form.php" hash="ad7fb2193e24cb2b00d79f95e8f862b1"/><dir name="Tab"><file name="Form.php" hash="8fff076d1311e04c67968f4deada4f9a"/></dir><file name="Tabs.php" hash="89c3573a7227d07dbad289cf346afaf2"/></dir><file name="Edit.php" hash="24549c44f5317a92a6e87a97ea794417"/><file name="Grid.php" hash="977323859c142cad8a3ad88d2b5ce10b"/></dir><file name="Orderreport.php" hash="d2cf373f60ec062e95ab5959d85e0ed4"/></dir><file name="Orderreport.php" hash="7c4cdfcfc5b95565962a92373b2aabb8"/></dir><dir name="Helper"><file name="Data.php" hash="4e8452b3ffe012843d74dd249a067a26"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Orderreport"><file name="Collection.php" hash="b43fa3bed466033794048c8497aa57a4"/></dir><file name="Orderreport.php" hash="28cd9015065f5500cafd4c5533c6fa73"/></dir><file name="Orderreport.php" hash="39f0e0d4fd81b0248f9197210457f7b6"/><file name="Status.php" hash="462163ddf8ab804d6f84ce29a7b1e37f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderreportController.php" hash="0a5146f0f4e8bb40861304117b8d3901"/></dir><file name="IndexController.php" hash="ce32c195b1ccb73f418a466fb522aa20"/></dir><dir name="etc"><file name="config.xml" hash="704c37dc7aec28f7bb9a4bdaf2ec37fa"/></dir><dir name="sql"><dir name="orderreport_setup"><file name="mysql4-install-0.1.0.php" hash="499386e75dab020c7ac3a64f7663ea60"/></dir></dir></dir><dir name="Press"><dir name="Block"><dir name="Adminhtml"><dir name="Press"><dir name="Edit"><file name="Form.php" hash="ad47e3678465d50289821385675bb424"/><dir name="Tab"><file name="Form.php" hash="781b74b982504a69faeab14ff8158211"/></dir><file name="Tabs.php" hash="300701aa9664a6a4a557461062d8c592"/></dir><file name="Edit.php" hash="087a1052a64e65f90c3591d6e8bce35f"/><file name="Grid.php" hash="d14e48135829dbdd78ac7959c34444d1"/></dir><file name="Press.php" hash="7b60f69eef219d73598ab8a1387dab4a"/></dir><file name="Press.php" hash="a0df115981f071134e4b2e25ec9c816d"/></dir><dir name="Helper"><file name="Data.php" hash="d3206f9858dc8b38f1cead355424b361"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Press"><file name="Collection.php" hash="45ed41bc770b567a0805a3832d330f72"/></dir><file name="Press.php" hash="f43c10890595ffe24021c01ed3f3f36c"/><dir name="Press_store"><file name="Collection.php" hash="fc7b18ada57014cbe6eac0e3e4ed2fcd"/></dir><file name="Press_store.php" hash="5ead548067fd284f025dbae8f7ebaccc"/></dir><file name="Press.php" hash="23b9e17959c7d8eb40b8d525143e49e6"/><file name="Press_store.php" hash="1c4efe49b22be2f2270d229d1c7d735b"/><file name="Status.php" hash="173892677cbabb5b13567b6e6212c347"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PressController.php" hash="1a9b344f76adf5486e99f1849c6fa5e2"/></dir><file name="IndexController.php" hash="f7d118b34f1f9ddc89edad001bf41ed4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="62055f196449f1f4cf4bad95a7ce50ee"/><file name="config.xml" hash="55c4a977df9941aedd0d86a73058c0f4"/><file name="system.xml" hash="d2f5dc4d658103737670be1b167c3fe4"/></dir><dir name="sql"><dir name="press_setup"><file name="mysql4-install-0.1.0.php" hash="03a8b75ad5be5dc23b4c8a78aeea5391"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="99ff1d565f180b13fd4a175948fc9b43"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="2398f20b3942f7a9efc9b32ebf724f30"/></dir></dir></dir><dir name="Promotionalbanner"><dir name="Block"><dir name="Adminhtml"><dir name="Promotionalbanner"><dir name="Edit"><file name="Form.php" hash="087963dfc7495abbefe500032e6c3771"/><dir name="Tab"><file name="Form.php" hash="49ebab4b78573f9b5c96d1cb7cad8945"/></dir><file name="Tabs.php" hash="571cf2c8f6ddda7cdf1bdfce7bee457c"/></dir><file name="Edit.php" hash="7e9ff48cdc9cd593c05d2bc166213d73"/><file name="Grid.php" hash="77d073401be533c47bfec4c356f0b884"/></dir><file name="Promotionalbanner.php" hash="bcbf5933fad7fec3305998c88624e16b"/></dir><file name="Promotionalbanner.php" hash="f3eaedcab4dca871cc4b97456293db39"/></dir><dir name="Helper"><file name="Data.php" hash="f1f00e13b228d274ae944c29776863dc"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Promotionalbanner"><file name="Collection.php" hash="9dca8e80de6ed28f6495a60704bcd757"/></dir><file name="Promotionalbanner.php" hash="ffbef4bfe3b0025d705d456588d64fa2"/></dir><file name="Promotionalbanner.php" hash="c807fa217d832065e03d17efa6571b54"/><file name="Status.php" hash="bfc65e8dc4d49c83849bcb23017d4300"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PromotionalbannerController.php" hash="1bff57aada1c19624ea5e53a13a27b5d"/></dir><file name="IndexController.php" hash="5830cf818556b05010381b7404e77647"/></dir><dir name="etc"><file name="config.xml" hash="e8165609d6be83674a3d78741886379b"/></dir><dir name="sql"><dir name="promotionalbanner_setup"><file name="mysql4-install-0.1.0.php" hash="bb85cccff3468e73d21f287ce7250aa5"/></dir></dir></dir><dir name="Slider"><dir name="Block"><dir name="Adminhtml"><dir name="Slider"><dir name="Edit"><file name="Form.php" hash="ca930481c7735510714bc08f3ed54388"/><dir name="Tab"><file name="Form.php" hash="54e9c80c9066465a2bf8f69fc54769a2"/></dir><file name="Tabs.php" hash="0c3f7a0eac2017c80051e863962dedeb"/></dir><file name="Edit.php" hash="8a3a0fef10e2e61350a5b96d42919fc3"/><file name="Grid.php" hash="f514362d14115b3723e936728a856ce0"/></dir><file name="Slider.php" hash="d1c6599add8772e4b564fa24d0706742"/></dir><file name="Slider.php" hash="206931d8e27c6917f7a2644006780348"/></dir><dir name="Helper"><file name="Data.php" hash="1040dcdf8a42eed3e0010fed0d6128a3"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Slider"><file name="Collection.php" hash="2ae22e2c3320dd3a22c853d443cc914f"/></dir><file name="Slider.php" hash="f58a717ab3b4bd59ba605649129ca9d1"/></dir><file name="Slider.php" hash="0d75c8352f467422a324d68e4e8f1ccb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SliderController.php" hash="cea85ed88e7daefc237ba9554f78ec30"/></dir><file name="IndexController.php" hash="c1fc4c20c94f5c3076b1be1370add42a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a9040db3e6497a97fe64483d19ccbda1"/><file name="config.xml" hash="3d5e3e946ba1aec4c828363ab16c82b5"/><file name="system.xml" hash="0ce62b0e65d5096ddc8564169705cb92"/></dir><dir name="sql"><dir name="slider_setup"><file name="mysql4-install-0.1.0.php" hash="efd60f0f0fd9351c16c15aca41bdfb48"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="slider"><file name="slider.xml" hash="a110923b7eeb351204c9e43f6ca8e0dd"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="slider"><file name="slider.xml" hash="9651b1f4114b5f8ff1229886b4607fca"/></dir></dir><dir name="template"><dir name="slider"><file name="slider.phtml" hash="c9125cc1cfd169f42416eaac97d3013b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tatva_Slider.xml" hash="248fedac6d3c4175a2564765fde3b4a9"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="slider"><file name="slider.css" hash="dab445ad3a99959812c5af9d2865a780"/></dir></dir><dir name="images"><dir name="slider"><file name="Thumbs.db" hash="a4e466bbbb29524e0d89c23c19829437"/><file name="b_next.png" hash="d72dde0609aded61a24fa18cdca4bf7f"/><file name="b_prev.png" hash="86e333b7023d493e8024ccc6b32cd690"/><file name="bannerscrollbg.gif" hash="bd8c7ef3273a6219fd1bb56bc24cbf6d"/><file name="bluehbg.gif" hash="bdd4f53932bd952684d5d87a69c261c3"/><file name="carousel_next.png" hash="8a6d7719accc317e0dbd4a831677598c"/><file name="carousel_prev.png" hash="849d28e8873e8104c232348348c5e5b8"/><file name="content_bg.jpg" hash="e32654532856667842f9002208341e15"/><file name="next.png" hash="1b2ee17462251a2bd374a8a8a49d6ede"/><file name="next_arrow.png" hash="f395949692f96b812d41521dc8418e37"/><file name="num-act.png" hash="bead24653e91070840cec1153577ba24"/><file name="num.png" hash="4847ee03d68096c72339117db3ce981d"/><file name="prev.png" hash="e0b379b1a7db33c59cc90c4068b2ae3f"/><file name="prev_arrow.png" hash="3ba0da3255d4aac51f8bddf814abd480"/><file name="primopiano_menu.gif" hash="157cf32c6c9a103000441d1cf13768bf"/><file name="primopiano_menu2.gif" hash="2e08aa45e6ad2bd460832bf2c0c20069"/><file name="scroolbg.gif" hash="39d89710b27da072e63bbbdc474ab090"/></dir></dir><dir name="js"><dir name="slider"><file name="jquery-1.6.4.min.js" hash="fdcd59e694043785ddaebb2c688cfa64"/><file name="jquery.jcarousel.js" hash="c12b6393fdd5aa32fc572ce1594d4184"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Etatvasoft_Dynamic_Image_Slider</name>
4
+ <version>1.5.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
14
  </description>
15
  <notes>All features are configurable from admin like width, height, auto slideshow, display next previous arrow, show caption, show navigation images, max number of slides to display, display slide content, time between two slides.</notes>
16
  <authors><author><name>Etatvasoft</name><user>Etatvasoft</user><email>etatvasoft.magentodevelopment@gmail.com</email></author></authors>
17
+ <date>2013-10-04</date>
18
+ <time>12:27:19</time>
19
+ <contents><target name="magelocal"><dir name="Tatva"><dir name="Attachpdf"><dir name="Block"><dir name="Adminhtml"><dir name="Attachpdf"><dir name="Edit"><file name="Form.php" hash="71167307526c08ac0542e614bf415563"/><dir name="Tab"><file name="Form.php" hash="272a88df27d0745a088eb7dda2647060"/></dir><file name="Tabs.php" hash="61752efa8f219f6d22ac8ec9740a3968"/></dir><file name="Edit.php" hash="21344666f3a8cc6e60614540c22aea11"/><file name="Grid.php" hash="051c12d5151e5fd7939c5d79f489ef06"/></dir><file name="Attachpdf.php" hash="b675e659432cb6ce42c414d1b6dddd09"/></dir><file name="Attachpdf.php" hash="d4cc880be6d6569787690b9654080e53"/></dir><dir name="Helper"><file name="Data.php" hash="818f669b000506a41788c47598172a9e"/></dir><dir name="Model"><file name="Attachpdf.php" hash="b372e4490e204c4ae9780ca9ea5dd254"/><dir name="Mysql4"><dir name="Attachpdf"><file name="Collection.php" hash="30c06057b8aec69132ff63d28a68ca6b"/></dir><file name="Attachpdf.php" hash="dba497e0be600334ebbf4902aab1b3be"/></dir><file name="Status.php" hash="e7daf4fcf69f842287557b19c4661c98"/></dir><dir name="controllers"><file name="IndexController.php" hash="ca68cf7e84ac470188da10b2b12453cb"/></dir><dir name="etc"><file name="config.xml" hash="46e807981c33a144220b7efd79b8283c"/></dir></dir><dir name="Catalogextensions"><dir name="Block"><dir name="Allproducts"><file name="List.php" hash="23bb783bec9a95377cf7d7bfeebc82e5"/></dir><dir name="Bestsellers"><dir name="Home"><file name="List.php" hash="2ca6ba90bc5f94b767208e9744f2378d"/></dir><file name="List.php" hash="fd407b80b108662fbf3455551f500fd9"/></dir><file name="Catalogextensions.php" hash="c8db46ed313124e15f4547cd23481805"/><dir name="Featured"><dir name="Home"><file name="List.php" hash="821b6fd6ef9beabddb9c74d1d1da26cd"/></dir><file name="List.php" hash="216bff6d57edeb08ec1fbe113f171b61"/></dir><dir name="Mostviewed"><dir name="Home"><file name="List.php" hash="acae4de506c8c106912fc1bbdedd6be0"/></dir><file name="List.php" hash="0b107893f3ac3b0b41308a2a115bb8fd"/></dir><dir name="Newproduct"><dir name="Home"><file name="List.php" hash="3fb45a68a9634e88de44a729caca32da"/></dir><file name="List.php" hash="9585d810fcf72d9df1157510900e6219"/></dir><dir name="Promotional"><dir name="Home"><file name="List.php" hash="60824f9318b57f2ee2cd50f0133b1461"/></dir><file name="List.php" hash="cc021c39e82f12208c86f9f6ac4b043d"/></dir><dir name="lastordered"><dir name="Home"><file name="List.php" hash="f335f13d27a151867e186600a3ba21a3"/></dir><file name="List.php" hash="03fefd64e05776599af96d286c01b48a"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b611bd4cc8fcfbb18474ae0f7abbb92f"/></dir><dir name="Model"><file name="Catalogextensions.php" hash="d13d2010207ce2a98c7aa4d105ab0c89"/><dir name="Mysql4"><dir name="Catalogextensions"><file name="Collection.php" hash="78c860170f8a69d2853dd244d30c3086"/></dir><file name="Catalogextensions.php" hash="19ccf69401d4e2f68c84a99b1fa12e02"/></dir><file name="Status.php" hash="0544078ffbda9356571152f217b4728c"/></dir><dir name="controllers"><file name="IndexController.php" hash="77345a6fd4f3d432d751e98156e8f448"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d049baa4bd9d3ea71f2ea01176344c74"/><file name="config.xml" hash="8f1a67cb30208b1fd87c0d56c9a4cc19"/><file name="system.xml" hash="a7f9c330c14972c0b0052055df509f91"/></dir><dir name="sql"><dir name="catalogextensions_setup"><file name="mysql4-install-0.1.0.php" hash="da1797c1b3d77ae8a140dfd894f139bb"/></dir></dir></dir><dir name="Customerattributes"><dir name="Block"><dir name="Adminhtml"><dir name="Attribute"><dir name="Edit"><dir name="Main"><file name="Abstract.php" hash="483d69a08e36871f3d5e820f66dfca7b"/></dir></dir></dir><dir name="Customer"><file name="Grid.php" hash="096ec9de1f653c0d2e0e9906b99b2f30"/></dir><dir name="Customeraddress"><dir name="Edit"><file name="Form.php" hash="f965696cf3eb025e5dfd28bee10e8129"/><dir name="Tab"><file name="Front.php" hash="47c7264bcb8731a14405bee36e84c003"/><file name="Main.php" hash="64375044d193d3a63741794ef70bd999"/><file name="Options.php" hash="81b239f00715460f5694812b2a8fddde"/><file name="System.php" hash="55303d594b65ce6461b73ffe9bf0fd0a"/></dir><file name="Tabs.php" hash="549882eac037338983d61f9a5be5f284"/></dir><file name="Edit.php" hash="c000e0cd4acfc3d22be304f9a1e65cf0"/><file name="Grid.php" hash="6f2beff8d49d36e17cea819e9af999f4"/><dir name="New"><dir name="Product"><file name="Attributes.php" hash="50bc8435f19e789f337d0faf0af5c351"/><file name="Created.php" hash="2804c65cdefe1a56cd85e01a0a0c1d2c"/></dir></dir></dir><file name="Customeraddress.php" hash="fa7e15f7ccd39578125c175d43b9c64a"/><dir name="Customerattributes"><dir name="Edit"><file name="Form.php" hash="2f3cbca8bfcec45bf3856b0e7b5ce458"/><dir name="Tab"><file name="Front.php" hash="e6e55599d004c085c02684f61b0fa623"/><file name="Main.php" hash="1cc1815e7b82b172fa545788f4b092c1"/><file name="Options.php" hash="e27270732a526f18f997366c80e401ad"/><file name="System.php" hash="f2f3cf4a04f74d38070dd2e58dca3a7a"/></dir><file name="Tabs.php" hash="5b00f2f2e556ef0ee2f7511ca051beac"/></dir><file name="Edit.php" hash="4e5b51dd63734916f4e3a28173d9f2ab"/><file name="Grid.php" hash="7b6afabadc0fbce7bd26f18a909c3619"/><dir name="New"><dir name="Product"><file name="Attributes.php" hash="3fad0080bc22d0efbbe33a7c990739d0"/><file name="Created.php" hash="c71acdfeb2e429390e78ffa107e41483"/></dir></dir></dir><file name="Customerattributes.php" hash="0ca5f821ef5f20a615ce40c90550ea5f"/><dir name="Grid"><dir name="Renderer"><file name="Image.php" hash="29beb3f06dee4b7569e78df877750e73"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Multiselectattributes.php" hash="5bea0d4bd94c722a8a5c08e6b7ad845a"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="54a3aa7ec3b1d7ffc8026b2f07b1d32f"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Resource"><dir name="Eav"><file name="Attribute.php" hash="e1b607e30afc7f175a65990b07864b75"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Inputtype.php" hash="7e9a938f2d22e5a6a7dde48d0b8e7bc3"/></dir></dir></dir></dir><file name="Attribute.php" hash="78df1915e933f279f8196e3227174642"/><file name="Customerattributes.php" hash="0f9c50f447cf2f8ef0541beb5bb4c8c4"/><dir name="Mysql4"><file name="Customerattributes.php" hash="243d26c4229d29f2f6b18b5d66de0ea5"/></dir><file name="Status.php" hash="cb8c9b90359a95aea294315e674727f4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController_old.php" hash="a84383e997f60829608357599967e9e5"/><file name="CustomeraddressController.php" hash="e1141b2545b5c2727888e076f23a6deb"/><file name="CustomerattributeController_old.php" hash="0c6481f7d3b8c482c05c4ed8470344c5"/><file name="CustomerattributesController.php" hash="3ec4d83529ee099b83bcc57107fbede9"/><file name="ProductController.php" hash="297a694397376a914ca889c6350cfb8e"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="30db531802ee3d13147cdefbae50f84b"/><file name="adminhtml_old.xml" hash="30db531802ee3d13147cdefbae50f84b"/><file name="config.xml" hash="feedb02c44df632712bb22e3641cb0f1"/><file name="config_old.xml" hash="4da4ba456f0adb80588c1d5bde04e02c"/><file name="system.xml" hash="a98df0872b5bdc895905db44ea517268"/><file name="system_old.xml" hash="a98df0872b5bdc895905db44ea517268"/></dir><dir name="sql"><dir name="customerattributes_setup"><file name="mysql4-install-0.1.0.php" hash="b3dcb3bdc8cde12e321f68ae083e3b5d"/></dir></dir></dir><dir name="Customtab"><dir name="Block"><dir name="Adminhtml"><dir name="Customtab"><dir name="Edit"><file name="Form.php" hash="a27a450cc8ce6b145d06468cac3ba3f8"/><dir name="Tab"><file name="Form.php" hash="399f13d1a51f86d12a2d733f01e1dc40"/></dir><file name="Tabs.php" hash="48a3e22f77cfcde64c3ebee60a8af70c"/></dir><file name="Edit.php" hash="e6e9e7b54118284776d21d11f368b0eb"/><file name="Grid.php" hash="f68a7102ed5b038de920016f1a9a62a4"/></dir><file name="Customtab.php" hash="8374194529bd3d00abba9b658f822a44"/></dir><file name="Customtab.php" hash="0b25a63f0d60ec41a0171af08f480974"/></dir><dir name="Helper"><file name="Data.php" hash="5817a9110e741c8da224f94037312499"/></dir><dir name="Model"><file name="Customtab.php" hash="3b5a1bab02e19b9f48d11119a4f04e3d"/><dir name="Mysql4"><dir name="Customtab"><file name="Collection.php" hash="98ed0e74ebf3930ebdd6d85bbc5c64ed"/></dir><file name="Customtab.php" hash="f59ba37df980f9abd111bf1a2290540e"/></dir><file name="Status.php" hash="0e63b9babd2e6dc60637f0717a0b046b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomtabController.php" hash="707f3257de821187d43e7f52bfb62bcc"/></dir><file name="IndexController.php" hash="2c7d48dfed058bf9c79e1f7a8720917a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="565b3f92e130c2175159552065f962ec"/><file name="config.xml" hash="b15eb3ea2bc472f29ddf5565c1ae19b0"/></dir><dir name="sql"><dir name="customtab_setup"><file name="mysql4-install-0.1.0.php" hash="5ed7f3c185e049eba0efb22303c195e5"/></dir></dir></dir><dir name="Downloadablereport"><dir name="Block"><dir name="Adminhtml"><dir name="Downloadablereport"><dir name="Edit"><file name="Form.php" hash="8e486535367fb8b8b3b431aa2c64a050"/><dir name="Tab"><file name="Form.php" hash="241d2d7ef04444dd253acc702a286fc7"/></dir><file name="Tabs.php" hash="9c0ae1b8c9e3257759d575dbf876ac47"/></dir><file name="Edit.php" hash="dcf3612a607c6e08c29b3e53f053a520"/><file name="Grid.php" hash="ed36d34c00177e41bf3c57e21cfcfd45"/></dir><file name="Downloadablereport.php" hash="fea6eca807b63b7813db8d58e41b24b7"/></dir><file name="Downloadablereport.php" hash="a6db01454924d3ee9bc8ea1b88ae62b0"/></dir><dir name="Helper"><file name="Data.php" hash="a8567da03125b258ae13dde552118f3c"/></dir><dir name="Model"><file name="Downloadablereport.php" hash="9f4592bf8caf9bc1ebc1aa387c9c4d7a"/><dir name="Mysql4"><dir name="Downloadablereport"><file name="Collection.php" hash="8ebc1996d41159142652791735d96225"/></dir><file name="Downloadablereport.php" hash="388f77f380fd1e22a377b0439e43e911"/></dir><file name="Status.php" hash="ba59c744ba717cb713d3c67f579ea1ac"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DownloadablereportController.php" hash="04471a8ce129922af0c629aa3d042dec"/></dir><file name="IndexController.php" hash="6e708f36f0628fc91d6caeecbc4bc5b2"/></dir><dir name="etc"><file name="config.xml" hash="d2677f82ab837de646108d57205506f0"/></dir><dir name="sql"><dir name="downloadablereport_setup"><file name="mysql4-install-0.1.0.php" hash="e02faa1ca822edb64bf1cd02d83b27a7"/></dir></dir></dir><dir name="Editorder"><dir name="Block"><dir name="Adminhtml"><dir name="Editorder"><dir name="Edit"><file name="Form.php" hash="24d23ddeee1f132dde30407d69523bbb"/><dir name="Tab"><file name="Form.php" hash="768011f9321589a1018bcc8653d19fd9"/></dir><file name="Tabs.php" hash="594bde9dce29e9bd60db741cf102d21f"/></dir><file name="Edit.php" hash="13fa1426a81aa9d6a0ff7ee5fa48c4b2"/><file name="Grid.php" hash="8041cf4361ec8e84ed224284987917b7"/></dir><file name="Editorder.php" hash="651996a53ecb91b759d6b937962c218a"/></dir><file name="Editorder.php" hash="9b2366cdc3baa4f00c285a38c818908b"/></dir><dir name="Helper"><file name="Data.php" hash="69b0ba17775a86ba95415332bedf1768"/></dir><dir name="Model"><file name="Editorder.php" hash="9e86db74abd40b12bbf00d90f5373477"/><dir name="Mysql4"><dir name="Editorder"><file name="Collection.php" hash="f7a8e6120bf723190a71d6b37d042a05"/></dir><file name="Editorder.php" hash="695a5f549da0d85232b5860fab073e9a"/></dir><file name="Status.php" hash="d12f6f0cae84ff593e296aeaa8c1da0b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="EditorderController.php" hash="44b3802cb3f5ddd363a4d92c1d7a4df9"/></dir><file name="IndexController.php" hash="74d20f383e4ce6fbd78b087f1c6318e9"/></dir><dir name="etc"><file name="config.xml" hash="1a1d59d9c278c92acdffdd05fd5137af"/></dir><dir name="sql"><dir name="editorder_setup"><file name="mysql4-install-0.1.0.php" hash="d639f02f96de3943512f901cae138f39"/></dir></dir></dir><dir name="Exportallimage"><dir name="Model"><dir name="Convert"><dir name="Adapter"><file name="Product.php" hash="6f911ae22cd63534c9d39a966e702236"/></dir><dir name="Parser"><file name="Csv.php" hash="f9eda88c25340d62d7870964cda7aae4"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="5fd3d4aa48e0dae823572cb094b544b5"/></dir></dir><dir name="Faqs"><dir name="Block"><dir name="Adminhtml"><dir name="Faqs"><dir name="Edit"><file name="Form.php" hash="799d3ad29a5dd7f67934ea48eab3afb9"/><dir name="Tab"><file name="Form.php" hash="c43f0964da43683f37f38ddff3f94a3a"/></dir><file name="Tabs.php" hash="39e88b2ceb9c1f4ea13077d4d0670ebf"/></dir><file name="Edit.php" hash="26632c3520045d1243aa1cd7447d4fb6"/><file name="Grid.php" hash="1be3bf15df2afa0761ab416734d146c5"/></dir><file name="Faqs.php" hash="4cc022d802bce20c3775cf9f5e7dee74"/></dir><file name="Faqs.php" hash="c6635068e58a55c56f3865de8408f5ef"/></dir><dir name="Helper"><file name="Data.php" hash="032eb75ab4a89a6b946adac8d4eb0c5d"/></dir><dir name="Model"><file name="Faqs.php" hash="0141e74c7df9ae5bc5ad0a72362272e4"/><dir name="Mysql4"><dir name="Faqs"><file name="Collection.php" hash="5111bcb3b9da342a52c034f48241dd43"/></dir><file name="Faqs.php" hash="edc944bc1249bfe18d7612cbdc0b9503"/></dir><file name="Status.php" hash="25ad28251c1e66b3f9c54ee16e2a16e4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FaqsController.php" hash="3c967d1fe98430aa20a6e038945a4528"/></dir><file name="IndexController.php" hash="f87d99fe39f62cb93c977579e671b0e4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5d4223cc3e04c2f011d7b9c20d861e66"/><file name="config.xml" hash="1cb3b196e3b5723eec43d7e7ec047fcb"/></dir><dir name="sql"><dir name="faqs_setup"><file name="mysql4-install-0.1.0.php" hash="8bf7eb94f9e47cb7a0125f657aaa268d"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="87f43636df51505ab9a513e8e32cb9c0"/></dir></dir></dir><dir name="Gallery"><dir name="Block"><dir name="Adminhtml"><dir name="Gallery"><dir name="Edit"><file name="Form.php" hash="b047a0629a42e3cfa3e5eeeac6a6c3d9"/><dir name="Tab"><file name="Form.php" hash="d4f9838af84fda33f03ea489030f7a57"/></dir><file name="Tabs.php" hash="b6438d98d47e5e4f572905f9886656c2"/></dir><file name="Edit.php" hash="7a74dd0d4a8c5a353878d2bd44d4327c"/><file name="Grid.php" hash="afe3be9f4f0fd71bd19dc25e7ac6d4c4"/></dir><file name="Gallery.php" hash="78f7fc7238a648725e89269ab1b1bc6b"/></dir><file name="Gallery.php" hash="7623e5a0dac8a8e8f40c825ce1bcd766"/></dir><dir name="Helper"><file name="Data.php" hash="6e19ac429a5976e5a6d7a68312d1aaf4"/></dir><dir name="Model"><file name="Gallery.php" hash="d393f48bd826e8072b452ed84ff50f91"/><dir name="Mysql4"><dir name="Gallery"><file name="Collection.php" hash="c761a1c1673411aafed6bbc63a91147b"/></dir><file name="Gallery.php" hash="adb807b4b4d196a81fca68eb1d88f2fb"/></dir><file name="Status.php" hash="61c9752a5e8aa3caa7b5f0068f9f8285"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="GalleryController.php" hash="92735e71c216f8ecdd0d2492f954b9eb"/></dir><file name="IndexController.php" hash="9ce7a896d4d640cbf836570a0cc725e3"/></dir><dir name="etc"><file name="config.xml" hash="45cdc67502af19cda3ad945cd8042fde"/></dir><dir name="sql"><dir name="gallery_setup"><file name="mysql4-install-0.1.0.php" hash="f48b3e51c84af8f0a2993f8d7f5c0376"/></dir></dir></dir><file name="Note.txt" hash="534bbd8615551ff088183c63e73f9332"/><dir name="Orderreport"><dir name="Block"><dir name="Adminhtml"><dir name="Orderreport"><dir name="Edit"><file name="Form.php" hash="ad7fb2193e24cb2b00d79f95e8f862b1"/><dir name="Tab"><file name="Form.php" hash="8fff076d1311e04c67968f4deada4f9a"/></dir><file name="Tabs.php" hash="89c3573a7227d07dbad289cf346afaf2"/></dir><file name="Edit.php" hash="24549c44f5317a92a6e87a97ea794417"/><file name="Grid.php" hash="977323859c142cad8a3ad88d2b5ce10b"/></dir><file name="Orderreport.php" hash="d2cf373f60ec062e95ab5959d85e0ed4"/></dir><file name="Orderreport.php" hash="7c4cdfcfc5b95565962a92373b2aabb8"/></dir><dir name="Helper"><file name="Data.php" hash="4e8452b3ffe012843d74dd249a067a26"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Orderreport"><file name="Collection.php" hash="b43fa3bed466033794048c8497aa57a4"/></dir><file name="Orderreport.php" hash="28cd9015065f5500cafd4c5533c6fa73"/></dir><file name="Orderreport.php" hash="39f0e0d4fd81b0248f9197210457f7b6"/><file name="Status.php" hash="462163ddf8ab804d6f84ce29a7b1e37f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderreportController.php" hash="0a5146f0f4e8bb40861304117b8d3901"/></dir><file name="IndexController.php" hash="ce32c195b1ccb73f418a466fb522aa20"/></dir><dir name="etc"><file name="config.xml" hash="704c37dc7aec28f7bb9a4bdaf2ec37fa"/></dir><dir name="sql"><dir name="orderreport_setup"><file name="mysql4-install-0.1.0.php" hash="499386e75dab020c7ac3a64f7663ea60"/></dir></dir></dir><dir name="Press"><dir name="Block"><dir name="Adminhtml"><dir name="Press"><dir name="Edit"><file name="Form.php" hash="ad47e3678465d50289821385675bb424"/><dir name="Tab"><file name="Form.php" hash="781b74b982504a69faeab14ff8158211"/></dir><file name="Tabs.php" hash="300701aa9664a6a4a557461062d8c592"/></dir><file name="Edit.php" hash="087a1052a64e65f90c3591d6e8bce35f"/><file name="Grid.php" hash="d14e48135829dbdd78ac7959c34444d1"/></dir><file name="Press.php" hash="7b60f69eef219d73598ab8a1387dab4a"/></dir><file name="Press.php" hash="a0df115981f071134e4b2e25ec9c816d"/></dir><dir name="Helper"><file name="Data.php" hash="d3206f9858dc8b38f1cead355424b361"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Press"><file name="Collection.php" hash="45ed41bc770b567a0805a3832d330f72"/></dir><file name="Press.php" hash="f43c10890595ffe24021c01ed3f3f36c"/><dir name="Press_store"><file name="Collection.php" hash="fc7b18ada57014cbe6eac0e3e4ed2fcd"/></dir><file name="Press_store.php" hash="5ead548067fd284f025dbae8f7ebaccc"/></dir><file name="Press.php" hash="23b9e17959c7d8eb40b8d525143e49e6"/><file name="Press_store.php" hash="1c4efe49b22be2f2270d229d1c7d735b"/><file name="Status.php" hash="173892677cbabb5b13567b6e6212c347"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PressController.php" hash="1a9b344f76adf5486e99f1849c6fa5e2"/></dir><file name="IndexController.php" hash="f7d118b34f1f9ddc89edad001bf41ed4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="62055f196449f1f4cf4bad95a7ce50ee"/><file name="config.xml" hash="55c4a977df9941aedd0d86a73058c0f4"/><file name="system.xml" hash="d2f5dc4d658103737670be1b167c3fe4"/></dir><dir name="sql"><dir name="press_setup"><file name="mysql4-install-0.1.0.php" hash="03a8b75ad5be5dc23b4c8a78aeea5391"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="99ff1d565f180b13fd4a175948fc9b43"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="2398f20b3942f7a9efc9b32ebf724f30"/></dir></dir></dir><dir name="Promotionalbanner"><dir name="Block"><dir name="Adminhtml"><dir name="Promotionalbanner"><dir name="Edit"><file name="Form.php" hash="087963dfc7495abbefe500032e6c3771"/><dir name="Tab"><file name="Form.php" hash="49ebab4b78573f9b5c96d1cb7cad8945"/></dir><file name="Tabs.php" hash="571cf2c8f6ddda7cdf1bdfce7bee457c"/></dir><file name="Edit.php" hash="7e9ff48cdc9cd593c05d2bc166213d73"/><file name="Grid.php" hash="77d073401be533c47bfec4c356f0b884"/></dir><file name="Promotionalbanner.php" hash="bcbf5933fad7fec3305998c88624e16b"/></dir><file name="Promotionalbanner.php" hash="f3eaedcab4dca871cc4b97456293db39"/></dir><dir name="Helper"><file name="Data.php" hash="f1f00e13b228d274ae944c29776863dc"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Promotionalbanner"><file name="Collection.php" hash="9dca8e80de6ed28f6495a60704bcd757"/></dir><file name="Promotionalbanner.php" hash="ffbef4bfe3b0025d705d456588d64fa2"/></dir><file name="Promotionalbanner.php" hash="c807fa217d832065e03d17efa6571b54"/><file name="Status.php" hash="bfc65e8dc4d49c83849bcb23017d4300"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PromotionalbannerController.php" hash="1bff57aada1c19624ea5e53a13a27b5d"/></dir><file name="IndexController.php" hash="5830cf818556b05010381b7404e77647"/></dir><dir name="etc"><file name="config.xml" hash="e8165609d6be83674a3d78741886379b"/></dir><dir name="sql"><dir name="promotionalbanner_setup"><file name="mysql4-install-0.1.0.php" hash="bb85cccff3468e73d21f287ce7250aa5"/></dir></dir></dir><dir name="Slider"><dir name="Block"><dir name="Adminhtml"><dir name="Slider"><dir name="Edit"><file name="Form.php" hash="ca930481c7735510714bc08f3ed54388"/><dir name="Tab"><file name="Form.php" hash="54e9c80c9066465a2bf8f69fc54769a2"/></dir><file name="Tabs.php" hash="caad7f9056c9c07c392980656c356871"/></dir><file name="Edit.php" hash="8a3a0fef10e2e61350a5b96d42919fc3"/><file name="Grid.php" hash="f514362d14115b3723e936728a856ce0"/></dir><file name="Slider.php" hash="d1c6599add8772e4b564fa24d0706742"/></dir><file name="Slider.php" hash="206931d8e27c6917f7a2644006780348"/></dir><dir name="Helper"><file name="Data.php" hash="1040dcdf8a42eed3e0010fed0d6128a3"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Slider"><file name="Collection.php" hash="2ae22e2c3320dd3a22c853d443cc914f"/></dir><file name="Slider.php" hash="f58a717ab3b4bd59ba605649129ca9d1"/></dir><file name="Slider.php" hash="0d75c8352f467422a324d68e4e8f1ccb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SliderController.php" hash="cea85ed88e7daefc237ba9554f78ec30"/></dir><file name="IndexController.php" hash="c1fc4c20c94f5c3076b1be1370add42a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="64953dacfdab437bf615e6fe7d543b1a"/><file name="config.xml" hash="21663e98935230f2a8ad0543b30d1276"/><file name="system.xml" hash="227dc82a7087bf08f755e814f086b418"/></dir><dir name="sql"><dir name="slider_setup"><file name="mysql4-install-0.1.0.php" hash="efd60f0f0fd9351c16c15aca41bdfb48"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="slider"><file name="slider.xml" hash="a110923b7eeb351204c9e43f6ca8e0dd"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="slider"><file name="slider.xml" hash="9651b1f4114b5f8ff1229886b4607fca"/></dir></dir><dir name="template"><dir name="slider"><file name="slider.phtml" hash="1b9b75b77d843c983fe181972f128c52"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tatva_Slider.xml" hash="248fedac6d3c4175a2564765fde3b4a9"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="slider"><file name="slider.css" hash="dab445ad3a99959812c5af9d2865a780"/></dir></dir><dir name="images"><dir name="slider"><file name="Thumbs.db" hash="a4e466bbbb29524e0d89c23c19829437"/><file name="b_next.png" hash="d72dde0609aded61a24fa18cdca4bf7f"/><file name="b_prev.png" hash="86e333b7023d493e8024ccc6b32cd690"/><file name="bannerscrollbg.gif" hash="bd8c7ef3273a6219fd1bb56bc24cbf6d"/><file name="bluehbg.gif" hash="bdd4f53932bd952684d5d87a69c261c3"/><file name="carousel_next.png" hash="8a6d7719accc317e0dbd4a831677598c"/><file name="carousel_prev.png" hash="849d28e8873e8104c232348348c5e5b8"/><file name="content_bg.jpg" hash="e32654532856667842f9002208341e15"/><file name="next.png" hash="1b2ee17462251a2bd374a8a8a49d6ede"/><file name="next_arrow.png" hash="f395949692f96b812d41521dc8418e37"/><file name="num-act.png" hash="bead24653e91070840cec1153577ba24"/><file name="num.png" hash="4847ee03d68096c72339117db3ce981d"/><file name="prev.png" hash="e0b379b1a7db33c59cc90c4068b2ae3f"/><file name="prev_arrow.png" hash="3ba0da3255d4aac51f8bddf814abd480"/><file name="primopiano_menu.gif" hash="157cf32c6c9a103000441d1cf13768bf"/><file name="primopiano_menu2.gif" hash="2e08aa45e6ad2bd460832bf2c0c20069"/><file name="scroolbg.gif" hash="39d89710b27da072e63bbbdc474ab090"/></dir></dir><dir name="js"><dir name="slider"><file name="jquery-1.6.4.min.js" hash="fdcd59e694043785ddaebb2c688cfa64"/><file name="jquery.jcarousel.js" hash="c12b6393fdd5aa32fc572ce1594d4184"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>