Skip to content
Browse files

2.0.0.0-dev39

* Visual design editor improvements:
  * VDE changes can be saved to DB for current store and theme. Layout updates composed by VDE are combined into one record
  * Introduced temporary layout changes which should store non-applied modifications made during VDE functioning. Added new column `updated_at` to `core_layout_update` table for this, added observers and cron jobs to clean outdated layout updates
  * Added `vde/` prefix to all links inside VDE frame
  * Disabled caching (layout, blocks HTML, etc) in Design mode
  * Reviewed and improved "Quit" action to properly cleanup session, cache and cookies
  * Visual enhancements added when block is being dragged (block display, highlighting, cursor shape)
  * Added ability to set placeholder for a draggable block in VDE canvas
  * Fixed sorting of items within container
  * Improved logic of VDE canvas iframe sizing according to window size to have one scroll bar and static toolbar at the bottom of the page
* Improved themes management:
  * New separate tab on theme edit page which allows to view and download CSS files used on frontend. Files are divided to framework files, library files and theme files
  * Added an ability to upload and store custom CSS file which can be applied on frontend
  * Improved renaming of virtual themes, restricted modifying of physical themes
* Implemented changes in product creation process in admin interface:
  * Added "Variations" block with configurable product attributes in "General" tab. With this block all final prices of configurable product variations can be easily added and configured in one place. Easy sorting mechanism helps understand the order of applying price modifications. "Variations" block can be reloaded itself without reloading all product creation page. All product variations are being created automatically with saving the parent configurable product
  * Improved image management control. Multiple image control is placed in General tab. It provides easier upload and basic management of product's images than image gallery does.
  * Changed Save button on product edit page. Save button is implemented as a split-button with the following options: "Save & New", "Save & Duplicate", "Save & Close"
* Changed representation of a configurable product's image on frontend to use product's variation image instead of parent product's one
* Implemented js-plugin `mage` to give an ability to extend Magento js-code and modify initializing parameters during the runtime. Replaced instantiation of `form` and `validation` instances with `mage` widget
* Implemented autocomplete js-component on backend based on jQuery-ui
* Refactored frontend design theme to use jQuery library instead of Prototype for the following frontend components:
  * Varien Product class – class handles product price calculations on the client side as product price options are changed: `Product.Config`, `Product.Zoom`, `Product.Super`, `Product.OptionsPrice`
  * `RegionUpdater` & `ZipUpdater` classes – classes handle dynamically changing State/Province field from drop down to text field depending on selected country. They also handle "required" setting for State/Province and Zip/Postal Code fields.
  * `Varien.searchForm` – class handles quick search autocomplete functionality
* `VarienForm` class is deprecated
* Improved floating toolbar in backend
* Refactored the following grids in backend to make them configurable through layout, rather than hard-coded: `Mage_Adminhtml_Block_Newsletter_Queue_Grid`, `Mage_Adminhtml_Block_Report_Refresh_Statistics`
* Dependency injection improvements:
  * Added ability to generate proxy and factory classes on-the-fly for use with DI implementations. Generators can be managed in DI configuration
  * Implemented tools (shell scripts) that allow generating skeletons of factory and proxy classes for use with DI implementations
  * Added ability to set preferences to object manager and specify them through configuration
* Refactored the following modules to utilize `Magento_Filesystem` library instead of using built-in PHP core functions directly: `Mage_Adminhtml`, `Mage_Backend`, `Mage_Backup`, `Mage_Captcha`, `Mage_Catalog`, `Mage_Cms`, `Mage_Connect`, `Mage_Core`, `Mage_Install`
* Bug fixes:
  * Fixed bug with incorrect order processing in `Mage_Authorizenet_Model_Directpost`
  * Fixed bug with unnecessary "loading" image on Category field during product editing in backend
  * Fixed bug in `Mage_Adminhtml_CustomerController` with error message during subscription to newsletter
  * Fixed bug in custom option template with incorrect import of custom option during product creation
  * Fixed JavaScript bug with image uploader control on product edit page on backend in IE9
  * Fixed bug with incorrect CSS directives in `app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml`
  * Replaced usages of Validation Prototype class with jQuery analog in modules `Manage Attributes Sets`, `Reports` and `Order`
  * Fixed bug with Javascript errors in "accordion" tabs and incorrect tab content during product creation.
  * Fixed XSS vulnerability in configurable product on backend product page
  * Fixed inability to update values in PayPal system configuration
  * Fixed "The command line is too long" error triggered by static code analysis CLI tools when the lists become too large
  * Fixed inability to create shipping label for DHL caused by wrong logo image path
  * Fixed inactive navigation menu item of "Import/Export Tax Rates" page
  • Loading branch information...
