Etatvasoft_Dynamic_Image_Slider - Version 1.5.5

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.5
Comparing to
See all releases


Code changes from version 1.5.4 to 1.5.5

Files changed (226) hide show
  1. app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf.php +0 -12
  2. app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit.php +0 -45
  3. app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit/Form.php +0 -19
  4. app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit/Tab/Form.php +0 -58
  5. app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit/Tabs.php +0 -24
  6. app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Grid.php +0 -116
  7. app/code/local/Tatva/Attachpdf/Block/Attachpdf.php +0 -17
  8. app/code/local/Tatva/Attachpdf/Helper/Data.php +0 -6
  9. app/code/local/Tatva/Attachpdf/Model/Attachpdf.php +0 -10
  10. app/code/local/Tatva/Attachpdf/Model/Mysql4/Attachpdf.php +0 -10
  11. app/code/local/Tatva/Attachpdf/Model/Mysql4/Attachpdf/Collection.php +0 -10
  12. app/code/local/Tatva/Attachpdf/Model/Status.php +0 -15
  13. app/code/local/Tatva/Attachpdf/controllers/IndexController.php +0 -47
  14. app/code/local/Tatva/Attachpdf/etc/config.xml +0 -33
  15. app/code/local/Tatva/Catalogextensions/Block/Allproducts/List.php +0 -65
  16. app/code/local/Tatva/Catalogextensions/Block/Bestsellers/Home/List.php +0 -68
  17. app/code/local/Tatva/Catalogextensions/Block/Bestsellers/List.php +0 -61
  18. app/code/local/Tatva/Catalogextensions/Block/Catalogextensions.php +0 -17
  19. app/code/local/Tatva/Catalogextensions/Block/Featured/Home/List.php +0 -67
  20. app/code/local/Tatva/Catalogextensions/Block/Featured/List.php +0 -60
  21. app/code/local/Tatva/Catalogextensions/Block/Mostviewed/Home/List.php +0 -68
  22. app/code/local/Tatva/Catalogextensions/Block/Mostviewed/List.php +0 -61
  23. app/code/local/Tatva/Catalogextensions/Block/Newproduct/Home/List.php +0 -69
  24. app/code/local/Tatva/Catalogextensions/Block/Newproduct/List.php +0 -60
  25. app/code/local/Tatva/Catalogextensions/Block/Promotional/Home/List.php +0 -86
  26. app/code/local/Tatva/Catalogextensions/Block/Promotional/List.php +0 -81
  27. app/code/local/Tatva/Catalogextensions/Block/lastordered/Home/List.php +0 -74
  28. app/code/local/Tatva/Catalogextensions/Block/lastordered/List.php +0 -69
  29. app/code/local/Tatva/Catalogextensions/Helper/Data.php +0 -6
  30. app/code/local/Tatva/Catalogextensions/Model/Catalogextensions.php +0 -10
  31. app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions.php +0 -10
  32. app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions/Collection.php +0 -10
  33. app/code/local/Tatva/Catalogextensions/Model/Status.php +0 -15
  34. app/code/local/Tatva/Catalogextensions/controllers/IndexController.php +0 -158
  35. app/code/local/Tatva/Catalogextensions/etc/adminhtml.xml +0 -29
  36. app/code/local/Tatva/Catalogextensions/etc/config.xml +0 -157
  37. app/code/local/Tatva/Catalogextensions/etc/system.xml +0 -266
  38. app/code/local/Tatva/Catalogextensions/sql/catalogextensions_setup/mysql4-install-0.1.0.php +0 -33
  39. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Attribute/Edit/Main/Abstract.php +0 -238
  40. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customer/Grid.php +0 -341
  41. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress.php +0 -12
  42. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit.php +0 -68
  43. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Form.php +0 -19
  44. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Front.php +0 -106
  45. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Main.php +0 -205
  46. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/Options.php +0 -36
  47. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tab/System.php +0 -134
  48. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Edit/Tabs.php +0 -38
  49. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/Grid.php +0 -58
  50. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/New/Product/Attributes.php +0 -94
  51. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customeraddress/New/Product/Created.php +0 -90
  52. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes.php +0 -12
  53. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit.php +0 -68
  54. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Form.php +0 -19
  55. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Front.php +0 -106
  56. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Main.php +0 -208
  57. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/Options.php +0 -36
  58. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tab/System.php +0 -134
  59. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Edit/Tabs.php +0 -38
  60. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/Grid.php +0 -58
  61. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/New/Product/Attributes.php +0 -94
  62. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Customerattributes/New/Product/Created.php +0 -90
  63. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Grid/Renderer/Image.php +0 -19
  64. app/code/local/Tatva/Customerattributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Multiselectattributes.php +0 -35
  65. app/code/local/Tatva/Customerattributes/Helper/Data.php +0 -27
  66. app/code/local/Tatva/Customerattributes/Model/Adminhtml/Resource/Eav/Attribute.php +0 -390
  67. app/code/local/Tatva/Customerattributes/Model/Adminhtml/System/Config/Source/Inputtype.php +0 -39
  68. app/code/local/Tatva/Customerattributes/Model/Attribute.php +0 -77
  69. app/code/local/Tatva/Customerattributes/Model/Customerattributes.php +0 -42
  70. app/code/local/Tatva/Customerattributes/Model/Mysql4/Customerattributes.php +0 -50
  71. app/code/local/Tatva/Customerattributes/Model/Status.php +0 -15
  72. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerController_old.php +0 -818
  73. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomeraddressController.php +0 -383
  74. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerattributeController_old.php +0 -16
  75. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/CustomerattributesController.php +0 -433
  76. app/code/local/Tatva/Customerattributes/controllers/Adminhtml/ProductController.php +0 -16
  77. app/code/local/Tatva/Customerattributes/etc/adminhtml.xml +0 -57
  78. app/code/local/Tatva/Customerattributes/etc/adminhtml_old.xml +0 -57
  79. app/code/local/Tatva/Customerattributes/etc/config.xml +0 -188
  80. app/code/local/Tatva/Customerattributes/etc/config_old.xml +0 -161
  81. app/code/local/Tatva/Customerattributes/etc/system.xml +0 -43
  82. app/code/local/Tatva/Customerattributes/etc/system_old.xml +0 -43
  83. app/code/local/Tatva/Customerattributes/sql/customerattributes_setup/mysql4-install-0.1.0.php +0 -13
  84. app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab.php +0 -12
  85. app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit.php +0 -45
  86. app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit/Form.php +0 -19
  87. app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit/Tab/Form.php +0 -58
  88. app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit/Tabs.php +0 -24
  89. app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Grid.php +0 -116
  90. app/code/local/Tatva/Customtab/Block/Customtab.php +0 -17
  91. app/code/local/Tatva/Customtab/Helper/Data.php +0 -6
  92. app/code/local/Tatva/Customtab/Model/Customtab.php +0 -10
  93. app/code/local/Tatva/Customtab/Model/Mysql4/Customtab.php +0 -10
  94. app/code/local/Tatva/Customtab/Model/Mysql4/Customtab/Collection.php +0 -10
  95. app/code/local/Tatva/Customtab/Model/Status.php +0 -15
  96. app/code/local/Tatva/Customtab/controllers/Adminhtml/CustomtabController.php +0 -214
  97. app/code/local/Tatva/Customtab/controllers/IndexController.php +0 -42
  98. app/code/local/Tatva/Customtab/etc/adminhtml.xml +0 -43
  99. app/code/local/Tatva/Customtab/etc/config.xml +0 -120
  100. app/code/local/Tatva/Customtab/sql/customtab_setup/mysql4-install-0.1.0.php +0 -23
  101. app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport.php +0 -12
  102. app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit.php +0 -45
  103. app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit/Form.php +0 -19
  104. app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit/Tab/Form.php +0 -58
  105. app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit/Tabs.php +0 -24
  106. app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Grid.php +0 -116
  107. app/code/local/Tatva/Downloadablereport/Block/Downloadablereport.php +0 -17
  108. app/code/local/Tatva/Downloadablereport/Helper/Data.php +0 -6
  109. app/code/local/Tatva/Downloadablereport/Model/Downloadablereport.php +0 -10
  110. app/code/local/Tatva/Downloadablereport/Model/Mysql4/Downloadablereport.php +0 -10
  111. app/code/local/Tatva/Downloadablereport/Model/Mysql4/Downloadablereport/Collection.php +0 -10
  112. app/code/local/Tatva/Downloadablereport/Model/Status.php +0 -15
  113. app/code/local/Tatva/Downloadablereport/controllers/Adminhtml/DownloadablereportController.php +0 -214
  114. app/code/local/Tatva/Downloadablereport/controllers/IndexController.php +0 -47
  115. app/code/local/Tatva/Downloadablereport/etc/config.xml +0 -120
  116. app/code/local/Tatva/Downloadablereport/sql/downloadablereport_setup/mysql4-install-0.1.0.php +0 -23
  117. app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder.php +0 -12
  118. app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit.php +0 -45
  119. app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit/Form.php +0 -19
  120. app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit/Tab/Form.php +0 -58
  121. app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit/Tabs.php +0 -24
  122. app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Grid.php +0 -116
  123. app/code/local/Tatva/Editorder/Block/Editorder.php +0 -17
  124. app/code/local/Tatva/Editorder/Helper/Data.php +0 -6
  125. app/code/local/Tatva/Editorder/Model/Editorder.php +0 -10
  126. app/code/local/Tatva/Editorder/Model/Mysql4/Editorder.php +0 -10
  127. app/code/local/Tatva/Editorder/Model/Mysql4/Editorder/Collection.php +0 -10
  128. app/code/local/Tatva/Editorder/Model/Status.php +0 -15
  129. app/code/local/Tatva/Editorder/controllers/Adminhtml/EditorderController.php +0 -214
  130. app/code/local/Tatva/Editorder/controllers/IndexController.php +0 -47
  131. app/code/local/Tatva/Editorder/etc/config.xml +0 -120
  132. app/code/local/Tatva/Editorder/sql/editorder_setup/mysql4-install-0.1.0.php +0 -23
  133. app/code/local/Tatva/Exportallimage/Model/Convert/Adapter/Product.php +0 -256
  134. app/code/local/Tatva/Exportallimage/Model/Convert/Parser/Csv.php +0 -77
  135. app/code/local/Tatva/Exportallimage/etc/config.xml +0 -22
  136. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs.php +0 -12
  137. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit.php +0 -55
  138. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Form.php +0 -19
  139. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Tab/Form.php +0 -72
  140. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Edit/Tabs.php +0 -24
  141. app/code/local/Tatva/Faqs/Block/Adminhtml/Faqs/Grid.php +0 -138
  142. app/code/local/Tatva/Faqs/Block/Faqs.php +0 -39
  143. app/code/local/Tatva/Faqs/Helper/Data.php +0 -26
  144. app/code/local/Tatva/Faqs/Model/Faqs.php +0 -36
  145. app/code/local/Tatva/Faqs/Model/Mysql4/Faqs.php +0 -60
  146. app/code/local/Tatva/Faqs/Model/Mysql4/Faqs/Collection.php +0 -65
  147. app/code/local/Tatva/Faqs/Model/Status.php +0 -15
  148. app/code/local/Tatva/Faqs/controllers/Adminhtml/FaqsController.php +0 -214
  149. app/code/local/Tatva/Faqs/controllers/IndexController.php +0 -25
  150. app/code/local/Tatva/Faqs/etc/adminhtml.xml +0 -38
  151. app/code/local/Tatva/Faqs/etc/config.xml +0 -136
  152. app/code/local/Tatva/Faqs/sql/faqs_setup/mysql4-install-0.1.0.php +0 -29
  153. app/code/local/Tatva/Faqs/sql/faqs_setup/mysql4-upgrade-0.1.0-0.2.0.php +0 -32
  154. app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery.php +0 -12
  155. app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit.php +0 -45
  156. app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit/Form.php +0 -19
  157. app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit/Tab/Form.php +0 -58
  158. app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit/Tabs.php +0 -24
  159. app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Grid.php +0 -116
  160. app/code/local/Tatva/Gallery/Block/Gallery.php +0 -17
  161. app/code/local/Tatva/Gallery/Helper/Data.php +0 -6
  162. app/code/local/Tatva/Gallery/Model/Gallery.php +0 -10
  163. app/code/local/Tatva/Gallery/Model/Mysql4/Gallery.php +0 -10
  164. app/code/local/Tatva/Gallery/Model/Mysql4/Gallery/Collection.php +0 -10
  165. app/code/local/Tatva/Gallery/Model/Status.php +0 -15
  166. app/code/local/Tatva/Gallery/controllers/Adminhtml/GalleryController.php +0 -214
  167. app/code/local/Tatva/Gallery/controllers/IndexController.php +0 -47
  168. app/code/local/Tatva/Gallery/etc/config.xml +0 -120
  169. app/code/local/Tatva/Gallery/sql/gallery_setup/mysql4-install-0.1.0.php +0 -23
  170. app/code/local/Tatva/Note.txt +0 -92
  171. app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport.php +0 -12
  172. app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit.php +0 -45
  173. app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit/Form.php +0 -19
  174. app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit/Tab/Form.php +0 -58
  175. app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit/Tabs.php +0 -24
  176. app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Grid.php +0 -116
  177. app/code/local/Tatva/Orderreport/Block/Orderreport.php +0 -17
  178. app/code/local/Tatva/Orderreport/Helper/Data.php +0 -6
  179. app/code/local/Tatva/Orderreport/Model/Mysql4/Orderreport.php +0 -10
  180. app/code/local/Tatva/Orderreport/Model/Mysql4/Orderreport/Collection.php +0 -10
  181. app/code/local/Tatva/Orderreport/Model/Orderreport.php +0 -10
  182. app/code/local/Tatva/Orderreport/Model/Status.php +0 -15
  183. app/code/local/Tatva/Orderreport/controllers/Adminhtml/OrderreportController.php +0 -214
  184. app/code/local/Tatva/Orderreport/controllers/IndexController.php +0 -47
  185. app/code/local/Tatva/Orderreport/etc/config.xml +0 -120
  186. app/code/local/Tatva/Orderreport/sql/orderreport_setup/mysql4-install-0.1.0.php +0 -23
  187. app/code/local/Tatva/Press/Block/Adminhtml/Press.php +0 -17
  188. app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit.php +0 -50
  189. app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit/Form.php +0 -19
  190. app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit/Tab/Form.php +0 -149
  191. app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit/Tabs.php +0 -26
  192. app/code/local/Tatva/Press/Block/Adminhtml/Press/Grid.php +0 -116
  193. app/code/local/Tatva/Press/Block/Press.php +0 -31
  194. app/code/local/Tatva/Press/Helper/Data.php +0 -6
  195. app/code/local/Tatva/Press/Model/Mysql4/Press.php +0 -48
  196. app/code/local/Tatva/Press/Model/Mysql4/Press/Collection.php +0 -10
  197. app/code/local/Tatva/Press/Model/Mysql4/Press_store.php +0 -10
  198. app/code/local/Tatva/Press/Model/Mysql4/Press_store/Collection.php +0 -10
  199. app/code/local/Tatva/Press/Model/Press.php +0 -10
  200. app/code/local/Tatva/Press/Model/Press_store.php +0 -10
  201. app/code/local/Tatva/Press/Model/Status.php +0 -15
  202. app/code/local/Tatva/Press/controllers/Adminhtml/PressController.php +0 -275
  203. app/code/local/Tatva/Press/controllers/IndexController.php +0 -35
  204. app/code/local/Tatva/Press/etc/adminhtml.xml +0 -51
  205. app/code/local/Tatva/Press/etc/config.xml +0 -151
  206. app/code/local/Tatva/Press/etc/system.xml +0 -114
  207. app/code/local/Tatva/Press/sql/press_setup/mysql4-install-0.1.0.php +0 -21
  208. app/code/local/Tatva/Press/sql/press_setup/mysql4-upgrade-0.1.0-0.1.1.php +0 -15
  209. app/code/local/Tatva/Press/sql/press_setup/mysql4-upgrade-0.1.1-0.1.2.php +0 -20
  210. app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner.php +0 -12
  211. app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit.php +0 -45
  212. app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit/Form.php +0 -19
  213. app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit/Tab/Form.php +0 -71
  214. app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit/Tabs.php +0 -24
  215. app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Grid.php +0 -116
  216. app/code/local/Tatva/Promotionalbanner/Block/Promotionalbanner.php +0 -17
  217. app/code/local/Tatva/Promotionalbanner/Helper/Data.php +0 -6
  218. app/code/local/Tatva/Promotionalbanner/Model/Mysql4/Promotionalbanner.php +0 -10
  219. app/code/local/Tatva/Promotionalbanner/Model/Mysql4/Promotionalbanner/Collection.php +0 -10
  220. app/code/local/Tatva/Promotionalbanner/Model/Promotionalbanner.php +0 -10
  221. app/code/local/Tatva/Promotionalbanner/Model/Status.php +0 -15
  222. app/code/local/Tatva/Promotionalbanner/controllers/Adminhtml/PromotionalbannerController.php +0 -214
  223. app/code/local/Tatva/Promotionalbanner/controllers/IndexController.php +0 -47
  224. app/code/local/Tatva/Promotionalbanner/etc/config.xml +0 -120
  225. app/code/local/Tatva/Promotionalbanner/sql/promotionalbanner_setup/mysql4-install-0.1.0.php +0 -24
  226. package.xml +3 -3
