Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update as of 8/9/2012

* Improvements:
  * Implemented "multi-file" scheduled import/export of customers, deleted legacy implementation
  * Ability to import amendments to complex product data, such as custom options
  * Ability to cleanup database before installation using CLI script (`dev/shell/install.php`)
  * Customer export feature performance optimizations
  * Ability to control `robots.txt` via backend (System -> Config -> Design -> Search Engine Robots)
  * Ability to create custom URL rewrites for CMS-pages
* Product editing and attribute set changes:
  * Ability to copy custom options from one product to another
  * Ability to create/change attribute set during product creation/editing
  * Ability to define default values for all system attributes
  * New "Minimal" attribute set which has only required system attributes
* "Google Sitemap" feature changes:
  * The feature is renamed to "XML Sitemap"
  * Reference to a XML sitemap file will be automatically added to `robots.txt` upon update. Controlled by "System -> Config -> Design -> Search Engine Robots", enabled by default
  * Automatic switch to multiple "sitemaps" when size exceeds Google limits
  * Support of images in sitemap
* Removed "HTML Sitemap" feature as such (not the one known as "Google Sitemap")
* Fixes:
  * Map of listed products in XML sitemap will list product last modification date, rather than current date
  * Incorrect timestamp of export file
  * Addressed WSI-compliance issues in SOAP API (V2)
  * Fixed incompatibility of Downloader tool with PHP 5.3
  * Fixed inconsistent behavior of importing duplicated rows in CSV files
  * Fixed message about successful registration not appearing if customer has previously logged out on the shopping cart page
  * Fixed minor configuration issues for "Cache on Delivery Payment" method
  * Fixed wrong order status in some cases when it is placed using PayPal with "Authorization" action
  * Applied Zend framework security hotfix against XML external entity injection via XMLRPC API
  * Fixed inappropriate displaying of credit card credentials to admin user after "reorder" action with Authorize.net and PayPal payment methods involved
  • Loading branch information...