1 parent b7f408d commit 660067437a919ab3b4a82fbb980745a942a4cc52 @magento-team magento-team committed
Showing with 3,829 additions and 2,387 deletions.
  1. +50 −0 CHANGELOG.markdown
  2. +1 −10 app/Mage.php
  3. +1 −0 app/bootstrap.php
  4. +8 −4 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php
  5. +5 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php
  6. +23 −21 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php
  7. +93 −40 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
  8. +5 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php
  9. +5 −13 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
  10. +48 −72 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
  11. +13 −13 ...Mage/Adminhtml/Block/{Newsletter/Queue.php → Catalog/Product/Edit/Tab/Super/Config/Attribute.php}
  12. +229 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Matrix.php
  13. +0 −9 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php
  14. +17 −25 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php
  15. +63 −58 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php
  16. +4 −2 app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php
  17. +5 −3 app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php
  18. +4 −2 app/code/core/Mage/Adminhtml/Block/Customer/Edit.php
  19. +3 −1 app/code/core/Mage/Adminhtml/Block/Html/Date.php
  20. +3 −2 app/code/core/Mage/Adminhtml/Block/Messages.php
  21. +15 −11 app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php
  22. +0 −130 app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php
  23. +3 −1 app/code/core/Mage/Adminhtml/Block/Page/Head.php
  24. +14 −10 app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php
  25. +4 −2 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php
  26. +3 −1 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php
  27. +3 −1 app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php
  28. +0 −169 app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php
  29. +18 −14 app/code/core/Mage/Adminhtml/Block/Review/Edit.php
  30. +10 −8 app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php
  31. +1 −2 app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php
  32. +5 −3 app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php
  33. +5 −3 app/code/core/Mage/Adminhtml/Block/System/Currency.php
  34. +5 −3 app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php
  35. +3 −2 app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php
  36. +4 −2 app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php
  37. +4 −2 app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php
  38. +4 −2 app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php
  39. +4 −2 app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php
  40. +4 −2 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php
  41. +33 −26 app/code/core/Mage/Adminhtml/Model/Extension.php
  42. +16 −1 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php
  43. +15 −3 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php
  44. +68 −139 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
  45. +6 −5 app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php
  46. +9 −13 app/code/core/Mage/Adminhtml/controllers/CustomerController.php
  47. +2 −7 app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php
  48. +0 −5 app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php
  49. +3 −1 app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
  50. +11 −5 app/code/core/Mage/Adminhtml/controllers/SitemapController.php
  51. +1 −1 app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php
  52. +93 −19 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
  53. +109 −14 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/base-image-uploader.css
  54. +110 −9 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/base-image-uploader.js
  55. +3 −4 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category-selector.css
  56. +1 −9 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category-selector.js
  57. +0 −52 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.js
  58. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml
  59. +10 −9 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml
  60. +82 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/form.js
  61. +44 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/configurable-product.css
  62. +101 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product-variation.js
  63. +0 −85 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js
  64. +4 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml
  65. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml
  66. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml
  67. +101 −90 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml
  68. +2 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml
  69. +0 −8 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/category/new/js.phtml
  70. +10 −6 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml
  71. +113 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml
  72. +140 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/attribute-template.phtml
  73. +109 −254 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml
  74. +158 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/matrix.phtml
  75. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml
  76. BIN app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
  77. BIN app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-icons_222222_256x240.png
  78. +0 −109 app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/tabs.css
  79. BIN app/code/core/Mage/Adminhtml/view/adminhtml/images/image-placeholder.png
  80. +7 −7 app/code/core/Mage/Adminhtml/view/adminhtml/main.xml
  81. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml
  82. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml
  83. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml
  84. +1 −0 app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml
  85. +69 −0 app/code/core/Mage/Adminhtml/view/adminhtml/page/js/components.phtml
  86. +0 −5 app/code/core/Mage/Adminhtml/view/adminhtml/report.xml
  87. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml
  88. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/resetforgottenpassword.phtml
  89. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml
  90. +7 −10 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js
  91. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml
  92. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml
  93. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml
  94. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml
  95. +4 −5 app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml
  96. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml
  97. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml
  98. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml
  99. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml
  100. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml
  101. +2 −1 app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml
  102. +6 −1 app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml
  103. +7 −0 app/code/core/Mage/Authorizenet/Model/Directpost.php
  104. +3 −1 app/code/core/Mage/Backend/Block/Abstract.php
  105. +3 −1 app/code/core/Mage/Backend/Block/Store/Switcher.php
  106. +7 −3 app/code/core/Mage/Backend/Block/System/Config/Edit.php
  107. +11 −9 app/code/core/Mage/Backend/Block/System/Config/Form.php
  108. +3 −1 app/code/core/Mage/Backend/Block/System/Config/Form/Field.php
  109. +3 −2 app/code/core/Mage/Backend/Block/System/Config/Tabs.php
  110. +4 −2 app/code/core/Mage/Backend/Block/Template.php
  111. +1 −1 app/code/core/Mage/Backend/Block/Widget.php
  112. +2 −2 app/code/core/Mage/Backend/Block/Widget/Button.php
  113. +5 −3 app/code/core/Mage/Backend/Block/Widget/Form/Container.php
  114. +3 −1 app/code/core/Mage/Backend/Block/Widget/Grid/Column/Multistore.php
  115. +1 −1 app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Action.php
  116. +3 −2 app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Currency.php
  117. +3 −1 app/code/core/Mage/Backend/Block/Widget/Grid/ColumnSet.php
  118. +27 −30 app/code/core/Mage/Backend/Block/Widget/Grid/Export.php
  119. +30 −31 app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php
  120. +5 −3 app/code/core/Mage/Backend/Controller/Router/Default.php
  121. +1 −1 app/code/core/Mage/Backend/Helper/Data.php
  122. +8 −8 app/code/core/Mage/Backend/Model/Config.php
  123. +36 −29 app/code/core/Mage/Backend/Model/Config/Backend/Admin/Robots.php
  124. +2 −4 app/code/core/Mage/Backend/Model/Config/Backend/Email/Logo.php
  125. +10 −3 app/code/core/Mage/Backend/Model/Config/Backend/File.php
  126. +1 −1 app/code/core/Mage/Backend/view/adminhtml/admin/login.phtml
  127. +1 −1 app/code/core/Mage/Backend/view/adminhtml/system/config/edit.phtml
  128. +37 −26 app/code/core/Mage/Backend/view/adminhtml/widget/button/split.phtml
  129. +2 −1 app/code/core/Mage/Backend/view/adminhtml/widget/form/container.phtml
  130. +10 −5 app/code/core/Mage/Backend/view/adminhtml/widget/tabs.phtml
  131. +21 −4 app/code/core/Mage/Backup/Helper/Data.php
  132. +107 −115 app/code/core/Mage/Backup/Model/Backup.php
  133. +27 −10 app/code/core/Mage/Backup/Model/Fs/Collection.php
  134. +207 −175 app/code/core/Mage/Bundle/view/frontend/bundle.js
  135. +15 −3 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml
  136. +1 −1 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml
  137. +1 −1 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml
  138. +3 −3 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml
  139. +2 −2 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml
  140. +7 −0 app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml
  141. +71 −0 app/code/core/Mage/Bundle/view/frontend/js/float.js
  142. +80 −0 app/code/core/Mage/Bundle/view/frontend/js/slide.js
  143. +42 −108 app/code/core/Mage/Captcha/Helper/Data.php
  144. +21 −7 app/code/core/Mage/Captcha/Model/Observer.php
  145. +5 −3 app/code/core/Mage/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php
  146. +92 −0 app/code/core/Mage/Catalog/Block/Product/Configurable/AttributeSelector.php
  147. +2 −1 app/code/core/Mage/Catalog/Block/Product/Gallery.php
  148. +2 −0 app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php
  149. +7 −2 app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php
  150. +14 −1 app/code/core/Mage/Catalog/Helper/Product/Options.php
  151. +15 −7 app/code/core/Mage/Catalog/Model/Observer.php
  152. +17 −9 app/code/core/Mage/Catalog/Model/Product.php
  153. +76 −65 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php
  154. +67 −31 app/code/core/Mage/Catalog/Model/Product/Image.php
  155. +12 −12 app/code/core/Mage/Catalog/Model/Product/Media/Config.php
  156. +49 −27 app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
  157. +35 −9 app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php
  158. +155 −11 app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
  159. +1 −1 app/code/core/Mage/Catalog/Model/Resource/Abstract.php
  160. +1 −10 app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php
  161. +5 −10 app/code/core/Mage/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php
  162. +8 −4 app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php
  163. +60 −0 .../core/Mage/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/form.phtml
  164. +137 −0 ...de/core/Mage/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/js.phtml
  165. +71 −0 app/code/core/Mage/Catalog/view/adminhtml/product/configurable/attribute-selector/js.phtml
  166. 0 ...s/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_diagonals-thick_18_b81900_40x40.png
  167. 0 ...s/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_diagonals-thick_20_666666_40x40.png
  168. 0 ...minhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_flat_10_000000_40x100.png
  169. 0 ...inhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_glass_100_f6f6f6_1x400.png
  170. 0 ...inhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_glass_100_fdf5ce_1x400.png
  171. 0 ...i/css → app/code/core/Mage/Catalog/view/adminhtml/product}/images/ui-bg_glass_65_ffffff_1x400.png
  172. 0 .../css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_gloss-wave_35_f67028_500x100.png
  173. 0 ...s/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
  174. 0 ...ss/ui-lightness → Catalog/view/adminhtml/product}/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
  175. 0 ...ry/ui/css → app/code/core/Mage/Catalog/view/adminhtml/product}/images/ui-icons_222222_256x240.png
  176. 0 ...w/adminhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-icons_228ef1_256x240.png
  177. 0 ...w/adminhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-icons_ef8c08_256x240.png
  178. 0 ...w/adminhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-icons_ffd27a_256x240.png
  179. 0 ...w/adminhtml/css/ui-lightness → Catalog/view/adminhtml/product}/images/ui-icons_ffffff_256x240.png
