Permalink
Browse files

2.0.0.0-dev60

* Fixed bugs:
  * Fixed an issue with exceeding the memory limit when uploading very big images
  * Fixed an issue in moving a category when $afterCategoryId is null
  * Fixed an issue when products from a non-default website were not available as bundle items
  * Fixed an issue when orders placed via Authorize.net had the wrong statuses
  * Fixed an issue where orders placed via PayPal Express Checkout could not be placed if HTTPS was used on the frontend
  * Fixed a security issue with a user session during registration
  * Removed a CSRF vulnerability in checkout
  * Fixed an issue with JavaScript static testing framework not handling corrupted paths in white/black lists properly
  * Fixed an issue with Google Shopping synchronization
  * Fixed the contextual help tooltip design
  * Fixed an issue with the Authorize.net CC section UI on the Onepage Checkout page
  * Fixed UI issues on the order pages in the backend
  * Fixed UI issues in the backend for IE9
  * Fixed UI issues on the Edit Customer page in the backend
  * Fixed a UI issue with the image preview placeholder on the Edit Product page for IE9
  * Fixed UI issues with forms in the backend
  * Fixed UI issues with buttons in the backend
  * Fixed an issue with a product status after a virtual product was duplicated
  * Fixed a fatal error with attribute file from the customer account page in the backend
  * Fixed a security issue when CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST where used with improper values sometimes
  * Updated the field descriptions for Secure Base URL settings in the backend
  * Fixed an issue in product duplication for multiple store views
  * Consolidated several 3rd-party JavaScript libraries in the pub/lib directory, and fixed license notice texts to conform to the open source license requirements
* Service Layer implementation:
  * Implemented the initial set of services for the Customer module
  • Loading branch information...