commit e0f1c29d706784384523b84aebae462c73c9b875 1 parent b370593
@mage2-team mage2-team authored
Showing with 16,462 additions and 7,231 deletions.
  1. +32 −0 CHANGELOG.markdown
  2. +30 −5 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php
  3. +6 −2 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php
  4. +1 −12 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php
  5. +31 −6 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php
  6. +20 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
  7. +59 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
  8. +7 −7 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
  9. +9 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php
  10. +21 −2 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php
  11. +84 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Popup/Grid.php
  12. +68 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Options/Ajax.php
  13. +96 −0 app/code/core/Mage/Adminhtml/Block/Page/System/Config/Robots/Reset.php
  14. +1 −1  app/code/core/Mage/Adminhtml/Block/Sitemap.php
  15. +5 −4 app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php
  16. +115 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php
  17. +3 −3 app/code/core/Mage/Adminhtml/Block/Urlrewrite/{ → Catalog}/Category/Tree.php
  18. +170 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php
  19. +193 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php
  20. +8 −7 app/code/core/Mage/Adminhtml/Block/Urlrewrite/{ → Catalog}/Product/Grid.php
  21. +115 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php
  22. +126 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php
  23. +116 −0 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Grid.php
  24. +135 −190 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php
  25. +244 −179 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php
  26. +2 −2 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php
  27. +7 −5 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php
  28. +17 −5 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php
  29. +6 −1 app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
  30. +102 −0 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Robots.php
  31. +72 −12 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php
  32. +39 −8 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
  33. +5 −5 app/code/core/Mage/Adminhtml/controllers/SitemapController.php
  34. +363 −83 app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php
  35. +28 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
  36. +35 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml
  37. +11 −5 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml
  38. +50 −57 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml
  39. +70 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/change_attribute_set_widget.phtml
  40. +2 −1  app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml
  41. +6 −12 ...ntend/seo/sitemap/container.phtml → Adminhtml/view/adminhtml/catalog/product/edit/attribute_set.phtml}
  42. +4 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml
  43. +88 −12 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml
  44. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
  45. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
  46. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
  47. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
  48. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
  49. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
  50. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_gloss-wave_35_f67028_500x100.png
  51. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
  52. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
  53. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-icons_222222_256x240.png
  54. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-icons_228ef1_256x240.png
  55. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
  56. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
  57. BIN  app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/images/ui-icons_ffffff_256x240.png
  58. +1,678 −0 app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/jquery-ui-1.8.21.custom.css
  59. +16 −16 ...Catalog/view/frontend/seo/tree.phtml → Adminhtml/view/adminhtml/page/system/config/robots/reset.phtml}
  60. +1 −1  app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml
  61. +86 −1 app/code/core/Mage/Api/Helper/Data.php
  62. +1 −7 app/code/core/Mage/Api/etc/wsdl2.xml
  63. +1 −1  app/code/core/Mage/Api/etc/wsi.xml
  64. +4 −0 app/code/core/Mage/Api2/Model/Request/Interpreter/Xml.php
  65. +12 −1 app/code/core/Mage/Backend/Block/Widget/Grid.php
  66. +0 −70 app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php
  67. +0 −180 app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php
  68. +0 −180 app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php
  69. +12 −18 app/code/core/Mage/Catalog/Model/Product/Api.php
  70. +0 −60 app/code/core/Mage/Catalog/Model/Product/Api/V2.php
  71. +1 −1  app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php
  72. +29 −0 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php
  73. +48 −3 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php
  74. +34 −3 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php
  75. +3 −2 app/code/core/Mage/Catalog/Model/Resource/Abstract.php
  76. +12 −2 app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php
  77. +0 −74 app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php
  78. +0 −4 app/code/core/Mage/Catalog/etc/config.xml
  79. +0 −27 app/code/core/Mage/Catalog/etc/system.xml
  80. +0 −95 app/code/core/Mage/Catalog/view/frontend/layout.xml
  81. +0 −1  app/code/core/Mage/CatalogSearch/etc/config.xml
  82. +0 −10 app/code/core/Mage/CatalogSearch/etc/system.xml
  83. +77 −0 app/code/core/Mage/Cms/Model/Page/Urlrewrite.php
  84. +9 −7 .../Mage/{CatalogSearch/Model/System/Config/Backend/Sitemap.php → Cms/Model/Resource/Page/Urlrewrite.php}
  85. +1 −1  app/code/core/Mage/Cms/etc/config.xml
  86. +66 −0 app/code/core/Mage/Cms/sql/cms_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php
  87. +12 −2 app/code/core/Mage/Core/Block/Abstract.php
  88. +13 −0 app/code/core/Mage/Core/Helper/Url/Rewrite.php
  89. +27 −22 app/code/core/Mage/{Catalog/Block/Seo/Sitemap/Category.php → Core/Model/Source/Urlrewrite/Options.php}
  90. +23 −18 app/code/core/Mage/{Catalog/Helper/Map.php → Core/Model/Source/Urlrewrite/Types.php}
  91. +7 −3 app/code/core/Mage/Customer/Model/Address.php
  92. +34 −19 app/code/core/Mage/Customer/Model/Customer.php
  93. +12 −21 app/code/core/Mage/Customer/Model/Customer/Api.php
  94. +0 −60 app/code/core/Mage/Customer/Model/Customer/Api/V2.php
  95. +4 −2 app/code/core/Mage/Customer/controllers/AccountController.php
  96. +131 −40 app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php
  97. +36 −10 app/code/core/Mage/Eav/Model/Entity/Abstract.php
  98. +6 −4 app/code/core/Mage/Eav/Model/Entity/Attribute.php
  99. +17 −8 app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
  100. +17 −0 app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php
  101. +65 −10 app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php
  102. +215 −82 app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php
  103. +11 −35 app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php
  104. +97 −0 app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Before.php
  105. +24 −67 app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php
  106. +2 −31 app/code/core/Mage/ImportExport/Helper/Data.php
  107. +11 −42 app/code/core/Mage/ImportExport/Model/Export.php
  108. +1 −1  app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php
  109. +0 −282 app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php
  110. +56 −31 app/code/core/Mage/ImportExport/Model/Export/Entity/{V2 → }/Eav/Customer.php
  111. +247 −0 app/code/core/Mage/ImportExport/Model/Export/Entity/Eav/Customer/Address.php
  112. +35 −23 app/code/core/Mage/ImportExport/Model/Export/Entity/{V2/Eav/Abstract.php → EavAbstract.php}
  113. +0 −180 app/code/core/Mage/ImportExport/Model/Export/Entity/V2/Eav/Customer/Address.php
  114. +98 −20 app/code/core/Mage/ImportExport/Model/Export/{Entity/V2/Abstract.php → EntityAbstract.php}
  115. +82 −62 app/code/core/Mage/ImportExport/Model/Import.php
  116. +2 −2 app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
  117. +0 −647 app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php
  118. +0 −489 app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php
  119. +507 −0 app/code/core/Mage/ImportExport/Model/Import/Entity/CustomerComposite.php
  120. +62 −39 app/code/core/Mage/ImportExport/Model/Import/Entity/{V2 → }/Eav/Customer.php
  121. +118 −76 app/code/core/Mage/ImportExport/Model/Import/Entity/{V2 → }/Eav/Customer/Address.php
  122. +47 −55 ...e/core/Mage/ImportExport/Model/Import/Entity/{V2/Eav/Customer/Abstract.php → Eav/CustomerAbstract.php}
  123. +82 −24 app/code/core/Mage/ImportExport/Model/Import/Entity/{V2/Eav/Abstract.php → EavAbstract.php}
  124. +68 −266 app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php
  125. +1,518 −0 app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Option.php
  126. +2 −2 app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php
  127. +1 −1  app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php
  128. +1 −1  app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php
  129. +131 −81 app/code/core/Mage/ImportExport/Model/Import/{Entity/V2/Abstract.php → EntityAbstract.php}
  130. +69 −0 app/code/core/Mage/ImportExport/Model/Resource/CollectionByPagesIterator.php
  131. +147 −0 app/code/core/Mage/ImportExport/Model/Resource/Customer/Storage.php
  132. +137 −0 app/code/core/Mage/ImportExport/Model/Resource/Import/CustomerComposite/Data.php
  133. +23 −5 app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php
  134. +1 −1  app/code/core/Mage/ImportExport/Model/Source/Export/{Format/File.php → Format.php}
  135. +64 −0 app/code/core/Mage/ImportExport/Model/Source/Import/Behavior/Basic.php
  136. +22 −22 app/code/core/Mage/ImportExport/Model/Source/Import/{Behavior.php → Behavior/Custom.php}
  137. +44 −23 app/code/core/Mage/ImportExport/Model/Source/{Format/Version.php → Import/BehaviorAbstract.php}
  138. +0 −76 app/code/core/Mage/ImportExport/Model/Source/Import/Customer/V2/Behavior.php
  139. +0 −4 app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php
  140. +33 −22 app/code/core/Mage/ImportExport/etc/config.xml
  141. +31 −0 app/code/core/Mage/ImportExport/sql/importexport_setup/upgrade-1.6.0.3-1.6.0.4.php
  142. +0 −2  app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml
  143. +49 −134 app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml
  144. +8 −14 app/code/core/Mage/ImportExport/view/adminhtml/export/form/filter/after.phtml
  145. +0 −4 app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml
  146. +32 −117 app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml
  147. +1 −1  app/code/core/Mage/ImportExport/view/adminhtml/layout.xml
  148. +21 −7 app/code/core/Mage/Install/Model/Installer/Console.php
  149. +1 −1  app/code/core/Mage/Page/Block/Html/Head.php
  150. +13 −12 app/code/core/Mage/{ImportExport/Model/Source/Export/Customer/Entity.php → Page/Helper/Robots.php}
  151. +28 −1 app/code/core/Mage/Page/etc/config.xml
  152. +39 −9 app/code/core/Mage/Page/etc/system.xml
  153. +2 −4 app/code/core/Mage/Payment/Block/Info/Instructions.php
  154. +7 −6 app/code/core/Mage/Paypal/Model/Ipn.php
  155. +4 −2 app/code/core/Mage/Sales/Model/Api/Resource.php
  156. +44 −56 app/code/core/Mage/Sales/Model/Order/Api.php
  157. +0 −97 app/code/core/Mage/Sales/Model/Order/Api/V2.php
  158. +18 −19 app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php
  159. +1 −0  app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php
  160. +29 −42 app/code/core/Mage/Sales/Model/Order/Invoice/Api.php
  161. +20 −87 app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php
  162. +15 −20 app/code/core/Mage/Sales/Model/Order/Shipment/Api.php
  163. +4 −59 app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php
  164. +0 −877 app/code/core/Mage/Sales/etc/config.xml
  165. +137 −0 app/code/core/Mage/Sitemap/Helper/Data.php
  166. +21 −17 app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php
  167. +213 −53 app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php
  168. +8 −7 app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php
  169. +537 −87 app/code/core/Mage/Sitemap/Model/Sitemap.php
  170. +18 −9 ...ImportExport/Model/Source/Import/Customer/Entity.php → Sitemap/Model/Source/Product/Image/Include.php}
  171. +2 −2 app/code/core/Mage/Sitemap/etc/adminhtml/acl.xml
  172. +1 −1  app/code/core/Mage/Sitemap/etc/adminhtml/menu.xml
  173. +8 −0 app/code/core/Mage/Sitemap/etc/config.xml
  174. +57 −2 app/code/core/Mage/Sitemap/etc/system.xml
  175. +1 −1  app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php
  176. +13 −11 app/code/core/Mage/XmlConnect/controllers/PbridgeController.php
  177. +442 −0 app/code/core/Zend/XmlRpc/Request.php
  178. +254 −0 app/code/core/Zend/XmlRpc/Response.php
  179. +0 −10 app/design/frontend/default/default/skin/blank/css/styles.css
  180. +0 −10 app/design/frontend/default/default/skin/blue/css/styles.css
  181. +0 −10 app/design/frontend/default/default/skin/default/css/styles.css
  182. +0 −74 app/design/frontend/default/iphone/Mage_Catalog/layout.xml
  183. +0 −3  app/design/frontend/default/iphone/skin/default/css/iphone.css
  184. +0 −77 app/design/frontend/default/modern/Mage_Catalog/layout.xml
  185. +0 −10 app/design/frontend/default/modern/skin/default/css/styles.css
  186. +1 −1  dev/shell/install.php
  187. +63 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/OptionTest.php
  188. +18 −32 ...stract.php → dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Options/AjaxTest.php
  189. +285 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/EditTest.php
  190. +97 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/TreeTest.php
  191. +253 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Catalog/Edit/FormTest.php
  192. +361 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Catalog/Product/EditTest.php
  193. +58 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Catalog/Product/GridTest.php
  194. +170 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/FormTest.php
  195. +285 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/EditTest.php
  196. +71 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/GridTest.php
  197. +184 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/Edit/FormTest.php
  198. +189 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Urlrewrite/EditTest.php
  199. +46 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Model/Sales/Order/CreateTest.php
  200. +109 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Model/System/Config/Backend/Admin/RobotsTest.php
  201. +31 −0 dev/tests/integration/testsuite/Mage/Adminhtml/_files/no_robots_txt.php
  202. +1 −0  dev/tests/integration/testsuite/Mage/Adminhtml/_files/robots.txt
  203. +28 −0 dev/tests/integration/testsuite/Mage/Adminhtml/_files/robots_txt.php
  204. +15 −4 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/UrlrewriteControllerTest.php
  205. +0 −67 dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php
  206. +5 −1 dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php
  207. +4 −1 dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php
  208. +48 −0 dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_options.php
  209. +0 −99 dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php
  210. +102 −0 dev/tests/integration/testsuite/Mage/ImportExport/Block/Adminhtml/Export/Edit/FormTest.php
  211. +30 −10 dev/tests/integration/testsuite/Mage/ImportExport/Block/Adminhtml/Import/Edit/FormTest.php
  212. +11 −9 ...tests/integration/testsuite/Mage/ImportExport/Model/Export/Entity/{V2 → }/Eav/Customer/AddressTest.php
  213. +47 −6 dev/tests/integration/testsuite/Mage/ImportExport/Model/Export/Entity/{V2 → }/Eav/CustomerTest.php
  214. +6 −54 ...ration/testsuite/Mage/ImportExport/Model/Export/Entity/{V2/Eav/AbstractTest.php → EavAbstractTest.php}
  215. +8 −8 ...gration/testsuite/Mage/ImportExport/Model/Export/{Entity/V2/AbstractTest.php → EntityAbstractTest.php}
  216. +100 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/ExportTest.php
  217. +196 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerCompositeTest.php
  218. +0 −258 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerTest.php
  219. +76 −70 ...tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → }/Eav/Customer/AddressTest.php
  220. +12 −12 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → Eav}/CustomerImportTest.php
  221. +24 −24 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → Eav}/CustomerValidateTest.php
  222. 0  ...ntegration/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → Eav}/_files/address_import_delete.csv
  223. 0  ...ntegration/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → Eav}/_files/address_import_update.csv
  224. 0  ...on/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → Eav}/_files/customers_for_validation_test.csv
  225. 0  .../integration/testsuite/Mage/ImportExport/Model/Import/Entity/{V2 → Eav}/_files/customers_to_import.csv
  226. +86 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/EavAbstractTest.php
  227. +318 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/ProductTest.php
  228. +0 −162 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/V2/Eav/AbstractTest.php
  229. +2 −0  dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/_files/customer_composite_delete.csv
  230. +7 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/_files/customer_composite_update.csv
  231. +11 −0 dev/tests/integration/testsuite/Mage/ImportExport/Model/Import/Entity/_files/product_with_custom_options.csv
  232. +7 −5 ...gration/testsuite/Mage/ImportExport/Model/Import/{Entity/V2/AbstractTest.php → EntityAbstractTest.php}
  233. +84 −40 dev/tests/integration/testsuite/Mage/ImportExport/Model/ImportTest.php
  234. +1 −0  dev/tests/integration/testsuite/Mage/ImportExport/_files/customers.php
  235. +0 −44 dev/tests/integration/testsuite/Mage/ImportExport/_files/customers_for_address_import.php
  236. +1 −3 dev/tests/integration/testsuite/Mage/ImportExport/_files/import_data.php
  237. +2 −4 dev/tests/integration/testsuite/Mage/ImportExport/controllers/Adminhtml/ExportControllerTest.php
  238. +18 −0 dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php
  239. +54 −0 dev/tests/integration/testsuite/Mage/Page/Helper/RobotsTest.php
  240. +21 −0 dev/tests/integration/testsuite/Mage/Page/_files/robots.txt
  241. +55 −0 dev/tests/integration/testsuite/Mage/Sales/_files/order_paid_with_saved_cc.php
  242. +55 −0 dev/tests/integration/testsuite/Mage/Sales/_files/order_paid_with_verisign.php
  243. +134 −0 dev/tests/integration/testsuite/Mage/Sitemap/Helper/DataTest.php
  244. +180 −0 dev/tests/integration/testsuite/Mage/Sitemap/Model/Resource/Catalog/ProductTest.php
  245. BIN  dev/tests/integration/testsuite/Mage/Sitemap/_files/magento_image_sitemap.png
  246. BIN  dev/tests/integration/testsuite/Mage/Sitemap/_files/second_image.png
  247. +104 −0 dev/tests/integration/testsuite/Mage/Sitemap/_files/sitemap_products.php
  248. +28 −0 dev/tests/integration/testsuite/Mage/Sitemap/_files/sitemap_products_rollback.php
  249. +12 −3 dev/tests/integration/testsuite/integrity/Mage/Payment/MethodsTest.php
  250. +81 −0 dev/tests/static/testsuite/Integrity/ConfigTest.php
  251. +0 −49 dev/tests/static/testsuite/Legacy/ConfigTest.php
  252. +11 −0 dev/tests/static/testsuite/Php/_files/whitelist/core.txt
  253. +2 −2 dev/tests/unit/framework/Magento/Test/TestCase/ZendDbAdapterAbstract.php
  254. +69 −0 dev/tests/unit/testsuite/Mage/Adminhtml/Block/Page/System/Config/Robots/ResetTest.php
  255. +12 −3 dev/tests/unit/testsuite/Mage/Adminhtml/Block/UrlrewriteTest.php
  256. +61 −0 dev/tests/unit/testsuite/Mage/Backend/Block/Widget/GridTest.php
  257. +112 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php
  258. +97 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php
  259. +110 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Resource/AbstractTest.php
  260. +90 −0 dev/tests/unit/testsuite/Mage/Cms/Model/Page/UrlrewriteTest.php
  261. +87 −0 dev/tests/unit/testsuite/Mage/Core/Helper/Url/RewriteTest.php
  262. +71 −0 dev/tests/unit/testsuite/Mage/Core/Model/Source/Urlrewrite/OptionsTest.php
  263. +70 −0 dev/tests/unit/testsuite/Mage/Core/Model/Source/Urlrewrite/TypesTest.php
  264. +156 −0 dev/tests/unit/testsuite/Mage/Eav/Model/Entity/AbstractTest.php
  265. +84 −0 dev/tests/unit/testsuite/Mage/Eav/Model/Entity/Attribute/Backend/AbstractTest.php
  266. +99 −0 dev/tests/unit/testsuite/Mage/Eav/Model/Entity/Attribute/SetTest.php
  267. +2 −2 dev/tests/unit/testsuite/Mage/Eav/Model/Entity/AttributeTest.php