Sorry, we could not display the entire diff because too many files (1,105) changed.
View
50 CHANGELOG.markdown
@@ -1,3 +1,53 @@
+2.0.0.0-dev39
+=============
+* Visual design editor improvements:
+ * VDE changes can be saved to DB for current store and theme. Layout updates composed by VDE are combined into one record
+ * Introduced temporary layout changes which should store non-applied modifications made during VDE functioning. Added new column `updated_at` to `core_layout_update` table for this, added observers and cron jobs to clean outdated layout updates
+ * Added `vde/` prefix to all links inside VDE frame
+ * Disabled caching (layout, blocks HTML, etc) in Design mode
+ * Reviewed and improved "Quit" action to properly cleanup session, cache and cookies
+ * Visual enhancements added when block is being dragged (block display, highlighting, cursor shape)
+ * Added ability to set placeholder for a draggable block in VDE canvas
+ * Fixed sorting of items within container
+ * Improved logic of VDE canvas iframe sizing according to window size to have one scroll bar and static toolbar at the bottom of the page
+* Improved themes management:
+ * New separate tab on theme edit page which allows to view and download CSS files used on frontend. Files are divided to framework files, library files and theme files
+ * Added an ability to upload and store custom CSS file which can be applied on frontend
+ * Improved renaming of virtual themes, restricted modifying of physical themes
+* Implemented changes in product creation process in admin interface:
+ * Added "Variations" block with configurable product attributes in "General" tab. With this block all final prices of configurable product variations can be easily added and configured in one place. Easy sorting mechanism helps understand the order of applying price modifications. "Variations" block can be reloaded itself without reloading all product creation page. All product variations are being created automatically with saving the parent configurable product
+ * Improved image management control. Multiple image control is placed in General tab. It provides easier upload and basic management of product's images than image gallery does.
+ * Changed Save button on product edit page. Save button is implemented as a split-button with the following options: "Save & New", "Save & Duplicate", "Save & Close"
+* Changed representation of a configurable product's image on frontend to use product's variation image instead of parent product's one
+* Implemented js-plugin `mage` to give an ability to extend Magento js-code and modify initializing parameters during the runtime. Replaced instantiation of `form` and `validation` instances with `mage` widget
+* Implemented autocomplete js-component on backend based on jQuery-ui
+* Refactored frontend design theme to use jQuery library instead of Prototype for the following frontend components:
+ * Varien Product class – class handles product price calculations on the client side as product price options are changed: `Product.Config`, `Product.Zoom`, `Product.Super`, `Product.OptionsPrice`
+ * `RegionUpdater` & `ZipUpdater` classes – classes handle dynamically changing State/Province field from drop down to text field depending on selected country. They also handle "required" setting for State/Province and Zip/Postal Code fields.
+ * `Varien.searchForm` – class handles quick search autocomplete functionality
+* `VarienForm` class is deprecated
+* Improved floating toolbar in backend
+* Refactored the following grids in backend to make them configurable through layout, rather than hard-coded: `Mage_Adminhtml_Block_Newsletter_Queue_Grid`, `Mage_Adminhtml_Block_Report_Refresh_Statistics`
+* Dependency injection improvements:
+ * Added ability to generate proxy and factory classes on-the-fly for use with DI implementations. Generators can be managed in DI configuration
+ * Implemented tools (shell scripts) that allow generating skeletons of factory and proxy classes for use with DI implementations
+ * Added ability to set preferences to object manager and specify them through configuration
+* Refactored the following modules to utilize `Magento_Filesystem` library instead of using built-in PHP core functions directly: `Mage_Adminhtml`, `Mage_Backend`, `Mage_Backup`, `Mage_Captcha`, `Mage_Catalog`, `Mage_Cms`, `Mage_Connect`, `Mage_Core`, `Mage_Install`
+* Bug fixes:
+ * Fixed bug with incorrect order processing in `Mage_Authorizenet_Model_Directpost`
+ * Fixed bug with unnecessary "loading" image on Category field during product editing in backend
+ * Fixed bug in `Mage_Adminhtml_CustomerController` with error message during subscription to newsletter
+ * Fixed bug in custom option template with incorrect import of custom option during product creation
+ * Fixed JavaScript bug with image uploader control on product edit page on backend in IE9
+ * Fixed bug with incorrect CSS directives in `app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml`
+ * Replaced usages of Validation Prototype class with jQuery analog in modules `Manage Attributes Sets`, `Reports` and `Order`
+ * Fixed bug with Javascript errors in "accordion" tabs and incorrect tab content during product creation.
+ * Fixed XSS vulnerability in configurable product on backend product page
+ * Fixed inability to update values in PayPal system configuration
+ * Fixed "The command line is too long" error triggered by static code analysis CLI tools when the lists become too large
+ * Fixed inability to create shipping label for DHL caused by wrong logo image path
+ * Fixed inactive navigation menu item of "Import/Export Tax Rates" page
+
2.0.0.0-dev38
=============
* Changed application initialization procedure
View
11 app/Mage.php
@@ -163,7 +163,7 @@ public static function getVersionInfo()
'revision' => '0',
'patch' => '0',
'stability' => 'dev',
- 'number' => '38',
+ 'number' => '39',
);
}
@@ -640,15 +640,6 @@ public static function app($code = '', $type = 'store', $options = array())
/**
* @static
- * @param string $areaCode
- */
- public static function setCurrentArea($areaCode)
- {
- self::getObjectManager()->loadAreaConfiguration($areaCode);
- }
-
- /**
- * @static
* @param string $code
* @param string $type
* @param array $options
View
1 app/bootstrap.php
@@ -100,6 +100,7 @@
BP . DS . 'app' . DS . 'code' . DS . 'community',
BP . DS . 'app' . DS . 'code' . DS . 'core',
BP . DS . 'lib',
+ BP . DS . 'var' . DS . 'generation',
));
$classMapPath = BP . DS . 'var/classmap.ser';
if (file_exists($classMapPath)) {
View
12 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php
@@ -69,8 +69,10 @@ protected function _construct()
array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save and Continue Edit'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#edit_form'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'),
+ ),
),
),
100
@@ -78,8 +80,10 @@ protected function _construct()
}
$this->_updateButton('save', 'label', Mage::helper('Mage_Catalog_Helper_Data')->__('Save Attribute'));
- $this->_updateButton('save', 'data_attr', array(
- 'widget-button' => array('event' => 'save', 'related' => '#edit_form')
+ $this->_updateButton('save', 'data_attribute', array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'save', 'target' => '#edit_form'),
+ ),
));
if (!Mage::registry('entity_attribute') || !Mage::registry('entity_attribute')->getIsUserDefined()) {
View
8 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php
@@ -41,9 +41,11 @@ protected function _prepareLayout()
$this->addChild('save_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save Attribute Set'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'save', 'related' => '#set-prop-form')
- )
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'save', 'target' => '#set-prop-form'),
+ ),
+ ),
));
$this->addChild('back_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Back'),
View
44 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php
@@ -61,17 +61,17 @@ public function getProductId()
}
/**
- * Indentifies edit mode of popup
+ * Identifies edit mode of popup
*
* @return boolean
*/
public function isEdit()
{
- return (bool) $this->getRequest()->getParam('edit');
+ return (bool)$this->getRequest()->getParam('edit');
}
/**
- * Retrive serialized json with configurable attributes values of simple
+ * Retrieve serialized json with configurable attributes values of simple
*
* @return string
*/
@@ -91,41 +91,43 @@ public function getAttributesJson()
return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result);
}
+ /**
+ * Retrieve array of attributes
+ *
+ * @return array
+ */
public function getAttributes()
{
- if ($this->getConfigurableProduct()->getId()) {
- return $this->getConfigurableProduct()
+ $configurableProduct = $this->getConfigurableProduct();
+ if ($configurableProduct->getId()) {
+ return $configurableProduct
->getTypeInstance()
- ->getUsedProductAttributes($this->getConfigurableProduct());
+ ->getUsedProductAttributes($configurableProduct);
}
$attributes = array();
-
$attributesIds = $this->getRequest()->getParam('required');
if ($attributesIds) {
- $attributesIds = explode(',', $attributesIds);
- foreach ($attributesIds as $attributeId) {
- $attribute = $this->getProduct()
- ->getTypeInstance()
- ->getAttributeById($attributeId, $this->getProduct());
- if (!$attribute) {
- continue;
+ $product = $this->getProduct();
+ $typeInstance = $product->getTypeInstance();
+ foreach (explode(',', $attributesIds) as $attributeId) {
+ $attribute = $typeInstance->getAttributeById($attributeId, $product);
+ if ($attribute) {
+ $attributes[] = $attribute;
}
- $attributes[] = $attribute;
}
}
-
return $attributes;
}
/**
- * Retrive configurable product for created/edited simple
+ * Retrieve configurable product for created/edited simple
*
* @return Mage_Catalog_Model_Product
*/
public function getConfigurableProduct()
{
- if (is_null($this->_configurableProduct)) {
+ if ($this->_configurableProduct === null) {
$this->_configurableProduct = Mage::getModel('Mage_Catalog_Model_Product')
->setStore(0)
->load($this->getRequest()->getParam('product'));
@@ -134,17 +136,17 @@ public function getConfigurableProduct()
}
/**
- * Retrive product
+ * Retrieve product
*
* @return Mage_Catalog_Model_Product
*/
public function getProduct()
{
- if (is_null($this->_product)) {
+ if ($this->_product === null) {
$this->_product = Mage::getModel('Mage_Catalog_Model_Product')
->setStore(0)
->load($this->getRequest()->getParam('id'));
}
return $this->_product;
}
-} // Class Mage_Adminhtml_Block_Catalog_Product_Created End
+}
View
133 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
@@ -60,68 +60,57 @@ protected function _prepareLayout()
{
if (!$this->getRequest()->getParam('popup')) {
$this->addChild('back_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Back'),
- 'onclick' => 'setLocation(\''
- . $this->getUrl('*/*/', array('store'=>$this->getRequest()->getParam('store', 0))).'\')',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Back'),
+ 'onclick' => 'setLocation(\''
+ . $this->getUrl('*/*/', array('store' => $this->getRequest()->getParam('store', 0))) . '\')',
'class' => 'back'
));
} else {
$this->addChild('back_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Close Window'),
- 'onclick' => 'window.close()',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Close Window'),
+ 'onclick' => 'window.close()',
'class' => 'cancel'
));
}
if (!$this->getProduct()->isReadonly()) {
if (!$this->getProduct()->isConfigurable() || !$this->getIsConfigured()) {
- $this->addChild('change_attribute_set_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Change Attribute Set'),
- 'onclick' => "jQuery('#attribute-set-info').dialog('open');"
- ));
+ $this->addChild(
+ 'change_attribute_set_button',
+ 'Mage_Backend_Block_Widget_Button',
+ array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Change Attribute Set'),
+ 'onclick' => "jQuery('#attribute-set-info').dialog('open');",
+ 'id' => 'change-attribute-set-button'
+ )
+ );
}
$this->addChild('reset_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Reset'),
- 'onclick' => 'setLocation(\''.$this->getUrl('*/*/*', array('_current'=>true)).'\')'
- ));
-
- $this->addChild('save_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save'),
- 'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'save', 'related' => '#product-edit-form')
- )
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Reset'),
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/*', array('_current' => true)) . '\')'
));
}
if (!$this->getRequest()->getParam('popup')) {
- if (!$this->getProduct()->isReadonly()) {
- $this->addChild('save_and_edit_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save and Continue Edit'),
- 'data_attr' => array(
- 'widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#product-edit-form')
- ),
- 'class' => 'save'
- ));
- }
if ($this->getProduct()->isDeleteable()) {
$this->addChild('delete_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Delete'),
- 'onclick' => 'confirmSetLocation(\''
- . Mage::helper('Mage_Catalog_Helper_Data')->__('Are you sure?').'\', \''.$this->getDeleteUrl().'\')',
- 'class' => 'delete'
- ));
- }
-
- if ($this->getProduct()->isDuplicable()) {
- $this->addChild('duplicate_button', 'Mage_Adminhtml_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Duplicate'),
- 'onclick' => 'setLocation(\'' . $this->getDuplicateUrl() . '\')',
- 'class' => 'add'
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Delete'),
+ 'onclick' => 'confirmSetLocation(\''
+ . Mage::helper('Mage_Catalog_Helper_Data')->__('Are you sure?') . '\', \'' . $this->getDeleteUrl() . '\')',
+ 'class' => 'delete'
));
}
}
+ if (!$this->getProduct()->isReadonly()) {
+ $this->addChild('save-split-button', 'Mage_Backend_Block_Widget_Button_Split', array(
+ 'id' => 'save-split-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save'),
+ 'class_name' => 'Mage_Backend_Block_Widget_Button_Split',
+ 'button_class' => 'widget-button-save',
+ 'options' => $this->_getSaveSplitButtonOptions()
+ ));
+ }
return parent::_prepareLayout();
}
@@ -166,6 +155,16 @@ public function getDuplicateButtonHtml()
return $this->getChildHtml('duplicate_button');
}
+ /**
+ * Get Save Split Button html
+ *
+ * @return string
+ */
+ public function getSaveSplitButtonHtml()
+ {
+ return $this->getChildHtml('save-split-button');
+ }
+
public function getValidationUrl()
{
return $this->getUrl('*/*/validate', array('_current'=>true));
@@ -308,4 +307,58 @@ protected function _getAttributes()
}
return $attributes;
}
+
+ /**
+ * Get dropdown options for save split button
+ *
+ * @return array
+ */
+ protected function _getSaveSplitButtonOptions()
+ {
+ $options = array();
+ if (!$this->getRequest()->getParam('popup')) {
+ $options[] = array(
+ 'id' => 'edit-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & Edit'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#product-edit-form'),
+ ),
+ ),
+ 'default' => true,
+ );
+ }
+ $options[] = array(
+ 'id' => 'new-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & New'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndNew', 'target' => '#product-edit-form'),
+ ),
+ ),
+ );
+ if (!$this->getRequest()->getParam('popup') && $this->getProduct()->isDuplicable()) {
+ $options[] = array(
+ 'id' => 'duplicate-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & Duplicate'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => '', 'target' => '#product-edit-form'),
+ ),
+ ),
+ 'onclick' => $this->getRequest()->getActionName() == 'new' ? ''
+ : 'setLocation(\'' . $this->getDuplicateUrl() . '\')',
+ );
+ }
+ $options[] = array(
+ 'id' => 'close-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & Close'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'save', 'target' => '#product-edit-form'),
+ ),
+ ),
+ );
+ return $options;
+ }
}
View
8 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php
@@ -51,9 +51,11 @@ protected function _prepareLayout()
$this->addChild('save_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'save', 'related' => '#attributes-edit-form')
- )
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'save', 'target' => '#attributes-edit-form'),
+ ),
+ ),
));
}
View
18 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
@@ -36,10 +36,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Backen
protected function _prepareForm()
{
$form = new Varien_Data_Form();
-
- $fieldset = $form->addFieldset('settings', array(
- 'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__('Product Settings')
- ));
+ $fieldset = $form->addFieldset('settings', array());
$entityType = Mage::registry('product')->getResource()->getEntityType();
@@ -53,15 +50,10 @@ protected function _prepareForm()
->load()
->toOptionArray()
));
-
- $fieldset->addField(
- 'type_id',
- 'hidden',
- array(
- 'name' => 'type_id',
- 'value' => Mage::registry('product')->getTypeId(),
- )
- );
+ $fieldset->addField('type_id', 'hidden', array(
+ 'name' => 'type_id',
+ 'value' => Mage::registry('product')->getTypeId(),
+ ));
$this->setForm($form);
}
}
View
120 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
@@ -130,6 +130,26 @@ protected function _prepareLayout()
));
}
+ $this->addChild(
+ 'generate',
+ 'Mage_Backend_Block_Widget_Button',
+ array(
+ 'id' => 'generate-variations-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Generate Variations'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array(
+ 'event' => 'generate',
+ 'target' => '#product-variations-matrix',
+ 'eventData' => array(
+ 'url' => $this->getUrl('*/*/variationsMatrix', array('_current' => true)),
+ ),
+ ),
+ ),
+ ),
+ )
+ );
+
return parent::_prepareLayout();
}
@@ -150,20 +170,38 @@ protected function _getProduct()
*/
public function getAttributes()
{
- $attributes = (array)$this->_getProductType()->getConfigurableAttributesAsArray($this->_getProduct());
- foreach ($attributes as &$attribute) {
- if (isset($attribute['values']) && is_array($attribute['values'])) {
- foreach ($attribute['values'] as &$attributeValue) {
- if (!$this->getCanReadPrice()) {
- $attributeValue['pricing_value'] = '';
- $attributeValue['is_percent'] = 0;
+ if (!$this->hasData('attributes')) {
+ $attributes = (array)$this->_getProductType()->getConfigurableAttributesAsArray($this->_getProduct());
+ $productData = (array)$this->getRequest()->getParam('product');
+ if (isset($productData['configurable_attributes_data'])) {
+ $configurableData = $productData['configurable_attributes_data'];
+ foreach ($attributes as $key => &$attribute) {
+ if (isset($configurableData[$key])) {
+ $attribute['values'] = array_merge(
+ isset($attribute['values']) ? $attribute['values'] : array(),
+ isset($configurableData[$key]['values'])
+ ? array_filter($configurableData[$key]['values'])
+ : array()
+ );
}
- $attributeValue['can_edit_price'] = $this->getCanEditPrice();
- $attributeValue['can_read_price'] = $this->getCanReadPrice();
}
}
+
+ foreach ($attributes as &$attribute) {
+ if (isset($attribute['values']) && is_array($attribute['values'])) {
+ foreach ($attribute['values'] as &$attributeValue) {
+ if (!$this->getCanReadPrice()) {
+ $attributeValue['pricing_value'] = '';
+ $attributeValue['is_percent'] = 0;
+ }
+ $attributeValue['can_edit_price'] = $this->getCanEditPrice();
+ $attributeValue['can_read_price'] = $this->getCanReadPrice();
+ }
+ }
+ }
+ $this->setData('attributes', $attributes);
}
- return $attributes;
+ return $this->getData('attributes');
}
/**
@@ -264,21 +302,6 @@ public function getNewProductUrl()
}
/**
- * Retrieve Quick create product URL
- *
- * @return string
- */
- public function getQuickCreationUrl()
- {
- return $this->getUrl(
- '*/*/quickCreate',
- array(
- 'product' => $this->_getProduct()->getId()
- )
- );
- }
-
- /**
* Retrieve Required attributes Ids (comma separated)
*
* @return string
@@ -357,51 +380,4 @@ public function getSelectedAttributes()
? array_filter($this->_getProductType()->getUsedProductAttributes($this->_getProduct()))
: array();
}
-
- /**
- * Retrieve all possible attribute values combinations
- *
- * @return array
- */
- public function getVariations()
- {
- $attributesCount = 0;
- $variationalAttributes = array();
- $usedProductAttributes = $this->getSelectedAttributes();
- foreach ($usedProductAttributes as $attribute) {
- /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
- $variationalAttributes[] = array(
- 'id' => $attribute->getId(),
- 'values' => $attribute->getSource()->getAllOptions(false),
- );
- $attributesCount++;
- }
-
- $variations = array();
- $currentVariation = array_fill(0, $attributesCount, 0);
- $variationalAttributes = array_reverse($variationalAttributes);
- $lastAttribute = $attributesCount - 1;
- do {
- for ($attributeIndex = 0; $attributeIndex < $attributesCount - 1; ++$attributeIndex) {
- if ($currentVariation[$attributeIndex] >= count($variationalAttributes[$attributeIndex]['values'])) {
- $currentVariation[$attributeIndex] = 0;
- ++$currentVariation[$attributeIndex + 1];
- }
- }
- if ($currentVariation[$lastAttribute] >= count($variationalAttributes[$lastAttribute]['values'])) {
- break;
- }
-
- $filledVariation = array();
- for ($attributeIndex = $attributesCount; $attributeIndex--;) {
- $currentAttribute = $variationalAttributes[$attributeIndex];
- $filledVariation[$currentAttribute['id']] =
- $currentAttribute['values'][$currentVariation[$attributeIndex]];
- }
-
- $variations[] = $filledVariation;
- $currentVariation[0]++;
- } while (1);
- return $variations;
- }
}
View
26 ...Mage/Adminhtml/Block/Newsletter/Queue.php → ...oduct/Edit/Tab/Super/Config/Attribute.php
@@ -25,24 +25,24 @@
*/
/**
- * Adminhtml queue grid block.
+ * Renderer for attribute block
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Newsletter_Queue extends Mage_Adminhtml_Block_Template
+class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Attribute
+ extends Mage_Backend_Block_Template
{
-
- protected $_template = 'newsletter/queue/list.phtml';
-
- protected function _beforeToHtml()
+ /**
+ * Render block
+ *
+ * @param array $arguments
+ * @return string
+ */
+ public function render(array $arguments)
{
- $this->setChild(
- 'grid',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Newsletter_Queue_Grid', 'newsletter.queue.grid')
- );
- return parent::_beforeToHtml();
+ $this->assign($arguments);
+ return $this->toHtml();
}
-
}
View
229 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Matrix.php
@@ -0,0 +1,229 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Product variations matrix block
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Matrix
+ extends Mage_Backend_Block_Template
+{
+ /**
+ * Get configurable product type
+ *
+ * @return Mage_Catalog_Model_Product_Type_Configurable
+ */
+ protected function _getProductType()
+ {
+ return Mage::getSingleton('Mage_Catalog_Model_Product_Type_Configurable');
+ }
+
+ /**
+ * Retrieve currently edited product object
+ *
+ * @return Mage_Catalog_Model_Product
+ */
+ protected function _getProduct()
+ {
+ return Mage::registry('current_product');
+ }
+
+ /**
+ * Retrieve all possible attribute values combinations
+ *
+ * @return array
+ */
+ public function getVariations()
+ {
+ $variationalAttributes = array();
+ $usedProductAttributes = $this->getAttributes();
+ foreach ($usedProductAttributes as &$attribute) {
+ $options = array();
+ foreach ($attribute['options'] as $valueInfo) {
+ foreach ($attribute['values'] as $priceData) {
+ if ($priceData['value_index'] == $valueInfo['value']
+ && (!isset($priceData['include']) || $priceData['include'])
+ ) {
+ $valueInfo['price'] = $priceData;
+ $options[] = $valueInfo;
+ }
+ }
+ }
+ /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
+ $variationalAttributes[] = array(
+ 'id' => $attribute['attribute_id'],
+ 'values' => $options,
+ );
+
+ }
+ $attributesCount = count($variationalAttributes);
+ if ($attributesCount === 0) {
+ return array();
+ }
+
+ $variations = array();
+ $currentVariation = array_fill(0, $attributesCount, 0);
+ $variationalAttributes = array_reverse($variationalAttributes);
+ $lastAttribute = $attributesCount - 1;
+ do {
+ for ($attributeIndex = 0; $attributeIndex < $attributesCount - 1; ++$attributeIndex) {
+ if ($currentVariation[$attributeIndex] >= count($variationalAttributes[$attributeIndex]['values'])) {
+ $currentVariation[$attributeIndex] = 0;
+ ++$currentVariation[$attributeIndex + 1];
+ }
+ }
+ if ($currentVariation[$lastAttribute] >= count($variationalAttributes[$lastAttribute]['values'])) {
+ break;
+ }
+
+ $filledVariation = array();
+ for ($attributeIndex = $attributesCount; $attributeIndex--;) {
+ $currentAttribute = $variationalAttributes[$attributeIndex];
+ $filledVariation[$currentAttribute['id']] =
+ $currentAttribute['values'][$currentVariation[$attributeIndex]];
+ }
+
+ $variations[] = $filledVariation;
+ $currentVariation[0]++;
+ } while (1);
+ return $variations;
+ }
+
+ /**
+ * Get url for product edit
+ *
+ * @param $id
+ *
+ * @return string
+ */
+ public function getEditProductUrl($id)
+ {
+ return $this->getUrl('*/*/edit', array('id' => $id));
+ }
+
+
+ /**
+ * Retrieve attributes data
+ *
+ * @return array
+ */
+ public function getAttributes()
+ {
+ if (!$this->hasData('attributes')) {
+ $attributes = (array)$this->_getProductType()->getConfigurableAttributesAsArray($this->_getProduct());
+ $productData = (array)$this->getRequest()->getParam('product');
+ if (isset($productData['configurable_attributes_data'])) {
+ $configurableData = $productData['configurable_attributes_data'];
+ foreach ($attributes as $key => &$attribute) {
+ if (isset($configurableData[$key])) {
+ $attribute['values'] = array_merge(
+ isset($attribute['values']) ? $attribute['values'] : array(),
+ isset($configurableData[$key]['values'])
+ ? array_filter($configurableData[$key]['values'])
+ : array()
+ );
+ }
+ }
+ }
+
+ $this->setData('attributes', $attributes);
+ }
+ return $this->getData('attributes');
+ }
+
+ /**
+ * Get used product attributes
+ *
+ * @return array
+ */
+ public function getUsedAttributes()
+ {
+ return $this->_getProductType()->getUsedProductAttributes($this->_getProduct());
+ }
+
+ /**
+ * Retrieve actual list of associated products, array key is obtained from varying attributes values
+ *
+ * @return array
+ */
+ public function getAssociatedProducts()
+ {
+ $productByUsedAttributes = array();
+ foreach ($this->_getAssociatedProducts() as $product) {
+ $keys = array();
+ foreach ($this->getUsedAttributes() as $attribute) {
+ /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
+ $keys[] = $product->getData($attribute->getAttributeCode());
+ }
+ $productByUsedAttributes[implode('-', $keys)] = $product;
+ }
+ return $productByUsedAttributes;
+ }
+
+ /**
+ * Retrieve actual list of associated products (i.e. if product contains variations matrix form data
+ * - previously saved in database relations are not considered)
+ *
+ * @return array
+ */
+ protected function _getAssociatedProducts()
+ {
+ $product = $this->_getProduct();
+ $ids = $this->_getProduct()->getAssociatedProductIds();
+ if ($ids === null) { // form data overrides any relations stored in database
+ return $this->_getProductType()->getUsedProducts($product);
+ }
+ $products = array();
+ foreach ($ids as $productId) {
+ /** @var $product Mage_Catalog_Model_Product */
+ $product = Mage::getModel('Mage_Catalog_Model_Product')->load($productId);
+ if ($product->getId()) {
+ $products[] = $product;
+ }
+ }
+ return $products;
+ }
+
+ /**
+ * Get html class for attribute
+ *
+ * @param string $code
+ * @return string
+ */
+ public function getAttributeFrontendClass($code)
+ {
+ /** @var $config Mage_Catalog_Model_Config */
+ $config = Mage::getSingleton('Mage_Catalog_Model_Config');
+ /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
+ $attribute = $config->getAttribute(Mage_Catalog_Model_Product::ENTITY, $code);
+ return $attribute instanceof Mage_Eav_Model_Entity_Attribute_Abstract
+ ? $attribute->getFrontend()->getClass()
+ : '';
+ }
+}
View
9 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php
@@ -171,15 +171,6 @@ protected function _prepareForm()
));
}
-
- $fieldset->addField('create_button', 'note', array(
- 'text' => $this->getButtonHtml(
- Mage::helper('Mage_Catalog_Helper_Data')->__('Quick Create'),
- 'superProduct.quickCreateNewProduct()',
- 'save'
- )
- ));
-
$this->setForm($form);
}
View
42 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php
@@ -70,45 +70,37 @@ protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('settings', array(
- 'legend'=>Mage::helper('Mage_Catalog_Helper_Data')->__('Select Configurable Attributes')
+ 'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__('Select Configurable Attributes')
));
- $product = $this->_getProduct();
- $attributes = $product->getTypeInstance()
- ->getSetAttributes($product);
+ $fieldset->addField('attribute-selector', 'text', array(
+ 'label' => 'Select Attribute',
+ 'title' => 'Select Attribute',
+ ));
- $hasAttributes = false;
+ $product = $this->_getProduct();
+ /** @var $configurableType Mage_Catalog_Model_Product_Type_Configurable */
+ $configurableType = Mage::getSingleton('Mage_Catalog_Model_Product_Type_Configurable');
$usedAttributes = $product->isConfigurable()
- ? $this->_getProduct()->getTypeInstance()->getUsedProductAttributeIds($this->_getProduct())
+ ? $configurableType->getUsedProductAttributes($product)
: array();
-
- $configurableType = Mage::getSingleton('Mage_Catalog_Model_Product_Type_Configurable');
-
- foreach ($attributes as $attribute) {
+ foreach ($usedAttributes as $attribute) {
+ /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
if ($configurableType->canUseAttribute($attribute, $product)) {
- $hasAttributes = true;
$fieldset->addField('attribute_' . $attribute->getAttributeId(), 'checkbox', array(
- 'label' => $attribute->getFrontend()->getLabel(),
- 'title' => $attribute->getFrontend()->getLabel(),
+ 'label' => $attribute->getFrontendLabel(),
+ 'title' => $attribute->getFrontendLabel(),
'name' => 'attributes[]',
'class' => 'configurable-attribute-checkbox',
'value' => $attribute->getAttributeId(),
- 'checked' => in_array($attribute->getAttributeId(), $usedAttributes)
+ 'checked' => true
));
}
}
- if ($hasAttributes) {
- $fieldset->addField('continue_button', 'note', array(
- 'text' => $this->getChildHtml('continue_button'),
- ));
- } else {
- $fieldset->addField('note_text', 'note', array(
- 'text' => $this->__('This attribute set does not have attributes which we can use for configurable product')
- ));
- }
-
-
+ $fieldset->addField('continue_button', 'note', array(
+ 'text' => $this->getChildHtml('continue_button'),
+ ));
$this->setForm($form);
return parent::_prepareForm();
View
121 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php
@@ -31,7 +31,7 @@
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_BaseImage extends Varien_Data_Form_Element_Hidden
+class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_BaseImage extends Varien_Data_Form_Element_Abstract
{
/**
* Maximum file size to upload in bytes.
@@ -55,25 +55,14 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_BaseImage extends Varien_
protected $_url;
/**
- * Media Config instance
- *
- * @var Mage_Catalog_Model_Product_Media_Config
- */
- protected $_mediaConfig;
-
- /**
- * Design Package instance
- *
- * @var Mage_Core_Model_Design_Package
+ * @var Mage_Core_Helper_Data
*/
- protected $_design;
+ protected $_coreHelper;
/**
- * Data instance
- *
- * @var Mage_Core_Helper_Data
+ * @var Mage_Catalog_Helper_Data
*/
- protected $_helperData;
+ protected $_catalogHelperData;
/**
* Constructor
@@ -88,16 +77,26 @@ public function __construct(array $attributes = array())
: Mage::getSingleton('Mage_Adminhtml_Block_Media_Uploader');
$this->_url = isset($attributes['url']) ? $attributes['url']
: Mage::getModel('Mage_Backend_Model_Url');
- $this->_mediaConfig = isset($attributes['mediaConfig']) ? $attributes['mediaConfig']
- : Mage::getSingleton('Mage_Catalog_Model_Product_Media_Config');
- $this->_design = isset($attributes['design']) ? $attributes['design']
- : Mage::getSingleton('Mage_Core_Model_Design_Package');
- $this->_helperData = isset($attributes['helperData']) ? $attributes['helperData']
+ $this->_coreHelper = isset($attributes['coreHelper']) ? $attributes['coreHelper']
: Mage::helper('Mage_Core_Helper_Data');
+ $this->_catalogHelperData = isset($attributes['catalogHelperData']) ? $attributes['catalogHelperData']
+ : Mage::helper('Mage_Catalog_Helper_Data');
$this->_maxFileSize = $this->_getFileMaxSize();
}
+ public function getDefaultHtml()
+ {
+ $html = $this->getData('default_html');
+ if (is_null($html)) {
+ $html = ($this->getNoSpan() === true) ? '' : '<span class="field-row">' . "\n";
+ $html .= $this->getLabelHtml();
+ $html .= $this->getElementHtml();
+ $html .= ($this->getNoSpan() === true) ? '' : '</span>' . "\n";
+ }
+ return $html;
+ }
+
/**
* Return element html code
*
@@ -105,16 +104,32 @@ public function __construct(array $attributes = array())
*/
public function getElementHtml()
{
- $imageUrl = $this->_helperData->escapeHtml($this->_getImageUrl($this->getValue()));
- $htmlId = $this->_helperData->escapeHtml($this->getHtmlId());
- $uploadUrl = $this->_helperData->escapeHtml($this->_getUploadUrl());
-
- $html = '<input id="' . $htmlId .'_upload" type="file" name="image" '
- . 'data-url="' . $uploadUrl . '" style="display: none;" />'
- . parent::getElementHtml()
- . '<img align="left" src="' . $imageUrl . '" id="' . $htmlId . '_image"'
- . ' title="' . $imageUrl . '" alt="' . $imageUrl . '" class="base-image-uploader"'
- . ' onclick="jQuery(\'#' . $htmlId . '_upload\').trigger(\'click\')"/>';
+ $htmlId = $this->_coreHelper->escapeHtml($this->getHtmlId());
+ $uploadUrl = $this->_coreHelper->escapeHtml($this->_getUploadUrl());
+ /** @var $product Mage_Catalog_Model_Product */
+ $product = $this->getForm()->getDataObject();
+ $gallery = $product->getMediaGalleryImages();
+ $html = '<input id="' . $htmlId .'-upload" type="file" name="image" '
+ . 'data-url="' . $uploadUrl . '" style="display:none" />'
+ . '<input id="' . $htmlId . '" type="hidden" name="'. $this->getName() .'" />'
+ . '<div id="' . $htmlId . '-container" data-main="' . $this->getEscapedValue() . '" '
+ . 'data-images="' . $this->_coreHelper->escapeHtml(
+ $this->_coreHelper->jsonEncode($gallery ? $gallery->toArray() : array())
+ ) . '">'
+ . '<span id="' . $htmlId . '-upload-placeholder"></span>'
+ . '<script id="' . $htmlId . '-template" type="text/x-jquery-tmpl">'
+ . '<span class="container">'
+ . '<span class="main-sticker">' . $this->helper('Mage_Catalog_Helper_Data')->__('Main') . '</span>'
+ . '<span class="close">&times;</span>'
+ . '<img class="base-image-uploader" src="${url}" data-position="${position}" alt="${label}" />'
+ . '<div class="drag-zone">'
+ . '<button class="make-main" type="button">'
+ . $this->helper('Mage_Catalog_Helper_Data')->__('Make Main')
+ . '</button>'
+ . '</div>'
+ . '</span>'
+ . '</script>'
+ . '</div>';
$html .= $this->_getJs();
return $html;
@@ -128,33 +143,11 @@ public function getElementHtml()
protected function _getJs()
{
return "<script>/* <![CDATA[ */"
- . "jQuery(function(){"
- . "BaseImageUploader({$this->_helperData->jsonEncode($this->getHtmlId())}, "
- . "{$this->_helperData->jsonEncode($this->_maxFileSize)});"
- . " });"
- . "/*]]>*/</script>";
- }
-
- /**
- * Get full url for image
- *
- * @param string $imagePath
- *
- * @return string
- */
- protected function _getImageUrl($imagePath)
- {
- if (!in_array($imagePath, array(null, 'no_selection', '/'))) {
- if (pathinfo($imagePath, PATHINFO_EXTENSION) == 'tmp') {
- $imageUrl = $this->_mediaConfig->getTmpMediaUrl(substr($imagePath, 0, -4));
- } else {
- $imageUrl = $this->_mediaConfig->getMediaUrl($imagePath);
- }
- } else {
- $imageUrl = $this->_design->getViewFileUrl('Mage_Adminhtml::images/image-placeholder.png');
- }
-
- return $imageUrl;
+ . "jQuery(function(){"
+ . "BaseImageUploader({$this->_coreHelper->jsonEncode($this->getHtmlId())}, "
+ . "{$this->_coreHelper->jsonEncode($this->_maxFileSize)});"
+ . " });"
+ . "/*]]>*/</script>";
}
/**
@@ -176,4 +169,16 @@ protected function _getFileMaxSize()
{
return $this->_mediaUploader->getDataMaxSizeInBytes();
}
+
+ /**
+ * Dummy function to give translation tool the ability to pick messages
+ * Must be called with Mage_Catalog_Helper_Data $className only
+ *
+ * @param string $className
+ * @return Mage_Catalog_Helper_Data|Mage_Core_Helper_Data
+ */
+ private function helper($className)
+ {
+ return $className === 'Mage_Catalog_Helper_Data' ? $this->_catalogHelperData : $this->_coreHelper;
+ }
}
View
6 app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php
@@ -47,8 +47,10 @@ protected function _construct()
$this->_addButton('saveandcontinue', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save and Continue Edit'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#edit_form'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'),
+ ),
),
), -100);
View
8 app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php
@@ -50,9 +50,11 @@ protected function _construct()
$this->_addButton('saveandcontinue', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save and Continue Edit'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#edit_form')
- )
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'),
+ ),
+ ),
), -100);
} else {
$this->_removeButton('save');
View
6 app/code/core/Mage/Adminhtml/Block/Customer/Edit.php
@@ -106,8 +106,10 @@ protected function _prepareLayout()
$this->_addButton('save_and_continue', array(
'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Save and Continue Edit'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#edit_form'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'),
+ ),
),
), 10);
}
View
4 app/code/core/Mage/Adminhtml/Block/Html/Date.php
@@ -47,6 +47,7 @@ class Mage_Adminhtml_Block_Html_Date extends Mage_Core_Block_Html_Date
* @param Mage_Core_Model_Store_Config $storeConfig
* @param Mage_Core_Controller_Varien_Front $frontController
* @param Mage_Core_Model_Factory_Helper $helperFactory
+ * @param Magento_Filesystem $filesystem
* @param array $data
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -63,10 +64,11 @@ public function __construct(
Mage_Core_Model_Store_Config $storeConfig,
Mage_Core_Controller_Varien_Front $frontController,
Mage_Core_Model_Factory_Helper $helperFactory,
+ Magento_Filesystem $filesystem,
array $data = array()
) {
parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $designPackage,
- $session, $storeConfig, $frontController, $helperFactory, $data
+ $session, $storeConfig, $frontController, $helperFactory, $filesystem, $data
);
}
}
View
5 app/code/core/Mage/Adminhtml/Block/Messages.php
@@ -46,6 +46,7 @@ class Mage_Adminhtml_Block_Messages extends Mage_Core_Block_Messages
* @param Mage_Core_Model_Store_Config $storeConfig
* @param Mage_Core_Controller_Varien_Front $frontController
* @param Mage_Core_Model_Factory_Helper $helperFactory
+ * @param Magento_Filesystem $filesystem
* @param array $data
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -62,10 +63,10 @@ public function __construct(
Mage_Core_Model_Store_Config $storeConfig,
Mage_Core_Controller_Varien_Front $frontController,
Mage_Core_Model_Factory_Helper $helperFactory,
+ Magento_Filesystem $filesystem,
array $data = array()
) {
parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $designPackage,
- $session, $storeConfig, $frontController, $helperFactory, $data
- );
+ $session, $storeConfig, $frontController, $helperFactory, $filesystem, $data);
}
}
View
26 app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php
@@ -92,23 +92,27 @@ protected function _prepareLayout()
$this->addChild('save_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Save Newsletter'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array('event' => 'save', 'related' => '#queue_edit_form'),
- )
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'save', 'target' => '#queue_edit_form'),
+ ),
+ ),
));
$this->addChild('save_and_resume', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Save and Resume'),
'class' => 'save',
- 'data_attr' => array(
- 'widget-button' => array(
- 'event' => 'save',
- 'related' => '#queue_edit_form',
- 'eventData' => array(
- 'action' => array(
- 'args' => array('_resume' => 1),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array(
+ 'event' => 'save',
+ 'target' => '#queue_edit_form',
+ 'eventData' => array(
+ 'action' => array(
+ 'args' => array('_resume' => 1),
+ ),
),
- )
+ ),
),
),
));
View
130 app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php
@@ -1,130 +0,0 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-/**
- * Adminhtml newsletter queue grid block
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Adminhtml_Block_Newsletter_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
-{
-
- protected function _construct()
- {
- parent::_construct();
- $this->setId('queueGrid');
- $this->setDefaultSort('start_at');
- $this->setDefaultDir('desc');
- $this->setSaveParametersInSession(true);
- $this->setUseAjax(true);
- }
-
- protected function _prepareCollection()
- {
- $collection = Mage::getResourceModel('Mage_Newsletter_Model_Resource_Queue_Collection')
- ->addSubscribersInfo();
-
- $this->setCollection($collection);
-
- return parent::_prepareCollection();
- }
-
- protected function _prepareColumns()
- {
- $this->addColumn('queue_id', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('ID'),
- 'index' => 'queue_id',
- 'width' => 10
- ));
-
- $this->addColumn('start_at', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Queue Start'),
- 'type' => 'datetime',
- 'index' => 'queue_start_at',
- 'gmtoffset' => true,
- 'default' => ' ---- '
- ));
-
- $this->addColumn('finish_at', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Queue Finish'),
- 'type' => 'datetime',
- 'index' => 'queue_finish_at',
- 'gmtoffset' => true,
- 'default' => ' ---- '
- ));
-
- $this->addColumn('newsletter_subject', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Subject'),
- 'index' => 'newsletter_subject'
- ));
-
- $this->addColumn('status', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Status'),
- 'index' => 'queue_status',
- 'type' => 'options',
- 'options' => array(
- Mage_Newsletter_Model_Queue::STATUS_SENT => Mage::helper('Mage_Newsletter_Helper_Data')->__('Sent'),
- Mage_Newsletter_Model_Queue::STATUS_CANCEL => Mage::helper('Mage_Newsletter_Helper_Data')->__('Cancelled'),
- Mage_Newsletter_Model_Queue::STATUS_NEVER => Mage::helper('Mage_Newsletter_Helper_Data')->__('Not Sent'),
- Mage_Newsletter_Model_Queue::STATUS_SENDING => Mage::helper('Mage_Newsletter_Helper_Data')->__('Sending'),
- Mage_Newsletter_Model_Queue::STATUS_PAUSE => Mage::helper('Mage_Newsletter_Helper_Data')->__('Paused'),
- ),
- 'width' => '100px',
- ));
-
- $this->addColumn('subscribers_sent', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Processed'),
- 'type' => 'number',
- 'index' => 'subscribers_sent'
- ));
-
- $this->addColumn('subscribers_total', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Recipients'),
- 'type' => 'number',
- 'index' => 'subscribers_total'
- ));
-
- $this->addColumn('action', array(
- 'header' => Mage::helper('Mage_Newsletter_Helper_Data')->__('Action'),
- 'filter' => false,
- 'sortable' => false,
- 'no_link' => true,
- 'width' => '100px',
- 'renderer' => 'Mage_Adminhtml_Block_Newsletter_Queue_Grid_Renderer_Action'
- ));
-
- return parent::_prepareColumns();
- }
-
- public function getRowUrl($row)
- {
- return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
- }
-
-}
-
View
4 app/code/core/Mage/Adminhtml/Block/Page/Head.php
@@ -47,6 +47,7 @@ class Mage_Adminhtml_Block_Page_Head extends Mage_Page_Block_Html_Head
* @param Mage_Core_Model_Store_Config $storeConfig
* @param Mage_Core_Controller_Varien_Front $frontController
* @param Mage_Core_Model_Factory_Helper $helperFactory
+ * @param Magento_Filesystem $filesystem
* @param array $data
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -63,10 +64,11 @@ public function __construct(
Mage_Core_Model_Store_Config $storeConfig,
Mage_Core_Controller_Varien_Front $frontController,
Mage_Core_Model_Factory_Helper $helperFactory,
+ Magento_Filesystem $filesystem,
array $data = array()
) {
parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $designPackage,
- $session, $storeConfig, $frontController, $helperFactory, $data
+ $session, $storeConfig, $frontController, $helperFactory, $filesystem, $data
);
}
View
24 app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php
@@ -46,15 +46,17 @@ protected function _construct()
$this->_addButton('save_apply', array(
'class' => 'save',
'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Apply'),
- 'data_attr' => array(
- 'widget-button' => array(
- 'event' => 'save',
- 'related' => '#edit_form',
- 'eventData' => array(
- 'action' => array(
- 'args' => array('auto_apply' => 1),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array(
+ 'event' => 'save',
+ 'target' => '#edit_form',
+ 'eventData' => array(
+ 'action' => array(
+ 'args' => array('auto_apply' => 1),
+ ),
),
- )
+ ),
),
),
));
@@ -62,8 +64,10 @@ protected function _construct()
$this->_addButton('save_and_continue_edit', array(
'class' => 'save',
'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Continue Edit'),
- 'data_attr' => array(
- 'widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#edit_form'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form'),
+ ),
),
), 10);
}
View
6 app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php
@@ -46,8 +46,10 @@ protected function _construct()
$this->_addButton('save_and_continue_edit', array(
'class' => 'save',
'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Save and Continue Edit'),
-