1 parent f98550d commit fcc07ebc4b225abaae13bd93243733d0e1fc86a7 @magento-team magento-team committed Jan 10, 2014
Showing with 24,561 additions and 2,064 deletions.
  1. +33 −0 CHANGELOG.md
  2. +10 −8 app/code/Magento/Authorizenet/Model/Directpost/Observer.php
  3. +9 −3 app/code/Magento/Backend/App/Response/Http/FileFactory.php
  4. +10 −1 app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php
  5. +1 −1 app/code/Magento/Backend/Controller/Adminhtml/System/Config.php
  6. +3 −1 app/code/Magento/Backend/etc/adminhtml/system.xml
  7. +7 −6 app/code/Magento/Backend/view/adminhtml/admin/login.phtml
  8. +2 −2 app/code/Magento/Backend/view/adminhtml/layout/default.xml
  9. +1 −1 app/code/Magento/Backend/view/adminhtml/layout/editor.xml
  10. +7 −1 app/code/Magento/Backup/Controller/Adminhtml/Index.php
  11. +1 −9 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php
  12. +66 −35 app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php
  13. +1 −1 app/code/Magento/Catalog/Model/Category.php
  14. +2 −2 app/code/Magento/Catalog/Model/Product.php
  15. +11 −24 app/code/Magento/Catalog/Model/Resource/Category.php
  16. +14 −1 app/code/Magento/Checkout/Controller/Onepage.php
  17. +1 −0 app/code/Magento/Checkout/view/frontend/onepage/payment.phtml
  18. +2 −2 app/code/Magento/Core/Model/App.php
  19. +22 −93 app/code/Magento/Core/view/adminhtml/prototype/magento.css
  20. +1 −1 app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php
  21. +3 −5 app/code/Magento/Customer/Block/Adminhtml/Grid/Renderer/Multiaction.php
  22. +13 −9 app/code/Magento/Customer/Controller/Adminhtml/Index.php
  23. +11 −1 app/code/Magento/Customer/Model/Address.php
  24. +165 −0 app/code/Magento/Customer/Model/Converter.php
  25. +17 −23 app/code/Magento/Customer/Model/Customer.php
  26. +91 −0 app/code/Magento/Customer/Model/Metadata/ElementFactory.php
  27. +559 −0 app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php
  28. +94 −0 app/code/Magento/Customer/Model/Metadata/Validator.php
  29. +5 −2 app/code/Magento/Customer/Model/Session.php
  30. +2 −1 app/code/Magento/Customer/Service/Customer.php
  31. +58 −0 app/code/Magento/Customer/Service/Entity/V1/AggregateException.php
  32. +46 −0 app/code/Magento/Customer/Service/Entity/V1/Exception.php
  33. +341 −0 app/code/Magento/Customer/Service/V1/CustomerAccountService.php
  34. +127 −0 app/code/Magento/Customer/Service/V1/CustomerAccountServiceInterface.php
  35. +323 −0 app/code/Magento/Customer/Service/V1/CustomerAddressService.php
  36. +101 −0 app/code/Magento/Customer/Service/V1/CustomerAddressServiceInterface.php
  37. +203 −0 app/code/Magento/Customer/Service/V1/CustomerGroupService.php
  38. +94 −0 app/code/Magento/Customer/Service/V1/CustomerGroupServiceInterface.php
  39. +241 −0 app/code/Magento/Customer/Service/V1/CustomerMetadataService.php
  40. +95 −0 app/code/Magento/Customer/Service/V1/CustomerMetadataServiceInterface.php
  41. +120 −0 app/code/Magento/Customer/Service/V1/CustomerService.php
  42. +50 −0 app/code/Magento/Customer/Service/V1/CustomerServiceInterface.php
  43. +214 −0 app/code/Magento/Customer/Service/V1/Dto/Address.php
  44. +226 −0 app/code/Magento/Customer/Service/V1/Dto/AddressBuilder.php
  45. +248 −0 app/code/Magento/Customer/Service/V1/Dto/Customer.php
  46. +179 −0 app/code/Magento/Customer/Service/V1/Dto/CustomerBuilder.php
  47. +53 −0 app/code/Magento/Customer/Service/V1/Dto/CustomerGroup.php
  48. +59 −0 app/code/Magento/Customer/Service/V1/Dto/CustomerGroupBuilder.php
  49. +51 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/Attribute.php
  50. +49 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/AttributeBuilder.php
  51. +125 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/AttributeMetadata.php
  52. +131 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/AttributeMetadataBuilder.php
  53. +41 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/EntityInterface.php
  54. +55 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/Option.php
  55. +51 −0 app/code/Magento/Customer/Service/V1/Dto/Eav/OptionBuilder.php
  56. +53 −0 app/code/Magento/Customer/Service/V1/Dto/Filter.php
  57. +70 −0 app/code/Magento/Customer/Service/V1/Dto/FilterBuilder.php
  58. +53 −0 app/code/Magento/Customer/Service/V1/Dto/Region.php
  59. +59 −0 app/code/Magento/Customer/Service/V1/Dto/RegionBuilder.php
  60. +45 −0 app/code/Magento/Customer/Service/V1/Dto/Response/CreateCustomerAccountResponse.php
  61. +47 −0 app/code/Magento/Customer/Service/V1/Dto/Response/CreateCustomerAccountResponseBuilder.php
  62. +66 −0 app/code/Magento/Customer/Service/V1/Dto/SearchCriteria.php
  63. +82 −0 app/code/Magento/Customer/Service/V1/Dto/SearchCriteriaBuilder.php
  64. +56 −0 app/code/Magento/Customer/Service/V1/Dto/SearchResults.php
  65. +61 −0 app/code/Magento/Customer/Service/V1/Dto/SearchResultsBuilder.php
  66. +21 −0 app/code/Magento/Customer/etc/di.xml
  67. +10 −0 app/code/Magento/Customer/etc/validation.xml
  68. +1 −1 app/code/Magento/Directory/Model/Currency/DefaultLocator.php
  69. +1 −1 app/code/Magento/Eav/Model/Resource/Entity/Attribute/Collection.php
  70. +1 −1 app/code/Magento/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml
  71. +3 −3 app/code/Magento/GoogleShopping/Model/Observer.php
  72. +1 −0 app/code/Magento/ImportExport/Controller/Adminhtml/Export.php
  73. +1 −1 app/code/Magento/Install/view/install/page.phtml
  74. +2 −2 app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php
  75. +11 −13 app/code/Magento/Paygate/view/frontend/info/cc.phtml
  76. +66 −64 app/code/Magento/Payment/view/adminhtml/form/cc.phtml
  77. +75 −67 app/code/Magento/Payment/view/adminhtml/form/ccsave.phtml
  78. +12 −14 app/code/Magento/Payment/view/adminhtml/form/checkmo.phtml
  79. +6 −6 app/code/Magento/Payment/view/adminhtml/form/purchaseorder.phtml
  80. +2 −2 app/code/Magento/Reports/Controller/Adminhtml/Index.php
  81. +6 −2 app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php
  82. +21 −13 app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php
  83. +0 −2 app/code/Magento/Reports/Model/Resource/Report/Collection/AbstractCollection.php
  84. +13 −3 app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php
  85. +12 −2 app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php
  86. +11 −3 app/code/Magento/Sales/Controller/Adminhtml/Order.php
  87. +8 −1 app/code/Magento/Sales/Controller/Adminhtml/Order/Shipment.php
  88. +11 −3 app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php
  89. +8 −4 app/code/Magento/Sales/Controller/Download.php
  90. +11 −2 app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/form.phtml
  91. +10 −3 app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items.phtml
  92. +9 −1 app/code/Magento/Sales/view/adminhtml/order/invoice/create/items.phtml
  93. +8 −1 app/code/Magento/Sales/view/adminhtml/order/view/info.phtml
  94. +26 −10 app/code/Magento/Sales/view/adminhtml/order/view/tab/info.phtml
  95. +2 −2 app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php
  96. +5 −5 app/code/Magento/Tax/Controller/Adminhtml/Rate.php
  97. +10 −5 app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php
  98. +8 −4 app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files.php
  99. +1 −1 app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml
  100. +4 −4 app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php
  101. +2 −2 app/code/Magento/Usa/Model/Shipping/Carrier/Fedex.php
  102. +2 −1 app/code/Magento/User/sql/user_setup/install-1.6.0.0.php
  103. +2 −2 app/code/Magento/User/view/adminhtml/admin/forgotpassword.phtml
  104. +2 −2 app/code/Magento/User/view/adminhtml/admin/resetforgottenpassword.phtml
  105. +37 −19 app/code/Magento/Wishlist/Controller/Index.php
  106. +32 −4 app/design/adminhtml/magento_backend/Magento_Backend/layout/default.xml
  107. +6,720 −0 app/design/adminhtml/magento_backend/css/admin.css
  108. +710 −0 app/design/adminhtml/magento_backend/css/header.css
  109. +3,053 −0 app/design/adminhtml/magento_backend/css/pages.css
  110. +300 −0 app/design/adminhtml/magento_backend/css/styles-ie8.css
  111. +16 −15 app/design/adminhtml/magento_backend/css/styles.css
  112. +1 −0 app/design/adminhtml/magento_backend/less/lib/buttons.less
  113. +105 −374 app/design/adminhtml/magento_backend/less/styles/admin.less
  114. +17 −264 app/design/adminhtml/magento_backend/less/styles/base.less
  115. +34 −45 app/design/adminhtml/magento_backend/less/styles/debug.less
  116. +59 −92 app/design/adminhtml/magento_backend/less/styles/header.less
  117. +49 −29 app/design/adminhtml/magento_backend/less/styles/pages.less
  118. +372 −0 app/design/adminhtml/magento_backend/less/styles/styles-ie8.less
  119. +337 −0 app/design/adminhtml/magento_backend/less/styles/vars.less
  120. +3 −3 app/design/frontend/magento_plushe/Magento_Theme/layout/default_head_blocks.xml
  121. +13 −0 app/design/frontend/magento_plushe/css/styles.css
  122. +0 −2 app/design/frontend/magento_plushe/js/extra-options.js
  123. +0 −356 app/design/frontend/magento_plushe/js/head.js
  124. +1 −3 app/design/frontend/magento_plushe/js/sticky.js
  125. +15 −0 app/design/frontend/magento_plushe/less/styles.less
  126. +16 −1 dev/tests/integration/framework/Magento/TestFramework/Helper/Memory.php
  127. +1 −1 dev/tests/integration/framework/bootstrap.php
  128. +14 −3 dev/tests/integration/testsuite/Magento/Backend/Utility/Controller.php
  129. +4 −1 dev/tests/integration/testsuite/Magento/Catalog/Helper/CategoryTest.php
  130. +38 −0 dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php
  131. +1 −0 dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
  132. +46 −8 dev/tests/integration/testsuite/Magento/Catalog/_files/categories.php
  133. +19 −0 dev/tests/integration/testsuite/Magento/Checkout/Controller/OnepageTest.php
  134. +63 −27 dev/tests/integration/testsuite/Magento/Customer/Service/CustomerTest.php
  135. +434 −0 dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php
  136. +568 −0 dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php
  137. +181 −0 dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerGroupServiceTest.php
  138. +113 −0 dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php
  139. +596 −0 dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerServiceTest.php
  140. +2 −2 dev/tests/integration/testsuite/Magento/Customer/_files/customer.php
  141. +4 −2 dev/tests/integration/testsuite/Magento/Customer/_files/customer_address.php
  142. +4 −2 dev/tests/integration/testsuite/Magento/Customer/_files/customer_two_addresses.php
  143. +44 −0 dev/tests/integration/testsuite/Magento/Customer/_files/inactive_customer.php
  144. +51 −0 dev/tests/integration/testsuite/Magento/GoogleShopping/Model/ObserverTest.php
  145. +38 −0 dev/tests/integration/testsuite/Magento/GoogleShopping/Model/_files/flag_expired.php
  146. +13 −0 dev/tests/integration/testsuite/Magento/User/Model/UserTest.php
  147. +17 −0 dev/tests/integration/testsuite/Magento/User/_files/dummy_user.php
  148. +1 −1 dev/tests/js/jsTestDriverOrder.php
  149. +51 −7 dev/tests/static/framework/Magento/TestFramework/Utility/Files.php
  150. +1 −1 dev/tests/static/framework/bootstrap.php
  151. +83 −0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/FilesTest.php
  152. 0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/bar/one.txt
  153. 0 ...tic/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/bar/recursive/one.txt
  154. 0 ...tic/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/bar/recursive/two.txt
  155. 0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/bar/two.txt
  156. 0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/baz/one.txt
  157. 0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/baz/two.txt
  158. 0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/one.txt
  159. 0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/foo/two.txt
  160. +2 −0 ...static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/list_corrupted_dir.txt
  161. +3 −0 ...tatic/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/list_corrupted_file.txt
  162. +4 −0 dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/_files/list_good.txt
  163. +12 −27 dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php
  164. +13 −13 dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt
  165. +12 −13 dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt
  166. +6 −40 dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
  167. +1 −0 dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt
  168. +110 −0 dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php
  169. +23 −10 dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/Column/Renderer/CurrencyTest.php
  170. +154 −0 dev/tests/unit/testsuite/Magento/Customer/Model/ConverterTest.php
  171. +1 −0 dev/tests/unit/testsuite/Magento/Customer/Service/CustomerTest.php
  172. +1,030 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php
  173. +880 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php
  174. +234 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerMetadataServiceTest.php
  175. +471 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerServiceTest.php
  176. +218 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/Dto/AddressTest.php
  177. +156 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/Dto/CustomerTest.php
  178. +58 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/Dto/Eav/AttributeMetadataTest.php
  179. +43 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/Dto/Eav/AttributeTest.php
  180. +43 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/Dto/Eav/OptionTest.php
  181. +44 −0 dev/tests/unit/testsuite/Magento/Customer/Service/V1/Dto/RegionTest.php
  182. +2 −3 dev/tests/unit/testsuite/Magento/Directory/Model/Currency/DefaultLocatorTest.php
  183. +172 −0 dev/tests/unit/testsuite/Magento/Image/Adapter/Gd2Test.php
  184. +75 −0 dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php
  185. +1 −1 lib/3Dsecure/CentinelClient.php
  186. +9 −3 lib/Magento/App/Response/Http/FileFactory.php
  187. +70 −0 lib/Magento/Convert/Object.php
  188. +2 −2 lib/Magento/HTTP/Adapter/Curl.php
  189. +68 −3 lib/Magento/Image/Adapter/Gd2.php
  190. +1 −1 lib/Magento/Oauth/Helper/Request.php
  191. +36 −0 lib/Magento/Object/Copy.php
  192. +63 −0 lib/Magento/Service/Entity/AbstractDto.php
  193. +111 −0 lib/Magento/Service/Entity/AbstractDtoBuilder.php
  194. +1 −0 lib/Magento/View/Element/AbstractBlock.php
  195. +1 −1 lib/Magento/View/Element/Text/ListText.php
  196. +664 −0 pub/lib/dnd.js
  197. +9 −1 pub/lib/{ → headjs}/head.load.min.js
  198. +6 −21 app/design/adminhtml/magento_backend/js/head.js → pub/lib/headjs/head.min.js
  199. +1 −48 {app/design/adminhtml/magento_backend/js → pub/lib/jquery}/jquery.details.js
  200. +1 −24 {app/design/adminhtml/magento_backend/js → pub/lib/jquery}/jquery.details.min.js
  201. +0 −23 {app/design/adminhtml/magento_backend/js → pub/lib/jquery}/jquery.mousewheel.js
  202. +0 −36 pub/lib/lib/dropdown.js
  203. 0 pub/lib/{lib → mage}/flex.js
  204. +0 −22 {app/design/frontend/magento_plushe/js → pub/lib}/matchMedia.js
  205. +4 −0 pub/lib/modernizr/modernizr.2.0.6.js
  206. +25 −0 pub/lib/modernizr/modernizr.details.js
  207. 0 pub/lib/{lib → modernizr}/modernizr.js
  208. +1 −1 pub/lib/prototype/validation.js
  209. +1 −23 {app/design/frontend/magento_plushe/js → pub/lib}/selectivizr.js