app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Attachpdf_Block_Adminhtml_Attachpdf extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_attachpdf';
7
- $this->_blockGroup = 'attachpdf';
8
- $this->_headerText = Mage::helper('attachpdf')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('attachpdf')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Block_Adminhtml_Attachpdf_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'attachpdf';
11
- $this->_controller = 'adminhtml_attachpdf';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('attachpdf')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('attachpdf')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('attachpdf_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'attachpdf_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'attachpdf_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('attachpdf_data') && Mage::registry('attachpdf_data')->getId() ) {
40
- return Mage::helper('attachpdf')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('attachpdf_data')->getTitle()));
41
- } else {
42
- return Mage::helper('attachpdf')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Block_Adminhtml_Attachpdf_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/Attachpdf/Block/Adminhtml/Attachpdf/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Block_Adminhtml_Attachpdf_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('attachpdf_form', array('legend'=>Mage::helper('attachpdf')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('attachpdf')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('attachpdf')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('attachpdf')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('attachpdf')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('attachpdf')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('attachpdf')->__('Content'),
43
- 'title' => Mage::helper('attachpdf')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getAttachpdfData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getAttachpdfData());
52
- Mage::getSingleton('adminhtml/session')->setAttachpdfData(null);
53
- } elseif ( Mage::registry('attachpdf_data') ) {
54
- $form->setValues(Mage::registry('attachpdf_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Block_Adminhtml_Attachpdf_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('attachpdf_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('attachpdf')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('attachpdf')->__('Item Information'),
18
- 'title' => Mage::helper('attachpdf')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('attachpdf/adminhtml_attachpdf_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Block/Adminhtml/Attachpdf/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Block_Adminhtml_Attachpdf_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('attachpdfGrid');
9
- $this->setDefaultSort('attachpdf_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('attachpdf/attachpdf')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('attachpdf_id', array(
24
- 'header' => Mage::helper('attachpdf')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'attachpdf_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('attachpdf')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('attachpdf')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('attachpdf')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('attachpdf')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('attachpdf')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('attachpdf')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('attachpdf')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('attachpdf_id');
84
- $this->getMassactionBlock()->setFormFieldName('attachpdf');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('attachpdf')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('attachpdf')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('attachpdf/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('attachpdf')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('attachpdf')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Block/Attachpdf.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Attachpdf_Block_Attachpdf extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getAttachpdf()
10
- {
11
- if (!$this->hasData('attachpdf')) {
12
- $this->setData('attachpdf', Mage::registry('attachpdf'));
13
- }
14
- return $this->getData('attachpdf');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Model/Attachpdf.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Model_Attachpdf extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('attachpdf/attachpdf');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Model/Mysql4/Attachpdf.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Model_Mysql4_Attachpdf extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the attachpdf_id refers to the key field in your database table.
8
- $this->_init('attachpdf/attachpdf', 'attachpdf_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Model/Mysql4/Attachpdf/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_Model_Mysql4_Attachpdf_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('attachpdf/attachpdf');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Attachpdf_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('attachpdf')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('attachpdf')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Tatva_Attachpdf_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/attachpdf?id=15
11
- * or
12
- * http://site.com/attachpdf/id/15
13
- */
14
- /*
15
- $attachpdf_id = $this->getRequest()->getParam('id');
16
-
17
- if($attachpdf_id != null && $attachpdf_id != '') {
18
- $attachpdf = Mage::getModel('attachpdf/attachpdf')->load($attachpdf_id)->getData();
19
- } else {
20
- $attachpdf = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($attachpdf == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $attachpdfTable = $resource->getTableName('attachpdf');
32
-
33
- $select = $read->select()
34
- ->from($attachpdfTable,array('attachpdf_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $attachpdf = $read->fetchRow($select);
39
- }
40
- Mage::register('attachpdf', $attachpdf);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Attachpdf/etc/config.xml DELETED
@@ -1,33 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Attachpdf>
5
- <version>0.1.0</version>
6
- </Tatva_Attachpdf>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <attachpdf>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Attachpdf</module>
14
- <frontName>attachpdf</frontName>
15
- </args>
16
- </attachpdf>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <attachpdf>
21
- <file>attachpdf.xml</file>
22
- </attachpdf>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <global>
27
- <blocks>
28
- <attachpdf>
29
- <class>Tatva_Attachpdf_Block</class>
30
- </attachpdf>
31
- </blocks>
32
- </global>
33
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Allproducts/List.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Allproducts_List extends Mage_Catalog_Block_Product_List {
14
-
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
-
19
- $storeId = Mage::app()->getStore()->getId();
20
- $products = Mage::getModel('catalog/product')->getCollection()
21
- ->addAttributeToSelect('*')
22
- ->setStoreId($storeId)
23
- ->addStoreFilter($storeId)
24
- ->setPageSize($this->get_prod_count())
25
- ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
- ->setCurPage($this->get_cur_page());
27
-
28
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
-
32
- $this->_productCollection = $products;
33
-
34
- return $this->_productCollection;
35
- }
36
-
37
- function get_order()
38
- {
39
- //unset any saved limits
40
- return (isset($_REQUEST['order'])) ? $_REQUEST['order'] : "entity_id";
41
- }// get_prod_count
42
-
43
- function get_order_dir()
44
- {
45
- //unset any saved limits
46
- return (isset($_REQUEST['dir'])) ? $_REQUEST['dir'] : "asc";
47
- }// get_prod_count
48
-
49
-
50
- function get_prod_count()
51
- {
52
- //unset any saved limits
53
- Mage::getSingleton('catalog/session')->unsLimitPage();
54
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 12;
55
- }// get_prod_count
56
-
57
- function get_cur_page()
58
- {
59
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
60
- }// get_cur_page
61
-
62
-
63
- }
64
-
65
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Bestsellers/Home/List.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Bestsellers_Home_List extends Tatva_Catalogextensions_Block_Bestsellers_List
14
- {
15
-
16
- protected function _getProductCollection()
17
- {
18
- parent::__construct();
19
- $storeId = Mage::app()->getStore()->getId();
20
- $products = Mage::getResourceModel('reports/product_collection')
21
- ->addOrderedQty()
22
- ->addAttributeToSelect('*')
23
- ->setStoreId($storeId)
24
- ->addStoreFilter($storeId)
25
- ->setOrder('ordered_qty', 'desc');
26
-
27
- if(Mage::getStoreConfig('catalogextensions/config1/max_product'))
28
- {
29
- $products->setPageSize(Mage::getStoreConfig('catalogextensions/config1/max_product'));
30
- }
31
-
32
-
33
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
34
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
35
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
36
-
37
- $this->_productCollection = $products;
38
-
39
- return $this->_productCollection;
40
- }
41
-
42
- function get_prod_count()
43
- {
44
- //unset any saved limits
45
- Mage::getSingleton('catalog/session')->unsLimitPage();
46
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
47
- }// get_prod_count
48
-
49
- function get_cur_page()
50
- {
51
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
52
- }// get_cur_page
53
-
54
- function get_order()
55
- {
56
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
57
- }// get_order
58
-
59
- function get_order_dir()
60
- {
61
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
62
- }// get_direction
63
-
64
- public function getToolbarHtml()
65
- {
66
-
67
- }
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Bestsellers/List.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Bestsellers_List extends Mage_Catalog_Block_Product_List
14
- {
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
- $storeId = Mage::app()->getStore()->getId();
19
- $products = Mage::getResourceModel('reports/product_collection')
20
- ->addOrderedQty()
21
- ->addAttributeToSelect('*')
22
- ->setStoreId($storeId)
23
- ->addStoreFilter($storeId)
24
- //->setOrder('ordered_qty', 'desc')
25
- ->setPageSize($this->get_prod_count())
26
- ->setOrder($this->get_order(), $this->get_order_dir())
27
- ->setCurPage($this->get_cur_page());
28
-
29
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
30
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
31
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
32
-
33
- $this->_productCollection = $products;
34
-
35
- return $this->_productCollection;
36
- }
37
-
38
- function get_prod_count()
39
- {
40
- //unset any saved limits
41
- Mage::getSingleton('catalog/session')->unsLimitPage();
42
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
43
- }// get_prod_count
44
-
45
- function get_cur_page()
46
- {
47
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
48
- }// get_cur_page
49
-
50
- function get_order()
51
- {
52
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
53
- }// get_order
54
-
55
- function get_order_dir()
56
- {
57
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
58
- }// get_direction
59
- }
60
-
61
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Catalogextensions.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Catalogextensions_Block_Catalogextensions extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getCatalogextensions()
10
- {
11
- if (!$this->hasData('catalogextensions')) {
12
- $this->setData('catalogextensions', Mage::registry('catalogextensions'));
13
- }
14
- return $this->getData('catalogextensions');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Featured/Home/List.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Featured_Home_List extends Tatva_Catalogextensions_Block_Featured_List
14
- {
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
- $storeId = Mage::app()->getStore()->getId();
19
- $products = Mage::getModel('catalog/product')->getCollection()
20
- ->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')))
21
- ->addAttributeToSelect('*')
22
- ->addAttributeToSelect(array('name', 'price', 'small_image'))
23
- ->setStoreId($storeId)
24
- ->addStoreFilter($storeId);
25
-
26
- if(Mage::getStoreConfig('catalogextensions/config2/max_product'))
27
- {
28
- $products->setPageSize(Mage::getStoreConfig('catalogextensions/config2/max_product'));
29
- }
30
-
31
-
32
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
33
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
34
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
35
-
36
- $this->_productCollection = $products;
37
-
38
- return $this->_productCollection;
39
- }
40
-
41
- function get_prod_count()
42
- {
43
- //unset any saved limits
44
- Mage::getSingleton('catalog/session')->unsLimitPage();
45
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
46
- }// get_prod_count
47
-
48
- function get_cur_page()
49
- {
50
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
51
- }// get_cur_page
52
-
53
- function get_order()
54
- {
55
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
56
- }// get_order
57
-
58
- function get_order_dir()
59
- {
60
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
61
- }// get_direction
62
-
63
- public function getToolbarHtml()
64
- {
65
-
66
- }
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Featured/List.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Featured_List extends Mage_Catalog_Block_Product_List
14
- {
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
- $storeId = Mage::app()->getStore()->getId();
19
- $products = Mage::getModel('catalog/product')->getCollection()
20
- ->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')))
21
- ->addAttributeToSelect('*')
22
- ->setStoreId($storeId)
23
- ->addStoreFilter($storeId)
24
- ->setPageSize($this->get_prod_count())
25
- ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
- ->setCurPage($this->get_cur_page());
27
-
28
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
-
32
- $this->_productCollection = $products;
33
-
34
- return $this->_productCollection;
35
- }
36
-
37
- function get_prod_count()
38
- {
39
- //unset any saved limits
40
- Mage::getSingleton('catalog/session')->unsLimitPage();
41
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
42
- }// get_prod_count
43
-
44
- function get_cur_page()
45
- {
46
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
47
- }// get_cur_page
48
-
49
- function get_order()
50
- {
51
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'position';
52
- }// get_order
53
-
54
- function get_order_dir()
55
- {
56
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
57
- }// get_direction
58
- }
59
-
60
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Mostviewed/Home/List.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Mostviewed_Home_List extends Tatva_Catalogextensions_Block_Mostviewed_List
14
- {
15
-
16
- protected function _getProductCollection()
17
- {
18
- parent::__construct();
19
- $storeId = Mage::app()->getStore()->getId();
20
- $products = Mage::getResourceModel('reports/product_collection')
21
- ->addAttributeToSelect('*')
22
- ->addAttributeToSelect(array('name', 'price', 'small_image'))
23
- ->setStoreId($storeId)
24
- ->addStoreFilter($storeId)
25
- ->addViewsCount();
26
-
27
- if(Mage::getStoreConfig('catalogextensions/config3/max_product'))
28
- {
29
- $products->setPageSize(Mage::getStoreConfig('catalogextensions/config3/max_product'));
30
- }
31
-
32
-
33
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
34
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
35
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
36
-
37
- $this->_productCollection = $products;
38
-
39
- return $this->_productCollection;
40
- }
41
-
42
- function get_prod_count()
43
- {
44
- //unset any saved limits
45
- Mage::getSingleton('catalog/session')->unsLimitPage();
46
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
47
- }// get_prod_count
48
-
49
- function get_cur_page()
50
- {
51
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
52
- }// get_cur_page
53
-
54
- function get_order()
55
- {
56
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'views';
57
- }// get_order
58
-
59
- function get_order_dir()
60
- {
61
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
62
- }// get_direction
63
-
64
- public function getToolbarHtml()
65
- {
66
-
67
- }
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Mostviewed/List.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Mostviewed_List extends Mage_Catalog_Block_Product_List
14
- {
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
- $storeId = Mage::app()->getStore()->getId();
19
- $products = Mage::getResourceModel('reports/product_collection')
20
- ->addAttributeToSelect('*')
21
- ->setStoreId($storeId)
22
- ->addStoreFilter($storeId)
23
- ->addViewsCount()
24
- ->setPageSize($this->get_prod_count())
25
- ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
- ->setCurPage($this->get_cur_page());
27
-
28
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
-
32
- $this->_productCollection = $products;
33
-
34
- return $this->_productCollection;
35
- }
36
-
37
-
38
- function get_prod_count()
39
- {
40
- //unset any saved limits
41
- Mage::getSingleton('catalog/session')->unsLimitPage();
42
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
43
- }// get_prod_count
44
-
45
- function get_cur_page()
46
- {
47
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
48
- }// get_cur_page
49
-
50
- function get_order()
51
- {
52
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'views';
53
- }// get_order
54
-
55
- function get_order_dir()
56
- {
57
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
58
- }// get_direction
59
- }
60
-
61
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Newproduct/Home/List.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Newproduct_Home_List extends Tatva_Catalogextensions_Block_Newproduct_List
14
- {
15
-
16
- protected function _getProductCollection()
17
- {
18
- parent::__construct();
19
- $storeId = Mage::app()->getStore()->getId();
20
- $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
21
-
22
- $products = Mage::getModel('catalog/product')->getCollection()
23
- ->addAttributeToSelect('*')
24
- ->addAttributeToSort("entity_id","DESC")
25
- ->addAttributeToSelect(array('name', 'price', 'small_image'))
26
- ->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds())
27
- ->setOrder($this->get_order(), $this->get_order_dir());
28
- if(Mage::getStoreConfig('catalogextensions/config4/max_product'))
29
- {
30
- $products->setPageSize(Mage::getStoreConfig('catalogextensions/config4/max_product'));
31
- }
32
-
33
-
34
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
35
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
36
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
37
-
38
- $this->_productCollection = $products;
39
-
40
- return $this->_productCollection;
41
- }
42
-
43
- function get_prod_count()
44
- {
45
- //unset any saved limits
46
- Mage::getSingleton('catalog/session')->unsLimitPage();
47
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
48
- }// get_prod_count
49
-
50
- function get_cur_page()
51
- {
52
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
53
- }// get_cur_page
54
-
55
- function get_order()
56
- {
57
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'position';
58
- }// get_order
59
-
60
- function get_order_dir()
61
- {
62
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
63
- }// get_direction
64
-
65
- public function getToolbarHtml()
66
- {
67
-
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Newproduct/List.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Newproduct_List extends Mage_Catalog_Block_Product_List
14
- {
15
-
16
- protected function _getProductCollection()
17
- {
18
- parent::__construct();
19
-
20
- $products = Mage::getModel('catalog/product')->getCollection()
21
- ->addAttributeToSort("entity_id","DESC")
22
- ->addAttributeToSelect(array('name', 'price', 'small_image'))
23
- ->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds())
24
- ->setPageSize($this->get_prod_count())
25
- ->addAttributeToSort($this->get_order(), $this->get_order_dir())
26
- ->setCurPage($this->get_cur_page());
27
-
28
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
29
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
30
- Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
31
-
32
- $this->_productCollection = $products;
33
-
34
- return $this->_productCollection;
35
- }
36
-
37
- function get_prod_count()
38
- {
39
- //unset any saved limits
40
- Mage::getSingleton('catalog/session')->unsLimitPage();
41
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
42
- }// get_prod_count
43
-
44
- function get_cur_page()
45
- {
46
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
47
- }// get_cur_page
48
-
49
- function get_order()
50
- {
51
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'position';
52
- }// get_order
53
-
54
- function get_order_dir()
55
- {
56
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
57
- }// get_direction
58
- }
59
-
60
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Promotional/Home/List.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Promotional_Home_List extends Tatva_Catalogextensions_Block_Promotional_List
14
- {
15
-
16
- protected function _getProductCollection()
17
- {
18
- parent::__construct();
19
- $storeId = Mage::app()->getStore()->getId();
20
- $websiteId = Mage::app()->getWebsite()->getId();
21
- $customerGroupId = 0;
22
- $login = Mage::getSingleton( 'customer/session' )->isLoggedIn();
23
- $attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
24
-
25
- if($login)
26
- $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
27
-
28
- $products = Mage::getModel('catalog/product')->getCollection()
29
- ->setStoreId($storeId)
30
- ->addStoreFilter($storeId)
31
- ->addAttributeToSelect($attributes)
32
- ->addMinimalPrice()
33
- ->addFinalPrice()
34
- ->addTaxPercents()
35
- ->setOrder($this->get_order(), $this->get_order_dir());
36
-
37
- if(Mage::getStoreConfig('catalogextensions/config1/max_product'))
38
- {
39
- $products->setPageSize(Mage::getStoreConfig('catalogextensions/config6/max_product'));
40
- }
41
-
42
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
43
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
44
-
45
- $todayDate = date("Y-m-d H:i:00", Mage::getModel('core/date')->timestamp(time()));
46
- $catalogRuleProducts = Mage::getResourceModel('catalogrule/rule_product_price_collection')
47
- ->addFieldToFilter('customer_group_id',$customerGroupId)
48
- ->addFieldToFilter('website_id',$websiteId)
49
- ->addFieldToFilter('latest_start_date', array(array('lteq'=>$todayDate),array('null'=>true)))
50
- ->addFieldToFilter('earliest_end_date', array(array('gteq'=>$todayDate),array('null'=>true)));
51
-
52
- $catalogRuleProductID = $catalogRuleProducts->getProductIds();
53
-
54
- $products->getSelect()->where('e.entity_id IN(?)',$catalogRuleProductID);
55
- $this->_productCollection = $products;
56
-
57
- return $this->_productCollection;
58
- }
59
-
60
- function get_prod_count()
61
- {
62
- //unset any saved limits
63
- Mage::getSingleton('catalog/session')->unsLimitPage();
64
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
65
- }// get_prod_count
66
-
67
- function get_cur_page()
68
- {
69
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
70
- }// get_cur_page
71
-
72
- function get_order()
73
- {
74
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'entity_id';
75
- }// get_order
76
-
77
- function get_order_dir()
78
- {
79
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
80
- }// get_direction
81
-
82
- public function getToolbarHtml()
83
- {
84
-
85
- }
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/Promotional/List.php DELETED
@@ -1,81 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Promotional_List extends Mage_Catalog_Block_Product_List
14
- {
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
- parent::__construct();
19
- $storeId = Mage::app()->getStore()->getId();
20
- $websiteId = Mage::app()->getWebsite()->getId();
21
- $customerGroupId = 0;
22
- $login = Mage::getSingleton( 'customer/session' )->isLoggedIn();
23
- $attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
24
-
25
- if($login)
26
- $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
27
-
28
- $products = Mage::getModel('catalog/product')->getCollection()
29
- ->setStoreId($storeId)
30
- ->addStoreFilter($storeId)
31
- ->addAttributeToSelect($attributes)
32
- ->addMinimalPrice()
33
- ->addFinalPrice()
34
- ->addTaxPercents()
35
- ->setPageSize($this->get_prod_count())
36
- ->setOrder($this->get_order(), $this->get_order_dir())
37
- ->setCurPage($this->get_cur_page());;
38
-
39
-
40
-
41
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
42
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
43
-
44
- $todayDate = date("Y-m-d H:i:00", Mage::getModel('core/date')->timestamp(time()));
45
- $catalogRuleProducts = Mage::getResourceModel('catalogrule/rule_product_price_collection')
46
- ->addFieldToFilter('customer_group_id',$customerGroupId)
47
- ->addFieldToFilter('website_id',$websiteId)
48
- ->addFieldToFilter('latest_start_date', array(array('lteq'=>$todayDate),array('null'=>true)))
49
- ->addFieldToFilter('earliest_end_date', array(array('gteq'=>$todayDate),array('null'=>true)));
50
-
51
- $catalogRuleProductID = $catalogRuleProducts->getProductIds();
52
-
53
- $products->getSelect()->where('e.entity_id IN(?)',$catalogRuleProductID);
54
- $this->_productCollection = $products;
55
- return $this->_productCollection;
56
- }
57
-
58
- function get_prod_count()
59
- {
60
- //unset any saved limits
61
- Mage::getSingleton('catalog/session')->unsLimitPage();
62
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
63
- }// get_prod_count
64
-
65
- function get_cur_page()
66
- {
67
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
68
- }// get_cur_page
69
-
70
- function get_order()
71
- {
72
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'entity_id';
73
- }// get_order
74
-
75
- function get_order_dir()
76
- {
77
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
78
- }// get_direction
79
- }
80
-
81
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/lastordered/Home/List.php DELETED
@@ -1,74 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Lastordered_Home_List extends Tatva_Catalogextensions_Block_Promotional_List
14
- {
15
-
16
- protected function _getProductCollection()
17
- {
18
- parent::__construct();
19
- $storeId = Mage::app()->getStore()->getId();
20
- $resource = Mage::getSingleton('core/resource');
21
- $read = Mage::getSingleton('core/resource')->getConnection('core_read');
22
- $orderItemTable = $resource->getTableName('sales/order_item');
23
- $demotb = $read->select()->from(array('coi'=>$orderItemTable),array('product_id','item_id'))->group('product_id');
24
- $products = Mage::getModel('catalog/product')->getCollection()
25
- ->setStoreId($storeId)
26
- ->addStoreFilter($storeId)
27
- ->addAttributeToSelect(array('name', 'price', 'small_image'));
28
-
29
-
30
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
31
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
32
-
33
- $products->getSelect()
34
- ->join(array('coi'=>$orderItemTable),'e.entity_id=coi.product_id',array('item_id'))
35
- ->order($this->get_order().' '.$this->get_order_dir());
36
-
37
-
38
- if(Mage::getStoreConfig('catalogextensions/config8/max_product'))
39
- {
40
- $products->setPageSize(Mage::getStoreConfig('catalogextensions/config8/max_product'));
41
- }
42
-
43
- $this->_productCollection = $products;
44
-
45
- return $this->_productCollection;
46
- }
47
-
48
- function get_prod_count()
49
- {
50
- //unset any saved limits
51
- Mage::getSingleton('catalog/session')->unsLimitPage();
52
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
53
- }// get_prod_count
54
-
55
- function get_cur_page()
56
- {
57
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
58
- }// get_cur_page
59
-
60
- function get_order()
61
- {
62
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'item_id';
63
- }// get_order
64
-
65
- function get_order_dir()
66
- {
67
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
68
- }// get_direction
69
-
70
- public function getToolbarHtml()
71
- {
72
-
73
- }
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Block/lastordered/List.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * To change this template, choose Tools | Templates
5
- * and open the template in the editor.
6
- */
7
-
8
- /**
9
- * Description of List
10
- *
11
- * @author om
12
- */
13
- class Tatva_Catalogextensions_Block_Lastordered_List extends Mage_Catalog_Block_Product_List
14
- {
15
- protected function _getProductCollection()
16
- {
17
- parent::__construct();
18
- $storeId = Mage::app()->getStore()->getId();
19
- $resource = Mage::getSingleton('core/resource');
20
- $read = Mage::getSingleton('core/resource')->getConnection('core_read');
21
-
22
- $orderItemTable = $resource->getTableName('sales/order_item');
23
- $demotb = $read->select()->from(array('coi'=>$orderItemTable),array('product_id','item_id'))->group('product_id');
24
- $products = Mage::getModel('catalog/product')->getCollection()
25
- ->setStoreId($storeId)
26
- ->addStoreFilter($storeId)
27
- ->addAttributeToSelect(array('name', 'price', 'small_image'));
28
-
29
-
30
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
31
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
32
-
33
- $products->getSelect()
34
- ->join(array('coid'=>$demotb),'e.entity_id=coid.product_id',array('item_id'))
35
- ->order($this->get_order().' '.$this->get_order_dir());
36
-
37
-
38
- $products->setPageSize($this->get_prod_count())->setCurPage($this->get_cur_page());
39
-
40
- $this->_productCollection = $products;
41
-
42
- return $this->_productCollection;
43
- }
44
-
45
- function get_prod_count()
46
- {
47
- //unset any saved limits
48
- Mage::getSingleton('catalog/session')->unsLimitPage();
49
- return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
50
-
51
- }// get_prod_count
52
-
53
- function get_cur_page()
54
- {
55
- return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
56
- }// get_cur_page
57
-
58
- function get_order()
59
- {
60
- return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'item_id';
61
- }// get_order
62
-
63
- function get_order_dir()
64
- {
65
- return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
66
- }// get_direction
67
- }
68
-
69
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Catalogextensions_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Model/Catalogextensions.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Catalogextensions_Model_Catalogextensions extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('catalogextensions/catalogextensions');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Catalogextensions_Model_Mysql4_Catalogextensions 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('catalogextensions/catalogextensions', 'catalogextensions_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Model/Mysql4/Catalogextensions/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Catalogextensions_Model_Mysql4_Catalogextensions_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('catalogextensions/catalogextensions');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Catalogextensions_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('catalogextensions')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('catalogextensions')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/controllers/IndexController.php DELETED
@@ -1,158 +0,0 @@
1
- <?php
2
- class Tatva_Catalogextensions_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/catalogextensions?id=15
11
- * or
12
- * http://site.com/catalogextensions/id/15
13
- */
14
- /*
15
- $catalogextensions_id = $this->getRequest()->getParam('id');
16
-
17
- if($catalogextensions_id != null && $catalogextensions_id != '') {
18
- $catalogextensions = Mage::getModel('catalogextensions/catalogextensions')->load($catalogextensions_id)->getData();
19
- } else {
20
- $catalogextensions = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($catalogextensions == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $catalogextensionsTable = $resource->getTableName('catalogextensions');
32
-
33
- $select = $read->select()
34
- ->from($catalogextensionsTable,array('catalogextensions_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $catalogextensions = $read->fetchRow($select);
39
- }
40
- Mage::register('catalogextensions', $catalogextensions);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- public function bestsellersAction()
48
- {
49
-
50
- $url = Mage::getUrl('no-route');
51
-
52
- $enable = Mage::getStoreConfig('catalogextensions/config1/active');
53
- if($enable != 1)
54
- {
55
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
56
- }
57
- else
58
- {
59
- $this->loadLayout();
60
- $this->getLayout()->getBlock('head')->setTitle('Besesellers');
61
- $this->renderLayout();
62
- }
63
- }
64
- public function featuredAction()
65
- {
66
-
67
- $url = Mage::getUrl('no-route');
68
-
69
- $enable = Mage::getStoreConfig('catalogextensions/config2/active');
70
- if($enable != 1)
71
- {
72
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
73
- }
74
-
75
- $this->loadLayout();
76
- $this->getLayout()->getBlock('head')->setTitle('Featured Products');
77
- $this->renderLayout();
78
- }
79
- public function mostviewedAction()
80
- {
81
-
82
- $url = Mage::getUrl('no-route');
83
-
84
- $enable = Mage::getStoreConfig('catalogextensions/config3/active');
85
- if($enable != 1)
86
- {
87
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
88
- }
89
-
90
- $this->loadLayout();
91
- $this->getLayout()->getBlock('head')->setTitle('Mostviewed products');
92
- $this->renderLayout();
93
- }
94
- public function newproductAction()
95
- {
96
-
97
- $url = Mage::getUrl('no-route');
98
-
99
- $enable = Mage::getStoreConfig('catalogextensions/config4/active');
100
- if($enable != 1)
101
- {
102
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
103
- }
104
-
105
- $this->loadLayout();
106
- $this->getLayout()->getBlock('head')->setTitle('New products');
107
- $this->renderLayout();
108
- }
109
-
110
- public function allproductAction()
111
- {
112
-
113
- $url = Mage::getUrl('no-route');
114
-
115
- $enable = Mage::getStoreConfig('catalogextensions/config5/active');
116
- if($enable != 1)
117
- {
118
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
119
- }
120
-
121
- $this->loadLayout();
122
- $this->getLayout()->getBlock('head')->setTitle('All products');
123
- $this->renderLayout();
124
- }
125
-
126
- public function promotionalAction()
127
- {
128
-
129
- $url = Mage::getUrl('no-route');
130
-
131
- $enable = Mage::getStoreConfig('catalogextensions/config6/active');
132
- if($enable != 1)
133
- {
134
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
135
- }
136
-
137
- $this->loadLayout();
138
- $this->getLayout()->getBlock('head')->setTitle('Promotional Products');
139
- $this->renderLayout();
140
- }
141
-
142
- public function recentlyorderedAction()
143
- {
144
-
145
- $url = Mage::getUrl('no-route');
146
-
147
- $enable = Mage::getStoreConfig('catalogextensions/config8/active');
148
- if($enable != 1)
149
- {
150
- Mage::app()->getFrontController()->getResponse()->setRedirect($url);
151
- }
152
-
153
- $this->loadLayout();
154
- $this->getLayout()->getBlock('head')->setTitle('Recently Ordered Products');
155
- $this->renderLayout();
156
- }
157
-
158
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/etc/adminhtml.xml DELETED
@@ -1,29 +0,0 @@
1
- <?xml version="1.0"?>
2
- <adminhtml>
3
- <acl>
4
- <resources>
5
- <all>
6
- <title>Allow Everything</title>
7
- </all>
8
- <admin>
9
- <children>
10
- <system>
11
- <children>
12
- <config>
13
- <children>
14
- <catalogextensions translate="title" module="catalogextensions">
15
- <title>Catalogextensions Configuration</title>
16
- </catalogextensions>
17
- </children>
18
- </config>
19
- </children>
20
- </system>
21
- <Tatva_Catalogextensions>
22
- <title>Catalogextensions Module</title>
23
- <sort_order>10</sort_order>
24
- </Tatva_Catalogextensions>
25
- </children>
26
- </admin>
27
- </resources>
28
- </acl>
29
- </adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/etc/config.xml DELETED
@@ -1,157 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Catalogextensions>
5
- <version>0.1.0</version>
6
- </Tatva_Catalogextensions>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <catalogextensions>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Catalogextensions</module>
14
- <frontName>catalogextensions</frontName>
15
- </args>
16
- </catalogextensions>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <catalogextensions>
21
- <file>catalogextensions/catalogextensions.xml</file>
22
- </catalogextensions>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <catalogextensions>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Catalogextensions</module>
32
- <frontName>catalogextensions</frontName>
33
- </args>
34
- </catalogextensions>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <acl>
39
- <resources>
40
- <all>
41
- <title>Allow Everything</title>
42
- </all>
43
- <admin>
44
- <children>
45
- <system>
46
- <children>
47
- <config>
48
- <children>
49
- <catalogextensions translate="title" module="catalogextensions">
50
- <title>Catalogextensions Configuration</title>
51
- </catalogextensions>
52
- </children>
53
- </config>
54
- </children>
55
- </system>
56
- <Tatva_Catalogextensions>
57
- <title>Catalogextensions Module</title>
58
- <sort_order>10</sort_order>
59
- </Tatva_Catalogextensions>
60
- </children>
61
- </admin>
62
- </resources>
63
- </acl>
64
- <layout>
65
- <updates>
66
- <catalogextensions>
67
- <file>catalogextensions.xml</file>
68
- </catalogextensions>
69
- </updates>
70
- </layout>
71
- </adminhtml>
72
- <global>
73
- <models>
74
- <catalogextensions>
75
- <class>Tatva_Catalogextensions_Model</class>
76
- <resourceModel>catalogextensions_mysql4</resourceModel>
77
- </catalogextensions>
78
- <catalogextensions_mysql4>
79
- <class>Tatva_Catalogextensions_Model_Mysql4</class>
80
- <entities>
81
- <catalogextensions>
82
- <table>catalogextensions</table>
83
- </catalogextensions>
84
- </entities>
85
- </catalogextensions_mysql4>
86
- </models>
87
- <resources>
88
- <catalogextensions_setup>
89
- <setup>
90
- <module>Tatva_Catalogextensions</module>
91
- </setup>
92
- <connection>
93
- <use>core_setup</use>
94
- </connection>
95
- </catalogextensions_setup>
96
- <catalogextensions_write>
97
- <connection>
98
- <use>core_write</use>
99
- </connection>
100
- </catalogextensions_write>
101
- <catalogextensions_read>
102
- <connection>
103
- <use>core_read</use>
104
- </connection>
105
- </catalogextensions_read>
106
- </resources>
107
- <blocks>
108
- <catalogextensions>
109
- <class>Tatva_Catalogextensions_Block</class>
110
- </catalogextensions>
111
- </blocks>
112
- <helpers>
113
- <catalogextensions>
114
- <class>Tatva_Catalogextensions_Helper</class>
115
- </catalogextensions>
116
- </helpers>
117
- </global>
118
- <default>
119
- <catalogextensions>
120
- <config1>
121
- <active>0</active>
122
- <max_product>3</max_product>
123
- <title>Bestseller Products</title>
124
- </config1>
125
- <config2>
126
- <active>0</active>
127
- <max_product>3</max_product>
128
- <title>Fetured Products</title>
129
- </config2>
130
- <config3>
131
- <active>0</active>
132
- <max_product>3</max_product>
133
- <title>Most Viewed Products</title>
134
- </config3>
135
- <config4>
136
- <active>0</active>
137
- <max_product>3</max_product>
138
- <title>New Products</title>
139
- <type>Recently Added</type>
140
- </config4>
141
- <config5>
142
- <active>0</active>
143
- <title>All Products</title>
144
- </config5>
145
- <config6>
146
- <active>0</active>
147
- <max_product>3</max_product>
148
- <title>Promotional Products</title>
149
- </config6>
150
- <config7>
151
- <active>0</active>
152
- <max_product>3</max_product>
153
- <title>Recently Ordered Products</title>
154
- </config7>
155
- </catalogextensions>
156
- </default>
157
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/etc/system.xml DELETED
@@ -1,266 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <catalogextensions translate="label" module="catalogextensions">
5
- <label>Catalog Supporting Extensions</label>
6
- <sort_order>101</sort_order>
7
- </catalogextensions>
8
- </tabs>
9
- <sections>
10
- <catalogextensions translate="label" module="catalogextensions">
11
- <class>separator-top</class>
12
- <label>Catalog Extensions Configuration</label>
13
- <tab>catalogextensions</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>
19
- <groups>
20
- <config1 translate="label" module="catalogextensions">
21
- <label>Topsellers Configuration</label>
22
- <frontend_type>text</frontend_type>
23
- <sort_order>10</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
- <active translate="label">
29
- <label>Enabled</label>
30
- <frontend_type>select</frontend_type>
31
- <source_model>adminhtml/system_config_source_yesno</source_model>
32
- <sort_order>1</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
- </active>
37
- <max_product translate="label" module="catalogextensions">
38
- <label>Maximum No Of Products To Dispay On Home</label>
39
- <frontend_type>text</frontend_type>
40
- <validate>validate-greater-than-zero</validate>
41
- <sort_order>10</sort_order>
42
- <show_in_default>1</show_in_default>
43
- <show_in_website>1</show_in_website>
44
- <show_in_store>1</show_in_store>
45
- </max_product>
46
- <title translate="label" module="catalogextensions">
47
- <label>Title</label>
48
- <frontend_type>text</frontend_type>
49
- <sort_order>30</sort_order>
50
- <show_in_default>1</show_in_default>
51
- <show_in_website>1</show_in_website>
52
- <show_in_store>1</show_in_store>
53
- </title>
54
- </fields>
55
- </config1>
56
- <config2 translate="label" module="catalogextensions">
57
- <label>Feature Product Configuration</label>
58
- <frontend_type>text</frontend_type>
59
- <sort_order>20</sort_order>
60
- <show_in_default>1</show_in_default>
61
- <show_in_website>1</show_in_website>
62
- <show_in_store>1</show_in_store>
63
- <fields>
64
- <active translate="label">
65
- <label>Enabled</label>
66
- <frontend_type>select</frontend_type>
67
- <source_model>adminhtml/system_config_source_yesno</source_model>
68
- <sort_order>1</sort_order>
69
- <show_in_default>1</show_in_default>
70
- <show_in_website>1</show_in_website>
71
- <show_in_store>1</show_in_store>
72
- </active>
73
- <max_product translate="label" module="catalogextensions">
74
- <label>Maximum No Of Products To Dispay On Home</label>
75
- <frontend_type>text</frontend_type>
76
- <validate>validate-greater-than-zero</validate>
77
- <sort_order>10</sort_order>
78
- <show_in_default>1</show_in_default>
79
- <show_in_website>1</show_in_website>
80
- <show_in_store>1</show_in_store>
81
- </max_product>
82
- <title translate="label" module="catalogextensions">
83
- <label>Title</label>
84
- <frontend_type>text</frontend_type>
85
- <sort_order>30</sort_order>
86
- <show_in_default>1</show_in_default>
87
- <show_in_website>1</show_in_website>
88
- <show_in_store>1</show_in_store>
89
- </title>
90
- </fields>
91
- </config2>
92
- <config3 translate="label" module="catalogextensions">
93
- <label>Most Viewed Product Configuration</label>
94
- <frontend_type>text</frontend_type>
95
- <sort_order>30</sort_order>
96
- <show_in_default>1</show_in_default>
97
- <show_in_website>1</show_in_website>
98
- <show_in_store>1</show_in_store>
99
- <fields>
100
- <active translate="label">
101
- <label>Enabled</label>
102
- <frontend_type>select</frontend_type>
103
- <source_model>adminhtml/system_config_source_yesno</source_model>
104
- <sort_order>1</sort_order>
105
- <show_in_default>1</show_in_default>
106
- <show_in_website>1</show_in_website>
107
- <show_in_store>1</show_in_store>
108
- </active>
109
- <max_product translate="label" module="catalogextensions">
110
- <label>Maximum No Of Products To Dispay On Home</label>
111
- <frontend_type>text</frontend_type>
112
- <validate>validate-greater-than-zero</validate>
113
- <sort_order>10</sort_order>
114
- <show_in_default>1</show_in_default>
115
- <show_in_website>1</show_in_website>
116
- <show_in_store>1</show_in_store>
117
- </max_product>
118
- <title translate="label" module="catalogextensions">
119
- <label>Title</label>
120
- <frontend_type>text</frontend_type>
121
- <sort_order>30</sort_order>
122
- <show_in_default>1</show_in_default>
123
- <show_in_website>1</show_in_website>
124
- <show_in_store>1</show_in_store>
125
- </title>
126
- </fields>
127
- </config3>
128
- <config4 translate="label" module="catalogextensions">
129
- <label>New Product Configuration</label>
130
- <frontend_type>text</frontend_type>
131
- <sort_order>40</sort_order>
132
- <show_in_default>1</show_in_default>
133
- <show_in_website>1</show_in_website>
134
- <show_in_store>1</show_in_store>
135
- <fields>
136
- <active translate="label">
137
- <label>Enabled</label>
138
- <frontend_type>select</frontend_type>
139
- <source_model>adminhtml/system_config_source_yesno</source_model>
140
- <sort_order>1</sort_order>
141
- <show_in_default>1</show_in_default>
142
- <show_in_website>1</show_in_website>
143
- <show_in_store>1</show_in_store>
144
- </active>
145
- <max_product translate="label" module="catalogextensions">
146
- <label>Maximum No Of Products To Dispay On Home</label>
147
- <frontend_type>text</frontend_type>
148
- <validate>validate-greater-than-zero</validate>
149
- <sort_order>10</sort_order>
150
- <show_in_default>1</show_in_default>
151
- <show_in_website>1</show_in_website>
152
- <show_in_store>1</show_in_store>
153
- </max_product>
154
- <title translate="label" module="catalogextensions">
155
- <label>Title</label>
156
- <frontend_type>text</frontend_type>
157
- <sort_order>30</sort_order>
158
- <show_in_default>1</show_in_default>
159
- <show_in_website>1</show_in_website>
160
- <show_in_store>1</show_in_store>
161
- </title>
162
- </fields>
163
- </config4>
164
- <config5 translate="label" module="catalogextensions">
165
- <label>All Product Configuration</label>
166
- <frontend_type>text</frontend_type>
167
- <sort_order>50</sort_order>
168
- <show_in_default>1</show_in_default>
169
- <show_in_website>1</show_in_website>
170
- <show_in_store>1</show_in_store>
171
- <fields>
172
- <active translate="label">
173
- <label>Enabled</label>
174
- <frontend_type>select</frontend_type>
175
- <source_model>adminhtml/system_config_source_yesno</source_model>
176
- <sort_order>1</sort_order>
177
- <show_in_default>1</show_in_default>
178
- <show_in_website>1</show_in_website>
179
- <show_in_store>1</show_in_store>
180
- </active>
181
- <title translate="label" module="catalogextensions">
182
- <label>Title</label>
183
- <frontend_type>text</frontend_type>
184
- <sort_order>40</sort_order>
185
- <show_in_default>1</show_in_default>
186
- <show_in_website>1</show_in_website>
187
- <show_in_store>1</show_in_store>
188
- </title>
189
- </fields>
190
- </config5>
191
- <config6 translate="label" module="catalogextensions">
192
- <label>Promotional Product Configuration</label>
193
- <frontend_type>text</frontend_type>
194
- <sort_order>60</sort_order>
195
- <show_in_default>1</show_in_default>
196
- <show_in_website>1</show_in_website>
197
- <show_in_store>1</show_in_store>
198
- <fields>
199
- <active translate="label">
200
- <label>Enabled</label>
201
- <frontend_type>select</frontend_type>
202
- <source_model>adminhtml/system_config_source_yesno</source_model>
203
- <sort_order>1</sort_order>
204
- <show_in_default>1</show_in_default>
205
- <show_in_website>1</show_in_website>
206
- <show_in_store>1</show_in_store>
207
- </active>
208
- <max_product translate="label" module="catalogextensions">
209
- <label>Maximum No Of Products To Dispay On Home</label>
210
- <frontend_type>text</frontend_type>
211
- <validate>validate-greater-than-zero</validate>
212
- <sort_order>10</sort_order>
213
- <show_in_default>1</show_in_default>
214
- <show_in_website>1</show_in_website>
215
- <show_in_store>1</show_in_store>
216
- </max_product>
217
- <title translate="label" module="catalogextensions">
218
- <label>Title</label>
219
- <frontend_type>text</frontend_type>
220
- <sort_order>40</sort_order>
221
- <show_in_default>1</show_in_default>
222
- <show_in_website>1</show_in_website>
223
- <show_in_store>1</show_in_store>
224
- </title>
225
- </fields>
226
- </config6>
227
- <config7 translate="label" module="catalogextensions">
228
- <label>Recently Ordered Product Configuration</label>
229
- <frontend_type>text</frontend_type>
230
- <sort_order>70</sort_order>
231
- <show_in_default>1</show_in_default>
232
- <show_in_website>1</show_in_website>
233
- <show_in_store>1</show_in_store>
234
- <fields>
235
- <active translate="label">
236
- <label>Enabled</label>
237
- <frontend_type>select</frontend_type>
238
- <source_model>adminhtml/system_config_source_yesno</source_model>
239
- <sort_order>1</sort_order>
240
- <show_in_default>1</show_in_default>
241
- <show_in_website>1</show_in_website>
242
- <show_in_store>1</show_in_store>
243
- </active>
244
- <max_product translate="label" module="catalogextensions">
245
- <label>Maximum No Of Products To Dispay On Home</label>
246
- <frontend_type>text</frontend_type>
247
- <validate>validate-greater-than-zero</validate>
248
- <sort_order>10</sort_order>
249
- <show_in_default>1</show_in_default>
250
- <show_in_website>1</show_in_website>
251
- <show_in_store>1</show_in_store>
252
- </max_product>
253
- <title translate="label" module="catalogextensions">
254
- <label>Title</label>
255
- <frontend_type>text</frontend_type>
256
- <sort_order>40</sort_order>
257
- <show_in_default>1</show_in_default>
258
- <show_in_website>1</show_in_website>
259
- <show_in_store>1</show_in_store>
260
- </title>
261
- </fields>
262
- </config7>
263
- </groups>
264
- </catalogextensions>
265
- </sections>
266
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Catalogextensions/sql/catalogextensions_setup/mysql4-install-0.1.0.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
8
- $setup->addAttribute('catalog_product', 'featured', array(
9
- 'type' => 'int',
10
- 'backend_type' => 'int',
11
- 'backend' => '',
12
- 'frontend' => '',
13
- 'label' => 'Is Featured',
14
- 'input' => 'boolean',
15
- 'frontend_class' => '',
16
- 'source' => 'eav/entity_attribute_source_boolean',
17
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
18
- 'visible' => false,
19
- 'required' => false,
20
- 'user_defined' => true,
21
- 'default' => '',
22
- 'searchable' => false,
23
- 'filterable' => false,
24
- 'comparable' => false,
25
- 'visible_on_front' => false,
26
- 'unique' => false,
27
- 'apply_to' => '',
28
- 'is_configurable' => false
29
- ));
30
-
31
- $setup->addAttributeToSet('catalog_product', 'Default', 'General', 'featured');
32
-
33
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customerattributes/Block/Adminhtml/Attribute/Edit/Main/Abstract.php DELETED
@@ -1,238 +0,0 @@
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 DELETED
@@ -1,341 +0,0 @@
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 DELETED
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,68 +0,0 @@
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 DELETED
@@ -1,19 +0,0 @@
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 DELETED
@@ -1,106 +0,0 @@
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 DELETED
@@ -1,205 +0,0 @@
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 DELETED
@@ -1,36 +0,0 @@
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 DELETED
@@ -1,134 +0,0 @@
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 DELETED
@@ -1,38 +0,0 @@
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 DELETED
@@ -1,58 +0,0 @@
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 DELETED
@@ -1,94 +0,0 @@
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 DELETED
@@ -1,90 +0,0 @@
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 DELETED
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,68 +0,0 @@
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 DELETED
@@ -1,19 +0,0 @@
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 DELETED
@@ -1,106 +0,0 @@
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 DELETED
@@ -1,208 +0,0 @@
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 DELETED
@@ -1,36 +0,0 @@
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 DELETED
@@ -1,134 +0,0 @@
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 DELETED
@@ -1,38 +0,0 @@
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 DELETED
@@ -1,58 +0,0 @@
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 DELETED
@@ -1,94 +0,0 @@
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 DELETED
@@ -1,90 +0,0 @@
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 DELETED
@@ -1,19 +0,0 @@
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 DELETED
@@ -1,35 +0,0 @@
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 DELETED
@@ -1,27 +0,0 @@
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 DELETED
@@ -1,390 +0,0 @@
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 DELETED
@@ -1,39 +0,0 @@
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 DELETED
@@ -1,77 +0,0 @@
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 DELETED
@@ -1,42 +0,0 @@
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 DELETED
@@ -1,50 +0,0 @@
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 DELETED
@@ -1,15 +0,0 @@
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 DELETED
@@ -1,818 +0,0 @@
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 DELETED
@@ -1,383 +0,0 @@
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 DELETED
@@ -1,16 +0,0 @@
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 DELETED
@@ -1,433 +0,0 @@
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 DELETED
@@ -1,16 +0,0 @@
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 DELETED
@@ -1,57 +0,0 @@
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 DELETED
@@ -1,57 +0,0 @@
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 DELETED
@@ -1,188 +0,0 @@
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 DELETED
@@ -1,161 +0,0 @@
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 DELETED
@@ -1,43 +0,0 @@
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 DELETED
@@ -1,43 +0,0 @@
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 DELETED
@@ -1,13 +0,0 @@
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/Customtab/Block/Adminhtml/Customtab.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Customtab_Block_Adminhtml_Customtab extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_customtab';
7
- $this->_blockGroup = 'customtab';
8
- $this->_headerText = Mage::helper('customtab')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('customtab')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Block_Adminhtml_Customtab_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'customtab';
11
- $this->_controller = 'adminhtml_customtab';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('customtab')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('customtab')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('customtab_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'customtab_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'customtab_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('customtab_data') && Mage::registry('customtab_data')->getId() ) {
40
- return Mage::helper('customtab')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('customtab_data')->getTitle()));
41
- } else {
42
- return Mage::helper('customtab')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Block_Adminhtml_Customtab_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/Customtab/Block/Adminhtml/Customtab/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Block_Adminhtml_Customtab_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('customtab_form', array('legend'=>Mage::helper('customtab')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('customtab')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('customtab')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('customtab')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('customtab')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('customtab')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('customtab')->__('Content'),
43
- 'title' => Mage::helper('customtab')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getCustomtabData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getCustomtabData());
52
- Mage::getSingleton('adminhtml/session')->setCustomtabData(null);
53
- } elseif ( Mage::registry('customtab_data') ) {
54
- $form->setValues(Mage::registry('customtab_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Block_Adminhtml_Customtab_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('customtab_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('customtab')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('customtab')->__('Item Information'),
18
- 'title' => Mage::helper('customtab')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('customtab/adminhtml_customtab_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Block/Adminhtml/Customtab/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Block_Adminhtml_Customtab_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('customtabGrid');
9
- $this->setDefaultSort('customtab_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('customtab/customtab')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('customtab_id', array(
24
- 'header' => Mage::helper('customtab')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'customtab_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('customtab')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('customtab')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('customtab')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('customtab')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('customtab')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('customtab')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('customtab')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('customtab_id');
84
- $this->getMassactionBlock()->setFormFieldName('customtab');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('customtab')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('customtab')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('customtab/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('customtab')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('customtab')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Block/Customtab.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Customtab_Block_Customtab extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getCustomtab()
10
- {
11
- if (!$this->hasData('customtab')) {
12
- $this->setData('customtab', Mage::registry('customtab'));
13
- }
14
- return $this->getData('customtab');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Model/Customtab.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Model_Customtab extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('customtab/customtab');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Model/Mysql4/Customtab.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Model_Mysql4_Customtab extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the customtab_id refers to the key field in your database table.
8
- $this->_init('customtab/customtab', 'customtab_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Model/Mysql4/Customtab/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Model_Mysql4_Customtab_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('customtab/customtab');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_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('customtab')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('customtab')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/controllers/Adminhtml/CustomtabController.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Customtab_Adminhtml_CustomtabController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('customtab/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('customtab/customtab')->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('customtab_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('customtab/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('customtab/adminhtml_customtab_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('customtab/adminhtml_customtab_edit_tabs'));
41
-
42
- $this->renderLayout();
43
- } else {
44
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('customtab')->__('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('customtab/customtab');
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('customtab')->__('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('customtab')->__('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('customtab/customtab');
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
- $customtabIds = $this->getRequest()->getParam('customtab');
137
- if(!is_array($customtabIds)) {
138
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
- } else {
140
- try {
141
- foreach ($customtabIds as $customtabId) {
142
- $customtab = Mage::getModel('customtab/customtab')->load($customtabId);
143
- $customtab->delete();
144
- }
145
- Mage::getSingleton('adminhtml/session')->addSuccess(
146
- Mage::helper('adminhtml')->__(
147
- 'Total of %d record(s) were successfully deleted', count($customtabIds)
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
- $customtabIds = $this->getRequest()->getParam('customtab');
160
- if(!is_array($customtabIds)) {
161
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
- } else {
163
- try {
164
- foreach ($customtabIds as $customtabId) {
165
- $customtab = Mage::getSingleton('customtab/customtab')
166
- ->load($customtabId)
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($customtabIds))
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 = 'customtab.csv';
184
- $content = $this->getLayout()->createBlock('customtab/adminhtml_customtab_grid')
185
- ->getCsv();
186
-
187
- $this->_sendUploadResponse($fileName, $content);
188
- }
189
-
190
- public function exportXmlAction()
191
- {
192
- $fileName = 'customtab.xml';
193
- $content = $this->getLayout()->createBlock('customtab/adminhtml_customtab_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/Customtab/controllers/IndexController.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- class Tatva_Customtab_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- $this->loadLayout();
8
- $block = $this->getLayout()->createBlock(
9
- 'Mage_Core_Block_Template',
10
- 'customtab.customtab',
11
- array(
12
- 'template' => 'customtab/customtab.phtml'
13
- )
14
- );
15
- $this->getLayout()->getBlock('content')->append($block);
16
- //$this->getLayout()->getBlock('right')->insert($block, 'catalog.compare.sidebar', true);
17
- $this->_initLayoutMessages('core/session');
18
- $this->renderLayout();
19
-
20
-
21
-
22
-
23
- }
24
-
25
- public function postAction()
26
- {
27
-
28
- $postData = $this->getRequest()->getPost();
29
- //print_r($postData);exit;
30
- $model = Mage::getModel('customtab/customtab');
31
- //print_r($model);exit;
32
- $model->setCustomtabId($this->getRequest()->getParam('customtab_id'))
33
- ->setName($postData['name'])
34
- ->setEmailId($postData['email_id'])
35
- ->setContactno($postData['contactno'])
36
- ->save();
37
- Mage::getSingleton('customer/session')->addSuccess(Mage::helper('adminhtml')->__('Rule was successfully saved'));
38
-
39
- // $this->_redirect('*/*/index');'
40
- $this->_redirect('*/*/');
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/etc/adminhtml.xml DELETED
@@ -1,43 +0,0 @@
1
- <?xml version="1.0"?>
2
-
3
-
4
-
5
-
6
- <adminhtml>
7
- <menu>
8
- <customtab module="customtab">
9
- <title>Customtab</title>
10
- <sort_order>71</sort_order>
11
- <children>
12
- <items module="customtab">
13
- <title>Manage Items</title>
14
- <sort_order>0</sort_order>
15
- <action>customtab/adminhtml_customtab</action>
16
- </items>
17
- </children>
18
- </customtab>
19
- </menu>
20
- <acl>
21
- <resources>
22
- <all>
23
- <title>Allow Everything</title>
24
- </all>
25
- <admin>
26
- <children>
27
- <Tatva_Customtab>
28
- <title>Customtab Module</title>
29
- <sort_order>10</sort_order>
30
- </Tatva_Customtab>
31
- </children>
32
- </admin>
33
- </resources>
34
- </acl>
35
- <layout>
36
- <updates>
37
- <customtab>
38
- <file>customtab.xml</file>
39
- </customtab>
40
- </updates>
41
- </layout>
42
- </adminhtml>
43
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/etc/config.xml DELETED
@@ -1,120 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Customtab>
5
- <version>0.1.0</version>
6
- </Tatva_Customtab>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <customtab>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Customtab</module>
14
- <frontName>customtab</frontName>
15
- </args>
16
- </customtab>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <customtab>
21
- <file>customtab.xml</file>
22
- </customtab>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <customtab>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Customtab</module>
32
- <frontName>customtab</frontName>
33
- </args>
34
- </customtab>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <customtab module="customtab">
40
- <title>Customtab</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="customtab">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>customtab/adminhtml_customtab</action>
47
- </items>
48
- </children>
49
- </customtab>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <Tatva_Customtab>
59
- <title>Customtab Module</title>
60
- <sort_order>10</sort_order>
61
- </Tatva_Customtab>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- <layout>
67
- <updates>
68
- <customtab>
69
- <file>customtab.xml</file>
70
- </customtab>
71
- </updates>
72
- </layout>
73
- </adminhtml>
74
- <global>
75
- <models>
76
- <customtab>
77
- <class>Tatva_Customtab_Model</class>
78
- <resourceModel>customtab_mysql4</resourceModel>
79
- </customtab>
80
- <customtab_mysql4>
81
- <class>Tatva_Customtab_Model_Mysql4</class>
82
- <entities>
83
- <customtab>
84
- <table>customtab</table>
85
- </customtab>
86
- </entities>
87
- </customtab_mysql4>
88
- </models>
89
- <resources>
90
- <customtab_setup>
91
- <setup>
92
- <module>Tatva_Customtab</module>
93
- </setup>
94
- <connection>
95
- <use>core_setup</use>
96
- </connection>
97
- </customtab_setup>
98
- <customtab_write>
99
- <connection>
100
- <use>core_write</use>
101
- </connection>
102
- </customtab_write>
103
- <customtab_read>
104
- <connection>
105
- <use>core_read</use>
106
- </connection>
107
- </customtab_read>
108
- </resources>
109
- <blocks>
110
- <customtab>
111
- <class>Tatva_Customtab_Block</class>
112
- </customtab>
113
- </blocks>
114
- <helpers>
115
- <customtab>
116
- <class>Tatva_Customtab_Helper</class>
117
- </customtab>
118
- </helpers>
119
- </global>
120
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Customtab/sql/customtab_setup/mysql4-install-0.1.0.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('customtab')};
10
- CREATE TABLE {$this->getTable('customtab')} (
11
- `customtab_id` int(11) unsigned NOT NULL auto_increment,
12
- `name` varchar(255) NOT NULL default '',
13
- `email_id` varchar(255) NOT NULL default '',
14
- `contactno`varchar(255) NOT NULL default '',
15
-
16
- `created_time` datetime NULL,
17
- `update_time` datetime NULL,
18
- PRIMARY KEY (`customtab_id`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
- ");
22
-
23
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Downloadablereport_Block_Adminhtml_Downloadablereport extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_downloadablereport';
7
- $this->_blockGroup = 'downloadablereport';
8
- $this->_headerText = Mage::helper('downloadablereport')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('downloadablereport')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Block_Adminhtml_Downloadablereport_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'downloadablereport';
11
- $this->_controller = 'adminhtml_downloadablereport';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('downloadablereport')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('downloadablereport')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('downloadablereport_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'downloadablereport_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'downloadablereport_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('downloadablereport_data') && Mage::registry('downloadablereport_data')->getId() ) {
40
- return Mage::helper('downloadablereport')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('downloadablereport_data')->getTitle()));
41
- } else {
42
- return Mage::helper('downloadablereport')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Block_Adminhtml_Downloadablereport_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/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Block_Adminhtml_Downloadablereport_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('downloadablereport_form', array('legend'=>Mage::helper('downloadablereport')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('downloadablereport')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('downloadablereport')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('downloadablereport')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('downloadablereport')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('downloadablereport')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('downloadablereport')->__('Content'),
43
- 'title' => Mage::helper('downloadablereport')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getDownloadablereportData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getDownloadablereportData());
52
- Mage::getSingleton('adminhtml/session')->setDownloadablereportData(null);
53
- } elseif ( Mage::registry('downloadablereport_data') ) {
54
- $form->setValues(Mage::registry('downloadablereport_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Block_Adminhtml_Downloadablereport_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('downloadablereport_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('downloadablereport')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('downloadablereport')->__('Item Information'),
18
- 'title' => Mage::helper('downloadablereport')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('downloadablereport/adminhtml_downloadablereport_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Block/Adminhtml/Downloadablereport/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Block_Adminhtml_Downloadablereport_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('downloadablereportGrid');
9
- $this->setDefaultSort('downloadablereport_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('downloadablereport/downloadablereport')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('downloadablereport_id', array(
24
- 'header' => Mage::helper('downloadablereport')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'downloadablereport_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('downloadablereport')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('downloadablereport')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('downloadablereport')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('downloadablereport')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('downloadablereport')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('downloadablereport')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('downloadablereport')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('downloadablereport_id');
84
- $this->getMassactionBlock()->setFormFieldName('downloadablereport');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('downloadablereport')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('downloadablereport')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('downloadablereport/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('downloadablereport')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('downloadablereport')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Block/Downloadablereport.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Downloadablereport_Block_Downloadablereport extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getDownloadablereport()
10
- {
11
- if (!$this->hasData('downloadablereport')) {
12
- $this->setData('downloadablereport', Mage::registry('downloadablereport'));
13
- }
14
- return $this->getData('downloadablereport');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Model/Downloadablereport.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Model_Downloadablereport extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('downloadablereport/downloadablereport');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Model/Mysql4/Downloadablereport.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Model_Mysql4_Downloadablereport extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the downloadablereport_id refers to the key field in your database table.
8
- $this->_init('downloadablereport/downloadablereport', 'downloadablereport_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Model/Mysql4/Downloadablereport/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Model_Mysql4_Downloadablereport_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('downloadablereport/downloadablereport');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_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('downloadablereport')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('downloadablereport')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/controllers/Adminhtml/DownloadablereportController.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Downloadablereport_Adminhtml_DownloadablereportController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('downloadablereport/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('downloadablereport/downloadablereport')->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('downloadablereport_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('downloadablereport/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('downloadablereport/adminhtml_downloadablereport_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('downloadablereport/adminhtml_downloadablereport_edit_tabs'));
41
-
42
- $this->renderLayout();
43
- } else {
44
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('downloadablereport')->__('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('downloadablereport/downloadablereport');
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('downloadablereport')->__('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('downloadablereport')->__('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('downloadablereport/downloadablereport');
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
- $downloadablereportIds = $this->getRequest()->getParam('downloadablereport');
137
- if(!is_array($downloadablereportIds)) {
138
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
- } else {
140
- try {
141
- foreach ($downloadablereportIds as $downloadablereportId) {
142
- $downloadablereport = Mage::getModel('downloadablereport/downloadablereport')->load($downloadablereportId);
143
- $downloadablereport->delete();
144
- }
145
- Mage::getSingleton('adminhtml/session')->addSuccess(
146
- Mage::helper('adminhtml')->__(
147
- 'Total of %d record(s) were successfully deleted', count($downloadablereportIds)
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
- $downloadablereportIds = $this->getRequest()->getParam('downloadablereport');
160
- if(!is_array($downloadablereportIds)) {
161
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
- } else {
163
- try {
164
- foreach ($downloadablereportIds as $downloadablereportId) {
165
- $downloadablereport = Mage::getSingleton('downloadablereport/downloadablereport')
166
- ->load($downloadablereportId)
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($downloadablereportIds))
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 = 'downloadablereport.csv';
184
- $content = $this->getLayout()->createBlock('downloadablereport/adminhtml_downloadablereport_grid')
185
- ->getCsv();
186
-
187
- $this->_sendUploadResponse($fileName, $content);
188
- }
189
-
190
- public function exportXmlAction()
191
- {
192
- $fileName = 'downloadablereport.xml';
193
- $content = $this->getLayout()->createBlock('downloadablereport/adminhtml_downloadablereport_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/Downloadablereport/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Tatva_Downloadablereport_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/downloadablereport?id=15
11
- * or
12
- * http://site.com/downloadablereport/id/15
13
- */
14
- /*
15
- $downloadablereport_id = $this->getRequest()->getParam('id');
16
-
17
- if($downloadablereport_id != null && $downloadablereport_id != '') {
18
- $downloadablereport = Mage::getModel('downloadablereport/downloadablereport')->load($downloadablereport_id)->getData();
19
- } else {
20
- $downloadablereport = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($downloadablereport == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $downloadablereportTable = $resource->getTableName('downloadablereport');
32
-
33
- $select = $read->select()
34
- ->from($downloadablereportTable,array('downloadablereport_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $downloadablereport = $read->fetchRow($select);
39
- }
40
- Mage::register('downloadablereport', $downloadablereport);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/etc/config.xml DELETED
@@ -1,120 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Downloadablereport>
5
- <version>0.1.0</version>
6
- </Tatva_Downloadablereport>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <downloadablereport>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Downloadablereport</module>
14
- <frontName>downloadablereport</frontName>
15
- </args>
16
- </downloadablereport>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <downloadablereport>
21
- <file>downloadablereport.xml</file>
22
- </downloadablereport>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <downloadablereport>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Downloadablereport</module>
32
- <frontName>downloadablereport</frontName>
33
- </args>
34
- </downloadablereport>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <downloadablereport module="downloadablereport">
40
- <title>Downloadablereport</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="downloadablereport">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>downloadablereport/adminhtml_downloadablereport</action>
47
- </items>
48
- </children>
49
- </downloadablereport>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <Tatva_Downloadablereport>
59
- <title>Downloadablereport Module</title>
60
- <sort_order>10</sort_order>
61
- </Tatva_Downloadablereport>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- <layout>
67
- <updates>
68
- <downloadablereport>
69
- <file>downloadablereport.xml</file>
70
- </downloadablereport>
71
- </updates>
72
- </layout>
73
- </adminhtml>
74
- <global>
75
- <models>
76
- <downloadablereport>
77
- <class>Tatva_Downloadablereport_Model</class>
78
- <resourceModel>downloadablereport_mysql4</resourceModel>
79
- </downloadablereport>
80
- <downloadablereport_mysql4>
81
- <class>Tatva_Downloadablereport_Model_Mysql4</class>
82
- <entities>
83
- <downloadablereport>
84
- <table>downloadablereport</table>
85
- </downloadablereport>
86
- </entities>
87
- </downloadablereport_mysql4>
88
- </models>
89
- <resources>
90
- <downloadablereport_setup>
91
- <setup>
92
- <module>Tatva_Downloadablereport</module>
93
- </setup>
94
- <connection>
95
- <use>core_setup</use>
96
- </connection>
97
- </downloadablereport_setup>
98
- <downloadablereport_write>
99
- <connection>
100
- <use>core_write</use>
101
- </connection>
102
- </downloadablereport_write>
103
- <downloadablereport_read>
104
- <connection>
105
- <use>core_read</use>
106
- </connection>
107
- </downloadablereport_read>
108
- </resources>
109
- <blocks>
110
- <downloadablereport>
111
- <class>Tatva_Downloadablereport_Block</class>
112
- </downloadablereport>
113
- </blocks>
114
- <helpers>
115
- <downloadablereport>
116
- <class>Tatva_Downloadablereport_Helper</class>
117
- </downloadablereport>
118
- </helpers>
119
- </global>
120
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Downloadablereport/sql/downloadablereport_setup/mysql4-install-0.1.0.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('downloadablereport')};
10
- CREATE TABLE {$this->getTable('downloadablereport')} (
11
- `downloadablereport_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `filename` varchar(255) NOT NULL default '',
14
- `content` text NOT NULL default '',
15
- `status` smallint(6) NOT NULL default '0',
16
- `created_time` datetime NULL,
17
- `update_time` datetime NULL,
18
- PRIMARY KEY (`downloadablereport_id`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
- ");
22
-
23
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Editorder_Block_Adminhtml_Editorder extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_editorder';
7
- $this->_blockGroup = 'editorder';
8
- $this->_headerText = Mage::helper('editorder')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('editorder')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Block_Adminhtml_Editorder_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'editorder';
11
- $this->_controller = 'adminhtml_editorder';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('editorder')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('editorder')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('editorder_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'editorder_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'editorder_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('editorder_data') && Mage::registry('editorder_data')->getId() ) {
40
- return Mage::helper('editorder')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('editorder_data')->getTitle()));
41
- } else {
42
- return Mage::helper('editorder')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Block_Adminhtml_Editorder_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/Editorder/Block/Adminhtml/Editorder/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Block_Adminhtml_Editorder_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('editorder_form', array('legend'=>Mage::helper('editorder')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('editorder')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('editorder')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('editorder')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('editorder')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('editorder')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('editorder')->__('Content'),
43
- 'title' => Mage::helper('editorder')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getEditorderData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getEditorderData());
52
- Mage::getSingleton('adminhtml/session')->setEditorderData(null);
53
- } elseif ( Mage::registry('editorder_data') ) {
54
- $form->setValues(Mage::registry('editorder_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Block_Adminhtml_Editorder_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('editorder_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('editorder')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('editorder')->__('Item Information'),
18
- 'title' => Mage::helper('editorder')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('editorder/adminhtml_editorder_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Block/Adminhtml/Editorder/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Block_Adminhtml_Editorder_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('editorderGrid');
9
- $this->setDefaultSort('editorder_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('editorder/editorder')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('editorder_id', array(
24
- 'header' => Mage::helper('editorder')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'editorder_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('editorder')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('editorder')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('editorder')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('editorder')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('editorder')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('editorder')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('editorder')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('editorder_id');
84
- $this->getMassactionBlock()->setFormFieldName('editorder');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('editorder')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('editorder')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('editorder/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('editorder')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('editorder')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Block/Editorder.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Editorder_Block_Editorder extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getEditorder()
10
- {
11
- if (!$this->hasData('editorder')) {
12
- $this->setData('editorder', Mage::registry('editorder'));
13
- }
14
- return $this->getData('editorder');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Model/Editorder.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Model_Editorder extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('editorder/editorder');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Model/Mysql4/Editorder.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Model_Mysql4_Editorder extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the editorder_id refers to the key field in your database table.
8
- $this->_init('editorder/editorder', 'editorder_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Model/Mysql4/Editorder/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Model_Mysql4_Editorder_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('editorder/editorder');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_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('editorder')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('editorder')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/controllers/Adminhtml/EditorderController.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Editorder_Adminhtml_EditorderController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('editorder/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('editorder/editorder')->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('editorder_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('editorder/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('editorder/adminhtml_editorder_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('editorder/adminhtml_editorder_edit_tabs'));
41
-
42
- $this->renderLayout();
43
- } else {
44
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('editorder')->__('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('editorder/editorder');
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('editorder')->__('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('editorder')->__('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('editorder/editorder');
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
- $editorderIds = $this->getRequest()->getParam('editorder');
137
- if(!is_array($editorderIds)) {
138
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
- } else {
140
- try {
141
- foreach ($editorderIds as $editorderId) {
142
- $editorder = Mage::getModel('editorder/editorder')->load($editorderId);
143
- $editorder->delete();
144
- }
145
- Mage::getSingleton('adminhtml/session')->addSuccess(
146
- Mage::helper('adminhtml')->__(
147
- 'Total of %d record(s) were successfully deleted', count($editorderIds)
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
- $editorderIds = $this->getRequest()->getParam('editorder');
160
- if(!is_array($editorderIds)) {
161
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
- } else {
163
- try {
164
- foreach ($editorderIds as $editorderId) {
165
- $editorder = Mage::getSingleton('editorder/editorder')
166
- ->load($editorderId)
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($editorderIds))
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 = 'editorder.csv';
184
- $content = $this->getLayout()->createBlock('editorder/adminhtml_editorder_grid')
185
- ->getCsv();
186
-
187
- $this->_sendUploadResponse($fileName, $content);
188
- }
189
-
190
- public function exportXmlAction()
191
- {
192
- $fileName = 'editorder.xml';
193
- $content = $this->getLayout()->createBlock('editorder/adminhtml_editorder_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/Editorder/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Tatva_Editorder_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/editorder?id=15
11
- * or
12
- * http://site.com/editorder/id/15
13
- */
14
- /*
15
- $editorder_id = $this->getRequest()->getParam('id');
16
-
17
- if($editorder_id != null && $editorder_id != '') {
18
- $editorder = Mage::getModel('editorder/editorder')->load($editorder_id)->getData();
19
- } else {
20
- $editorder = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($editorder == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $editorderTable = $resource->getTableName('editorder');
32
-
33
- $select = $read->select()
34
- ->from($editorderTable,array('editorder_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $editorder = $read->fetchRow($select);
39
- }
40
- Mage::register('editorder', $editorder);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/etc/config.xml DELETED
@@ -1,120 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Editorder>
5
- <version>0.1.0</version>
6
- </Tatva_Editorder>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <editorder>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Editorder</module>
14
- <frontName>editorder</frontName>
15
- </args>
16
- </editorder>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <editorder>
21
- <file>editorder.xml</file>
22
- </editorder>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <editorder>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Editorder</module>
32
- <frontName>editorder</frontName>
33
- </args>
34
- </editorder>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <editorder module="editorder">
40
- <title>Editorder</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="editorder">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>editorder/adminhtml_editorder</action>
47
- </items>
48
- </children>
49
- </editorder>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <Tatva_Editorder>
59
- <title>Editorder Module</title>
60
- <sort_order>10</sort_order>
61
- </Tatva_Editorder>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- <layout>
67
- <updates>
68
- <editorder>
69
- <file>editorder.xml</file>
70
- </editorder>
71
- </updates>
72
- </layout>
73
- </adminhtml>
74
- <global>
75
- <models>
76
- <editorder>
77
- <class>Tatva_Editorder_Model</class>
78
- <resourceModel>editorder_mysql4</resourceModel>
79
- </editorder>
80
- <editorder_mysql4>
81
- <class>Tatva_Editorder_Model_Mysql4</class>
82
- <entities>
83
- <editorder>
84
- <table>editorder</table>
85
- </editorder>
86
- </entities>
87
- </editorder_mysql4>
88
- </models>
89
- <resources>
90
- <editorder_setup>
91
- <setup>
92
- <module>Tatva_Editorder</module>
93
- </setup>
94
- <connection>
95
- <use>core_setup</use>
96
- </connection>
97
- </editorder_setup>
98
- <editorder_write>
99
- <connection>
100
- <use>core_write</use>
101
- </connection>
102
- </editorder_write>
103
- <editorder_read>
104
- <connection>
105
- <use>core_read</use>
106
- </connection>
107
- </editorder_read>
108
- </resources>
109
- <blocks>
110
- <editorder>
111
- <class>Tatva_Editorder_Block</class>
112
- </editorder>
113
- </blocks>
114
- <helpers>
115
- <editorder>
116
- <class>Tatva_Editorder_Helper</class>
117
- </editorder>
118
- </helpers>
119
- </global>
120
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Editorder/sql/editorder_setup/mysql4-install-0.1.0.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('editorder')};
10
- CREATE TABLE {$this->getTable('editorder')} (
11
- `editorder_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `filename` varchar(255) NOT NULL default '',
14
- `content` text NOT NULL default '',
15
- `status` smallint(6) NOT NULL default '0',
16
- `created_time` datetime NULL,
17
- `update_time` datetime NULL,
18
- PRIMARY KEY (`editorder_id`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
- ");
22
-
23
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Exportallimage/Model/Convert/Adapter/Product.php DELETED
@@ -1,256 +0,0 @@
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 DELETED
@@ -1,77 +0,0 @@
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 DELETED
@@ -1,22 +0,0 @@
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 DELETED
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,55 +0,0 @@
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 DELETED
@@ -1,19 +0,0 @@
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 DELETED
@@ -1,72 +0,0 @@
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 DELETED
@@ -1,24 +0,0 @@
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 DELETED
@@ -1,138 +0,0 @@
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 DELETED
@@ -1,39 +0,0 @@
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 DELETED
@@ -1,26 +0,0 @@
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 DELETED
@@ -1,36 +0,0 @@
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 DELETED
@@ -1,60 +0,0 @@
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 DELETED
@@ -1,65 +0,0 @@
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 DELETED
@@ -1,15 +0,0 @@
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 DELETED
@@ -1,214 +0,0 @@
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 DELETED
@@ -1,25 +0,0 @@
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 DELETED
@@ -1,38 +0,0 @@
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 DELETED
@@ -1,136 +0,0 @@
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 DELETED
@@ -1,29 +0,0 @@
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 DELETED
@@ -1,32 +0,0 @@
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/Gallery/Block/Adminhtml/Gallery.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Gallery_Block_Adminhtml_Gallery extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_gallery';
7
- $this->_blockGroup = 'gallery';
8
- $this->_headerText = Mage::helper('gallery')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('gallery')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Block_Adminhtml_Gallery_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'gallery';
11
- $this->_controller = 'adminhtml_gallery';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('gallery')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('gallery')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('gallery_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'gallery_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'gallery_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('gallery_data') && Mage::registry('gallery_data')->getId() ) {
40
- return Mage::helper('gallery')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('gallery_data')->getTitle()));
41
- } else {
42
- return Mage::helper('gallery')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Block_Adminhtml_Gallery_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/Gallery/Block/Adminhtml/Gallery/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Block_Adminhtml_Gallery_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('gallery_form', array('legend'=>Mage::helper('gallery')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('gallery')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('gallery')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('gallery')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('gallery')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('gallery')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('gallery')->__('Content'),
43
- 'title' => Mage::helper('gallery')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getGalleryData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getGalleryData());
52
- Mage::getSingleton('adminhtml/session')->setGalleryData(null);
53
- } elseif ( Mage::registry('gallery_data') ) {
54
- $form->setValues(Mage::registry('gallery_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Block_Adminhtml_Gallery_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('gallery_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('gallery')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('gallery')->__('Item Information'),
18
- 'title' => Mage::helper('gallery')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('gallery/adminhtml_gallery_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Block/Adminhtml/Gallery/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Block_Adminhtml_Gallery_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('galleryGrid');
9
- $this->setDefaultSort('gallery_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('gallery/gallery')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('gallery_id', array(
24
- 'header' => Mage::helper('gallery')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'gallery_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('gallery')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('gallery')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('gallery')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('gallery')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('gallery')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('gallery')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('gallery')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('gallery_id');
84
- $this->getMassactionBlock()->setFormFieldName('gallery');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('gallery')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('gallery')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('gallery/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('gallery')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('gallery')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Block/Gallery.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Gallery_Block_Gallery extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getGallery()
10
- {
11
- if (!$this->hasData('gallery')) {
12
- $this->setData('gallery', Mage::registry('gallery'));
13
- }
14
- return $this->getData('gallery');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Model/Gallery.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Model_Gallery extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('gallery/gallery');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Model/Mysql4/Gallery.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Model_Mysql4_Gallery extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the gallery_id refers to the key field in your database table.
8
- $this->_init('gallery/gallery', 'gallery_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Model/Mysql4/Gallery/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Model_Mysql4_Gallery_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('gallery/gallery');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_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('gallery')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('gallery')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/controllers/Adminhtml/GalleryController.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Gallery_Adminhtml_GalleryController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('gallery/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('gallery/gallery')->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('gallery_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('gallery/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('gallery/adminhtml_gallery_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('gallery/adminhtml_gallery_edit_tabs'));
41
-
42
- $this->renderLayout();
43
- } else {
44
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('gallery')->__('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('gallery/gallery');
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('gallery')->__('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('gallery')->__('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('gallery/gallery');
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
- $galleryIds = $this->getRequest()->getParam('gallery');
137
- if(!is_array($galleryIds)) {
138
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
- } else {
140
- try {
141
- foreach ($galleryIds as $galleryId) {
142
- $gallery = Mage::getModel('gallery/gallery')->load($galleryId);
143
- $gallery->delete();
144
- }
145
- Mage::getSingleton('adminhtml/session')->addSuccess(
146
- Mage::helper('adminhtml')->__(
147
- 'Total of %d record(s) were successfully deleted', count($galleryIds)
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
- $galleryIds = $this->getRequest()->getParam('gallery');
160
- if(!is_array($galleryIds)) {
161
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
- } else {
163
- try {
164
- foreach ($galleryIds as $galleryId) {
165
- $gallery = Mage::getSingleton('gallery/gallery')
166
- ->load($galleryId)
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($galleryIds))
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 = 'gallery.csv';
184
- $content = $this->getLayout()->createBlock('gallery/adminhtml_gallery_grid')
185
- ->getCsv();
186
-
187
- $this->_sendUploadResponse($fileName, $content);
188
- }
189
-
190
- public function exportXmlAction()
191
- {
192
- $fileName = 'gallery.xml';
193
- $content = $this->getLayout()->createBlock('gallery/adminhtml_gallery_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/Gallery/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Tatva_Gallery_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/gallery?id=15
11
- * or
12
- * http://site.com/gallery/id/15
13
- */
14
- /*
15
- $gallery_id = $this->getRequest()->getParam('id');
16
-
17
- if($gallery_id != null && $gallery_id != '') {
18
- $gallery = Mage::getModel('gallery/gallery')->load($gallery_id)->getData();
19
- } else {
20
- $gallery = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($gallery == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $galleryTable = $resource->getTableName('gallery');
32
-
33
- $select = $read->select()
34
- ->from($galleryTable,array('gallery_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $gallery = $read->fetchRow($select);
39
- }
40
- Mage::register('gallery', $gallery);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/etc/config.xml DELETED
@@ -1,120 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Gallery>
5
- <version>0.1.0</version>
6
- </Tatva_Gallery>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <gallery>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Gallery</module>
14
- <frontName>gallery</frontName>
15
- </args>
16
- </gallery>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <gallery>
21
- <file>gallery.xml</file>
22
- </gallery>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <gallery>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Gallery</module>
32
- <frontName>gallery</frontName>
33
- </args>
34
- </gallery>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <gallery module="gallery">
40
- <title>Gallery</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="gallery">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>gallery/adminhtml_gallery</action>
47
- </items>
48
- </children>
49
- </gallery>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <Tatva_Gallery>
59
- <title>Gallery Module</title>
60
- <sort_order>10</sort_order>
61
- </Tatva_Gallery>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- <layout>
67
- <updates>
68
- <gallery>
69
- <file>gallery.xml</file>
70
- </gallery>
71
- </updates>
72
- </layout>
73
- </adminhtml>
74
- <global>
75
- <models>
76
- <gallery>
77
- <class>Tatva_Gallery_Model</class>
78
- <resourceModel>gallery_mysql4</resourceModel>
79
- </gallery>
80
- <gallery_mysql4>
81
- <class>Tatva_Gallery_Model_Mysql4</class>
82
- <entities>
83
- <gallery>
84
- <table>gallery</table>
85
- </gallery>
86
- </entities>
87
- </gallery_mysql4>
88
- </models>
89
- <resources>
90
- <gallery_setup>
91
- <setup>
92
- <module>Tatva_Gallery</module>
93
- </setup>
94
- <connection>
95
- <use>core_setup</use>
96
- </connection>
97
- </gallery_setup>
98
- <gallery_write>
99
- <connection>
100
- <use>core_write</use>
101
- </connection>
102
- </gallery_write>
103
- <gallery_read>
104
- <connection>
105
- <use>core_read</use>
106
- </connection>
107
- </gallery_read>
108
- </resources>
109
- <blocks>
110
- <gallery>
111
- <class>Tatva_Gallery_Block</class>
112
- </gallery>
113
- </blocks>
114
- <helpers>
115
- <gallery>
116
- <class>Tatva_Gallery_Helper</class>
117
- </gallery>
118
- </helpers>
119
- </global>
120
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Gallery/sql/gallery_setup/mysql4-install-0.1.0.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('gallery')};
10
- CREATE TABLE {$this->getTable('gallery')} (
11
- `gallery_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `filename` varchar(255) NOT NULL default '',
14
- `content` text NOT NULL default '',
15
- `status` smallint(6) NOT NULL default '0',
16
- `created_time` datetime NULL,
17
- `update_time` datetime NULL,
18
- PRIMARY KEY (`gallery_id`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
- ");
22
-
23
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Note.txt DELETED
@@ -1,92 +0,0 @@
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/Orderreport/Block/Adminhtml/Orderreport.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Orderreport_Block_Adminhtml_Orderreport extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_orderreport';
7
- $this->_blockGroup = 'orderreport';
8
- $this->_headerText = Mage::helper('orderreport')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('orderreport')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Block_Adminhtml_Orderreport_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'orderreport';
11
- $this->_controller = 'adminhtml_orderreport';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('orderreport')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('orderreport')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('orderreport_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'orderreport_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'orderreport_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('orderreport_data') && Mage::registry('orderreport_data')->getId() ) {
40
- return Mage::helper('orderreport')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('orderreport_data')->getTitle()));
41
- } else {
42
- return Mage::helper('orderreport')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Block_Adminhtml_Orderreport_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/Orderreport/Block/Adminhtml/Orderreport/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Block_Adminhtml_Orderreport_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('orderreport_form', array('legend'=>Mage::helper('orderreport')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('orderreport')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('orderreport')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('orderreport')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('orderreport')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('orderreport')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('orderreport')->__('Content'),
43
- 'title' => Mage::helper('orderreport')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getOrderreportData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getOrderreportData());
52
- Mage::getSingleton('adminhtml/session')->setOrderreportData(null);
53
- } elseif ( Mage::registry('orderreport_data') ) {
54
- $form->setValues(Mage::registry('orderreport_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Block_Adminhtml_Orderreport_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('orderreport_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('orderreport')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('orderreport')->__('Item Information'),
18
- 'title' => Mage::helper('orderreport')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('orderreport/adminhtml_orderreport_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Block/Adminhtml/Orderreport/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Block_Adminhtml_Orderreport_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('orderreportGrid');
9
- $this->setDefaultSort('orderreport_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('orderreport/orderreport')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('orderreport_id', array(
24
- 'header' => Mage::helper('orderreport')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'orderreport_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('orderreport')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('orderreport')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('orderreport')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('orderreport')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('orderreport')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('orderreport')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('orderreport')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('orderreport_id');
84
- $this->getMassactionBlock()->setFormFieldName('orderreport');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('orderreport')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('orderreport')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('orderreport/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('orderreport')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('orderreport')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Block/Orderreport.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Orderreport_Block_Orderreport extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getOrderreport()
10
- {
11
- if (!$this->hasData('orderreport')) {
12
- $this->setData('orderreport', Mage::registry('orderreport'));
13
- }
14
- return $this->getData('orderreport');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Model/Mysql4/Orderreport.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Model_Mysql4_Orderreport extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the orderreport_id refers to the key field in your database table.
8
- $this->_init('orderreport/orderreport', 'orderreport_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Model/Mysql4/Orderreport/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Model_Mysql4_Orderreport_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('orderreport/orderreport');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Model/Orderreport.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Model_Orderreport extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('orderreport/orderreport');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_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('orderreport')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('orderreport')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/controllers/Adminhtml/OrderreportController.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Orderreport_Adminhtml_OrderreportController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('orderreport/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('orderreport/orderreport')->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('orderreport_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('orderreport/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('orderreport/adminhtml_orderreport_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('orderreport/adminhtml_orderreport_edit_tabs'));
41
-
42
- $this->renderLayout();
43
- } else {
44
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('orderreport')->__('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('orderreport/orderreport');
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('orderreport')->__('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('orderreport')->__('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('orderreport/orderreport');
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
- $orderreportIds = $this->getRequest()->getParam('orderreport');
137
- if(!is_array($orderreportIds)) {
138
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
- } else {
140
- try {
141
- foreach ($orderreportIds as $orderreportId) {
142
- $orderreport = Mage::getModel('orderreport/orderreport')->load($orderreportId);
143
- $orderreport->delete();
144
- }
145
- Mage::getSingleton('adminhtml/session')->addSuccess(
146
- Mage::helper('adminhtml')->__(
147
- 'Total of %d record(s) were successfully deleted', count($orderreportIds)
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
- $orderreportIds = $this->getRequest()->getParam('orderreport');
160
- if(!is_array($orderreportIds)) {
161
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
- } else {
163
- try {
164
- foreach ($orderreportIds as $orderreportId) {
165
- $orderreport = Mage::getSingleton('orderreport/orderreport')
166
- ->load($orderreportId)
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($orderreportIds))
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 = 'orderreport.csv';
184
- $content = $this->getLayout()->createBlock('orderreport/adminhtml_orderreport_grid')
185
- ->getCsv();
186
-
187
- $this->_sendUploadResponse($fileName, $content);
188
- }
189
-
190
- public function exportXmlAction()
191
- {
192
- $fileName = 'orderreport.xml';
193
- $content = $this->getLayout()->createBlock('orderreport/adminhtml_orderreport_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/Orderreport/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Tatva_Orderreport_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/orderreport?id=15
11
- * or
12
- * http://site.com/orderreport/id/15
13
- */
14
- /*
15
- $orderreport_id = $this->getRequest()->getParam('id');
16
-
17
- if($orderreport_id != null && $orderreport_id != '') {
18
- $orderreport = Mage::getModel('orderreport/orderreport')->load($orderreport_id)->getData();
19
- } else {
20
- $orderreport = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($orderreport == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $orderreportTable = $resource->getTableName('orderreport');
32
-
33
- $select = $read->select()
34
- ->from($orderreportTable,array('orderreport_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $orderreport = $read->fetchRow($select);
39
- }
40
- Mage::register('orderreport', $orderreport);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/etc/config.xml DELETED
@@ -1,120 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Orderreport>
5
- <version>0.1.0</version>
6
- </Tatva_Orderreport>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <orderreport>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Orderreport</module>
14
- <frontName>orderreport</frontName>
15
- </args>
16
- </orderreport>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <orderreport>
21
- <file>orderreport.xml</file>
22
- </orderreport>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <orderreport>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Orderreport</module>
32
- <frontName>orderreport</frontName>
33
- </args>
34
- </orderreport>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <orderreport module="orderreport">
40
- <title>Orderreport</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="orderreport">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>orderreport/adminhtml_orderreport</action>
47
- </items>
48
- </children>
49
- </orderreport>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <Tatva_Orderreport>
59
- <title>Orderreport Module</title>
60
- <sort_order>10</sort_order>
61
- </Tatva_Orderreport>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- <layout>
67
- <updates>
68
- <orderreport>
69
- <file>orderreport.xml</file>
70
- </orderreport>
71
- </updates>
72
- </layout>
73
- </adminhtml>
74
- <global>
75
- <models>
76
- <orderreport>
77
- <class>Tatva_Orderreport_Model</class>
78
- <resourceModel>orderreport_mysql4</resourceModel>
79
- </orderreport>
80
- <orderreport_mysql4>
81
- <class>Tatva_Orderreport_Model_Mysql4</class>
82
- <entities>
83
- <orderreport>
84
- <table>orderreport</table>
85
- </orderreport>
86
- </entities>
87
- </orderreport_mysql4>
88
- </models>
89
- <resources>
90
- <orderreport_setup>
91
- <setup>
92
- <module>Tatva_Orderreport</module>
93
- </setup>
94
- <connection>
95
- <use>core_setup</use>
96
- </connection>
97
- </orderreport_setup>
98
- <orderreport_write>
99
- <connection>
100
- <use>core_write</use>
101
- </connection>
102
- </orderreport_write>
103
- <orderreport_read>
104
- <connection>
105
- <use>core_read</use>
106
- </connection>
107
- </orderreport_read>
108
- </resources>
109
- <blocks>
110
- <orderreport>
111
- <class>Tatva_Orderreport_Block</class>
112
- </orderreport>
113
- </blocks>
114
- <helpers>
115
- <orderreport>
116
- <class>Tatva_Orderreport_Helper</class>
117
- </orderreport>
118
- </helpers>
119
- </global>
120
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Orderreport/sql/orderreport_setup/mysql4-install-0.1.0.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('orderreport')};
10
- CREATE TABLE {$this->getTable('orderreport')} (
11
- `orderreport_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `filename` varchar(255) NOT NULL default '',
14
- `content` text NOT NULL default '',
15
- `status` smallint(6) NOT NULL default '0',
16
- `created_time` datetime NULL,
17
- `update_time` datetime NULL,
18
- PRIMARY KEY (`orderreport_id`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
- ");
22
-
23
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Block/Adminhtml/Press.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Press_Block_Adminhtml_Press extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_press';
7
- $this->_blockGroup = 'press';
8
- $this->_headerText = Mage::helper('press')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('press')->__('Add Item');
10
- parent::__construct();
11
- }
12
-
13
- /*public function getHeaderCssClass()
14
- {
15
- return '';
16
- }*/
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Block_Adminhtml_Press_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'press';
11
- $this->_controller = 'adminhtml_press';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('press')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('press')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('press_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'press_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'press_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('press_data') && Mage::registry('press_data')->getId() ) {
40
- return Mage::helper('press')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('press_data')->getTitle()));
41
- } else {
42
- return Mage::helper('press')->__('Add Item');
43
- }
44
- }
45
-
46
- /*public function getHeaderCssClass()
47
- {
48
- return '';
49
- }*/
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Block_Adminhtml_Press_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/Press/Block/Adminhtml/Press/Edit/Tab/Form.php DELETED
@@ -1,149 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Block_Adminhtml_Press_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
- {
5
- /**
6
- * Load Wysiwyg on demand and Prepare layout
7
- */
8
-
9
- protected function _prepareForm()
10
- {
11
-
12
- $form = new Varien_Data_Form();
13
- $form->setHtmlIdPrefix('press_');
14
- $this->setForm($form);
15
- $fieldset = $form->addFieldset('press_form', array('legend'=>Mage::helper('press')->__('Item information')));
16
- $press = Mage::getModel('press/press')->load( $this->getRequest()->getParam('id') );
17
- $model = Mage::registry('press_data');
18
- $_model = Mage::registry('press_data')->getData();
19
- $_data = Mage::getResourceModel('press/press')->edit_form($_model['press_id']);
20
-
21
- if ( Mage::registry('press_data') ) {
22
- $model_data = Mage::registry('press_data')->getData();
23
- $model_data["stores"] = $_data;
24
- $model_data["store_id"] = $_data;
25
- }
26
-
27
- $after_html = '';
28
- $afterpdf_html = '';
29
- if( $press->getDisplaypicture() )
30
- {
31
- $path = Mage::getBaseUrl('media')."press/".$press->getDisplaypicture();
32
- $after_html = '<a href="'.$path.'" target="_blank"><img height="20" width="20" alt="'.$press->getDisplaypicture().'" title="'.$press->getDisplaypicture().'" id="press" src="'.$path.'" style="vertical-align: middle;"/></a>';
33
- }
34
- if( $press->getPdffile() )
35
- {
36
- $path = Mage::getBaseUrl('media')."press/pdf/".$press->getPdffile();
37
- $afterpdf_html = '<a target="_blank" href="'.$path.'">'.$press->getPdffile().'</a>';
38
- }
39
- if( $press->getDate() )
40
- {
41
- $date = $press->getDate();
42
- }
43
-
44
- $fieldset->addField('title', 'text', array(
45
- 'label' => Mage::helper('press')->__('Title'),
46
- 'class' => 'required-entry',
47
- 'required' => true,
48
- 'name' => 'title',
49
- ));
50
-
51
- $element = $fieldset->addField('date', 'date', array(
52
- 'name' => 'date',
53
- 'title' => Mage::helper('press')->__('Press Date'),
54
- 'label' => Mage::helper('press')->__('Press Date'),
55
- 'image' => $this->getSkinUrl('images/grid-cal.gif'),
56
- 'format' => 'yyyy-MM-dd',
57
- 'class' => 'required-entry validate-date',
58
- 'required' => true,
59
-
60
- ));
61
-
62
-
63
- $fieldset->addField('displaypicture', 'file', array(
64
- 'label' => Mage::helper('press')->__('Display Picture'),
65
- 'required' => false,
66
- 'class' => 'validate-imagefile',
67
- 'name' => 'displaypicture',
68
- 'after_element_html' => $after_html,
69
- ));
70
-
71
- $fieldset->addField('pdffile', 'file', array(
72
- 'label' => Mage::helper('press')->__('PDF Attachment'),
73
- 'required' => false,
74
- 'class' => 'validate-pdffile',
75
- 'name' => 'pdffile',
76
- 'after_element_html' => $afterpdf_html,
77
- ));
78
-
79
- /*$fieldset->addField('pressvideo', 'file', array(
80
- 'label' => Mage::helper('press')->__('Press Video'),
81
- 'required' => false,
82
- //'class' => 'validate-flvfile',
83
- 'name' => 'pressvideo',
84
- ));*/
85
-
86
- $fieldset->addField('pressvideo', 'text', array(
87
- 'label' => Mage::helper('press')->__('Press Video Link'),
88
- 'required' => false,
89
- 'class' => 'validate-url',
90
- 'name' => 'pressvideo',
91
- ));
92
-
93
- $fieldset->addField('status', 'select', array(
94
- 'label' => Mage::helper('press')->__('Status'),
95
- 'name' => 'status',
96
- 'values' => array(
97
- array(
98
- 'value' => 1,
99
- 'label' => Mage::helper('press')->__('Enabled'),
100
- ),
101
-
102
- array(
103
- 'value' => 2,
104
- 'label' => Mage::helper('press')->__('Disabled'),
105
- ),
106
- ),
107
- ));
108
-
109
-
110
- $fieldset->addField('store_id', 'multiselect', array(
111
- 'name' => 'stores[]',
112
- 'label' => Mage::helper('cms')->__('Store View'),
113
- 'title' => Mage::helper('cms')->__('Store View'),
114
- 'required' => true,
115
- 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
116
- ));
117
-
118
-
119
-
120
- $fieldset->addField('content', 'editor', array(
121
- 'name' => 'content',
122
- 'label' => Mage::helper('press')->__('Content'),
123
- 'title' => Mage::helper('press')->__('Content'),
124
- 'style' => 'height:25em;width:40em;',
125
- //'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
126
- 'wysiwyg' => true,
127
- 'required' => true,
128
- ));
129
-
130
-
131
-
132
-
133
- if ( Mage::getSingleton('adminhtml/session')->getPressData() )
134
- {
135
- $form->setValues(Mage::getSingleton('adminhtml/session')->getPressData());
136
- Mage::getSingleton('adminhtml/session')->setPressData(null);
137
- } elseif ( Mage::registry('press_data') ) {
138
- $form->setValues($model_data);
139
- }
140
-
141
-
142
- return parent::_prepareForm();
143
- }
144
-
145
- public function getCustomerGroups()
146
- {
147
- $table = $this->getTable('customer_group');
148
- }
149
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Block/Adminhtml/Press/Edit/Tabs.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Block_Adminhtml_Press_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('press_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('press')->__('Item Information'));
12
- }
13
-
14
- protected function _prepareLayout()
15
- {
16
- $return = parent::_prepareLayout();
17
- $this->addTab('form_section', array(
18
- 'label' => Mage::helper('press')->__('Item Information'),
19
- 'title' => Mage::helper('press')->__('Item Information'),
20
- 'content' => $this->getLayout()->createBlock('press/adminhtml_press_edit_tab_form')->toHtml(),
21
- ));
22
-
23
- return $return;
24
- }
25
-
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Block/Adminhtml/Press/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Block_Adminhtml_Press_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('pressGrid');
9
- $this->setDefaultSort('press_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('press/press')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('press_id', array(
24
- 'header' => Mage::helper('press')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'press_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('press')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('press')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('press')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('press')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('press')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('press')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('press')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('press_id');
84
- $this->getMassactionBlock()->setFormFieldName('press');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('press')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('press')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('press/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('press')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('press')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Block/Press.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- class Tatva_Press_Block_Press extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getPressCollection()
10
- {
11
- $store_id = Mage::app()->getStore()->getId();
12
- $collection = Mage::getModel('press/press')->getCollection()->addFieldToFilter('status',1)->setOrder('date','DESC');
13
- $_id = Mage::getResourceModel('press/press')->getStoreId($store_id);
14
- $final_collection = array();
15
- foreach($collection as $_collection)
16
- {
17
- if(array_key_exists($_collection['press_id'],$_id))
18
- {
19
- $final_collection[] = $_collection->getData();
20
- }
21
- }
22
- //echo "<pre/>";print_r($final_collection);exit;
23
- return $final_collection;
24
- }
25
-
26
- public function getPressView()
27
- {
28
- $pressItem = Mage::getModel('press/press')->getCollection()->addFieldToFilter('press_id',$this->getRequest()->getParam('id'));
29
- return $pressItem;
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Mysql4/Press.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Model_Mysql4_Press extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the press_id refers to the key field in your database table.
8
- $this->_init('press/press', 'press_id');
9
- }
10
-
11
- public function insert($a,$b,$c='')
12
- {
13
- $count = count($b);
14
- $write = Mage::getSingleton('core/resource')->getConnection('core_write');
15
- if($c!='')
16
- {
17
- $write->query("delete from press_store where press_id = ".$c);
18
- }
19
- for($i=0 ; $i<$count ; $i++)
20
- {
21
- $write->query("insert into press_store(press_id,store_id) values ($a,$b[$i])");
22
- }
23
- }
24
-
25
- public function edit_form($id)
26
- {
27
- $query = "select store_id from press,press_store where press_store.press_id ='" .$id. "'";
28
- $read = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($query);
29
- $final_aray = array();
30
- foreach($read as $_read)
31
- {
32
- $final_aray[] = $_read['store_id'];
33
- }
34
- return $final_aray;
35
- }
36
-
37
- public function getStoreId($id)
38
- {
39
- $query = "select * from press_store where press_store.store_id ='" .$id. "' or press_store.store_id=0";
40
- $read = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($query);
41
- $final_aray = array();
42
- foreach($read as $_read)
43
- {
44
- $final_aray[$_read['press_id']] = $_read['store_id'];
45
- }
46
- return $final_aray;
47
- }
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Mysql4/Press/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Model_Mysql4_Press_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('press/press');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Mysql4/Press_store.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_store_Model_Mysql4_Press_store extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the press_store_id refers to the key field in your database table.
8
- $this->_init('press_store/press_store', 'press_store_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Mysql4/Press_store/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_store_Model_Mysql4_Press_store_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('press_store/press_store');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Press.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Model_Press extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('press/press');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Press_store.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_store_Model_Press_store extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('press_store/press_store');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_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('press')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('press')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/controllers/Adminhtml/PressController.php DELETED
@@ -1,275 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Press_Adminhtml_PressController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('press/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('press/press')->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('press_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('press/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('press/adminhtml_press_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('press/adminhtml_press_edit_tabs'));
41
- if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
42
- $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
43
- }
44
- $this->renderLayout();
45
- } else {
46
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('press')->__('Item does not exist'));
47
- $this->_redirect('*/*/');
48
- }
49
- }
50
-
51
- public function newAction() {
52
- $this->_forward('edit');
53
- }
54
-
55
- public function saveAction() {
56
- if ($data = $this->getRequest()->getPost()) {
57
-
58
- if(isset($_FILES['displaypicture']['name']) && $_FILES['displaypicture']['name'] != '') {
59
- try {
60
- /* Starting upload */
61
- $uploader = new Varien_File_Uploader('displaypicture');
62
-
63
- // Any extention would work
64
- $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
65
- $uploader->setAllowRenameFiles(false);
66
-
67
- // Set the file upload mode
68
- // false -> get the file directly in the specified folder
69
- // true -> get the file in the product like folders
70
- // (file.jpg will go in something like /media/f/i/file.jpg)
71
- $uploader->setFilesDispersion(false);
72
- $filedet = pathinfo($_FILES['displaypicture']['name']);
73
-
74
- // We set media/press as the upload dir
75
- $path = Mage::getBaseDir('media') . DS .'press'.DS;
76
- $filedet['displaypicture'] = str_replace(" ","",$filedet['filename']);
77
- $uploader->save($path, str_replace(" ","_",$filedet['displaypicture'].time().'.'.$filedet['extension']));
78
- // actual path of image
79
- $imageUrl = Mage::getBaseDir('media').DS."press".DS.$filedet['displaypicture'].time().'.'.$filedet['extension'];
80
-
81
- // path of the resized image to be saved
82
- // here, the resized image is saved in media/resized folder
83
- $imageResized = Mage::getBaseDir('media').DS."press".DS."thumbnail".DS.$filedet['displaypicture'].time().'.'.$filedet['extension'];
84
- $store = Mage::app()->getStore();
85
- $code = $store->getCode();
86
- // resize image only if the image file exists and the resized image file doesn't exist
87
- // the image is resized proportionally with the width/height 135px
88
- if (!file_exists($imageResized)&&file_exists($imageUrl)) :
89
- $imageObj = new Varien_Image($imageUrl);
90
- $imageObj->constrainOnly(TRUE);
91
- $imageObj->keepAspectRatio(TRUE);
92
- $imageObj->keepFrame(FALSE);
93
- $imageObj->resize(Mage::getStoreConfig('press/press/imagewidth',$code),Mage::getStoreConfig('press/press/imageheight',$code));
94
- $imageObj->save($imageResized);
95
- endif;
96
-
97
- } catch (Exception $e) {
98
- Mage::getSingleton('adminhtml/session')->addError('Only .jpg, .jpeg, .png, .gif file extension is allowed for Display Picture');
99
- Mage::getSingleton('adminhtml/session')->setFormData($data_files);
100
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
101
- return;
102
- }
103
-
104
- //this way the name is saved in DB
105
- $data['displaypicture'] = str_replace(" ","_",$filedet['displaypicture'].time().'.'.$filedet['extension']);
106
-
107
- }
108
-
109
- if(isset($_FILES['pdffile']['name']) && $_FILES['pdffile']['name'] != '') {
110
- try {
111
- /* Starting upload */
112
- $uploader1 = new Varien_File_Uploader('pdffile');
113
-
114
- // Any extention would work
115
- $uploader1->setAllowedExtensions(array('pdf'));
116
- $uploader1->setAllowRenameFiles(false);
117
- $uploader1->setFilesDispersion(false);
118
- $filedet1 = pathinfo($_FILES['pdffile']['name']);
119
- $filedet1['pdffile'] = str_replace(" ","",$filedet1['filename']);
120
-
121
- // We set media/press as the upload dir
122
- $path = Mage::getBaseDir('media') . DS .'press'.DS.'pdf'.DS;
123
-
124
- $uploader1->save($path, str_replace(" ","_",$filedet1['pdffile'].time().'.'.$filedet1['extension']));
125
-
126
- } catch (Exception $e) {
127
- Mage::getSingleton('adminhtml/session')->addError('Only .pdf file extension is allowed for Attachement');
128
- Mage::getSingleton('adminhtml/session')->setFormData($data_files);
129
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
130
- return;
131
- }
132
-
133
- //this way the name is saved in DB
134
- $data['pdffile'] = str_replace(" ","_",$filedet1['pdffile'].time().'.'.$filedet1['extension']);
135
-
136
- }
137
-
138
- $model = Mage::getModel('press/press');
139
- $model1 = Mage::getModel('press/press_store');
140
-
141
-
142
- $data['store_id'] = $value;
143
- $model->setData($data)->setId($this->getRequest()->getParam('id'));
144
-
145
- $model->setData($data)
146
- ->setId($this->getRequest()->getParam('id'));
147
-
148
- try {
149
-
150
- $model->save();
151
- $_press_id = $model['press_id'];
152
- $_store = $model['stores'];
153
- if(!$this->getRequest()->getParam('id'))
154
- Mage::getResourceModel('press/press')->insert($_press_id,$_store);
155
- else
156
- Mage::getResourceModel('press/press')->insert($_press_id,$_store,$this->getRequest()->getParam('id'));
157
-
158
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('press')->__('Item was successfully saved'));
159
- Mage::getSingleton('adminhtml/session')->setFormData(false);
160
-
161
- if ($this->getRequest()->getParam('back')) {
162
- $this->_redirect('*/*/edit', array('id' => $model->getId()));
163
- return;
164
- }
165
- $this->_redirect('*/*/');
166
- return;
167
- } catch (Exception $e) {
168
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
169
- Mage::getSingleton('adminhtml/session')->setFormData($data);
170
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
171
- return;
172
- }
173
- }
174
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('press')->__('Unable to find item to save'));
175
- $this->_redirect('*/*/');
176
- }
177
-
178
- public function deleteAction() {
179
- if( $this->getRequest()->getParam('id') > 0 ) {
180
- try {
181
- $model = Mage::getModel('press/press');
182
-
183
- $model->setId($this->getRequest()->getParam('id'))
184
- ->delete();
185
-
186
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
187
- $this->_redirect('*/*/');
188
- } catch (Exception $e) {
189
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
190
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
191
- }
192
- }
193
- $this->_redirect('*/*/');
194
- }
195
-
196
- public function massDeleteAction() {
197
- $pressIds = $this->getRequest()->getParam('press');
198
- if(!is_array($pressIds)) {
199
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
200
- } else {
201
- try {
202
- foreach ($pressIds as $pressId) {
203
- $press = Mage::getModel('press/press')->load($pressId);
204
- $press->delete();
205
- }
206
- Mage::getSingleton('adminhtml/session')->addSuccess(
207
- Mage::helper('adminhtml')->__(
208
- 'Total of %d record(s) were successfully deleted', count($pressIds)
209
- )
210
- );
211
- } catch (Exception $e) {
212
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
213
- }
214
- }
215
- $this->_redirect('*/*/index');
216
- }
217
-
218
- public function massStatusAction()
219
- {
220
- $pressIds = $this->getRequest()->getParam('press');
221
- if(!is_array($pressIds)) {
222
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
223
- } else {
224
- try {
225
- foreach ($pressIds as $pressId) {
226
- $press = Mage::getSingleton('press/press')
227
- ->load($pressId)
228
- ->setStatus($this->getRequest()->getParam('status'))
229
- ->setIsMassupdate(true)
230
- ->save();
231
- }
232
- $this->_getSession()->addSuccess(
233
- $this->__('Total of %d record(s) were successfully updated', count($pressIds))
234
- );
235
- } catch (Exception $e) {
236
- $this->_getSession()->addError($e->getMessage());
237
- }
238
- }
239
- $this->_redirect('*/*/index');
240
- }
241
-
242
- public function exportCsvAction()
243
- {
244
- $fileName = 'press.csv';
245
- $content = $this->getLayout()->createBlock('press/adminhtml_press_grid')
246
- ->getCsv();
247
-
248
- $this->_sendUploadResponse($fileName, $content);
249
- }
250
-
251
- public function exportXmlAction()
252
- {
253
- $fileName = 'press.xml';
254
- $content = $this->getLayout()->createBlock('press/adminhtml_press_grid')
255
- ->getXml();
256
-
257
- $this->_sendUploadResponse($fileName, $content);
258
- }
259
-
260
- protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
261
- {
262
- $response = $this->getResponse();
263
- $response->setHeader('HTTP/1.1 200 OK','');
264
- $response->setHeader('Pragma', 'public', true);
265
- $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
266
- $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
267
- $response->setHeader('Last-Modified', date('r'));
268
- $response->setHeader('Accept-Ranges', 'bytes');
269
- $response->setHeader('Content-Length', strlen($content));
270
- $response->setHeader('Content-type', $contentType);
271
- $response->setBody($content);
272
- $response->sendResponse();
273
- die;
274
- }
275
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/controllers/IndexController.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- class Tatva_Press_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
- $store = Mage::app()->getStore();
7
- $code = $store->getCode();
8
- $enable = Mage::getStoreConfig('press/press/enable',$code);
9
- if($enable == 0)
10
- {
11
- $this->_redirect('');
12
- return;
13
- }
14
-
15
- $this->loadLayout();
16
- $this->getLayout()->getBlock('head')->setTitle('Press');
17
- $this->renderLayout();
18
- }
19
-
20
- public function viewAction()
21
- {
22
- $store = Mage::app()->getStore();
23
- $code = $store->getCode();
24
- $enable = Mage::getStoreConfig('press/press/enable',$code);
25
- if($enable == 0)
26
- {
27
- $this->_redirect('');
28
- return;
29
- }
30
-
31
- $this->loadLayout();
32
- $this->getLayout()->getBlock('head')->setTitle('Press View');
33
- $this->renderLayout();
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/etc/adminhtml.xml DELETED
@@ -1,51 +0,0 @@
1
- <?xml version="1.0"?>
2
- <adminhtml>
3
- <menu>
4
- <press module="press">
5
- <title>Press</title>
6
- <sort_order>71</sort_order>
7
- <children>
8
- <items module="press">
9
- <title>Manage Items</title>
10
- <sort_order>0</sort_order>
11
- <action>press/adminhtml_press</action>
12
- </items>
13
- </children>
14
- </press>
15
- </menu>
16
- <acl>
17
- <resources>
18
- <all>
19
- <title>Allow Everything</title>
20
- </all>
21
- <admin>
22
- <children>
23
- <children>
24
- <Tatva_Press>
25
- <title>Press Module</title>
26
- <sort_order>10</sort_order>
27
- </Tatva_Press>
28
- </children>
29
- <system>
30
- <children>
31
- <config>
32
- <children>
33
- <press translate="title" module="press">
34
- <title>Press</title>
35
- </press>
36
- </children>
37
- </config>
38
- </children>
39
- </system>
40
- </children>
41
- </admin>
42
- </resources>
43
- </acl>
44
- <layout>
45
- <updates>
46
- <press>
47
- <file>press.xml</file>
48
- </press>
49
- </updates>
50
- </layout>
51
- </adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/etc/config.xml DELETED
@@ -1,151 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Press>
5
- <version>0.1.2</version>
6
- </Tatva_Press>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <press>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Press</module>
14
- <frontName>press</frontName>
15
- </args>
16
- </press>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <press>
21
- <file>press.xml</file>
22
- </press>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <press>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Press</module>
32
- <frontName>press</frontName>
33
- </args>
34
- </press>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <press module="press">
40
- <title>Press</title>
41
- <sort_order>90</sort_order>
42
- <children>
43
- <items module="press">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>press/adminhtml_press</action>
47
- </items>
48
- </children>
49
- </press>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <children>
59
- <Tatva_Press>
60
- <title>Press Module</title>
61
- <sort_order>10</sort_order>
62
- </Tatva_Press>
63
- </children>
64
- <system>
65
- <children>
66
- <config>
67
- <children>
68
- <press translate="title" module="press">
69
- <title>Press</title>
70
- </press>
71
- </children>
72
- </config>
73
- </children>
74
- </system>
75
- </children>
76
- </admin>
77
- </resources>
78
- </acl>
79
- <layout>
80
- <updates>
81
- <press>
82
- <file>press.xml</file>
83
- </press>
84
- </updates>
85
- </layout>
86
- </adminhtml>
87
- <global>
88
- <models>
89
- <press>
90
- <class>Tatva_Press_Model</class>
91
- <resourceModel>press_mysql4</resourceModel>
92
- </press>
93
- <press_mysql4>
94
- <class>Tatva_Press_Model_Mysql4</class>
95
- <entities>
96
- <press>
97
- <table>press</table>
98
- </press>
99
- <press_store>
100
- <table>press_store</table>
101
- </press_store>
102
- </entities>
103
- </press_mysql4>
104
- </models>
105
- <resources>
106
- <press_setup>
107
- <setup>
108
- <module>Tatva_Press</module>
109
- </setup>
110
- <connection>
111
- <use>core_setup</use>
112
- </connection>
113
- </press_setup>
114
- <press_write>
115
- <connection>
116
- <use>core_write</use>
117
- </connection>
118
- </press_write>
119
- <press_read>
120
- <connection>
121
- <use>core_read</use>
122
- </connection>
123
- </press_read>
124
- </resources>
125
- <blocks>
126
- <press>
127
- <class>Tatva_Press_Block</class>
128
- </press>
129
- </blocks>
130
- <helpers>
131
- <press>
132
- <class>Tatva_Press_Helper</class>
133
- </press>
134
- </helpers>
135
- </global>
136
- <default>
137
- <press>
138
- <press>
139
- <enable>1</enable>
140
- <displayvideo>1</displayvideo>
141
- <videoheight>600</videoheight>
142
- <videowidth>700</videowidth>
143
- <displaypdf>1</displaypdf>
144
- <displaytext>1</displaytext>
145
- <displayimage>1</displayimage>
146
- <imagewidth>500</imagewidth>
147
- <imageheight>400</imageheight>
148
- </press>
149
- </press>
150
- </default>
151
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/etc/system.xml DELETED
@@ -1,114 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <press translate="label" module="press">
5
- <label>Press</label>
6
- <sort_order>100</sort_order>
7
- </press>
8
- </tabs>
9
- <sections>
10
- <press translate="label" module="press">
11
- <label>Press Configuration</label>
12
- <class>separator-top</class>
13
- <tab>press</tab>
14
- <frontend_type>text</frontend_type>
15
- <sort_order>1000</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
- <press translate="label" module="press">
21
- <label>Press Configuration</label>
22
- <frontend_type>text</frontend_type>
23
- <sort_order>50</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
- <enable translate="label" module="press">
29
- <label>Enable</label>
30
- <frontend_type>select</frontend_type>
31
- <source_model>adminhtml/system_config_source_yesno</source_model>
32
- <sort_order>1</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
- </enable>
37
- <displayvideo translate="label" module="press">
38
- <label>Display Video Link</label>
39
- <frontend_type>select</frontend_type>
40
- <source_model>adminhtml/system_config_source_yesno</source_model>
41
- <sort_order>2</sort_order>
42
- <show_in_default>1</show_in_default>
43
- <show_in_website>1</show_in_website>
44
- <show_in_store>1</show_in_store>
45
- </displayvideo>
46
- <videoheight translate="label" module="press">
47
- <label>Video Height</label>
48
- <frontend_type>text</frontend_type>
49
- <validate>validate-digits validate-greater-than-zero</validate>
50
- <sort_order>3</sort_order>
51
- <show_in_default>1</show_in_default>
52
- <show_in_website>1</show_in_website>
53
- <show_in_store>1</show_in_store>
54
- </videoheight>
55
- <videowidth translate="label" module="press">
56
- <label>Video Width</label>
57
- <frontend_type>text</frontend_type>
58
- <validate>validate-digits validate-greater-than-zero</validate>
59
- <sort_order>4</sort_order>
60
- <show_in_default>1</show_in_default>
61
- <show_in_website>1</show_in_website>
62
- <show_in_store>1</show_in_store>
63
- </videowidth>
64
- <displaypdf translate="label" module="press">
65
- <label>Display Download Link</label>
66
- <frontend_type>select</frontend_type>
67
- <source_model>adminhtml/system_config_source_yesno</source_model>
68
- <sort_order>5</sort_order>
69
- <show_in_default>1</show_in_default>
70
- <show_in_website>1</show_in_website>
71
- <show_in_store>1</show_in_store>
72
- </displaypdf>
73
- <displaytext translate="label" module="press">
74
- <label>Display Content</label>
75
- <frontend_type>select</frontend_type>
76
- <source_model>adminhtml/system_config_source_yesno</source_model>
77
- <sort_order>6</sort_order>
78
- <show_in_default>1</show_in_default>
79
- <show_in_website>1</show_in_website>
80
- <show_in_store>1</show_in_store>
81
- </displaytext>
82
- <displayimage translate="label" module="press">
83
- <label>Display Image</label>
84
- <frontend_type>select</frontend_type>
85
- <source_model>adminhtml/system_config_source_yesno</source_model>
86
- <sort_order>7</sort_order>
87
- <show_in_default>1</show_in_default>
88
- <show_in_website>1</show_in_website>
89
- <show_in_store>1</show_in_store>
90
- </displayimage>
91
- <imagewidth translate="label" module="press">
92
- <label>Image Width</label>
93
- <frontend_type>text</frontend_type>
94
- <validate>validate-digits validate-greater-than-zero</validate>
95
- <sort_order>10</sort_order>
96
- <show_in_default>1</show_in_default>
97
- <show_in_website>1</show_in_website>
98
- <show_in_store>1</show_in_store>
99
- </imagewidth>
100
- <imageheight translate="label" module="press">
101
- <label>Image Height</label>
102
- <frontend_type>text</frontend_type>
103
- <validate>validate-digits validate-greater-than-zero</validate>
104
- <sort_order>11</sort_order>
105
- <show_in_default>1</show_in_default>
106
- <show_in_website>1</show_in_website>
107
- <show_in_store>1</show_in_store>
108
- </imageheight>
109
- </fields>
110
- </press>
111
- </groups>
112
- </press>
113
- </sections>
114
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/sql/press_setup/mysql4-install-0.1.0.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS `press`;
10
- CREATE TABLE `press` (
11
- `press_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `displaypicture` varchar(255) NOT NULL default '',
14
- `content` text NOT NULL default '',
15
- `status` smallint(6) NOT NULL default '0',
16
- PRIMARY KEY (`press_id`)
17
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18
-
19
- ");
20
-
21
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/sql/press_setup/mysql4-upgrade-0.1.0-0.1.1.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- ALTER TABLE `press`
10
- ADD `date` date NOT NULL AFTER `press_id`,
11
- ADD `pdffile` varchar(255) NOT NULL AFTER `displaypicture`,
12
- ADD `pressvideo` varchar(255) NOT NULL AFTER `pdffile`,
13
- ");
14
-
15
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Press/sql/press_setup/mysql4-upgrade-0.1.1-0.1.2.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- CREATE TABLE `press_store` (
10
- `press_id` int(11) unsigned NOT NULL,
11
- `store_id` smallint(5) unsigned NOT NULL,
12
- KEY `press_id` (`press_id`),
13
- KEY `store_id` (`store_id`),
14
- CONSTRAINT `press_store_ibfk_2` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
15
- CONSTRAINT `press_store_ibfk` FOREIGN KEY (`press_id`) REFERENCES `press` (`press_id`) ON DELETE CASCADE ON UPDATE CASCADE
16
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
17
-
18
- ");
19
-
20
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Tatva_Promotionalbanner_Block_Adminhtml_Promotionalbanner extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_promotionalbanner';
7
- $this->_blockGroup = 'promotionalbanner';
8
- $this->_headerText = Mage::helper('promotionalbanner')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('promotionalbanner')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Block_Adminhtml_Promotionalbanner_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'promotionalbanner';
11
- $this->_controller = 'adminhtml_promotionalbanner';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('promotionalbanner')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('promotionalbanner')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('promotionalbanner_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'promotionalbanner_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'promotionalbanner_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('promotionalbanner_data') && Mage::registry('promotionalbanner_data')->getId() ) {
40
- return Mage::helper('promotionalbanner')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('promotionalbanner_data')->getTitle()));
41
- } else {
42
- return Mage::helper('promotionalbanner')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Block_Adminhtml_Promotionalbanner_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/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit/Tab/Form.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Block_Adminhtml_Promotionalbanner_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('promotionalbanner_form', array('legend'=>Mage::helper('promotionalbanner')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('promotionalbanner')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('promotionalbanner')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('position', 'select', array(
25
- 'label' => Mage::helper('promotionalbanner')->__('Banner Position'),
26
- 'required' => false,
27
- 'name' => 'position',
28
- 'values' => array(''),
29
- ));
30
-
31
- $fieldset->addField('sort_order', 'text', array(
32
- 'label' => Mage::helper('promotionalbanner')->__('Sort'),
33
- 'required' => false,
34
- 'name' => 'position',
35
- ));
36
-
37
- $fieldset->addField('status', 'select', array(
38
- 'label' => Mage::helper('promotionalbanner')->__('Status'),
39
- 'name' => 'status',
40
- 'values' => array(
41
- array(
42
- 'value' => 1,
43
- 'label' => Mage::helper('promotionalbanner')->__('Enabled'),
44
- ),
45
-
46
- array(
47
- 'value' => 2,
48
- 'label' => Mage::helper('promotionalbanner')->__('Disabled'),
49
- ),
50
- ),
51
- ));
52
-
53
- $fieldset->addField('content', 'editor', array(
54
- 'name' => 'content',
55
- 'label' => Mage::helper('promotionalbanner')->__('Content'),
56
- 'title' => Mage::helper('promotionalbanner')->__('Content'),
57
- 'style' => 'width:700px; height:500px;',
58
- 'wysiwyg' => false,
59
- 'required' => true,
60
- ));
61
-
62
- if ( Mage::getSingleton('adminhtml/session')->getPromotionalbannerData() )
63
- {
64
- $form->setValues(Mage::getSingleton('adminhtml/session')->getPromotionalbannerData());
65
- Mage::getSingleton('adminhtml/session')->setPromotionalbannerData(null);
66
- } elseif ( Mage::registry('promotionalbanner_data') ) {
67
- $form->setValues(Mage::registry('promotionalbanner_data')->getData());
68
- }
69
- return parent::_prepareForm();
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Block_Adminhtml_Promotionalbanner_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('promotionalbanner_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('promotionalbanner')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('promotionalbanner')->__('Item Information'),
18
- 'title' => Mage::helper('promotionalbanner')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('promotionalbanner/adminhtml_promotionalbanner_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Block/Adminhtml/Promotionalbanner/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Block_Adminhtml_Promotionalbanner_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('promotionalbannerGrid');
9
- $this->setDefaultSort('promotionalbanner_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('promotionalbanner/promotionalbanner')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('promotionalbanner_id', array(
24
- 'header' => Mage::helper('promotionalbanner')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'promotionalbanner_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('promotionalbanner')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('promotionalbanner')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('promotionalbanner')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('promotionalbanner')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('promotionalbanner')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('promotionalbanner')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('promotionalbanner')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('promotionalbanner_id');
84
- $this->getMassactionBlock()->setFormFieldName('promotionalbanner');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('promotionalbanner')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('promotionalbanner')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('promotionalbanner/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('promotionalbanner')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('promotionalbanner')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Block/Promotionalbanner.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Tatva_Promotionalbanner_Block_Promotionalbanner extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getPromotionalbanner()
10
- {
11
- if (!$this->hasData('promotionalbanner')) {
12
- $this->setData('promotionalbanner', Mage::registry('promotionalbanner'));
13
- }
14
- return $this->getData('promotionalbanner');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Model/Mysql4/Promotionalbanner.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Model_Mysql4_Promotionalbanner extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the promotionalbanner_id refers to the key field in your database table.
8
- $this->_init('promotionalbanner/promotionalbanner', 'promotionalbanner_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Model/Mysql4/Promotionalbanner/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Model_Mysql4_Promotionalbanner_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('promotionalbanner/promotionalbanner');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Model/Promotionalbanner.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Model_Promotionalbanner extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('promotionalbanner/promotionalbanner');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_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('promotionalbanner')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('promotionalbanner')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/controllers/Adminhtml/PromotionalbannerController.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- class Tatva_Promotionalbanner_Adminhtml_PromotionalbannerController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('promotionalbanner/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('promotionalbanner/promotionalbanner')->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('promotionalbanner_data', $model);
30
-
31
- $this->loadLayout();
32
- $this->_setActiveMenu('promotionalbanner/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('promotionalbanner/adminhtml_promotionalbanner_edit'))
40
- ->_addLeft($this->getLayout()->createBlock('promotionalbanner/adminhtml_promotionalbanner_edit_tabs'));
41
-
42
- $this->renderLayout();
43
- } else {
44
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('promotionalbanner')->__('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('promotionalbanner/promotionalbanner');
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('promotionalbanner')->__('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('promotionalbanner')->__('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('promotionalbanner/promotionalbanner');
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
- $promotionalbannerIds = $this->getRequest()->getParam('promotionalbanner');
137
- if(!is_array($promotionalbannerIds)) {
138
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
- } else {
140
- try {
141
- foreach ($promotionalbannerIds as $promotionalbannerId) {
142
- $promotionalbanner = Mage::getModel('promotionalbanner/promotionalbanner')->load($promotionalbannerId);
143
- $promotionalbanner->delete();
144
- }
145
- Mage::getSingleton('adminhtml/session')->addSuccess(
146
- Mage::helper('adminhtml')->__(
147
- 'Total of %d record(s) were successfully deleted', count($promotionalbannerIds)
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
- $promotionalbannerIds = $this->getRequest()->getParam('promotionalbanner');
160
- if(!is_array($promotionalbannerIds)) {
161
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
- } else {
163
- try {
164
- foreach ($promotionalbannerIds as $promotionalbannerId) {
165
- $promotionalbanner = Mage::getSingleton('promotionalbanner/promotionalbanner')
166
- ->load($promotionalbannerId)
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($promotionalbannerIds))
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 = 'promotionalbanner.csv';
184
- $content = $this->getLayout()->createBlock('promotionalbanner/adminhtml_promotionalbanner_grid')
185
- ->getCsv();
186
-
187
- $this->_sendUploadResponse($fileName, $content);
188
- }
189
-
190
- public function exportXmlAction()
191
- {
192
- $fileName = 'promotionalbanner.xml';
193
- $content = $this->getLayout()->createBlock('promotionalbanner/adminhtml_promotionalbanner_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/Promotionalbanner/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Tatva_Promotionalbanner_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/promotionalbanner?id=15
11
- * or
12
- * http://site.com/promotionalbanner/id/15
13
- */
14
- /*
15
- $promotionalbanner_id = $this->getRequest()->getParam('id');
16
-
17
- if($promotionalbanner_id != null && $promotionalbanner_id != '') {
18
- $promotionalbanner = Mage::getModel('promotionalbanner/promotionalbanner')->load($promotionalbanner_id)->getData();
19
- } else {
20
- $promotionalbanner = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($promotionalbanner == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $promotionalbannerTable = $resource->getTableName('promotionalbanner');
32
-
33
- $select = $read->select()
34
- ->from($promotionalbannerTable,array('promotionalbanner_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $promotionalbanner = $read->fetchRow($select);
39
- }
40
- Mage::register('promotionalbanner', $promotionalbanner);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/etc/config.xml DELETED
@@ -1,120 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Tatva_Promotionalbanner>
5
- <version>0.1.0</version>
6
- </Tatva_Promotionalbanner>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <promotionalbanner>
11
- <use>standard</use>
12
- <args>
13
- <module>Tatva_Promotionalbanner</module>
14
- <frontName>promotionalbanner</frontName>
15
- </args>
16
- </promotionalbanner>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <promotionalbanner>
21
- <file>promotionalbanner.xml</file>
22
- </promotionalbanner>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <promotionalbanner>
29
- <use>admin</use>
30
- <args>
31
- <module>Tatva_Promotionalbanner</module>
32
- <frontName>promotionalbanner</frontName>
33
- </args>
34
- </promotionalbanner>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <menu>
39
- <promotionalbanner module="promotionalbanner">
40
- <title>Promotionalbanner</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="promotionalbanner">
44
- <title>Manage Items</title>
45
- <sort_order>0</sort_order>
46
- <action>promotionalbanner/adminhtml_promotionalbanner</action>
47
- </items>
48
- </children>
49
- </promotionalbanner>
50
- </menu>
51
- <acl>
52
- <resources>
53
- <all>
54
- <title>Allow Everything</title>
55
- </all>
56
- <admin>
57
- <children>
58
- <Tatva_Promotionalbanner>
59
- <title>Promotionalbanner Module</title>
60
- <sort_order>10</sort_order>
61
- </Tatva_Promotionalbanner>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- <layout>
67
- <updates>
68
- <promotionalbanner>
69
- <file>promotionalbanner.xml</file>
70
- </promotionalbanner>
71
- </updates>
72
- </layout>
73
- </adminhtml>
74
- <global>
75
- <models>
76
- <promotionalbanner>
77
- <class>Tatva_Promotionalbanner_Model</class>
78
- <resourceModel>promotionalbanner_mysql4</resourceModel>
79
- </promotionalbanner>
80
- <promotionalbanner_mysql4>
81
- <class>Tatva_Promotionalbanner_Model_Mysql4</class>
82
- <entities>
83
- <promotionalbanner>
84
- <table>promotionalbanner</table>
85
- </promotionalbanner>
86
- </entities>
87
- </promotionalbanner_mysql4>
88
- </models>
89
- <resources>
90
- <promotionalbanner_setup>
91
- <setup>
92
- <module>Tatva_Promotionalbanner</module>
93
- </setup>
94
- <connection>
95
- <use>core_setup</use>
96
- </connection>
97
- </promotionalbanner_setup>
98
- <promotionalbanner_write>
99
- <connection>
100
- <use>core_write</use>
101
- </connection>
102
- </promotionalbanner_write>
103
- <promotionalbanner_read>
104
- <connection>
105
- <use>core_read</use>
106
- </connection>
107
- </promotionalbanner_read>
108
- </resources>
109
- <blocks>
110
- <promotionalbanner>
111
- <class>Tatva_Promotionalbanner_Block</class>
112
- </promotionalbanner>
113
- </blocks>
114
- <helpers>
115
- <promotionalbanner>
116
- <class>Tatva_Promotionalbanner_Helper</class>
117
- </promotionalbanner>
118
- </helpers>
119
- </global>
120
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Tatva/Promotionalbanner/sql/promotionalbanner_setup/mysql4-install-0.1.0.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('promotionalbanner')};
10
- CREATE TABLE {$this->getTable('promotionalbanner')} (
11
- `promotionalbanner_id` int(11) unsigned NOT NULL auto_increment,
12
- `title` varchar(255) NOT NULL default '',
13
- `filename` varchar(255) NOT NULL default '',
14
- `position` smallint(6) NOT NULL default '1',
15
- `status` smallint(6) NOT NULL default '0',
16
- `sort_order` int(11) NOT NULL default '0',
17
- `created_time` datetime NULL,
18
- `update_time` datetime NULL,
19
- PRIMARY KEY (`promotionalbanner_id`)
20
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21
-
22
- ");
23
-
24
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.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>
@@ -15,8 +15,8 @@ All features are configurable from admin like width, height, auto slideshow, dis
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Etatvasoft_Dynamic_Image_Slider</name>
4
+ <version>1.5.5</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>
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>13:21:33</time>
19
+ <contents><target name="magelocal"><dir name="Tatva"><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></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>