Sorry, we could not display the entire diff because too many files (371) changed.
View
32 CHANGELOG.markdown
@@ -1,3 +1,35 @@
+Update as of 8/9/2012
+=====================
+* Improvements:
+ * Implemented "multi-file" scheduled import/export of customers, deleted legacy implementation
+ * Ability to import amendments to complex product data, such as custom options
+ * Ability to cleanup database before installation using CLI script (`dev/shell/install.php`)
+ * Customer export feature performance optimizations
+ * Ability to control `robots.txt` via backend (System -> Config -> Design -> Search Engine Robots)
+ * Ability to create custom URL rewrites for CMS-pages
+* Product editing and attribute set changes:
+ * Ability to copy custom options from one product to another
+ * Ability to create/change attribute set during product creation/editing
+ * Ability to define default values for all system attributes
+ * New "Minimal" attribute set which has only required system attributes
+* "Google Sitemap" feature changes:
+ * The feature is renamed to "XML Sitemap"
+ * Reference to a XML sitemap file will be automatically added to `robots.txt` upon update. Controlled by "System -> Config -> Design -> Search Engine Robots", enabled by default
+ * Automatic switch to multiple "sitemaps" when size exceeds Google limits
+ * Support of images in sitemap
+* Removed "HTML Sitemap" feature as such (not the one known as "Google Sitemap")
+* Fixes:
+ * Map of listed products in XML sitemap will list product last modification date, rather than current date
+ * Incorrect timestamp of export file
+ * Addressed WSI-compliance issues in SOAP API (V2)
+ * Fixed incompatibility of Downloader tool with PHP 5.3
+ * Fixed inconsistent behavior of importing duplicated rows in CSV files
+ * Fixed message about successful registration not appearing if customer has previously logged out on the shopping cart page
+ * Fixed minor configuration issues for "Cache on Delivery Payment" method
+ * Fixed wrong order status in some cases when it is placed using PayPal with "Authorization" action
+ * Applied Zend framework security hotfix against XML external entity injection via XMLRPC API
+ * Fixed inappropriate displaying of credit card credentials to admin user after "reorder" action with Authorize.net and PayPal payment methods involved
+
Update as of 8/2/2012
=====================
* Refactored ACL for the backend
View
35 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php
@@ -29,12 +29,14 @@
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
-
+ /**
+ * Update block controls
+ */
public function __construct()
{
$this->_objectId = 'attribute_id';
@@ -53,6 +55,16 @@ public function __construct()
'level' => -1
)
);
+ $this->_addButton(
+ 'save_in_new_set',
+ array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save in New Attribute Set'),
+ 'class' => 'save',
+ 'onclick' => 'saveAttributeInNewSet(\''
+ . Mage::helper('Mage_Catalog_Helper_Data')->__('Enter Name for New Attribute Set')
+ . '\')',
+ )
+ );
} else {
$this->_addButton(
'save_and_edit_button',
@@ -75,6 +87,11 @@ public function __construct()
}
}
+ /**
+ * Retrieve header text
+ *
+ * @return string
+ */
public function getHeaderText()
{
if (Mage::registry('entity_attribute')->getId()) {
@@ -84,16 +101,24 @@ public function getHeaderText()
}
return Mage::helper('Mage_Catalog_Helper_Data')->__('Edit Product Attribute "%s"', $this->escapeHtml($frontendLabel));
}
- else {
- return Mage::helper('Mage_Catalog_Helper_Data')->__('New Product Attribute');
- }
+ return Mage::helper('Mage_Catalog_Helper_Data')->__('New Product Attribute');
}
+ /**
+ * Retrieve URL for validation
+ *
+ * @return string
+ */
public function getValidationUrl()
{
return $this->getUrl('*/*/validate', array('_current'=>true));
}
+ /**
+ * Retrieve URL for save
+ *
+ * @return string
+ */
public function getSaveUrl()
{
return $this->getUrl('*/'.$this->_controller.'/save', array('_current'=>true, 'back'=>null));
View
8 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php
@@ -27,10 +27,14 @@
/**
* Product attribute add/edit form options tab
*
+ * @method Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options setReadOnly(bool $value)
+ * @method null|bool getReadOnly
+ *
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
+class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
+ extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
{
}
View
13 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php
@@ -29,7 +29,7 @@
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
{
@@ -52,23 +52,12 @@ protected function _beforeToHtml()
'active' => true
));
- $model = Mage::registry('entity_attribute');
-
$this->addTab('labels', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Manage Label / Options'),
'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Manage Label / Options'),
'content' => $this->getLayout()
->createBlock('Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options')->toHtml(),
));
-
- /*if ('select' == $model->getFrontendInput()) {
- $this->addTab('options_section', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Options Control'),
- 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Options Control'),
- 'content' => $this->getLayout()
- ->createBlock('Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options')->toHtml(),
- ));
- }*/
return parent::_beforeToHtml();
}
View
37 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php
@@ -29,19 +29,26 @@
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Created extends Mage_Adminhtml_Block_Widget
{
+ /**
+ * Set block template
+ */
public function __construct()
{
parent::__construct();
$this->setTemplate('catalog/product/attribute/new/created.phtml');
}
+ /**
+ * Add additional blocks to layout
+ *
+ * @return void
+ */
protected function _prepareLayout()
{
-
$this->setChild(
'attributes',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Attributes')
@@ -56,16 +63,20 @@ protected function _prepareLayout()
'onclick' => 'addAttribute(true)'
))
);
-
}
+ /**
+ * Retrieve list of product attributes
+ *
+ * @return array
+ */
protected function _getGroupAttributes()
{
$attributes = array();
+ /** @var $product Mage_Catalog_Model_Product */
$product = Mage::registry('product');
- /* @var $product Mage_Catalog_Model_Product */
foreach($product->getAttributes($this->getRequest()->getParam('group')) as $attribute) {
- /* @var $attribute Mage_Eav_Model_Entity_Attribute */
+ /** @var $attribute Mage_Eav_Model_Entity_Attribute */
if ($attribute->getId() == $this->getRequest()->getParam('attribute')) {
$attributes[] = $attribute;
}
@@ -73,17 +84,31 @@ protected function _getGroupAttributes()
return $attributes;
}
+ /**
+ * Retrieve HTML for 'Close' button
+ *
+ * @return string
+ */
public function getCloseButtonHtml()
{
return $this->getChildHtml('close_button');
}
+ /**
+ * Retrieve attributes data as JSON
+ *
+ * @return string
+ */
public function getAttributesBlockJson()
{
$result = array(
$this->getRequest()->getParam('tab') => $this->getChildHtml('attributes')
);
+ $newAttributeSetId = $this->getRequest()->getParam('new_attribute_set_id');
+ if ($newAttributeSetId) {
+ $result['newAttributeSetId'] = $newAttributeSetId;
+ }
return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result);
}
-} // Class Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Created End
+}
View
20 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
@@ -74,6 +74,16 @@ protected function _prepareLayout()
}
if (!$this->getProduct()->isReadonly()) {
+ $this->setChild('change_attribute_set_button',
+ $this->getLayout()->createBlock(
+ 'Mage_Adminhtml_Block_Widget_Button',
+ $this->getNameInLayout() . '-change-attribute-set'
+ )->setData(array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Change Attribute Set'),
+ 'onclick' => "jQuery('#attribute-set-info').dialog('open');"
+ ))
+ );
+
$this->setChild('reset_button',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
@@ -145,6 +155,16 @@ public function getSaveButtonHtml()
return $this->getChildHtml('save_button');
}
+ /**
+ * Get Change AttributeSet Button html
+ *
+ * @return string
+ */
+ public function getChangeAttributeSetButtonHtml()
+ {
+ return $this->getChildHtml('change_attribute_set_button');
+ }
+
public function getSaveAndEditButtonHtml()
{
return $this->getChildHtml('save_and_edit_button');
View
59 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
@@ -0,0 +1,59 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Create product attribute set selector
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Adminhtml_Block_Widget_Form
+{
+ protected function _prepareForm()
+ {
+ $form = new Varien_Data_Form();
+
+ $fieldset = $form->addFieldset('settings', array(
+ 'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__('Product Settings')
+ ));
+
+ $entityType = Mage::registry('product')->getResource()->getEntityType();
+
+ $fieldset->addField('attribute_set_id', 'select', array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Set'),
+ 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Set'),
+ 'name' => 'set',
+ 'value' => Mage::registry('product')->getAttributeSetId(),
+ 'values'=> Mage::getResourceModel('Mage_Eav_Model_Resource_Entity_Attribute_Set_Collection')
+ ->setEntityTypeFilter($entityType->getId())
+ ->load()
+ ->toOptionArray()
+ ));
+
+ $this->setForm($form);
+ }
+}
View
14 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
@@ -56,9 +56,9 @@ protected function _prepareForm()
$group = $this->getGroup();
if ($group) {
$form = new Varien_Data_Form();
-
+ $product = Mage::registry('product');
// Initialize product object as form property to use it during elements generation
- $form->setDataObject(Mage::registry('product'));
+ $form->setDataObject($product);
$fieldset = $form->addFieldset('group_fields' . $group->getId(), array(
'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__($group->getAttributeGroupName()),
@@ -118,10 +118,10 @@ protected function _prepareForm()
$form->getElement('meta_description')->setOnkeyup('checkMaxLength(this, 255);');
}
- $values = Mage::registry('product')->getData();
+ $values = $product->getData();
- // Set default attribute values for new product
- if (!Mage::registry('product')->getId()) {
+ // Set default attribute values for new product or on attribute set change
+ if (!$product->getId() || $product->dataHasChangedFor('attribute_set_id')) {
foreach ($attributes as $attribute) {
if (!isset($values[$attribute->getAttributeCode()])) {
$values[$attribute->getAttributeCode()] = $attribute->getDefaultValue();
@@ -129,8 +129,8 @@ protected function _prepareForm()
}
}
- if (Mage::registry('product')->hasLockedAttributes()) {
- foreach (Mage::registry('product')->getLockedAttributes() as $attribute) {
+ if ($product->hasLockedAttributes()) {
+ foreach ($product->getLockedAttributes() as $attribute) {
$element = $form->getElement($attribute);
if ($element) {
$element->setReadonly(true, true);
View
9 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php
@@ -56,6 +56,15 @@ protected function _prepareLayout()
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option')
);
+ $this->setChild('import_button',
+ $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
+ ->setData(array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Import Options'),
+ 'class' => 'add',
+ 'id' => 'import_new_defined_option'
+ ))
+ );
+
return parent::_prepareLayout();
}
View
23 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php
@@ -216,9 +216,8 @@ public function getTemplatesHtml()
public function getOptionValues()
{
$optionsArr = array_reverse($this->getProduct()->getOptions(), true);
-// $optionsArr = $this->getProduct()->getOptions();
- if (!$this->_values) {
+ if (!$this->_values || $this->getIgnoreCaching()) {
$showPrice = $this->getCanReadPrice();
$values = array();
$scope = (int) Mage::app()->getStore()->getConfig(Mage_Core_Model_Store::XML_PATH_PRICE_SCOPE);
@@ -342,4 +341,24 @@ public function getPriceValue($value, $type)
return number_format($value, 2, null, '');
}
}
+
+ /**
+ * Return product grid url for custom options import popup
+ *
+ * @return string
+ */
+ public function getProductGridUrl()
+ {
+ return $this->getUrl('*/*/optionsImportGrid');
+ }
+
+ /**
+ * Return custom options getter URL for ajax queries
+ *
+ * @return string
+ */
+ public function getCustomOptionsUrl()
+ {
+ return $this->getUrl('*/*/customOptions');
+ }
}
View
84 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Popup/Grid.php
@@ -0,0 +1,84 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Adminhtml product grid in custom options popup
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Popup_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
+{
+ /**
+ * Return empty row url for disabling JS click events
+ *
+ * @param Mage_Catalog_Model_Product|Varien_Object
+ * @return string|null
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function getRowUrl($row)
+ {
+ return null;
+ }
+
+ /**
+ * Remove some grid columns for product grid in popup
+ */
+ public function _prepareColumns()
+ {
+ parent::_prepareColumns();
+ $this->removeColumn('action');
+ $this->removeColumn('status');
+ $this->removeColumn('visibility');
+ $this->clearRss();
+ }
+
+ /**
+ * Add import action to massaction block
+ *
+ * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Popup_Grid
+ */
+ public function _prepareMassaction()
+ {
+ $this->setMassactionIdField('entity_id');
+ $this->getMassactionBlock()
+ ->setFormFieldName('product')
+ ->addItem('import', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Import')));
+
+ return $this;
+ }
+
+ /**
+ * Define grid update URL for ajax queries
+ *
+ * @return string
+ */
+ public function getGridUrl()
+ {
+ return $this->getUrl('*/*/optionsimportgrid');
+ }
+}
View
68 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Options/Ajax.php
@@ -0,0 +1,68 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * JSON products custom options
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Options_Ajax extends Mage_Backend_Block_Abstract
+{
+ /**
+ * Return product custom options in JSON format
+ *
+ * @return string
+ */
+ protected function _toHtml()
+ {
+ $results = array();
+ /** @var $optionsBlock Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option */
+ $optionsBlock = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option')
+ ->setIgnoreCaching(true);
+
+ $products = Mage::registry('import_option_products');
+ if (is_array($products)) {
+ foreach ($products as $productId) {
+ $product = Mage::getModel('Mage_Catalog_Model_Product')->load((int)$productId);
+ if (!$product->getId()) {
+ continue;
+ }
+
+ $optionsBlock->setProduct($product);
+ $results = array_merge($results, $optionsBlock->getOptionValues());
+ }
+ }
+
+ $output = array();
+ foreach ($results as $resultObject) {
+ $output[] = $resultObject->getData();
+ }
+
+ return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($output);
+ }
+}
View
96 app/code/core/Mage/Adminhtml/Block/Page/System/Config/Robots/Reset.php
@@ -0,0 +1,96 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * "Reset to Defaults" button renderer
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Page_System_Config_Robots_Reset extends Mage_Adminhtml_Block_System_Config_Form_Field
+{
+ /*
+ * Set template
+ */
+ protected function _construct()
+ {
+ parent::_construct();
+ $this->setTemplate('page/system/config/robots/reset.phtml');
+ }
+
+ /**
+ * Get robots.txt custom instruction default value
+ *
+ * @return string
+ */
+ public function getRobotsDefaultCustomInstructions()
+ {
+ return Mage::helper('Mage_Page_Helper_Robots')->getRobotsDefaultCustomInstructions();
+ }
+
+ /**
+ * Generate button html
+ *
+ * @return string
+ */
+ public function getButtonHtml()
+ {
+ $button = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
+ ->setData(array(
+ 'id' => 'reset_to_default_button',
+ 'label' => $this->helper('Mage_Adminhtml_Helper_Data')->__('Reset to Default'),
+ 'onclick' => 'javascript:resetRobotsToDefault(); return false;'
+ ));
+
+ return $button->toHtml();
+ }
+
+ /**
+ * Render button
+ *
+ * @param Varien_Data_Form_Element_Abstract $element
+ * @return string
+ */
+ public function render(Varien_Data_Form_Element_Abstract $element)
+ {
+ // Remove scope label
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
+ return parent::render($element);
+ }
+
+ /**
+ * Return element html
+ *
+ * @param Varien_Data_Form_Element_Abstract $element
+ * @return string
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
+ {
+ return $this->_toHtml();
+ }
+}
View
2  app/code/core/Mage/Adminhtml/Block/Sitemap.php
@@ -39,7 +39,7 @@ class Mage_Adminhtml_Block_Sitemap extends Mage_Adminhtml_Block_Widget_Grid_Cont
public function __construct()
{
$this->_controller = 'sitemap';
- $this->_headerText = Mage::helper('Mage_Sitemap_Helper_Data')->__('Google Sitemap');
+ $this->_headerText = Mage::helper('Mage_Sitemap_Helper_Data')->__('XML Sitemap');
$this->_addButtonLabel = Mage::helper('Mage_Sitemap_Helper_Data')->__('Add Sitemap');
parent::__construct();
}
View
9 app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php
@@ -41,14 +41,15 @@ class Mage_Adminhtml_Block_Sitemap_Grid_Renderer_Link extends Mage_Adminhtml_Blo
*/
public function render(Varien_Object $row)
{
- $fileName = preg_replace('/^\//', '', $row->getSitemapPath() . $row->getSitemapFilename());
- $url = $this->escapeHtml(
- Mage::app()->getStore($row->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . $fileName
- );
+ /** @var $sitemap Mage_Sitemap_Model_Sitemap */
+ $sitemap = Mage::getModel('Mage_Sitemap_Model_Sitemap');
+ $url = $this->escapeHtml($sitemap->getSitemapUrl($row->getSitemapPath(), $row->getSitemapFilename()));
+ $fileName = preg_replace('/^\//', '', $row->getSitemapPath() . $row->getSitemapFilename());
if (file_exists(BP . DS . $fileName)) {
return sprintf('<a href="%1$s">%1$s</a>', $url);
}
+
return $url;
}
View
115 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php
@@ -0,0 +1,115 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Block for Catalog Category URL rewrites
+ *
+ * @method Mage_Catalog_Model_Category getCategory()
+ * @method Mage_Adminhtml_Block_Urlrewrite_Catalog_Category_Edit setCategory(Mage_Catalog_Model_Category $category)
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Urlrewrite_Catalog_Category_Edit extends Mage_Adminhtml_Block_Urlrewrite_Edit
+{
+ /**
+ * Prepare layout for URL rewrite creating for category
+ */
+ protected function _prepareLayoutFeatures()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+
+ if ($this->_getUrlRewrite()->getId()) {
+ $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Edit URL Rewrite for a Category');
+ } else {
+ $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add URL Rewrite for a Category');
+ }
+
+ if ($this->_getCategory()->getId()) {
+ $this->_addCategoryLinkBlock();
+ $this->_addEditFormBlock();
+ $this->_updateBackButtonLink($helper->getUrl('*/*/edit') . 'category');
+ } else {
+ $this->_addUrlRewriteSelectorBlock();
+ $this->_addCategoryTreeBlock();
+ }
+ }
+
+ /**
+ * Get or create new instance of category
+ *
+ * @return Mage_Catalog_Model_Product
+ */
+ private function _getCategory()
+ {
+ if (!$this->hasData('category')) {
+ $this->setCategory(Mage::getModel('Mage_Catalog_Model_Category'));
+ }
+ return $this->getCategory();
+ }
+
+ /**
+ * Add child category link block
+ */
+ private function _addCategoryLinkBlock()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+ $this->setChild('category_link', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Link')
+ ->setData(array(
+ 'item_url' => $helper->getUrl('*/*/*') . 'category',
+ 'item_name' => $this->_getCategory()->getName(),
+ 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Category:')
+ ))
+ );
+ }
+
+ /**
+ * Add child category tree block
+ */
+ private function _addCategoryTreeBlock()
+ {
+ $this->setChild(
+ 'categories_tree',
+ $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Catalog_Category_Tree')
+ );
+ }
+
+ /**
+ * Creates edit form block
+ *
+ * @return Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form
+ */
+ protected function _createEditFormBlock()
+ {
+ return $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form', '', array(
+ 'category' => $this->_getCategory(),
+ 'url_rewrite' => $this->_getUrlRewrite()
+ ));
+ }
+}
View
6 ...Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php → ...inhtml/Block/Urlrewrite/Catalog/Category/Tree.php
@@ -25,13 +25,13 @@
*/
/**
- * Categories tree block for urlrewrites
+ * Categories tree block for URL rewrites editing process
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Urlrewrite_Category_Tree extends Mage_Adminhtml_Block_Catalog_Category_Abstract
+class Mage_Adminhtml_Block_Urlrewrite_Catalog_Category_Tree extends Mage_Adminhtml_Block_Catalog_Category_Abstract
{
/**
* List of allowed category ids
View
170 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php
@@ -0,0 +1,170 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Edit form for Catalog product and category URL rewrites
+ *
+ * @method Mage_Catalog_Model_Product getProduct()
+ * @method Mage_Catalog_Model_Category getCategory()
+ * @method Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form setProduct(Mage_Catalog_Model_Product $product)
+ * @method Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form setCategory(Mage_Catalog_Model_Category $category)
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form extends Mage_Adminhtml_Block_Urlrewrite_Edit_Form
+{
+ /**
+ * Form post init
+ *
+ * @param Varien_Data_Form $form
+ * @return Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form
+ */
+ protected function _formPostInit($form)
+ {
+ // Set form action
+ $form->setAction(
+ Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl('*/*/save', array(
+ 'id' => $this->_getModel()->getId(),
+ 'product' => $this->_getProduct()->getId(),
+ 'category' => $this->_getCategory()->getId()
+ ))
+ );
+
+ // Fill id path, request path and target path elements
+ /** @var $idPath Varien_Data_Form_Element_Abstract */
+ $idPath = $this->getForm()->getElement('id_path');
+ /** @var $requestPath Varien_Data_Form_Element_Abstract */
+ $requestPath = $this->getForm()->getElement('request_path');
+ /** @var $targetPath Varien_Data_Form_Element_Abstract */
+ $targetPath = $this->getForm()->getElement('target_path');
+
+ $model = $this->_getModel();
+ $disablePaths = false;
+ if (!$model->getId()) {
+ $product = null;
+ $category = null;
+ if ($this->_getProduct()->getId()) {
+ $product = $this->_getProduct();
+ $category = $this->_getCategory();
+ } elseif ($this->_getCategory()->getId()) {
+ $category = $this->_getCategory();
+ }
+
+ if ($product || $category) {
+ /** @var $catalogUrlModel Mage_Catalog_Model_Url */
+ $catalogUrlModel = Mage::getSingleton('Mage_Catalog_Model_Url');
+ $idPath->setValue($catalogUrlModel->generatePath('id', $product, $category));
+
+ $sessionData = $this->_getSessionData();
+ if (!isset($sessionData['request_path'])) {
+ $requestPath->setValue($catalogUrlModel->generatePath('request', $product, $category, ''));
+ }
+ $targetPath->setValue($catalogUrlModel->generatePath('target', $product, $category));
+ $disablePaths = true;
+ }
+ } else {
+ $disablePaths = $model->getProductId() || $model->getCategoryId();
+ }
+
+ // Disable id_path and target_path elements
+ if ($disablePaths) {
+ $idPath->setData('disabled', true);
+ $targetPath->setData('disabled', true);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get catalog entity associated stores
+ *
+ * @return array
+ * @throws Mage_Core_Model_Store_Exception
+ */
+ protected function _getEntityStores()
+ {
+ $product = $this->_getProduct();
+ $category = $this->_getCategory();
+ $entityStores = array();
+
+ // showing websites that only associated to products
+ if ($product->getId()) {
+ $entityStores = (array) $product->getStoreIds();
+
+ //if category is chosen, reset stores which are not related with this category
+ if ($category->getId()) {
+ $categoryStores = (array) $category->getStoreIds();
+ $entityStores = array_intersect($entityStores, $categoryStores);
+ }
+ if (!$entityStores) {
+ throw new Mage_Core_Model_Store_Exception(
+ Mage::helper('Mage_Adminhtml_Helper_Data')
+ ->__('Chosen product does not associated with any website, so URL rewrite is not possible.')
+ );
+ }
+ $this->_requireStoresFilter = true;
+ } elseif ($category->getId()) {
+ $entityStores = (array) $category->getStoreIds();
+ if (!$entityStores) {
+ throw new Mage_Core_Model_Store_Exception(
+ Mage::helper('Mage_Adminhtml_Helper_Data')
+ ->__('Chosen category does not associated with any website, so URL rewrite is not possible.')
+ );
+ }
+ $this->_requireStoresFilter = true;
+ }
+
+ return $entityStores;
+ }
+
+ /**
+ * Get product model instance
+ *
+ * @return Mage_Catalog_Model_Product
+ */
+ protected function _getProduct()
+ {
+ if (!$this->hasData('product')) {
+ $this->setProduct(Mage::getModel('Mage_Catalog_Model_Product'));
+ }
+ return $this->getProduct();
+ }
+
+ /**
+ * Get category model instance
+ *
+ * @return Mage_Catalog_Model_Category
+ */
+ protected function _getCategory()
+ {
+ if (!$this->hasData('category')) {
+ $this->setCategory(Mage::getModel('Mage_Catalog_Model_Category'));
+ }
+ return $this->getCategory();
+ }
+}
View
193 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php
@@ -0,0 +1,193 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Block for Catalog Category URL rewrites editing
+ *
+ * @method Mage_Catalog_Model_Category getCategory()
+ * @method Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Edit setCategory(Mage_Catalog_Model_Category $category)
+ * @method Mage_Catalog_Model_Product getProduct()
+ * @method Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Edit setProduct(Mage_Catalog_Model_Product $product)
+ * @method bool getIsCategoryMode()
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Edit extends Mage_Adminhtml_Block_Urlrewrite_Edit
+{
+ /**
+ * Prepare layout for URL rewrite creating for product
+ */
+ protected function _prepareLayoutFeatures()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+
+ if ($this->_getUrlRewrite()->getId()) {
+ $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Edit URL Rewrite for a Product');
+ } else {
+ $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add URL Rewrite for a Product');
+ }
+
+ if ($this->_getProduct()->getId()) {
+ $this->_addProductLinkBlock($this->_getProduct());
+ }
+
+ if ($this->_getCategory()->getId()) {
+ $this->_addCategoryLinkBlock();
+ }
+
+ if ($this->_getProduct()->getId()) {
+ if ($this->_getCategory()->getId() || !$this->getIsCategoryMode()) {
+ $this->_addEditFormBlock();
+ $this->_updateBackButtonLink(
+ $helper->getUrl('*/*/edit', array('product' => $this->_getProduct()->getId())) . 'category'
+ );
+ } else {
+ // categories selector & skip categories button
+ $this->_addCategoriesTreeBlock();
+ $this->_addSkipCategoriesBlock();
+ $this->_updateBackButtonLink($helper->getUrl('*/*/edit') . 'product');
+ }
+ } else {
+ $this->_addUrlRewriteSelectorBlock();
+ $this->_addProductsGridBlock();
+ }
+ }
+
+ /**
+ * Get or create new instance of product
+ *
+ * @return Mage_Catalog_Model_Product
+ */
+ private function _getProduct()
+ {
+ if (!$this->hasData('product')) {
+ $this->setProduct(Mage::getModel('Mage_Catalog_Model_Product'));
+ }
+ return $this->getProduct();
+ }
+
+ /**
+ * Get or create new instance of category
+ *
+ * @return Mage_Catalog_Model_Category
+ */
+ private function _getCategory()
+ {
+ if (!$this->hasData('category')) {
+ $this->setCategory(Mage::getModel('Mage_Catalog_Model_Category'));
+ }
+ return $this->getCategory();
+ }
+
+ /**
+ * Add child product link block
+ */
+ private function _addProductLinkBlock()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+ $this->setChild('product_link', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Link')
+ ->setData(array(
+ 'item_url' => $helper->getUrl('*/*/*') . 'product',
+ 'item_name' => $this->_getProduct()->getName(),
+ 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Product:')
+ ))
+ );
+ }
+
+ /**
+ * Add child category link block
+ */
+ private function _addCategoryLinkBlock()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+ $this->setChild('category_link', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Link')
+ ->setData(array(
+ 'item_url' => $helper->getUrl('*/*/*', array('product' => $this->_getProduct()->getId())) . 'category',
+ 'item_name' => $this->_getCategory()->getName(),
+ 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Category:')
+ ))
+ );
+ }
+
+ /**
+ * Add child products grid block
+ */
+ private function _addProductsGridBlock()
+ {
+ $this->setChild(
+ 'products_grid',
+ $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Grid')
+ );
+ }
+
+ /**
+ * Add child Categories Tree block
+ */
+ private function _addCategoriesTreeBlock()
+ {
+ $this->setChild(
+ 'categories_tree',
+ $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Catalog_Category_Tree')
+ );
+ }
+
+ /**
+ * Add child Skip Categories block
+ */
+ private function _addSkipCategoriesBlock()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+ $this->setChild('skip_categories',
+ $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData(array(
+ 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Skip Category Selection'),
+ 'onclick' => 'window.location = \''
+ . $helper->getUrl('*/*/*', array('product' => $this->_getProduct()->getId())) . '\'',
+ 'class' => 'save',
+ 'level' => -1
+ ))
+ );
+ }
+
+ /**
+ * Creates edit form block
+ *
+ * @return Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form
+ */
+ protected function _createEditFormBlock()
+ {
+ return $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Catalog_Edit_Form', '', array(
+ 'product' => $this->_getProduct(),
+ 'category' => $this->_getCategory(),
+ 'url_rewrite' => $this->_getUrlRewrite()
+ ));
+ }
+}
View
15 .../Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php → ...minhtml/Block/Urlrewrite/Catalog/Product/Grid.php
@@ -25,18 +25,18 @@
*/
/**
- * Products grid for urlrewrites
+ * Products grid for URL rewrites editing
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
+ * @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Urlrewrite_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
+class Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
{
/**
* Disable massaction
*
- * @return Mage_Adminhtml_Block_Urlrewrite_Product_Grid
+ * @return Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Grid
*/
protected function _prepareMassaction()
{
@@ -46,7 +46,7 @@ protected function _prepareMassaction()
/**
* Prepare columns layout
*
- * @return Mage_Adminhtml_Block_Urlrewrite_Product_Grid
+ * @return Mage_Adminhtml_Block_Urlrewrite_Catalog_Product_Grid
*/
protected function _prepareColumns()
{
@@ -81,7 +81,7 @@ protected function _prepareColumns()
}
/**
- * Get url for dispatching grid ajax requests
+ * Get URL for dispatching grid ajax requests
*
* @return string
*/
@@ -91,8 +91,9 @@ public function getGridUrl()
}
/**
- * Get row url
+ * Return row url for js event handlers
*
+ * @param Mage_Catalog_Model_Product|Varien_Object
* @return string
*/
public function getRowUrl($row)
View
115 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php
@@ -0,0 +1,115 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Block for CMS pages URL rewrites
+ *
+ * @method Mage_Cms_Model_Page getCmsPage()
+ * @method Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit setCmsPage(Mage_Cms_Model_Page $cmsPage)
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit extends Mage_Adminhtml_Block_Urlrewrite_Edit
+{
+ /**
+ * Prepare layout for URL rewrite creating for CMS page
+ */
+ protected function _prepareLayoutFeatures()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+
+ if ($this->_getUrlRewrite()->getId()) {
+ $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Edit URL Rewrite for CMS page');
+ } else {
+ $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add URL Rewrite for CMS page');
+ }
+
+ if ($this->_getCmsPage()->getId()) {
+ $this->_addCmsPageLinkBlock();
+ $this->_addEditFormBlock();
+ $this->_updateBackButtonLink($helper->getUrl('*/*/edit') . 'cms_page');
+ } else {
+ $this->_addUrlRewriteSelectorBlock();
+ $this->_addCmsPageGridBlock();
+ }
+ }
+
+ /**
+ * Get or create new instance of CMS page
+ *
+ * @return Mage_Cms_Model_Page
+ */
+ private function _getCmsPage()
+ {
+ if (!$this->hasData('cms_page')) {
+ $this->setCmsPage(Mage::getModel('Mage_Cms_Model_Page'));
+ }
+ return $this->getCmsPage();
+ }
+
+ /**
+ * Add child CMS page link block
+ */
+ private function _addCmsPageLinkBlock()
+ {
+ /** @var $helper Mage_Adminhtml_Helper_Data */
+ $helper = Mage::helper('Mage_Adminhtml_Helper_Data');
+ $this->setChild('cms_page_link', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Link')
+ ->setData(array(
+ 'item_url' => $helper->getUrl('*/*/*') . 'cms_page',
+ 'item_name' => $this->getCmsPage()->getTitle(),
+ 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('CMS page:')
+ ))
+ );
+ }
+
+ /**
+ * Add child CMS page block
+ */
+ private function _addCmsPageGridBlock()
+ {
+ $this->setChild(
+ 'cms_pages_grid',
+ $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Grid')
+ );
+ }
+
+ /**
+ * Creates edit form block
+ *
+ * @return Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form
+ */
+ protected function _createEditFormBlock()
+ {
+ return $this->getLayout()->createBlock('Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form', '', array(
+ 'cms_page' => $this->_getCmsPage(),
+ 'url_rewrite' => $this->_getUrlRewrite()
+ ));
+ }
+}
View
126 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php
@@ -0,0 +1,126 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Edit form for CMS page URL rewrites
+ *
+ * @method Mage_Cms_Model_Page getCmsPage()
+ * @method Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form setCmsPage(Mage_Cms_Model_Page $model)
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form extends Mage_Adminhtml_Block_Urlrewrite_Edit_Form
+{
+ /**
+ * Form post init
+ *
+ * @param Varien_Data_Form $form
+ * @return Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form
+ */
+ protected function _formPostInit($form)
+ {
+ $cmsPage = $this->_getCmsPage();
+ $form->setAction(
+ Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl('*/*/save', array(
+ 'id' => $this->_getModel()->getId(),
+ 'cms_page' => $cmsPage->getId()
+ ))
+ );
+
+ // Fill id path, request path and target path elements
+ /** @var $idPath Varien_Data_Form_Element_Abstract */
+ $idPath = $this->getForm()->getElement('id_path');
+ /** @var $requestPath Varien_Data_Form_Element_Abstract */
+ $requestPath = $this->getForm()->getElement('request_path');
+ /** @var $targetPath Varien_Data_Form_Element_Abstract */
+ $targetPath = $this->getForm()->getElement('target_path');
+
+ $model = $this->_getModel();
+ /** @var $cmsPageUrlrewrite Mage_Cms_Model_Page_Urlrewrite */
+ $cmsPageUrlrewrite = Mage::getModel('Mage_Cms_Model_Page_Urlrewrite');
+ if (!$model->getId()) {
+ $idPath->setValue($cmsPageUrlrewrite->generateIdPath($cmsPage));
+
+ $sessionData = $this->_getSessionData();
+ if (!isset($sessionData['request_path'])) {
+ $requestPath->setValue($cmsPageUrlrewrite->generateRequestPath($cmsPage));
+ }
+ $targetPath->setValue($cmsPageUrlrewrite->generateTargetPath($cmsPage));
+ $disablePaths = true;
+ } else {
+ $cmsPageUrlrewrite->load($this->_getModel()->getId(), 'url_rewrite_id');
+ $disablePaths = $cmsPageUrlrewrite->getId() > 0;
+ }
+ if ($disablePaths) {
+ $idPath->setData('disabled', true);
+ $targetPath->setData('disabled', true);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get catalog entity associated stores
+ *
+ * @return array
+ * @throws Mage_Core_Model_Store_Exception
+ */
+ protected function _getEntityStores()
+ {
+ $cmsPage = $this->_getCmsPage();
+ $entityStores = array();
+
+ // showing websites that only associated to CMS page
+ if ($this->_getCmsPage()->getId()) {
+ $entityStores = (array) $cmsPage->getResource()->lookupStoreIds($cmsPage->getId());
+ $this->_requireStoresFilter = !in_array(0, $entityStores);
+
+ if (!$entityStores) {
+ throw new Mage_Core_Model_Store_Exception(
+ Mage::helper('Mage_Adminhtml_Helper_Data')
+ ->__('Chosen cms page does not associated with any website.')
+ );
+ }
+ }
+
+ return $entityStores;
+ }
+
+ /**
+ * Get CMS page model instance
+ *
+ * @return Mage_Cms_Model_Page
+ */
+ protected function _getCmsPage()
+ {
+ if (!$this->hasData('cms_page')) {
+ $this->setCmsPage(Mage::getModel('Mage_Cms_Model_Page'));
+ }
+ return $this->getCmsPage();
+ }
+}
View
116 app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Grid.php
@@ -0,0 +1,116 @@
+<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * CMS pages grid for URL rewrites
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Grid extends Mage_Adminhtml_Block_Cms_Page_Grid
+{
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setUseAjax(true);
+ }
+
+ /**
+ * Disable massaction
+ *
+ * @return Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Grid
+ */
+ protected function _prepareMassaction()
+ {
+ return $this;
+ }
+
+ /**
+ * Prepare columns layout
+ *
+ * @return Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Grid
+ */
+ protected function _prepareColumns()
+ {
+ $this->addColumn('title', array(
+ 'header' => Mage::helper('Mage_Cms_Helper_Data')->__('Title'),
+ 'align' => 'left',
+ 'index' => 'title',
+ ));
+
+ $this->addColumn('identifier', array(
+ 'header' => Mage::helper('Mage_Cms_Helper_Data')->__('URL Key'),
+ 'align' => 'left',
+ 'index' => 'identifier'
+ ));
+
+ if (!Mage::app()->isSingleStoreMode()) {
+ $this->addColumn('store_id', array(
+ 'header' => Mage::helper('Mage_Cms_Helper_Data')->__('Store View'),
+ 'index' => 'store_id',
+ 'type' => 'store',
+ 'store_all' => true,
+ 'store_view' => true,
+ 'sortable' => false,
+ 'filter_condition_callback' => array($this, '_filterStoreCondition'),
+ ));
+ }
+
+ $this->addColumn('is_active', array(
+ 'header' => Mage::helper('Mage_Cms_Helper_Data')->__('Status'),
+ 'index' => 'is_active',
+ 'type' => 'options',
+ 'options' => Mage::getSingleton('Mage_Cms_Model_Page')->getAvailableStatuses()
+ ));
+
+ return $this;
+ }
+
+ /**
+ * Get URL for dispatching grid ajax requests
+ *
+ * @return string
+ */
+ public function getGridUrl()
+ {
+ return $this->getUrl('*/*/cmsPageGrid', array('_current' => true));
+ }
+
+ /**
+ * Return row url for js event handlers
+ *