View
33 CHANGELOG.md
@@ -1,3 +1,32 @@
+2.0.0.0-dev60
+=============
+* Fixed bugs:
+ * Fixed an issue with exceeding the memory limit when uploading very big images
+ * Fixed an issue in moving a category when $afterCategoryId is null
+ * Fixed an issue when products from a non-default website were not available as bundle items
+ * Fixed an issue when orders placed via Authorize.net had the wrong statuses
+ * Fixed an issue where orders placed via PayPal Express Checkout could not be placed if HTTPS was used on the frontend
+ * Fixed a security issue with a user session during registration
+ * Removed a CSRF vulnerability in checkout
+ * Fixed an issue with JavaScript static testing framework not handling corrupted paths in white/black lists properly
+ * Fixed an issue with Google Shopping synchronization
+ * Fixed the contextual help tooltip design
+ * Fixed an issue with the Authorize.net CC section UI on the Onepage Checkout page
+ * Fixed UI issues on the order pages in the backend
+ * Fixed UI issues in the backend for IE9
+ * Fixed UI issues on the Edit Customer page in the backend
+ * Fixed a UI issue with the image preview placeholder on the Edit Product page for IE9
+ * Fixed UI issues with forms in the backend
+ * Fixed UI issues with buttons in the backend
+ * Fixed an issue with a product status after a virtual product was duplicated
+ * Fixed a fatal error with attribute file from the customer account page in the backend
+ * Fixed a security issue when CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST where used with improper values sometimes
+ * Updated the field descriptions for Secure Base URL settings in the backend
+ * Fixed an issue in product duplication for multiple store views
+ * Consolidated several 3rd-party JavaScript libraries in the pub/lib directory, and fixed license notice texts to conform to the open source license requirements
+* Service Layer implementation:
+ * Implemented the initial set of services for the Customer module
+
2.0.0.0-dev59
=============
* Fixed bugs:
@@ -103,6 +132,10 @@
* Fixed date resetting to 1 Jan 1970 after saving a design change in the admin panel in case date format is DD/MM/YY
* Fixed CAPTCHA on multi-address checkout flow
* Fixed view files population tool
+ * Fixed DHL functionality of generation shipping labels
+ * Fixed target rule if it is applied for specific customer segment
+ * Fixed product importing that cleared price and weight
+ * Fixed fatal error when a file reference is added to HTML head
* GitHub requests:
* [#122](https://github.com/magento/magento2/pull/122) -- Added support of federal units of Brazil with 27 states
* [#184](https://github.com/magento/magento2/issues/184) -- Removed unused blocks and methods in Magento_Wishlist module
View
18 app/code/Magento/Authorizenet/Model/Directpost/Observer.php
@@ -57,9 +57,9 @@ class Observer
protected $_authorizenetData;
/**
- * @var \Magento\Authorizenet\Model\DirectpostFactory
+ * @var \Magento\Authorizenet\Model\Directpost
*/
- protected $_modelFactory;
+ protected $_payment;
/**
* @var \Magento\Authorizenet\Model\Directpost\Session
@@ -75,22 +75,22 @@ class Observer
* @param \Magento\Authorizenet\Helper\Data $authorizenetData
* @param \Magento\Core\Helper\Data $coreData
* @param \Magento\Core\Model\Registry $coreRegistry
- * @param \Magento\Authorizenet\Model\DirectpostFactory $modelFactory
+ * @param \Magento\Authorizenet\Model\Directpost $payment
* @param \Magento\Authorizenet\Model\Directpost\Session $session
* @param \Magento\Core\Model\StoreManagerInterface $storeManager
*/
public function __construct(
\Magento\Authorizenet\Helper\Data $authorizenetData,
\Magento\Core\Helper\Data $coreData,
\Magento\Core\Model\Registry $coreRegistry,
- \Magento\Authorizenet\Model\DirectpostFactory $modelFactory,
+ \Magento\Authorizenet\Model\Directpost $payment,
\Magento\Authorizenet\Model\Directpost\Session $session,
\Magento\Core\Model\StoreManagerInterface $storeManager
) {
$this->_coreRegistry = $coreRegistry;
$this->_authorizenetData = $authorizenetData;
$this->_coreData = $coreData;
- $this->_modelFactory = $modelFactory;
+ $this->_payment = $payment;
$this->_session = $session;
$this->_storeManager = $storeManager;
}
@@ -123,9 +123,11 @@ public function addAdditionalFieldsToResponseFrontend(\Magento\Event\Observer $o
if ($order && $order->getId()) {
$payment = $order->getPayment();
- if ($payment && $payment->getMethod() == $this->_modelFactory->create()->getCode()) {
- $request = $observer->getEvent()->getRequest();
- $response = $observer->getEvent()->getResponse();
+ if ($payment && $payment->getMethod() == $this->_payment->getCode()) {
+ /** @var \Magento\Checkout\Controller\Action $controller */
+ $controller = $observer->getEvent()->getData('controller_action');
+ $request = $controller->getRequest();
+ $response = $controller->getResponse();
$result = $this->_coreData->jsonDecode($response->getBody('default'));
if (empty($result['error'])) {
View
12 app/code/Magento/Backend/App/Response/Http/FileFactory.php
@@ -104,15 +104,21 @@ protected function _redirect($path, $arguments=array())
* @param string $fileName
* @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in
* that case
+ * @param string $baseDir
* @param string $contentType
* @param int $contentLength explicit content length, if strlen($content) isn't applicable
* @return \Magento\App\ResponseInterface
*/
- public function create($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
- {
+ public function create(
+ $fileName,
+ $content,
+ $baseDir = \Magento\Filesystem::ROOT,
+ $contentType = 'application/octet-stream',
+ $contentLength = null
+ ) {
if ($this->_auth->getAuthStorage()->isFirstPageAfterLogin()) {
return $this->_redirect($this->_backendUrl->getStartupPageUrl());
}
- return parent::create($fileName, $content, $contentType, $contentLength);
+ return parent::create($fileName, $content, $baseDir, $contentType, $contentLength);
}
}
View
11 app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php
@@ -64,20 +64,29 @@ class Currency
protected $_currencyLocator;
/**
+ * @var \Magento\Directory\Model\Currency
+ */
+ protected $_baseCurrency;
+
+ /**
* @param \Magento\Backend\Block\Context $context
* @param \Magento\Core\Model\StoreManagerInterface $storeManager
* @param \Magento\Directory\Model\Currency\DefaultLocator $currencyLocator
+ * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Context $context,
\Magento\Core\Model\StoreManagerInterface $storeManager,
\Magento\Directory\Model\Currency\DefaultLocator $currencyLocator,
+ \Magento\Directory\Model\CurrencyFactory $currencyFactory,
array $data = array()
) {
parent::__construct($context, $data);
$this->_storeManager = $storeManager;
$this->_currencyLocator = $currencyLocator;
+ $baseCurrencyCode = $this->_app->getBaseCurrencyCode();
+ $this->_baseCurrency = $currencyFactory->create()->load($baseCurrencyCode);
}
/**
@@ -131,7 +140,7 @@ protected function _getRate($row)
if ($rate = $row->getData($this->getColumn()->getRateField())) {
return floatval($rate);
}
- return $this->_storeManager->getStore()->getBaseCurrency()->getRate($this->_getCurrencyCode($row));
+ return $this->_baseCurrency->getRate($this->_getCurrencyCode($row));
}
/**
View
2 app/code/Magento/Backend/Controller/Adminhtml/System/Config.php
@@ -132,6 +132,6 @@ public function exportTableratesAction()
}
$gridBlock->setWebsiteId($website->getId())->setConditionName($conditionName);
$content = $gridBlock->getCsvFile();
- return $this->_fileFactory->create($fileName, $content);
+ return $this->_fileFactory->create($fileName, $content, \Magento\Filesystem::VAR_DIR);
}
}
View
4 app/code/Magento/Backend/etc/adminhtml/system.xml
@@ -551,7 +551,7 @@
</group>
<group id="secure" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Base URLs (Secure)</label>
- <comment>Any of the fields allow fully qualified URLs that end with '/' (slash) e.g. http://example.com/magento/</comment>
+ <comment>Any of the fields allow fully qualified URLs that end with '/' (slash) e.g. https://example.com/magento/</comment>
<field id="base_url" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Secure Base URL</label>
<backend_model>Magento\Backend\Model\Config\Backend\Baseurl</backend_model>
@@ -586,11 +586,13 @@
<label>Use Secure URLs in Frontend</label>
<source_model>Magento\Backend\Model\Config\Source\Yesno</source_model>
<backend_model>Magento\Backend\Model\Config\Backend\Secure</backend_model>
+ <comment>Enter https protocol to use Secure URLs in Frontend.</comment>
</field>
<field id="use_in_adminhtml" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Use Secure URLs in Admin</label>
<source_model>Magento\Backend\Model\Config\Source\Yesno</source_model>
<backend_model>Magento\Backend\Model\Config\Backend\Secure</backend_model>
+ <comment>Enter https protocol to use Secure URLs in Admin.</comment>
</field>
<field id="offloader_header" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Offloader header</label>
View
13 app/code/Magento/Backend/view/adminhtml/admin/login.phtml
@@ -26,7 +26,6 @@
?>
<!doctype html>
<html lang="en">
-
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo __('Log into Magento Admin Page') ?></title>
@@ -38,10 +37,12 @@
<link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/base.css') ?>" media="all" />
<link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/elements.css') ?>" media="all" />
<link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/form.css') ?>" media="all" />
- <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/styles.css') ?>" media="all" />
+ <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/admin.css') ?>" media="all" />
+ <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/header.css') ?>" media="all" />
+ <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/pages.css') ?>" media="all" />
+ <?php /* <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('css/styles.css') ?>" media="all" /> */?>
<link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/utils.css') ?>" media="all" />
-
<script src="<?php echo $this->getViewFileUrl('jquery/jquery.js') ?>"></script>
<script src="<?php echo $this->getViewFileUrl('mage/jquery-no-conflict.js') ?>"></script>
<script src="<?php echo $this->getViewFileUrl('jquery/jquery-ui.js') ?>"></script>
@@ -55,9 +56,9 @@
<script src="<?php echo $this->getViewFileUrl('prototype/prototype.js') ?>"></script>
<script src="<?php echo $this->getViewFileUrl('scriptaculous/effects.js') ?>"></script>
<script src="<?php echo $this->getViewFileUrl('mage/captcha.js') ?>"></script>
- <script src="<?php echo $this->getViewFileUrl('lib/modernizr.js') ?>"></script>
- <script src="<?php echo $this->getViewFileUrl('js/head.js') ?>"></script>
-
+ <script src="<?php echo $this->getViewFileUrl('modernizr/modernizr.js') ?>"></script>
+ <script src="<?php echo $this->getViewFileUrl('headjs/head.min.js') ?>"></script>
+</head>
<body id="page-login" class="page-login" onload="document.forms['login-form'].username.focus();">
<div class="wrapper">
<div class="wrapper-inner">
View
4 app/code/Magento/Backend/view/adminhtml/layout/default.xml
@@ -46,7 +46,7 @@
</block>
<block class="Magento\Theme\Block\Html\Head\Script" name="head-load-min-js">
<arguments>
- <argument name="file" xsi:type="string">head.load.min.js</argument>
+ <argument name="file" xsi:type="string">headjs/head.load.min.js</argument>
</arguments>
</block>
<block class="Magento\Theme\Block\Html\Head\Script" name="underscore-js">
@@ -300,4 +300,4 @@
</block>
<container name="before_body_end" as="before_body_end" label="Before Body End"/>
</block>
-</layout>
+</layout>
View
2 app/code/Magento/Backend/view/adminhtml/layout/editor.xml
@@ -40,7 +40,7 @@
</block>
<block class="Magento\Theme\Block\Html\Head\Script" name="lib-flex-js">
<arguments>
- <argument name="file" xsi:type="string">lib/flex.js</argument>
+ <argument name="file" xsi:type="string">mage/flex.js</argument>
</arguments>
</block>
<block class="Magento\Theme\Block\Html\Head\Script" name="lib-fabridge-js">
View
8 app/code/Magento/Backup/Controller/Adminhtml/Index.php
@@ -212,7 +212,13 @@ public function downloadAction()
$fileName = $this->_objectManager->get('Magento\Backup\Helper\Data')
->generateBackupDownloadName($backup);
- $response = $this->_fileFactory->create($fileName, null, 'application/octet-stream', $backup->getSize());
+ $response = $this->_fileFactory->create(
+ $fileName,
+ null,
+ \Magento\Filesystem::VAR_DIR,
+ 'application/octet-stream',
+ $backup->getSize()
+ );
$response->sendHeaders();
View
10 ...ode/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php
@@ -115,15 +115,14 @@ protected function _prepareCollection()
{
$collection = $this->_productFactory->create()->getCollection()
->setOrder('id')
- ->setStore($this->getStore())
->addAttributeToSelect('name')
->addAttributeToSelect('sku')
->addAttributeToSelect('price')
->addAttributeToSelect('attribute_set_id')
->addAttributeToFilter('entity_id', array('nin' => $this->_getSelectedProducts()))
->addAttributeToFilter('type_id', array('in' => $this->getAllowedSelectionTypes()))
->addFilterByRequiredOptions()
- ->addStoreFilter();
+ ->addStoreFilter(\Magento\Core\Model\Store::DEFAULT_STORE_ID);
if ($this->getFirstShow()) {
$collection->addIdFilter('-1');
@@ -169,8 +168,6 @@ protected function _prepareColumns()
'header' => __('Price'),
'align' => 'center',
'type' => 'currency',
- 'currency_code' => $this->getStore()->getCurrentCurrencyCode(),
- 'rate' => $this->getStore()->getBaseCurrency()->getRate($this->getStore()->getCurrentCurrencyCode()),
'index' => 'price',
'header_css_class'=> 'col-price',
'column_css_class'=> 'col-price'
@@ -208,11 +205,6 @@ protected function _getProducts()
}
}
- public function getStore()
- {
- return $this->_storeManager->getStore();
- }
-
/**
* Retrieve array of allowed product types for bundle selection product
*
View
101 app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php
@@ -135,15 +135,18 @@ protected function _prepareCollection()
->addAttributeToSelect('sku')
->addAttributeToSelect('name')
->addAttributeToSelect('attribute_set_id')
- ->addAttributeToSelect('type_id');
+ ->addAttributeToSelect('type_id')
+ ->setStore($store);
if ($this->_catalogData->isModuleEnabled('Magento_CatalogInventory')) {
- $collection->joinField('qty',
+ $collection->joinField(
+ 'qty',
'cataloginventory_stock_item',
'qty',
'product_id=entity_id',
'{{table}}.stock_id=1',
- 'left');
+ 'left'
+ );
}
if ($store->getId()) {
//$collection->setStoreId($store->getId());
@@ -188,8 +191,7 @@ protected function _prepareCollection()
'left',
$store->getId()
);
- }
- else {
+ } else {
$collection->addAttributeToSelect('price');
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
@@ -206,49 +208,58 @@ protected function _addColumnFilterToCollection($column)
{
if ($this->getCollection()) {
if ($column->getId() == 'websites') {
- $this->getCollection()->joinField('websites',
+ $this->getCollection()->joinField(
+ 'websites',
'catalog_product_website',
'website_id',
'product_id=entity_id',
null,
- 'left');
+ 'left'
+ );
}
}
return parent::_addColumnFilterToCollection($column);
}
protected function _prepareColumns()
{
- $this->addColumn('entity_id',
+ $this->addColumn(
+ 'entity_id',
array(
'header'=> __('ID'),
'width' => '50px',
'type' => 'number',
'index' => 'entity_id',
'header_css_class' => 'col-id',
'column_css_class' => 'col-id'
- ));
- $this->addColumn('name',
+ )
+ );
+ $this->addColumn(
+ 'name',
array(
'header'=> __('Name'),
'index' => 'name',
'class' => 'xxx',
'header_css_class' => 'col-name',
'column_css_class' => 'col-name'
- ));
+ )
+ );
$store = $this->_getStore();
if ($store->getId()) {
- $this->addColumn('custom_name',
+ $this->addColumn(
+ 'custom_name',
array(
'header'=> __('Name in %1', $store->getName()),
'index' => 'custom_name',
'header_css_class' => 'col-name',
'column_css_class' => 'col-name'
- ));
+ )
+ );
}
- $this->addColumn('type',
+ $this->addColumn(
+ 'type',
array(
'header'=> __('Type'),
'width' => '60px',
@@ -257,14 +268,16 @@ protected function _prepareColumns()
'options' => $this->_type->getOptionArray(),
'header_css_class' => 'col-type',
'column_css_class' => 'col-type'
- ));
+ )
+ );
$sets = $this->_setsFactory->create()
->setEntityTypeFilter($this->_productFactory->create()->getResource()->getTypeId())
->load()
->toOptionHash();
- $this->addColumn('set_name',
+ $this->addColumn(
+ 'set_name',
array(
'header'=> __('Attribute Set'),
'width' => '100px',
@@ -273,41 +286,49 @@ protected function _prepareColumns()
'options' => $sets,
'header_css_class' => 'col-attr-name',
'column_css_class' => 'col-attr-name'
- ));
+ )
+ );
- $this->addColumn('sku',
+ $this->addColumn(
+ 'sku',
array(
'header'=> __('SKU'),
'width' => '80px',
'index' => 'sku',
'header_css_class' => 'col-sku',
'column_css_class' => 'col-sku'
- ));
+ )
+ );
$store = $this->_getStore();
- $this->addColumn('price',
+ $this->addColumn(
+ 'price',
array(
'header'=> __('Price'),
'type' => 'price',
'currency_code' => $store->getBaseCurrency()->getCode(),
'index' => 'price',
'header_css_class' => 'col-price',
'column_css_class' => 'col-price'
- ));
+ )
+ );
if ($this->_catalogData->isModuleEnabled('Magento_CatalogInventory')) {
- $this->addColumn('qty',
+ $this->addColumn(
+ 'qty',
array(
'header'=> __('Quantity'),
'width' => '100px',
'type' => 'number',
'index' => 'qty',
'header_css_class' => 'col-qty',
'column_css_class' => 'col-qty'
- ));
+ )
+ );
}
- $this->addColumn('visibility',
+ $this->addColumn(
+ 'visibility',
array(
'header'=> __('Visibility'),
'width' => '70px',
@@ -316,9 +337,11 @@ protected function _prepareColumns()
'options' => $this->_visibility->getOptionArray(),
'header_css_class' => 'col-visibility',
'column_css_class' => 'col-visibility'
- ));
+ )
+ );
- $this->addColumn('status',
+ $this->addColumn(
+ 'status',
array(
'header'=> __('Status'),
'width' => '70px',
@@ -327,10 +350,12 @@ protected function _prepareColumns()
'options' => $this->_status->getOptionArray(),
'header_css_class' => 'col-status',
'column_css_class' => 'col-status'
- ));
+ )
+ );
if (!$this->_storeManager->isSingleStoreMode()) {
- $this->addColumn('websites',
+ $this->addColumn(
+ 'websites',
array(
'header'=> __('Websites'),
'width' => '100px',
@@ -340,10 +365,12 @@ protected function _prepareColumns()
'options' => $this->_websiteFactory->create()->getCollection()->toOptionHash(),
'header_css_class' => 'col-websites',
'column_css_class' => 'col-websites'
- ));
+ )
+ );
}
- $this->addColumn('edit',
+ $this->addColumn(
+ 'edit',
array(
'header' => __('Edit'),
'width' => '50px',
@@ -364,7 +391,8 @@ protected function _prepareColumns()
'index' => 'stores',
'header_css_class' => 'col-action',
'column_css_class' => 'col-action'
- ));
+ )
+ );
if ($this->_catalogData->isModuleEnabled('Magento_Rss')) {
$this->addRssList('rss/catalog/notifystock', __('Notify Low Stock RSS'));
@@ -402,7 +430,7 @@ protected function _prepareMassaction()
)
));
- if ($this->_authorization->isAllowed('Magento_Catalog::update_attributes')){
+ if ($this->_authorization->isAllowed('Magento_Catalog::update_attributes')) {
$this->getMassactionBlock()->addItem('attributes', array(
'label' => __('Update Attributes'),
'url' => $this->getUrl('catalog/product_action_attribute/edit', array('_current'=>true))
@@ -420,9 +448,12 @@ public function getGridUrl()
public function getRowUrl($row)
{
- return $this->getUrl('catalog/*/edit', array(
- 'store'=>$this->getRequest()->getParam('store'),
- 'id'=>$row->getId())
+ return $this->getUrl(
+ 'catalog/*/edit',
+ array(
+ 'store'=>$this->getRequest()->getParam('store'),
+ 'id'=>$row->getId()
+ )
);
}
}
View
2 app/code/Magento/Catalog/Model/Category.php
@@ -291,7 +291,7 @@ public function getTreeModelInstance()
* Move category
*
* @param int $parentId new parent category id
- * @param int $afterCategoryId category id after which we have put current category
+ * @param null|int $afterCategoryId category id after which we have put current category
* @return \Magento\Catalog\Model\Category
* @throws \Magento\Core\Exception|\Exception
*/
View
4 app/code/Magento/Catalog/Model/Product.php
@@ -241,7 +241,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel
* @param \Magento\Data\CollectionFactory $collectionFactory
* @param \Magento\Filesystem $filesystem
* @param array $data
- *
+ *
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -1184,7 +1184,7 @@ public function duplicate()
->setCreatedAt(null)
->setUpdatedAt(null)
->setId(null)
- ->setStoreId($this->_storeManager->getStore()->getId());
+ ->setStoreId(\Magento\Core\Model\Store::DEFAULT_STORE_ID);
$this->_eventManager->dispatch(
'catalog_model_product_duplicate',
View
35 app/code/Magento/Catalog/Model/Resource/Category.php
@@ -920,32 +920,19 @@ protected function _processPositions($category, $newParent, $afterCategoryId)
->from($table, 'position')
->where('entity_id = :entity_id');
$position = $adapter->fetchOne($select, array('entity_id' => $afterCategoryId));
-
- $bind = array(
- 'position' => new \Zend_Db_Expr($positionField . ' + 1')
- );
- $where = array(
- 'parent_id = ?' => $newParent->getId(),
- $positionField . ' > ?' => $position
- );
- $adapter->update($table, $bind, $where);
- } elseif ($afterCategoryId !== null) {
- $position = 0;
- $bind = array(
- 'position' => new \Zend_Db_Expr($positionField . ' + 1')
- );
- $where = array(
- 'parent_id = ?' => $newParent->getId(),
- $positionField . ' > ?' => $position
- );
- $adapter->update($table, $bind, $where);
+ $position += 1;
} else {
- $select = $adapter->select()
- ->from($table, array('position' => new \Zend_Db_Expr('MIN(' . $positionField . ')')))
- ->where('parent_id = :parent_id');
- $position = $adapter->fetchOne($select, array('parent_id' => $newParent->getId()));
+ $position = 1;
}
- $position += 1;
+
+ $bind = array(
+ 'position' => new \Zend_Db_Expr($positionField . ' + 1')
+ );
+ $where = array(
+ 'parent_id = ?' => $newParent->getId(),
+ $positionField . ' >= ?' => $position
+ );
+ $adapter->update($table, $bind, $where);
return $position;
}
View
15 app/code/Magento/Checkout/Controller/Onepage.php
@@ -53,16 +53,24 @@ class Onepage extends \Magento\Checkout\Controller\Action
protected $_coreRegistry = null;
/**
+ * @var \Magento\Core\App\Action\FormKeyValidator
+ */
+ protected $_formKeyValidator;
+
+ /**
* @param \Magento\App\Action\Context $context
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Core\Model\Registry $coreRegistry
+ * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
*/
public function __construct(
\Magento\App\Action\Context $context,
\Magento\Customer\Model\Session $customerSession,
- \Magento\Core\Model\Registry $coreRegistry
+ \Magento\Core\Model\Registry $coreRegistry,
+ \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
) {
$this->_coreRegistry = $coreRegistry;
+ $this->_formKeyValidator = $formKeyValidator;
parent::__construct($context, $customerSession);
}
@@ -534,6 +542,11 @@ protected function _initInvoice()
*/
public function saveOrderAction()
{
+ if (!$this->_formKeyValidator->validate($this->getRequest())) {
+ $this->_redirect('*/*/');
+ return;
+ }
+
if ($this->_expireAjax()) {
return;
}
View
1 app/code/Magento/Checkout/view/frontend/onepage/payment.phtml
@@ -23,6 +23,7 @@
*/
?>
<form id="co-payment-form" class="form payments">
+ <?php echo $this->getBlockHtml('formkey') ?>
<fieldset class="fieldset">
<?php echo $this->getChildChildHtml('methods_additional') ?>
<div id="checkout-payment-method-load"><?php echo $this->getChildHtml('methods') ?></div>
View
4 app/code/Magento/Core/Model/App.php
@@ -53,7 +53,7 @@ class App implements \Magento\Core\Model\AppInterface
/**
* Magento version
*/
- const VERSION = '2.0.0.0-dev59';
+ const VERSION = '2.0.0.0-dev60';
/**
@@ -804,7 +804,7 @@ public function getVersionInfo()
'revision' => '0',
'patch' => '0',
'stability' => 'dev',
- 'number' => '59',
+ 'number' => '60',
);
}
}
View
115 app/code/Magento/Core/view/adminhtml/prototype/magento.css
@@ -171,8 +171,8 @@
.popup-window .page-actions {
padding: 0;
position: absolute;
- right: 19px;
- top: 29px;
+ right: 43px;
+ top: 30px;
z-index: 2;
}
@@ -185,90 +185,6 @@
margin: 5px 0 0;
}
-/*
- Styles for tables in popup window
--------------------------------------- */
-
-.popup-window .data {
- border-collapse: inherit; /* do not remove this! without this rule in FF when table has only 1 row bottom and side borders disappear */
- width: 100%;
-}
-
-.popup-window .grid .data {
- border-left: 1px solid #c0bbaf;
- border-right: 1px solid #c0bbaf;
-}
-
-.popup-window .grid .data td:first-child {
- border-left-width: 0;
-}
-
-.popup-window .grid .data td:last-child {
- border-left-width: 0;
- border-right-width: 0;
-}
-
-.popup-window .grid .data tr:last-child td {
- border-bottom-color: #c0bbaf;
-}
-
-.popup-window .grid tr.headings th,
-.popup-window .grid tr.filter th {
- background: #fff;
- border-color: #c9c2b8;
- border-width: 0 0 1px;
- color: #666;
- padding: 3px 7px;
-}
-
-.popup-window .grid tr.headings th a {
- color: #666;
-}
-
-.popup-window .data tr.headings th:hover > span {
- border-color: #cac2b5;
-}
-
-.popup-window .grid tr.headings th a:after {
- color: #dbd6ce;
-}
-
-.popup-window .grid tr.headings th a:hover:after {
- color: #cac2b5;
-}
-
-.popup-window .grid .filter input.input-text,
-.popup-window .grid .filter select {
- background: #fff;
- border: 1px solid #ccc;
- color: #666;
-}
-
-.popup-window .grid tr th:first-child {
- border: 0;
-}
-
-.popup-window .grid tbody tr:first-child td {
- border-top: 1px solid #eae8e4;
-}
-
-.popup-window .grid tbody tr td,
-.popup-window .grid tbody tr td:hover {
- border-bottom: 1px solid #eae8e4;
- padding: 3px 7px;
-}
-
-.popup-window .grid tbody tr:nth-child(odd) td,
-.popup-window .grid tbody tr:nth-child(odd):hover td {
- background: #fbfaf6;
-}
-
-.popup-window .grid tr.on-mouse td,
-.popup-window .grid table tbody tr.on-mouse:hover td,
-.popup-window .grid table tbody tr.on-mouse:nth-child(odd):hover td {
- background-color: #f3efea;
-}
-
.popup-window .data .col-id {
width: 35px;
}
@@ -325,13 +241,29 @@
margin: 0 5px 0 0;
}
+.magento_message #contents-uploader {
+ margin: 0 0 18px;
+}
+
.magento_message .fileinput-button {
display: inline-block;
cursor: pointer;
float: none;
vertical-align: middle;
}
+.magento_message .fileinput-button span {
+ display: none;
+}
+
+.magento_message .fileinput-button input {
+ position: static;
+ border: none;
+ opacity: 1;
+ filter: alpha(opacity=1);
+ -moz-transform: none;
+}
+
.magento_message .file-row {
background: #fff;
border: 1px solid #cac2b5;
@@ -422,7 +354,8 @@
.ui-dialog .ui-dialog-title {
color: #676056;
- font: normal 20px/1 'CallunaSans';
+ font-size: 20px;
+ line-height: 1;
display: block;
padding: 19px 0 19px 20px;
cursor: move;
@@ -464,18 +397,14 @@
border: none;
}
-.ui-dialog .ui-dialog-content {
- padding: 10px 10px 0;
-}
-
.ui-dialog .ui-dialog-content .fieldset {
border-radius: 0;
border: none;
}
.ui-dialog .ui-dialog-content {
overflow: auto;
- padding: 25px 25px 0;
+ padding: 25px 25px 20px;
}
.ui-dialog .ui-dialog-content label.mage-error {
@@ -489,7 +418,7 @@
.ui-dialog .ui-dialog-buttonpane {
margin: 0;
- padding: 25px;
+ padding: 0 25px 25px;
border: none;
}
View
2 app/code/Magento/Customer/Block/Adminhtml/Form/Element/File.php
@@ -194,7 +194,7 @@ protected function _getHiddenInput()
protected function _getPreviewUrl()
{
return $this->_adminhtmlData->getUrl('customer/index/viewfile', array(
- 'file' => $this->_escaper->urlEncode($this->getValue()),
+ 'file' => $this->_adminhtmlData->urlEncode($this->getValue()),
));
}
View
8 app/code/Magento/Customer/Block/Adminhtml/Grid/Renderer/Multiaction.php
@@ -71,7 +71,7 @@ public function render(\Magento\Object $row)
*
* @param array $action
* @param \Magento\Object $row
- * @return string
+ * @return bool|string
*/
protected function _toLinkHtml($action, \Magento\Object $row)
{
@@ -81,12 +81,10 @@ protected function _toLinkHtml($action, \Magento\Object $row)
if ($product->canConfigure()) {
$style = '';
$onClick = sprintf('onclick="return %s.configureItem(%s)"', $action['control_object'], $row->getId());
+ return sprintf('<a href="%s" %s %s>%s</a>', $action['url'], $style, $onClick, $action['caption']);
} else {
- $style = 'style="color: #CCC;"';
- $onClick = '';
+ return false;
}
-
- return sprintf('<a href="%s" %s %s>%s</a>', $action['url'], $style, $onClick, $action['caption']);
} else {
return parent::_toLinkHtml($action, $row);
}
View
22 app/code/Magento/Customer/Controller/Adminhtml/Index.php
@@ -472,7 +472,7 @@ public function exportCsvAction()
$fileName = 'customers.csv';
$content = $this->_view->getLayout()->createBlock('Magento\Customer\Block\Adminhtml\Grid')->getCsvFile();
- return $this->_fileFactory->create($fileName, $content);
+ return $this->_fileFactory->create($fileName, $content, \Magento\Filesystem::VAR_DIR);
}
/**
@@ -482,7 +482,7 @@ public function exportXmlAction()
{
$fileName = 'customers.xml';
$content = $this->_view->getLayout()->createBlock('Magento\Customer\Block\Adminhtml\Grid')->getExcelFile();
- return $this->_fileFactory->create($fileName, $content);
+ return $this->_fileFactory->create($fileName, $content, \Magento\Filesystem::VAR_DIR);
}
/**
@@ -851,8 +851,8 @@ public function viewfileAction()
/** @var \Magento\Filesystem $filesystem */
$filesystem = $this->_objectManager->get('Magento\Filesystem');
- $directory = $filesystem->getDirectoryRead(\Magento\Filesystem:: MEDIA);
- $fileName = 'customer/' . $file;
+ $directory = $filesystem->getDirectoryRead(\Magento\Filesystem::MEDIA);
+ $fileName = 'customer' . '/' . ltrim($file, '/');
$path = $directory->getAbsolutePath($fileName);
if (!$directory->isFile($fileName)
&& !$this->_objectManager->get('Magento\Core\Helper\File\Storage')
@@ -877,7 +877,7 @@ public function viewfileAction()
$contentType = 'application/octet-stream';
break;
}
- $stat = $directory->stat($fileName);
+ $stat = $directory->stat($path);
$contentLength = $stat['size'];
$contentModify = $stat['mtime'];
@@ -893,10 +893,14 @@ public function viewfileAction()
echo $directory->readFile($fileName);
} else {
$name = pathinfo($path, PATHINFO_BASENAME);
- $this->_fileFactory->create($name, array(
- 'type' => 'filename',
- 'value' => $fileName
- ))->sendResponse();
+ $this->_fileFactory->create(
+ $name,
+ array(
+ 'type' => 'filename',
+ 'value' => $fileName
+ ),
+ \Magento\Filesystem::MEDIA
+ )->sendResponse();
}
exit();
View
12 app/code/Magento/Customer/Model/Address.php
@@ -160,7 +160,7 @@ public function delete()
/**
* Retrieve address entity attributes
*
- * @return array
+ * @return \Magento\Customer\Model\Attribute[]
*/
public function getAttributes()
{
@@ -174,6 +174,16 @@ public function getAttributes()
return $attributes;
}
+ /**
+ * Get attributes created by default
+ *
+ * @return string[]
+ */
+ public function getDefaultAttributeCodes()
+ {
+ return $this->_getResource()->getDefaultAttributes();
+ }
+
public function __clone()
{
$this->setId(null);
View
165 app/code/Magento/Customer/Model/Converter.php
@@ -0,0 +1,165 @@
+<?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.
+ *
+ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Customer\Model;
+
+use Magento\Customer\Service\Entity\V1\Exception;
+use Magento\Customer\Service\V1\CustomerMetadataServiceInterface;
+
+/**
+ * Customer Model converter.
+ *
+ * Converts a Customer Model to a DTO.
+ *
+ * TODO: Remove this class after service refactoring is done and the model
+ * TODO: is no longer needed outside of service. Then this function could
+ * TODO: be moved to the service.
+ */
+class Converter
+{
+ /**
+ * @var \Magento\Customer\Service\V1\Dto\CustomerBuilder
+ */
+ protected $_customerBuilder;
+
+ /**
+ * @var CustomerFactory
+ */
+ protected $_customerFactory;
+
+ /**
+ * @param CustomerFactory $customerFactory
+ * @param \Magento\Customer\Service\V1\Dto\CustomerBuilder $customerBuilder
+ */
+ public function __construct(
+ \Magento\Customer\Service\V1\Dto\CustomerBuilder $customerBuilder,
+ \Magento\Customer\Model\CustomerFactory $customerFactory
+ ) {
+ $this->_customerBuilder = $customerBuilder;
+ $this->_customerFactory = $customerFactory;
+ }
+
+ /**
+ * Convert a customer model to a customer entity
+ *
+ * @param \Magento\Customer\Model\Customer $customerModel
+ * @throws \InvalidArgumentException
+ * @return \Magento\Customer\Service\V1\Dto\Customer
+ */
+ public function createCustomerFromModel($customerModel)
+ {
+ if (!($customerModel instanceof \Magento\Customer\Model\Customer)) {
+ throw new \InvalidArgumentException('customer model is invalid');
+ }
+ $this->_convertAttributesFromModel($this->_customerBuilder, $customerModel);
+ $this->_customerBuilder->setCustomerId($customerModel->getId());
+ $this->_customerBuilder->setFirstname($customerModel->getFirstname());
+ $this->_customerBuilder->setLastname($customerModel->getLastname());
+ $this->_customerBuilder->setEmail($customerModel->getEmail());
+ return $this->_customerBuilder->create();
+ }
+
+
+ /**
+ * @param int $customerId
+ * @throws Exception If customerId is not found or other error occurs.
+ * @return Customer
+ */
+ public function getCustomerModel($customerId)
+ {
+ try {
+ $customer = $this->_customerFactory->create()->load($customerId);
+ } catch (\Exception $e) {
+ throw new Exception($e->getMessage(), $e->getCode(), $e);
+ }
+
+ if (!$customer->getId()) {
+ // customer does not exist
+ throw new Exception(
+ 'No customer with customerId ' . $customerId . ' exists.',
+ Exception::CODE_INVALID_CUSTOMER_ID
+ );
+ } else {
+ return $customer;
+ }
+ }
+
+
+ /**
+ * Creates a customer model from a customer entity.
+ *
+ * @param \Magento\Customer\Service\V1\Dto\Customer $customer
+ * @return Customer
+ */
+ public function createCustomerModel(\Magento\Customer\Service\V1\Dto\Customer $customer)
+ {
+ $customerModel = $this->_customerFactory->create();
+
+ $attributes = $customer->getAttributes();
+ foreach ($attributes as $attributeCode => $attributeValue) {
+ // avoid setting password through set attribute
+ if ($attributeCode == 'password') {
+ continue;
+ } else {
+ $customerModel->setData($attributeCode, $attributeValue);
+ }
+ }
+
+ $customerId = $customer->getCustomerId();
+ if ($customerId) {
+ $customerModel->setId($customerId);
+ }
+
+ // Need to use attribute set or future updates can cause data loss
+ if (!$customerModel->getAttributeSetId()) {
+ $customerModel->setAttributeSetId(CustomerMetadataServiceInterface::CUSTOMER_ATTRIBUTE_SET_ID);
+ return $customerModel;
+ }
+
+ return $customerModel;
+ }
+
+ /**
+ * Loads the values from a customer model
+ *
+ * @param \Magento\Customer\Service\V1\Dto\CustomerBuilder $customerBuilder
+ * @param \Magento\Customer\Model\Customer $customerModel
+ */
+ protected function _convertAttributesFromModel($customerBuilder, $customerModel)
+ {
+ $attributes = [];
+ foreach ($customerModel->getAttributes() as $attribute) {
+ $attrCode = $attribute->getAttributeCode();
+ $value = $customerModel->getData($attrCode);
+ if (null == $value) {
+ continue;
+ }
+ $attributes[$attrCode] = $value;
+ }
+
+ $customerBuilder->populateWithArray($attributes);
+ }
+
+}
View
40 app/code/Magento/Customer/Model/Customer.php
@@ -30,6 +30,7 @@
* Customer model
*
* @method int getWebsiteId() getWebsiteId()
+ * @method \Magento\Customer\Model\Customer setWebsiteId(int)
* @method int getStoreId() getStoreId()
* @method string getEmail() getEmail()
* @method \Magento\Customer\Model\Resource\Customer _getResource()
@@ -170,14 +171,14 @@ class Customer extends \Magento\Core\Model\AbstractModel
protected $_emailInfoFactory;
/**
- * @var \Magento\Customer\Model\GroupFactory
+ * @var \Magento\Customer\Model\AttributeFactory
*/
- protected $_groupFactory;
+ protected $_attributeFactory;
/**
- * @var \Magento\Customer\Model\AttributeFactory
+ * @var \Magento\Customer\Service\V1\CustomerGroupServiceInterface
*/
- protected $_attributeFactory;
+ protected $_groupService;
/**
* @var \Magento\Encryption\EncryptorInterface
@@ -208,7 +209,7 @@ class Customer extends \Magento\Core\Model\AbstractModel
* @param \Magento\Customer\Model\Resource\Address\CollectionFactory $addressesFactory
* @param \Magento\Email\Model\Template\MailerFactory $mailerFactory
* @param \Magento\Email\Model\InfoFactory $emailInfoFactory
- * @param \Magento\Customer\Model\GroupFactory $groupFactory
+ * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService
* @param \Magento\Customer\Model\AttributeFactory $attributeFactory
* @param \Magento\Encryption\EncryptorInterface $encryptor
* @param \Magento\Math\Random $mathRandom
@@ -230,7 +231,7 @@ public function __construct(
\Magento\Customer\Model\Resource\Address\CollectionFactory $addressesFactory,
\Magento\Email\Model\Template\MailerFactory $mailerFactory,
\Magento\Email\Model\InfoFactory $emailInfoFactory,
- \Magento\Customer\Model\GroupFactory $groupFactory,
+ \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService,
\Magento\Customer\Model\AttributeFactory $attributeFactory,
\Magento\Encryption\EncryptorInterface $encryptor,
\Magento\Math\Random $mathRandom,
@@ -248,7 +249,7 @@ public function __construct(
$this->_addressesFactory = $addressesFactory;
$this->_mailerFactory = $mailerFactory;
$this->_emailInfoFactory = $emailInfoFactory;
- $this->_groupFactory = $groupFactory;
+ $this->_groupService = $groupService;
$this->_attributeFactory = $attributeFactory;
$this->_encryptor = $encryptor;
$this->mathRandom = $mathRandom;
@@ -296,9 +297,9 @@ public function authenticate($login, $password)
);
}
$this->_eventManager->dispatch('customer_customer_authenticated', array(
- 'model' => $this,
- 'password' => $password,
- ));
+ 'model' => $this,
+ 'password' => $password,
+ ));
return true;
}
@@ -445,14 +446,14 @@ public function getAddresses()
/**
* Retrieve all customer attributes
*
- * @return array
+ * @return \Magento\Customer\Model\Attribute[]
*/
public function getAttributes()
{
if ($this->_attributes === null) {
$this->_attributes = $this->_getResource()
- ->loadAllAttributes($this)
- ->getSortedAttributes();
+ ->loadAllAttributes($this)
+ ->getSortedAttributes();
}
return $this->_attributes;
}
@@ -821,7 +822,7 @@ public function getGroupId()
{
if (!$this->hasData('group_id')) {
$storeId = $this->getStoreId() ? $this->getStoreId() : $this->_storeManager->getStore()->getId();
- $groupId = $this->_coreStoreConfig->getConfig(\Magento\Customer\Model\Group::XML_PATH_DEFAULT_ID, $storeId);
+ $groupId = $this->_groupService->getDefaultGroup($storeId)->getId();
$this->setData('group_id', $groupId);
}
return $this->getData('group_id');
@@ -835,7 +836,8 @@ public function getGroupId()
public function getTaxClassId()
{
if (!$this->getData('tax_class_id')) {
- $this->setTaxClassId($this->_createCustomerGroup()->getTaxClassId($this->getGroupId()));
+ $groupTaxClassId = $this->_groupService->getGroup($this->getGroupId())->getTaxClassId();
+ $this->setData('tax_class_id', $groupTaxClassId);
}
return $this->getData('tax_class_id');
}
@@ -1257,14 +1259,6 @@ protected function _createEmailInfo()
}
/**
- * @return \Magento\Customer\Model\Group
- */
- protected function _createCustomerGroup()
- {
- return $this->_groupFactory->create();
- }
-
- /**
* @return \Magento\Customer\Model\Attribute
*/
protected function _createCustomerAttribute()
View
91 app/code/Magento/Customer/Model/Metadata/ElementFactory.php
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Customer Form Element Factory
+ *
+ * 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 Magento
+ * @package Magento_Customer
+ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Customer\Model\Metadata;
+
+class ElementFactory
+{
+ /**
+ * @var \Magento\ObjectManager
+ */
+ protected $_objectManager;
+
+ /**
+ * @var \Magento\Stdlib\String
+ */
+ protected $_string;
+
+ /**
+ * @param \Magento\ObjectManager $objectManager
+ * @param \Magento\Stdlib\String $string
+ */
+ public function __construct(\Magento\ObjectManager $objectManager, \Magento\Stdlib\String $string)
+ {
+ $this->_objectManager = $objectManager;
+ $this->_string = $string;
+ }
+
+ /**
+ * Create Form Element
+ *
+ * @param \Magento\Customer\Service\V1\Dto\Eav\AttributeMetadata $attribute
+ * @param $value
+ * @param $entityTypeCode
+ * @param bool $isAjax
+ * @return \Magento\Customer\Model\Metadata\Form\AbstractData
+ */
+ public function create(
+ \Magento\Customer\Service\V1\Dto\Eav\AttributeMetadata $attribute,
+ $value,
+ $entityTypeCode,
+ $isAjax = false
+ ) {
+ $dataModelClass = $attribute->getDataModel();
+ $params = [
+ 'entityTypeCode' => $entityTypeCode,
+ 'value' => is_null($value) ? false : $value,
+ 'isAjax' => $isAjax,
+ 'attribute' => $attribute
+ ];
+ /** TODO fix when Validation is implemented MAGETWO-17341 */
+ if ($dataModelClass == 'Magento\Customer\Model\Attribute\Data\Postcode') {
+ $dataModelClass = 'Magento\Customer\Model\Metadata\Form\Text';
+ }
+ if (!empty($dataModelClass)) {
+ $dataModel = $this->_objectManager->create($dataModelClass, $params);
+ } else {
+ $dataModelClass = sprintf(
+ 'Magento\Customer\Model\Metadata\Form\%s',
+ $this->_string->upperCaseWords($attribute->getFrontendInput())
+ );
+ $dataModel = $this->_objectManager->create($dataModelClass, $params);
+ }
+
+ return $dataModel;
+ }
+}
View
559 app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php
@@ -0,0 +1,559 @@
+<?php
+/**
+ * Form Element Abstract Data Model
+ *
+ * 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 Magento