From 6d9aa0588ca6eabf612087b8789b2b549b955b33 Mon Sep 17 00:00:00 2001 From: mage2-team Date: Fri, 27 Dec 2013 11:09:23 -0800 Subject: [PATCH] 2.0.0.0-dev58 * Fixed bugs: * Security improved for the Login, Update Cart, Add to Compare, Review, and Add entire wishlist actions on the frontend * Removed warnings on category pages when Flat Catalog Category is enabled * Fixed product price displayed in wrong currency after switching currency on the frontend * Fixed the Save & Duplicate action in product creation * Fixed big image scaling in product description * Fixed admin dashboard styling issue * Fixed validation message for the Quantity field on the product page in the backend * Fixed the email template for sharing a Wishlist * Fixed the response of the drop-down menu in the Plushe theme * Fixed the missing Related Banners tab for Catalog Price Rule * Fixed inability to enable the duplicated product * Removed warnings on saving payment method configuration * Fixed gift messages displaying on the Order View page after admin edits * Fixed inability to create a new order status * Fixed the behavior of the Save and Previous and the Previous buttons on the Edit Review page * Fixed inability to delete a website if the number of websites is less or equal to two * Fixed Export on the All Customers page * Fixed inability to add products to the Shopping Cart from the Category page in Internet Explorer * Fixed logo on the backend login page * Fixed visual elements to indicate that Tax details can be expanded on the order creation page in the backend * Fixed the CMS page preview design * Fixed the newsletter template preview design * Fixed the Matched Customers grid design in the Email Reminder Rules * Fixed the theme version validation message displayed when creating a new theme * Fixed performance degradation during installation wizard execution * Fixed cron shell script * Fixed user login on the frontend, when the Redirect Customer to Account Dashboard after Logging option is set to No * Fixed errors in requests to shipping carrier (DHL International) when the shipping address contains letters with diacritic marks * Fixed invalid account creation date * Fixed displaying Product Alert links on product view page when the functionality is disabled * Fixed the absence of some bundle options when configuring a bundle product in the Shopping Cart on the frontend * Fixed the issue which allowed to view and cancel billing agreements belonging to another customer * Fixed the content spoofing vulnerability when Solr was used * Fixed a potential XSS vulnerability in customer login * Fixed RSS feed for categories containing bundle product(s) * Fixed inability to place an order with 3D Secure in Internet Explorer 10 * Fixed inability to place an order with PayPal Payflow Link and PayPal Payments Advanced * Fixed integrity constraint violation in catalog URL rewrites * Fixed the absence of the error when a wrong website code is specified during a website creation * Fixed saving in the backend a new customer address, which contains new customer address attributes configured to be not visible on frontend * Fixed USPS shipping method in the checkout * Fixed placing orders with recurring profile items via PayPal Express Checkout * Fixed email template creation in the backend * Fixed the issue with default billing address being used instead of default shipping address during admin order creation * Fixed inability to choose DB as Media Storage * Fixed PHP issues found during the UI testing of the backend * Fixed shipping label creation for USPS Priority Mail Shipping methods * Fixed the issue which allowed to create customers with duplicate email * Fixed the abstract product block error in the tier price template getter * Fixed system message displaying in the backend * Fixed the "404" error on customer review page * Fixed autocomplete enabled on the admin login page * Fixed the 3D Secure iframe * Fixed the indicators of mandatory fields on the Package Extension page * Fixed product image scaling on the Compare Products page * Fixed product page design for products with the Fixed Product Tax attribute * Removed spaces between parentheses and numbers in the Cart, Wishlist, and Compare Products blocks * Fixed the message displaying the quantity for products found on the Advanced Search page * Fixed incorrect caching of locale settings and URL settings during web installation * Fixed inability to use a newly created store for admin user roles * Fixed absence of the Advanced Search field on the frontend, when the Popular Search Terms functionality is disabled * Fixed incorrect link to downloadable product(s) in the email invoice copy * Fixed customs monetary value in labels/package info for international shipments * Fixed importing for files with blank URL Key field on the store view level * Fixed table rate error message * Fixed frontend login without pre-set cookies * 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 * 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 * [#390](https://github.com/magento/magento2/pull/390) -- Support of alphanumeric order increment ids by the quote resource model * Themes update: * Responsive design improvements * Improvements in code coverage calculation: * Code coverage calculation approach for unit tests was changed from blacklist to whitelist --- CHANGELOG.md | 83 +++- .../view/adminhtml/layout/default.xml | 32 +- .../view/frontend/directpost/form.phtml | 4 +- .../Magento/Backend/App/AbstractAction.php | 19 - .../System/Config/System/Storage.php | 10 +- .../Controller/Adminhtml/System/Design.php | 29 +- .../Controller/Adminhtml/System/Store.php | 2 +- .../Magento/Backend/Model/Auth/Session.php | 7 + .../Backend/view/adminhtml/admin/login.phtml | 4 +- .../Backend/view/adminhtml/layout/default.xml | 1 + .../system/storage/media/synchronize.phtml | 11 +- .../Product/View/Type/Bundle/Option.php | 18 +- .../mysql4-upgrade-1.6.0.0-1.6.0.0.1.php | 3 + .../view/type/bundle/option/radio.phtml | 2 +- .../view/type/bundle/option/select.phtml | 2 +- .../frontend/rss/catalog/product/price.phtml | 6 +- .../Magento/Captcha/Model/ModelInterface.php | 2 +- app/code/Magento/Captcha/Model/Observer.php | 21 +- .../Adminhtml/Product/Edit/NewCategory.php | 17 +- .../Catalog/Block/Product/AbstractProduct.php | 12 +- .../Controller/Adminhtml/Product/Review.php | 6 +- .../Catalog/Controller/Product/Compare.php | 14 +- .../Catalog/Helper/Product/Compare.php | 13 +- .../Catalog/Model/Layer/Filter/Price.php | 17 +- .../Model/Product/Attribute/Backend/Media.php | 5 +- .../Model/Product/Type/AbstractType.php | 2 +- .../Catalog/Model/Resource/Category/Flat.php | 22 +- app/code/Magento/Catalog/Model/Url.php | 2 +- .../mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php | 3 + .../view/adminhtml/product/product.css | 6 +- .../view/frontend/product/compare/link.phtml | 8 +- .../frontend/product/compare/sidebar.phtml | 5 +- .../frontend/product/view/addtocart.phtml | 2 +- .../frontend/product/view/type/grouped.phtml | 2 +- .../CatalogSearch/Model/Resource/Fulltext.php | 2 +- .../view/frontend/advanced/result.phtml | 8 +- .../view/frontend/layout/default.xml | 2 +- app/code/Magento/Centinel/Model/Service.php | 28 +- .../view/frontend/authentication.phtml | 2 +- app/code/Magento/Checkout/Block/Cart/Link.php | 2 +- .../Checkout/Block/Onepage/Payment.php | 10 + .../Checkout/Block/Onepage/Success.php | 2 +- app/code/Magento/Checkout/Controller/Cart.php | 14 +- app/code/Magento/Checkout/Helper/Data.php | 1 - .../Checkout/view/frontend/cart/form.phtml | 1 + .../cart/item/configure/updatecart.phtml | 2 +- .../view/frontend/cart/item/default.phtml | 2 +- .../view/frontend/cart/minicart.phtml | 4 +- .../Checkout/view/frontend/js/opcheckout.js | 6 +- .../layout/checkout_multishipping.xml | 8 +- .../layout/checkout_onepage_index.xml | 4 +- .../frontend/multishipping/addresses.phtml | 2 +- .../Checkout/view/frontend/onepage.phtml | 2 + .../view/frontend/onepage/login.phtml | 1 + .../adminhtml/extension/custom/authors.phtml | 24 +- .../Core/App/Action/Plugin/Session.php | 2 +- app/code/Magento/Core/Model/App.php | 4 +- .../Core/Model/Config/FileResolver.php | 2 +- app/code/Magento/Core/Model/Design.php | 10 +- app/code/Magento/Core/Model/File/Storage.php | 2 +- app/code/Magento/Core/Model/Layout.php | 2 +- .../Locale/Hierarchy/Config/FileResolver.php | 2 +- .../Core/Model/Resource/File/Storage/File.php | 2 +- .../Magento/Core/Model/Resource/Setup.php | 16 +- app/code/Magento/Core/Model/Store.php | 7 +- .../Magento/Core/Model/Theme/Collection.php | 14 +- app/code/Magento/Core/Model/Website.php | 2 +- .../Customer/Block/Account/Customer.php | 10 +- .../Block/Adminhtml/Edit/Tab/Account.php | 2 +- .../Block/Adminhtml/Edit/Tab/View.php | 2 +- .../Magento/Customer/Controller/Account.php | 4 +- .../Customer/Model/Resource/Customer.php | 2 +- app/code/Magento/Customer/etc/module.xml | 2 +- app/code/Magento/Customer/etc/validation.xml | 1 - .../upgrade-1.6.2.0.4-1.6.2.0.5.php | 39 ++ .../Customer/view/frontend/form/login.phtml | 2 + .../data-upgrade-1.6.0.1-1.6.0.2.php | 59 +++ app/code/Magento/Directory/etc/module.xml | 2 +- .../Sales/Order/Email/Items/Downloadable.php | 10 +- app/code/Magento/Downloadable/etc/di.xml | 5 + .../frontend/checkout/cart/item/default.phtml | 2 +- .../frontend/customer/products/list.phtml | 58 +-- .../Email/Block/Adminhtml/Template/Edit.php | 4 +- .../Model/Template/Config/FileResolver.php | 8 +- .../view/adminhtml/giftoptionsform.phtml | 6 - .../GiftMessage/view/adminhtml/popup.phtml | 2 + .../Adminhtml/Googleshopping/Types.php | 12 +- .../Model/Import/Entity/Product.php | 10 + .../Entity/Product/Type/AbstractType.php | 27 +- .../view/adminhtml/export/form/before.phtml | 15 - app/code/Magento/Install/Model/Installer.php | 15 +- .../Install/Model/Installer/Config.php | 40 +- .../Problem/Grid/Filter/Checkbox.php | 2 +- .../adminhtml/preview/iframeswitcher.phtml | 11 +- .../Payment/view/frontend/form/cc.phtml | 4 +- .../Payment/view/frontend/form/ccsave.phtml | 4 +- app/code/Magento/Paypal/Block/Iframe.php | 2 +- app/code/Magento/Paypal/Model/Cert.php | 3 +- .../ProductAlert/Block/Product/View/Price.php | 14 +- .../ProductAlert/Block/Product/View/Stock.php | 13 +- .../Grid/Column/Renderer/Customer.php | 2 +- .../reports_report_review_customer_grid.xml | 2 +- .../Magento/Review/Block/Adminhtml/Edit.php | 6 +- .../Magento/Review/Controller/Product.php | 20 +- .../Review/view/frontend/customer/list.phtml | 78 ++-- .../Magento/Review/view/frontend/form.phtml | 1 + .../Adminhtml/Order/Status/NewStatus.php | 3 +- .../Sales/Controller/Billing/Agreement.php | 23 +- .../Magento/Sales/Model/Billing/Agreement.php | 4 +- .../Magento/Sales/Model/Quote/Address.php | 61 ++- ...wstatus.xml => sales_order_status_new.xml} | 0 .../adminhtml/order/create/giftmessage.js | 2 +- .../order/create/totals/default.phtml | 2 +- .../order/create/totals/grandtotal.phtml | 6 +- .../order/create/totals/shipping.phtml | 6 +- .../order/create/totals/subtotal.phtml | 6 +- .../adminhtml/order/create/totals/tax.phtml | 2 +- .../adminhtml/order/invoice/view/form.phtml | 13 +- .../adminhtml/order/shipment/packaging.js | 2 +- .../view/adminhtml/order/view/info.phtml | 11 +- .../frontend/billing/agreement/view.phtml | 51 +- .../view/frontend/billing/agreements.phtml | 50 +- .../frontend/order/creditmemo/items.phtml | 50 +- .../Sales/view/frontend/order/history.phtml | 64 +-- .../view/frontend/order/invoice/items.phtml | 46 +- .../Sales/view/frontend/order/items.phtml | 90 ++-- .../Sales/view/frontend/order/recent.phtml | 64 +-- .../view/frontend/order/shipment/items.phtml | 36 +- .../Sendfriend/view/frontend/send.phtml | 25 +- .../Shipping/Model/Carrier/Tablerate.php | 12 +- app/code/Magento/Shipping/Model/Shipping.php | 10 +- .../Shipping/Model/Shipping/Labels.php | 10 +- .../Magento/Shipping/etc/adminhtml/system.xml | 1 + .../Magento/Theme/Model/Wysiwyg/Storage.php | 4 +- .../Theme/view/frontend/layout/default.xml | 2 +- app/code/Magento/Usa/Helper/Data.php | 38 +- .../Usa/Model/Shipping/Carrier/Dhl.php | 4 - .../Shipping/Carrier/Dhl/International.php | 8 - .../Model/Shipping/Carrier/Dhl/Label/Pdf.php | 35 +- .../Shipping/Carrier/Dhl/Label/Pdf/Page.php | 4 +- .../Carrier/Dhl/Label/Pdf/PageBuilder.php | 4 +- .../Usa/Model/Shipping/Carrier/Usps.php | 404 ++++++++++------ .../Shipping/Carrier/Usps/Source/Generic.php | 6 +- app/code/Magento/Usa/etc/config.xml | 4 +- app/code/Magento/Usa/i18n/en_US.csv | 84 +++- .../Weee/view/adminhtml/renderer/tax.phtml | 31 +- .../Widget/Model/Config/FileResolver.php | 8 +- .../Magento/Wishlist/Block/AbstractBlock.php | 67 --- .../Wishlist/Block/Customer/Sidebar.php | 2 +- .../Wishlist/Block/Customer/Wishlist.php | 25 +- app/code/Magento/Wishlist/Block/Link.php | 27 +- .../Controller/AbstractController.php | 25 +- .../Magento/Wishlist/Controller/Index.php | 14 +- .../Magento/Wishlist/Controller/Shared.php | 4 +- app/code/Magento/Wishlist/Helper/Data.php | 2 +- .../view/email/share_notification.html | 2 +- .../view/frontend/item/column/cart.phtml | 2 +- .../Wishlist/view/frontend/layout/default.xml | 2 +- .../{render/item/price.phtml => link.phtml} | 20 +- .../Wishlist/view/frontend/sidebar.phtml | 12 +- .../Magento/Wishlist/view/frontend/view.phtml | 2 +- .../adminhtml/magento_backend/css/styles.css | 270 +++++++++-- .../magento_backend/less/styles/admin.less | 9 + .../magento_backend/less/styles/pages.less | 164 ++++++- .../magento_backend/mui/elements.css | 2 +- .../adminhtml/magento_backend/mui/form.css | 2 +- .../Magento_Customer/layout/default.xml | 4 +- .../frontend/magento_plushe/css/styles.css | 435 +++++++++++------- .../frontend/magento_plushe/i18n/en_US.csv | 4 + .../frontend/magento_plushe/js/matchMedia.js | 12 +- .../magento_plushe/js/navigation-menu.js | 2 +- .../frontend/magento_plushe/js/responsive.js | 43 ++ .../magento_plushe/less/lib/forms.less | 15 +- .../magento_plushe/less/lib/icons.less | 18 + .../magento_plushe/less/lib/snippets.less | 6 +- .../less/responsive/responsive.less | 165 ++++--- .../frontend/magento_plushe/less/styles.less | 202 ++++---- dev/shell/cron.sh | 4 +- .../TestCase/AbstractConfigFiles.php | 5 +- .../Controller/Adminhtml/System/StoreTest.php | 27 ++ .../Controller/Adminhtml/ProductTest.php | 22 + .../Controller/Product/CompareTest.php | 7 +- .../Product/Attribute/Backend/MediaTest.php | 22 +- .../Model/Resource/Category/FlatTest.php | 64 +++ .../Magento/Catalog/Model/UrlTest.php | 7 - .../Magento/Core/Model/DesignTest.php | 1 + .../Magento/Core/Model/View/DesignTest.php | 3 - .../Controller/Adminhtml/IndexTest.php | 2 +- .../Magento/Filesystem/Directory/ReadTest.php | 4 +- .../Adminhtml/GoogleShopping/TypesTest.php | 38 +- .../Magento/Install/Model/InstallerTest.php | 30 +- .../Magento/Sales/Model/Quote/AddressTest.php | 138 ++++++ .../Sales/Model/Resource/QuoteTest.php | 55 +++ .../Sales/_files/order_alphanumeric_id.php | 33 ++ .../Integrity/Modular/DiConfigFilesTest.php | 5 +- .../Modular/EavAttributesConfigFilesTest.php | 7 +- .../Modular/ExportConfigFilesTest.php | 7 +- .../Modular/FieldsetConfigFilesTest.php | 6 +- .../Modular/ImportConfigFilesTest.php | 7 +- .../Modular/IndexerConfigFilesTest.php | 7 +- .../Modular/InstallWizardConfigFilesTest.php | 6 +- .../Modular/PaymentConfigFilesTest.php | 6 +- .../Modular/ProductOptionsConfigFilesTest.php | 7 +- .../Modular/ProductTypesConfigFilesTest.php | 7 +- .../Modular/ResourcesConfigFilesTest.php | 7 +- .../Modular/ThemeConfigFilesTest.php | 6 +- .../Modular/WidgetConfigFilesTest.php | 6 +- .../Magento/Tools/View/GeneratorTest.php | 77 ++++ .../Widget/Model/Config/ReaderTest.php | 2 +- .../Test/Legacy/_files/obsolete_classes.php | 1 + .../Test/Legacy/_files/obsolete_methods.php | 7 +- .../Legacy/_files/obsolete_properties.php | 2 + dev/tests/unit/phpunit.xml.dist | 10 + .../App/Response/Http/FileFactoryTest.php | 24 +- .../Product/View/Type/Bundle/OptionTest.php | 75 +++ .../Magento/Captcha/Model/ObserverTest.php | 119 ++++- .../Magento/Catalog/Model/UrlTest.php | 51 ++ .../Magento/Centinel/Model/ServiceTest.php | 88 +++- .../Checkout/Block/Onepage/PaymentTest.php | 59 +++ .../Magento/Checkout/Helper/DataTest.php | 142 ++++++ .../Core/Model/Config/FileResolverTest.php | 2 +- .../Model/Resource/File/Storage/FileTest.php | 96 ++++ .../Core/Model/Theme/ValidationTest.php | 4 +- .../Magento/Core/Model/WebsiteTest.php | 57 +++ .../Customer/Block/Account/CustomerTest.php | 49 ++ .../Customer/Controller/AccountTest.php | 112 ++++- .../Data/Form/Element/MultiselectTest.php | 10 + .../Magento/Filesystem/Directory/ReadTest.php | 17 - .../Magento/Install/Model/InstallerTest.php | 121 +++++ .../Block/Product/View/PriceTest.php | 145 ++++-- .../Block/Product/View/StockTest.php | 139 ++++-- .../Controller/Billing/AgreementTest.php | 162 +++++++ .../View/Generator/ThemeDeploymentTest.php | 16 +- .../View/Generator/_files/fixture_themes.php | 6 +- .../testsuite/Magento/Usa/Helper/DataTest.php | 92 ++++ .../Carrier/Dhl/Label/Pdf/PageBuilderTest.php | 52 +++ .../Carrier/Usps/Source/GenericTest.php | 77 ++++ .../Usa/Model/Shipping/Carrier/UspsTest.php | 215 +++++++++ .../Carrier/_files/rates_request_data.php | 56 +++ .../_files/return_shipment_request_data.php | 88 ++++ .../_files/success_usps_response_rates.xml | 171 +++++++ .../success_usps_response_return_shipment.xml | 38 ++ .../testsuite/Magento/View/FileSystemTest.php | 33 ++ .../View/Layout/File/Source/BaseTest.php | 17 +- .../Layout/File/Source/Override/ThemeTest.php | 17 +- .../Magento/View/Url/CssResolverTest.php | 112 +++-- .../Magento/View/Url/_files/result.css | 11 +- .../Magento/View/Url/_files/source.css | 11 +- .../unit/testsuite/Magento/View/UrlTest.php | 3 +- .../Magento/Tools/View/Generator/CopyRule.php | 12 +- dev/tools/Magento/Tools/View/generator.php | 41 +- .../App/Config/FileResolver/Primary.php | 3 +- .../ObjectManager/ConfigLoader/Primary.php | 12 +- lib/Magento/App/ObjectManagerFactory.php | 8 +- lib/Magento/App/Response/Http/FileFactory.php | 22 +- .../Data/Form/Element/AbstractElement.php | 14 +- lib/Magento/Filesystem/Directory/Read.php | 42 +- .../Filesystem/Directory/ReadInterface.php | 3 +- lib/Magento/Filesystem/Directory/Write.php | 1 - lib/Magento/Filesystem/Driver/File.php | 49 ++ lib/Magento/Filesystem/DriverInterface.php | 19 + .../Module/Declaration/FileResolver.php | 36 +- lib/Magento/View/Design/Theme/Validator.php | 2 +- lib/Magento/View/FileSystem.php | 31 +- lib/Magento/View/Layout/File/Source/Base.php | 20 +- .../View/Layout/File/Source/Override/Base.php | 21 +- .../Layout/File/Source/Override/Theme.php | 26 +- lib/Magento/View/Layout/File/Source/Theme.php | 17 +- lib/Magento/View/Publisher.php | 13 +- lib/Magento/View/Url.php | 20 +- lib/Magento/View/Url/CssResolver.php | 41 +- pub/lib/mage/deletable-item.js | 7 +- 272 files changed, 5613 insertions(+), 1909 deletions(-) create mode 100644 app/code/Magento/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php create mode 100644 app/code/Magento/Directory/data/directory_setup/data-upgrade-1.6.0.1-1.6.0.2.php rename app/code/Magento/Sales/view/adminhtml/layout/{sales_order_status_newstatus.xml => sales_order_status_new.xml} (100%) mode change 100644 => 100755 app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php rename app/code/Magento/Wishlist/view/frontend/{render/item/price.phtml => link.phtml} (60%) create mode 100644 app/design/frontend/magento_plushe/i18n/en_US.csv create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php rename app/code/Magento/Wishlist/Block/Render/Item/Price.php => dev/tests/integration/testsuite/Magento/GoogleShopping/Controller/Adminhtml/GoogleShopping/TypesTest.php (51%) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Model/Resource/QuoteTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_alphanumeric_id.php create mode 100644 dev/tests/integration/testsuite/Magento/Tools/View/GeneratorTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Catalog/Model/UrlTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/PaymentTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/WebsiteTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Sales/Controller/Billing/AgreementTest.php create mode 100755 dev/tests/unit/testsuite/Magento/Usa/Helper/DataTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilderTest.php create mode 100755 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Usps/Source/GenericTest.php create mode 100755 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/UspsTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/rates_request_data.php create mode 100644 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/return_shipment_request_data.php create mode 100644 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_rates.xml create mode 100644 dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_return_shipment.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e9863bafdf42..27362ec8c6562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,84 @@ +2.0.0.0-dev58 +============= +* Fixed bugs: + * Security improved for the Login, Update Cart, Add to Compare, Review, and Add entire wishlist actions on the frontend + * Removed warnings on category pages when Flat Catalog Category is enabled + * Fixed product price displayed in wrong currency after switching currency on the frontend + * Fixed the Save & Duplicate action in product creation + * Fixed big image scaling in product description + * Fixed admin dashboard styling issue + * Fixed validation message for the Quantity field on the product page in the backend + * Fixed the email template for sharing a Wishlist + * Fixed the response of the drop-down menu in the Plushe theme + * Fixed the missing Related Banners tab for Catalog Price Rule + * Fixed inability to enable the duplicated product + * Removed warnings on saving payment method configuration + * Fixed gift messages displaying on the Order View page after admin edits + * Fixed inability to create a new order status + * Fixed the behavior of the Save and Previous and the Previous buttons on the Edit Review page + * Fixed inability to delete a website if the number of websites is less or equal to two + * Fixed Export on the All Customers page + * Fixed inability to add products to the Shopping Cart from the Category page in Internet Explorer + * Fixed logo on the backend login page + * Fixed visual elements to indicate that Tax details can be expanded on the order creation page in the backend + * Fixed the CMS page preview design + * Fixed the newsletter template preview design + * Fixed the Matched Customers grid design in the Email Reminder Rules + * Fixed the theme version validation message displayed when creating a new theme + * Fixed performance degradation during installation wizard execution + * Fixed cron shell script + * Fixed user login on the frontend, when the Redirect Customer to Account Dashboard after Logging option is set to No + * Fixed errors in requests to shipping carrier (DHL International) when the shipping address contains letters with diacritic marks + * Fixed invalid account creation date + * Fixed displaying Product Alert links on product view page when the functionality is disabled + * Fixed the absence of some bundle options when configuring a bundle product in the Shopping Cart on the frontend + * Fixed the issue which allowed to view and cancel billing agreements belonging to another customer + * Fixed the content spoofing vulnerability when Solr was used + * Fixed a potential XSS vulnerability in customer login + * Fixed RSS feed for categories containing bundle product(s) + * Fixed inability to place an order with 3D Secure in Internet Explorer 10 + * Fixed inability to place an order with PayPal Payflow Link and PayPal Payments Advanced + * Fixed integrity constraint violation in catalog URL rewrites + * Fixed the absence of the error when a wrong website code is specified during a website creation + * Fixed saving in the backend a new customer address, which contains new customer address attributes configured to be not visible on frontend + * Fixed USPS shipping method in the checkout + * Fixed placing orders with recurring profile items via PayPal Express Checkout + * Fixed email template creation in the backend + * Fixed the issue with default billing address being used instead of default shipping address during admin order creation + * Fixed inability to choose DB as Media Storage + * Fixed PHP issues found during the UI testing of the backend + * Fixed shipping label creation for USPS Priority Mail Shipping methods + * Fixed the issue which allowed to create customers with duplicate email + * Fixed the abstract product block error in the tier price template getter + * Fixed system message displaying in the backend + * Fixed the "404" error on customer review page + * Fixed autocomplete enabled on the admin login page + * Fixed the 3D Secure iframe + * Fixed the indicators of mandatory fields on the Package Extension page + * Fixed product image scaling on the Compare Products page + * Fixed product page design for products with the Fixed Product Tax attribute + * Removed spaces between parentheses and numbers in the Cart, Wishlist, and Compare Products blocks + * Fixed the message displaying the quantity for products found on the Advanced Search page + * Fixed incorrect caching of locale settings and URL settings during web installation + * Fixed inability to use a newly created store for admin user roles + * Fixed absence of the Advanced Search field on the frontend, when the Popular Search Terms functionality is disabled + * Fixed incorrect link to downloadable product(s) in the email invoice copy + * Fixed customs monetary value in labels/package info for international shipments + * Fixed importing for files with blank URL Key field on the store view level + * Fixed table rate error message + * Fixed frontend login without pre-set cookies + * 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 +* 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 + * [#390](https://github.com/magento/magento2/pull/390) -- Support of alphanumeric order increment ids by the quote resource model +* Themes update: + * Responsive design improvements +* Improvements in code coverage calculation: + * Code coverage calculation approach for unit tests was changed from blacklist to whitelist + 2.0.0.0-dev57 ============= * Fixed bugs: @@ -44,7 +125,7 @@ * Session generic wrapper moved to library * Messages functionality moved from the Session model as separate component, message manager interface created * Sid resolver interface created to handle session sid from request - + 2.0.0.0-dev56 ============= * Fixed bugs: diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml index 6e753a4ffcfd2..7544c90f6c0b4 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml @@ -24,32 +24,28 @@ */ --> - - - - - - - - - - Magento_AdminNotification::system/notification.js - - - - + + + + + - + - Magento_Core::prototype/magento.css + Magento_AdminNotification::toolbar_entry.js - + - Magento_AdminNotification::toolbar_entry.js + Magento_AdminNotification::system/notification.js + + + + + Magento_Core::prototype/magento.css diff --git a/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml b/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml index b2d202315fca5..4c65ada1da4e2 100644 --- a/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml +++ b/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml @@ -56,7 +56,7 @@ $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Data')->getPlaceOrderFro
- +
@@ -90,7 +90,7 @@ $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Data')->getPlaceOrderFro
- +
diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php index 3628ae730a235..33a91d89cfce1 100644 --- a/app/code/Magento/Backend/App/AbstractAction.php +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -381,23 +381,4 @@ protected function _validateSecretKey() } return true; } - - /** - * Render specified template - * - * @param string $tplName - * @param array $data parameters required by template - */ - protected function _outTemplate($tplName, $data = array()) - { - $this->_view->getLayout()->initMessages(); - $block = $this->_view->getLayout() - ->createBlock('Magento\Backend\Block\Template')->setTemplate("{$tplName}.phtml"); - foreach ($data as $index => $value) { - $block->assign($index, $value); - } - $html = $block->toHtml(); - $this->_objectManager->get('Magento\Core\Model\Translate')->processResponseBody($html); - $this->getResponse()->setBody($html); - } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php index 327a5432a94bd..65b03db650f2b 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php @@ -64,7 +64,9 @@ public function synchronizeAction() { session_write_close(); - if (!isset($_REQUEST['storage'])) { + $requestStorage = $this->getRequest()->getParam('storage'); + $requestConnection = $this->getRequest()->getParam('connection'); + if (!isset($requestStorage)) { return; } @@ -80,9 +82,9 @@ public function synchronizeAction() ->setFlagData(array()) ->save(); - $storage = array('type' => (int) $_REQUEST['storage']); - if (isset($_REQUEST['connection']) && !empty($_REQUEST['connection'])) { - $storage['connection'] = $_REQUEST['connection']; + $storage = array('type' => $requestStorage); + if (isset($requestConnection) && !empty($requestConnection)) { + $storage['connection'] = $requestConnection; } try { diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php index 787ec2188c102..3428a47dac3a5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php @@ -35,15 +35,23 @@ class Design extends \Magento\Backend\App\Action */ protected $_coreRegistry = null; + /** + * @var \Magento\Core\Filter\Date + */ + protected $dateFilter; + /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Core\Filter\Date $dateFilter */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Core\Model\Registry $coreRegistry + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Core\Filter\Date $dateFilter ) { $this->_coreRegistry = $coreRegistry; + $this->dateFilter = $dateFilter; parent::__construct($context); } @@ -86,7 +94,9 @@ public function editAction() $this->_coreRegistry->register('design', $design); $this->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit')); - $this->_addLeft($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit\Tabs', 'design_tabs')); + $this->_addLeft( + $this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit\Tabs', 'design_tabs') + ); $this->_view->renderLayout(); } @@ -95,6 +105,7 @@ public function saveAction() { $data = $this->getRequest()->getPost(); if ($data) { + $data['design'] = $this->_filterPostData($data['design']); $id = (int) $this->getRequest()->getParam('id'); $design = $this->_objectManager->create('Magento\Core\Model\Design'); @@ -143,4 +154,18 @@ protected function _isAllowed() { return $this->_authorization->isAllowed('Magento_Adminhtml::design'); } + + /** + * Filtering posted data. Converting localized data if needed + * + * @param array + * @return array + */ + protected function _filterPostData($data) + { + $inputFilter = new \Zend_Filter_Input( + array('date_from' => $this->dateFilter, 'date_to' => $this->dateFilter), array(), $data); + $data = $inputFilter->getUnescaped(); + return $data; + } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php index fb27a38d8f41b..94acf1592ff65 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php @@ -255,7 +255,7 @@ public function saveAction() $this->_redirect('adminhtml/*/'); return; } catch (\Magento\Core\Exception $e) { - $this->messageManager->addMessages($e->getMessages()); + $this->messageManager->addError($e->getMessage()); $this->_getSession()->setPostData($postData); } catch (\Exception $e) { $this->messageManager->addException($e, __('An error occurred while saving. Please review the error log.')); diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php index 9b21e4e7d35e5..521343315ce8f 100644 --- a/app/code/Magento/Backend/Model/Auth/Session.php +++ b/app/code/Magento/Backend/Model/Auth/Session.php @@ -29,6 +29,13 @@ /** * Backend Auth session model * + * @method \Magento\User\Model\User|null getUser() + * @method \Magento\Backend\Model\Auth\Session setUser(\Magento\User\Model\User $value) + * @method \Magento\Acl|null getAcl() + * @method \Magento\Backend\Model\Auth\Session setAcl(\Magento\Acl $value) + * @method int getUpdatedAt() + * @method \Magento\Backend\Model\Auth\Session setUpdatedAt(int $value) + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @todo implement solution that keeps is_first_visit flag in session during redirects */ diff --git a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml index af9150cbc8986..d54559f710f8a 100644 --- a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml @@ -68,7 +68,7 @@
getLayout()->getMessagesBlock()->getGroupedHtml() ?>
-
+

@@ -81,6 +81,8 @@
+ +
diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index 488e6e96e742c..506f580206624 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -279,6 +279,7 @@ + diff --git a/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml b/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml index f450da745e7c6..9bb2c8e64fa41 100644 --- a/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml +++ b/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml @@ -32,10 +32,6 @@ jQuery.mage.extend('validation', 'validation', 'getViewFileUrl('Magento_Backend::system/validation-rules.js'); ?>'); - defaultValues = []; - defaultValues['system_media_storage_configuration_media_storage'] = $('system_media_storage_configuration_media_storage').value; - defaultValues['system_media_storage_configuration_media_database'] = $('system_media_storage_configuration_media_database').value; - allowedStorages = []; addAllowedStorage( $('system_media_storage_configuration_media_storage').value, @@ -45,6 +41,10 @@ getSyncStorageParams() ?> addAllowedStorage(, ''); + defaultValues = []; + defaultValues['system_media_storage_configuration_media_storage'] = $('system_media_storage_configuration_media_storage').value; + defaultValues['system_media_storage_configuration_media_database'] = $('system_media_storage_configuration_media_database').value; + function getConnectionName(storageType, connection) { if (storageType == 0) { @@ -63,6 +63,8 @@ if (storage != '' && !allowedStorages.include(storage)) { allowedStorages.push(storage); } + $('system_media_storage_configuration_media_storage').value = storageType; + $('system_media_storage_configuration_media_database').value = connection; } function checkButtonState(event) { @@ -77,7 +79,6 @@ $('system_media_storage_configuration_media_storage').value, $('system_media_storage_configuration_media_database').value ); - if (defaultStorage != storage) { enableSyncButton(); } else { diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index 0db6c9ec5fe1c..db4e19690b27f 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -151,7 +151,7 @@ public function getDefaultValues() /** * Collect selected options * - * @return void + * @return mixed */ protected function _getSelectedOptions() { @@ -183,9 +183,9 @@ public function isSelected($selection) { $selectedOptions = $this->_getSelectedOptions(); if (is_numeric($selectedOptions)) { - return ($selection->getSelectionId() == $this->_getSelectedOptions()); + return ($selection->getSelectionId() == $selectedOptions); } elseif (is_array($selectedOptions) && !empty($selectedOptions)) { - return in_array($selection->getSelectionId(), $this->_getSelectedOptions()); + return in_array($selection->getSelectionId(), $selectedOptions); } elseif ($selectedOptions == 'None') { return false; } else { @@ -322,4 +322,16 @@ public function formatPriceString($price, $includeContainer = true) return $formated; } + + /** + * Clear selected option when setting new option + * + * @param \Magento\Bundle\Model\Option $option + * @return mixed + */ + public function setOption(\Magento\Bundle\Model\Option $option) + { + $this->_selectedOptions = null; + return parent::setOption($option); + } } diff --git a/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php index 90af8f4d1938b..fe3c60dca0ce1 100644 --- a/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -24,6 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +/** @var $installer \Magento\Catalog\Model\Resource\Setup */ +$installer = $this; + /** @var $this \Magento\Catalog\Model\Resource\Setup */ $installFile = __DIR__ . '/upgrade-1.6.0.0-1.6.0.0.1.php'; diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml index c808e6c31c41b..b7fc1b4198420 100644 --- a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml +++ b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml @@ -80,7 +80,7 @@ id="bundle-option-getId() ?>-qty-input" class="input-text qty" - type="text" + type="number" name="bundle_option_qty[getId() ?>]" value=""/>
diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml index 52801328c7f05..e9e1a9d02c3ae 100644 --- a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml +++ b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml @@ -62,7 +62,7 @@ id="bundle-option-getId() ?>-qty-input" class="input-text qty" - type="text" + type="number" name="bundle_option_qty[getId() ?>]" value=""/>
diff --git a/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml b/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml index e8ab7745d80e1..60c1e8ad9970f 100644 --- a/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml +++ b/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml @@ -32,7 +32,11 @@ ?> getProduct() ?> -getPriceModel()->getPrices($_product) ?> +getPriceModel() +?> +getTotalPrices($_product) ?> getId() ?> diff --git a/app/code/Magento/Captcha/Model/ModelInterface.php b/app/code/Magento/Captcha/Model/ModelInterface.php index 0c8b5bdd65807..d969e5540ee6a 100644 --- a/app/code/Magento/Captcha/Model/ModelInterface.php +++ b/app/code/Magento/Captcha/Model/ModelInterface.php @@ -42,7 +42,7 @@ public function generate(); * * @abstract * @param string $word - * @return void + * @return bool */ public function isCorrect($word); diff --git a/app/code/Magento/Captcha/Model/Observer.php b/app/code/Magento/Captcha/Model/Observer.php index 59105886db4b0..55b78ec34649e 100644 --- a/app/code/Magento/Captcha/Model/Observer.php +++ b/app/code/Magento/Captcha/Model/Observer.php @@ -93,6 +93,11 @@ class Observer */ protected $messageManager; + /** + * @var \Magento\App\Response\RedirectInterface + */ + protected $redirect; + /** * @param Resource\LogFactory $resLogFactory * @param \Magento\Session\SessionManagerInterface $session @@ -104,6 +109,9 @@ class Observer * @param \Magento\App\RequestInterface $request * @param \Magento\App\ActionFlag $actionFlag * @param \Magento\Message\ManagerInterface $messageManager + * @param \Magento\App\Response\RedirectInterface $redirect + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Captcha\Model\Resource\LogFactory $resLogFactory, @@ -115,7 +123,8 @@ public function __construct( \Magento\Core\Model\Url $urlManager, \Magento\App\RequestInterface $request, \Magento\App\ActionFlag $actionFlag, - \Magento\Message\ManagerInterface $messageManager + \Magento\Message\ManagerInterface $messageManager, + \Magento\App\Response\RedirectInterface $redirect ) { $this->_resLogFactory = $resLogFactory; $this->_session = $session; @@ -127,6 +136,7 @@ public function __construct( $this->_request = $request; $this->_actionFlag = $actionFlag; $this->messageManager = $messageManager; + $this->redirect = $redirect; } /** @@ -145,7 +155,7 @@ public function checkForgotpassword($observer) if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->messageManager->addError(__('Incorrect CAPTCHA')); $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); - $controller->getResponse()->setRedirect($this->_urlManager->getUrl('*/*/forgotpassword')); + $this->redirect->redirect($controller->getResponse(), '*/*/forgotpassword'); } } return $this; @@ -161,11 +171,12 @@ public function checkContactUsForm($observer) $formId = 'contact_us'; $captcha = $this->_helper->getCaptcha($formId); if ($captcha->isRequired()) { + /** @var \Magento\App\Action\Action $controller */ $controller = $observer->getControllerAction(); if (!$captcha->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->messageManager->addError(__('Incorrect CAPTCHA.')); $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); - $controller->getResponse()->setRedirect($this->_urlManager->getUrl('contacts/index/index')); + $this->redirect->redirect($controller->getResponse(), 'contacts/index/index'); } } } @@ -209,12 +220,14 @@ public function checkUserCreate($observer) $formId = 'user_create'; $captchaModel = $this->_helper->getCaptcha($formId); if ($captchaModel->isRequired()) { + /** @var \Magento\App\Action\Action $controller */ $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->messageManager->addError(__('Incorrect CAPTCHA')); $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_session->setCustomerFormData($controller->getRequest()->getPost()); - $controller->getResponse()->setRedirect($this->_urlManager->getUrl('*/*/create')); + $url = $this->_urlManager->getUrl('*/*/create', array('_nosecret' => true)); + $controller->getResponse()->setRedirect($this->redirect->error($url)); } } return $this; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php index b336778eadc47..06eaf262645e9 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php @@ -43,6 +43,11 @@ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_jsonEncoder; + /** + * @var \Magento\Catalog\Model\CategoryFactory + */ + protected $_categoryFactory; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Json\EncoderInterface $jsonEncoder @@ -60,9 +65,9 @@ public function __construct( array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; + $this->_categoryFactory = $categoryFactory; parent::__construct($context, $registry, $formFactory, $data); $this->setUseContainer(true); - $this->_categoryFactory = $categoryFactory; } /** @@ -119,9 +124,13 @@ protected function _getParentCategoryOptions() ->load() ->getItems(); - return count($items) === 2 - ? array($items[2]->getEntityId() => $items[2]->getName()) - : array(); + $result = array(); + if (count($items) === 2) { + $item = array_pop($items); + $result = array($item->getEntityId() => $item->getName()); + } + + return $result; } /** diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index 34a53c8ee8966..49ae70c174820 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -87,7 +87,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template * @var \Magento\Core\Model\Registry */ protected $_coreRegistry = null; - + /** * Catalog data * @@ -152,7 +152,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template * @param \Magento\Theme\Helper\Layout $layoutHelper * @param \Magento\Catalog\Helper\Image $imageHelper * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -399,6 +399,11 @@ public function getProduct() return $this->getData('product'); } + /** + * Retrieve tier price template + * + * @return string + */ public function getTierPriceTemplate() { if (!$this->hasData('tier_price_template')) { @@ -407,6 +412,7 @@ public function getTierPriceTemplate() return $this->getData('tier_price_template'); } + /** * Returns product tier price block html * @@ -421,7 +427,7 @@ public function getTierPriceHtml($product = null) return $this->_getPriceBlock($product->getTypeId()) ->setTemplate($this->getTierPriceTemplate()) ->setProduct($product) - ->setInGrouped($this->getProduct()->isGrouped()) + ->setInGrouped($product->isGrouped()) ->toHtml(); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php index dc4f438ecfc02..57f017a95aa11 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php @@ -169,7 +169,7 @@ public function saveAction() $nextId = (int) $this->getRequest()->getParam('next_item'); $url = $this->getUrl($this->getRequest()->getParam('ret') == 'pending' ? '*/*/pending' : '*/*/'); if ($nextId) { - $url = $this->getUrl('adminhtml/*/edit', array('id' => $nextId)); + $url = $this->getUrl('catalog/*/edit', array('id' => $nextId)); } return $this->getResponse()->setRedirect($url); } @@ -186,9 +186,9 @@ public function deleteAction() $this->messageManager->addSuccess(__('The review has been deleted.')); if( $this->getRequest()->getParam('ret') == 'pending' ) { - $this->getResponse()->setRedirect($this->getUrl('adminhtml/*/pending')); + $this->getResponse()->setRedirect($this->getUrl('catalog/*/pending')); } else { - $this->getResponse()->setRedirect($this->getUrl('adminhtml/*/')); + $this->getResponse()->setRedirect($this->getUrl('catalog/*/')); } return; } catch (\Magento\Core\Exception $e) { diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php index 13521974c5cb2..180865bc59797 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare.php @@ -101,6 +101,11 @@ class Compare extends \Magento\App\Action\Action */ protected $_storeManager; + /** + * @var \Magento\Core\App\Action\FormKeyValidator + */ + protected $_formKeyValidator; + /** * @param \Magento\App\Action\Context $context * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -123,7 +128,8 @@ public function __construct( \Magento\Log\Model\Visitor $logVisitor, \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList, \Magento\Catalog\Model\Session $catalogSession, - \Magento\Core\Model\StoreManagerInterface $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\App\Action\FormKeyValidator $formKeyValidator ) { $this->_storeManager = $storeManager; $this->_customerFactory = $customerFactory; @@ -134,6 +140,7 @@ public function __construct( $this->_logVisitor = $logVisitor; $this->_catalogProductCompareList = $catalogProductCompareList; $this->_catalogSession = $catalogSession; + $this->_formKeyValidator = $formKeyValidator; parent::__construct($context); } @@ -168,6 +175,11 @@ public function indexAction() */ public function addAction() { + if (!$this->_formKeyValidator->validate($this->getRequest())) { + $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); + return; + } + $productId = (int)$this->getRequest()->getParam('product'); if ($productId && ($this->_logVisitor->getId() diff --git a/app/code/Magento/Catalog/Helper/Product/Compare.php b/app/code/Magento/Catalog/Helper/Product/Compare.php index e73f82973e73a..1c1b16773601c 100644 --- a/app/code/Magento/Catalog/Helper/Product/Compare.php +++ b/app/code/Magento/Catalog/Helper/Product/Compare.php @@ -96,6 +96,11 @@ class Compare extends \Magento\Core\Helper\Url */ protected $_itemCollectionFactory; + /** + * @var \Magento\Data\Form\FormKey + */ + protected $_formKey; + /** * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -104,6 +109,7 @@ class Compare extends \Magento\Core\Helper\Url * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\Session $catalogSession + * @param \Magento\Data\Form\FormKey $formKey */ public function __construct( \Magento\App\Helper\Context $context, @@ -112,13 +118,15 @@ public function __construct( \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Session $catalogSession + \Magento\Catalog\Model\Session $catalogSession, + \Magento\Data\Form\FormKey $formKey ) { $this->_itemCollectionFactory = $itemCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_logVisitor = $logVisitor; $this->_customerSession = $customerSession; $this->_catalogSession = $catalogSession; + $this->_formKey = $formKey; parent::__construct($context, $storeManager); } @@ -152,7 +160,8 @@ protected function _getUrlParams($product) { return array( 'product' => $product->getId(), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl(), + 'form_key' => $this->_formKey->getFormKey(), ); } diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php index 2a77459993f48..fb1ff9e0924d8 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php @@ -34,9 +34,6 @@ namespace Magento\Catalog\Model\Layer\Filter; -/** - * @SuppressWarnings(PHPMD.LongVariable) - */ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter { /** @@ -79,7 +76,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * * @var \Magento\Catalog\Model\Layer\Filter\Price\Algorithm */ - protected $_catalogLayerFilterPriceAlgorithm; + protected $_priceAlgorithm; /** * Customer session @@ -94,7 +91,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $catalogLayerFilterPriceAlgorithm + * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm * @param \Magento\Core\Model\Registry $coreRegistry * @param array $data */ @@ -104,13 +101,13 @@ public function __construct( \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $catalogLayerFilterPriceAlgorithm, + \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm, \Magento\Core\Model\Registry $coreRegistry, array $data = array() ) { $this->_resource = $filterPriceFactory->create(); $this->_customerSession = $customerSession; - $this->_catalogLayerFilterPriceAlgorithm = $catalogLayerFilterPriceAlgorithm; + $this->_priceAlgorithm = $priceAlgorithm; $this->_coreRegistry = $coreRegistry; parent::__construct($filterItemFactory, $storeManager, $catalogLayer, $data); $this->_requestVar = 'price'; @@ -289,7 +286,7 @@ protected function _getCalculatedItemsData() ) { return array(); } - $this->_catalogLayerFilterPriceAlgorithm->setPricesModel($this)->setStatistics( + $this->_priceAlgorithm->setPricesModel($this)->setStatistics( $collection->getMinPrice(), $collection->getMaxPrice(), $collection->getPriceStandardDeviation(), @@ -300,11 +297,11 @@ protected function _getCalculatedItemsData() if ($appliedInterval[0] == $appliedInterval[1] || $appliedInterval[1] === '0') { return array(); } - $this->_catalogLayerFilterPriceAlgorithm->setLimits($appliedInterval[0], $appliedInterval[1]); + $this->_priceAlgorithm->setLimits($appliedInterval[0], $appliedInterval[1]); } $items = array(); - foreach ($this->_catalogLayerFilterPriceAlgorithm->calculateSeparators() as $separator) { + foreach ($this->_priceAlgorithm->calculateSeparators() as $separator) { $items[] = array( 'label' => $this->_renderRangeLabel($separator['from'], $separator['to']), 'value' => (($separator['from'] == 0) ? '' : $separator['from']) diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php index 37aade372f527..01a4cb89aba28 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php @@ -199,8 +199,6 @@ public function beforeSave($object) $value['images'] = array(); } - - $clearImages = array(); $newImages = array(); $existImages = array(); @@ -226,7 +224,8 @@ public function beforeSave($object) continue; } $duplicate[$image['value_id']] = $this->_copyImage($image['file']); - $newImages[$image['file']] = $duplicate[$image['value_id']]; + $image['new_file'] = $duplicate[$image['value_id']]; + $newImages[$image['file']] = $image; } $value['duplicate'] = $duplicate; diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index e61902ac18c0e..1735a8b6a68ea 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -506,7 +506,7 @@ public function processFileQueue() try { $this->_filesystem->getDirectoryWrite(\Magento\Filesystem::ROOT)->create($path); - } catch (\Magento\Filesystem\Exception $e) { + } catch (\Magento\Filesystem\FilesystemException $e) { throw new \Magento\Core\Exception( __("We can't create writeable directory \"%1\".", $path) ); diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index 3ebf8306126bd..6b3bb79d076ca 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -1321,17 +1321,17 @@ public function getParentCategories($category, $isActive = true) */ public function getParentDesignCategory($category) { - $adapter = $this->_getReadAdapter(); - $levelField = $adapter->quoteIdentifier('level'); - $pathIds = array_reverse($category->getPathIds()); - $select = $adapter->select() - ->from(array('main_table' => $this->getMainStoreTable($category->getStoreId())), '*') - ->where('entity_id IN (?)', $pathIds) - ->where('custom_use_parent_settings = ?', 0) - ->where($levelField . ' != ?', 0) - ->order('level ' . \Magento\DB\Select::SQL_DESC); - $result = $adapter->fetchRow($select); - return $this->_categoryFactory->create()->setData($result); + $pathIds = array_reverse($category->getPathIds()); + $collection = clone $category->getCollection(); + $collection + ->setMainTable($this->getMainStoreTable($category->getStoreId())) + ->addFieldToSelect('*') + ->addFieldToFilter('entity_id', array('in' => $pathIds)) + ->addFieldToFilter('custom_use_parent_settings', array(array('eq' => 0), array('null' => 0))) + ->addFieldToFilter('level', array('neq' => 0)) + ->setOrder('level', 'DESC') + ->load(); + return $collection->getFirstItem(); } /** diff --git a/app/code/Magento/Catalog/Model/Url.php b/app/code/Magento/Catalog/Model/Url.php index e6f87519f2d6a..34f65d92147d8 100644 --- a/app/code/Magento/Catalog/Model/Url.php +++ b/app/code/Magento/Catalog/Model/Url.php @@ -1006,7 +1006,7 @@ public function generatePath($type = 'target', $product = null, $category = null */ public function generateUniqueIdPath() { - return str_replace('0.', '', str_replace(' ', '_', microtime())); + return str_replace('.', '_', uniqid(mt_rand(), true)); } /** diff --git a/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php index 8e4e1b6a95995..27c6693a624e3 100644 --- a/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php +++ b/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -24,6 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +/** @var $installer \Magento\Catalog\Model\Resource\Setup */ +$installer = $this; + /** @var $this \Magento\Catalog\Model\Resource\Setup */ $installFile = __DIR__ . '/upgrade-1.6.0.0.8-1.6.0.0.9.php'; diff --git a/app/code/Magento/Catalog/view/adminhtml/product/product.css b/app/code/Magento/Catalog/view/adminhtml/product/product.css index 205199fc30f2a..78acac6b140ab 100644 --- a/app/code/Magento/Catalog/view/adminhtml/product/product.css +++ b/app/code/Magento/Catalog/view/adminhtml/product/product.css @@ -484,14 +484,16 @@ .field-price .control, .field-special_price .control, .field-msrp .control, -.field-weight .control { +.field-weight .control, +.field-quantity_and_stock_status .control { position: relative; } .field-price label.mage-error, .field-special_price label.mage-error, .field-msrp label.mage-error, -.field-weight label.mage-error { +.field-weight label.mage-error, +.field-quantity_and_stock_status label.mage-error { position: absolute; left: 0; top: 30px; diff --git a/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml b/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml index b7c2bed52316a..ab3f9371ecd90 100644 --- a/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml @@ -26,13 +26,13 @@ helper('Magento\Catalog\Helper\Product\Compare'); $_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null; +$count = $_helper->getItemCount(); ?> -getItemCount() > 0): ?> + 0): ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml b/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml index bc3729367539c..49de51cf5362c 100644 --- a/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml @@ -26,13 +26,14 @@ helper('Magento\Catalog\Helper\Product\Compare'); $_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null; +$count = $_helper->getItemCount(); ?>
- getItemCount() > 0): ?> - getItemCount()) ?> + 0): ?> +
diff --git a/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml b/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml index 8491717db9450..e48841a9e4fa3 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml @@ -30,7 +30,7 @@
- isSaleable()) : ?>
- update($this->getTable('catalogsearch_query'), array('is_processed' => 0)); - $adapter->truncateTable($this->getTable('catalogsearch_result')); + $adapter->delete($this->getTable('catalogsearch_result')); $this->_eventManager->dispatch('catalogsearch_reset_search_result'); } else { // Optimized deletion only product-related records diff --git a/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml b/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml index 3938edb1e6df8..35fa8b7e7ca1c 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml +++ b/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml @@ -22,9 +22,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -getResultCount()): ?> +getResultCount()): ?>
diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml index 6845a1111a9e8..3e0375e6eac3b 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml @@ -34,7 +34,7 @@ catalogsearch/term/popular - + Advanced Search catalogsearch/advanced diff --git a/app/code/Magento/Centinel/Model/Service.php b/app/code/Magento/Centinel/Model/Service.php index 16325bc0684c7..f73402df1e9aa 100644 --- a/app/code/Magento/Centinel/Model/Service.php +++ b/app/code/Magento/Centinel/Model/Service.php @@ -55,18 +55,11 @@ class Service extends \Magento\Object ); /** - * Is API model configured - * - * @var bool - */ - protected $_isConfigured = false; - - /** - * Validation api model + * Validation api model factory * * @var \Magento\Centinel\Model\Api */ - protected $_api; + protected $_apiFactory; /** * Config @@ -115,7 +108,7 @@ class Service extends \Magento\Object /** * @param \Magento\Centinel\Model\Config $config - * @param \Magento\Centinel\Model\Api $api + * @param \Magento\Centinel\Model\ApiFactory $apiFactory * @param \Magento\UrlInterface $url * @param \Magento\Session\SessionManagerInterface $centinelSession * @param \Magento\Centinel\Model\StateFactory $stateFactory @@ -125,7 +118,7 @@ class Service extends \Magento\Object */ public function __construct( \Magento\Centinel\Model\Config $config, - \Magento\Centinel\Model\Api $api, + \Magento\Centinel\Model\ApiFactory $apiFactory, \Magento\UrlInterface $url, \Magento\Session\SessionManagerInterface $centinelSession, \Magento\Centinel\Model\StateFactory $stateFactory, @@ -134,7 +127,7 @@ public function __construct( array $data = array() ) { $this->_config = $config; - $this->_api = $api; + $this->_apiFactory = $apiFactory; $this->_url = $url; $this->_centinelSession = $centinelSession; $this->_stateFactory = $stateFactory; @@ -195,20 +188,16 @@ protected function _getUrl($suffix, $current = false) */ protected function _getApi() { - if ($this->_isConfigured) { - return $this->_api; - } - $config = $this->_getConfig(); - $this->_api + $api = $this->_apiFactory->create(); + $api ->setProcessorId($config->getProcessorId()) ->setMerchantId($config->getMerchantId()) ->setTransactionPwd($config->getTransactionPwd()) ->setIsTestMode($config->getIsTestMode()) ->setDebugFlag($config->getDebugFlag()) ->setApiEndpointUrl($this->getCustomApiEndpointUrl()); - $this->_isConfigured = true; - return $this->_api; + return $api; } /** @@ -361,7 +350,6 @@ public function validate($data) public function reset() { $this->_resetValidationState(); - $this->_api = null; return $this; } diff --git a/app/code/Magento/Centinel/view/frontend/authentication.phtml b/app/code/Magento/Centinel/view/frontend/authentication.phtml index 43ce26d12e956..68ea70519038c 100644 --- a/app/code/Magento/Centinel/view/frontend/authentication.phtml +++ b/app/code/Magento/Centinel/view/frontend/authentication.phtml @@ -29,7 +29,7 @@

- +
diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php index e8dfbcdefe981..41e001f12a8ef 100644 --- a/app/code/Magento/Checkout/Block/Cart/Link.php +++ b/app/code/Magento/Checkout/Block/Cart/Link.php @@ -105,7 +105,7 @@ protected function _getItemCount() protected function _createLabel($count) { if ($count == 1) { - return __('My Cart (%1 item)', $count); + return __('My Cart (1 item)'); } elseif ($count > 0) { return __('My Cart (%1 items)', $count); } else { diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment.php b/app/code/Magento/Checkout/Block/Onepage/Payment.php index 9b610571400d8..6c49c96fe5679 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment.php @@ -54,4 +54,14 @@ public function getQuoteBaseGrandTotal() { return (float)$this->getQuote()->getBaseGrandTotal(); } + + /** + * Check whether the quote has recurring items + * + * @return bool + */ + public function hasRecurringItems() + { + return $this->getQuote()->hasRecurringItems(); + } } diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php index c8139e46cc1cb..10c00be0c7307 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Success.php +++ b/app/code/Magento/Checkout/Block/Onepage/Success.php @@ -56,7 +56,7 @@ class Success extends \Magento\View\Element\Template protected $_agreementFactory; /** - * @var \Magento\Sales\Model\Resource\Recurring\Profile\Collection + * @var \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory */ protected $_recurringProfileCollectionFactory; diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php index b20c725d99ccb..bbef85ec76211 100644 --- a/app/code/Magento/Checkout/Controller/Cart.php +++ b/app/code/Magento/Checkout/Controller/Cart.php @@ -49,22 +49,25 @@ class Cart protected $_storeManager; /** - * @var \Magento\Message\ManagerInterface + * @var \Magento\Core\App\Action\FormKeyValidator */ - protected $messageManager; + protected $_formKeyValidator; /** * @param \Magento\App\Action\Context $context * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( \Magento\App\Action\Context $context, \Magento\Core\Model\Store\ConfigInterface $storeConfig, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Core\Model\StoreManagerInterface $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\App\Action\FormKeyValidator $formKeyValidator ) { + $this->_formKeyValidator = $formKeyValidator; $this->_storeConfig = $storeConfig; $this->_checkoutSession = $checkoutSession; $this->_storeManager = $storeManager; @@ -418,6 +421,11 @@ public function updateItemOptionsAction() */ public function updatePostAction() { + if (!$this->_formKeyValidator->validate($this->getRequest())) { + $this->_redirect('*/*/'); + return; + } + $updateAction = (string)$this->getRequest()->getParam('update_cart_action'); switch ($updateAction) { diff --git a/app/code/Magento/Checkout/Helper/Data.php b/app/code/Magento/Checkout/Helper/Data.php index 531760bba5ff2..9ed30be18213c 100644 --- a/app/code/Magento/Checkout/Helper/Data.php +++ b/app/code/Magento/Checkout/Helper/Data.php @@ -208,7 +208,6 @@ public function getBaseSubtotalInclTax($item) */ public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'onepage') { - /* @var $translate \Magento\Core\Model\Translate */ $this->_translator->setTranslateInline(false); /** @var \Magento\Email\Model\Template $mailTemplate */ diff --git a/app/code/Magento/Checkout/view/frontend/cart/form.phtml b/app/code/Magento/Checkout/view/frontend/cart/form.phtml index e139a2d49049e..bf96b44470c86 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/form.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/form.phtml @@ -28,6 +28,7 @@
getChildHtml('form_before') ?> + getBlockHtml('formkey'); ?> diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml index 1c13b896e1479..71990e390b553 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml @@ -31,7 +31,7 @@
- +
diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml index faf4f01808d9e..03148346a552b 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml @@ -190,7 +190,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite diff --git a/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml b/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml index 6bcc918c8b41b..2968b6bd19f48 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml @@ -34,9 +34,7 @@ getIsLinkMode() || !$this->getIsNeedToDisplaySideBar()): ?> - - - +
'+ - ''+ - ''+ - ''+ ' + + @@ -38,7 +38,7 @@ renderTotals('taxes', $this->getColspan()); ?> - + @@ -47,7 +47,7 @@ - + diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml index cc9e7fbd967a1..49fc7be161fe9 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml @@ -29,7 +29,7 @@ */ ?> displayBoth()):?> - + @@ -37,7 +37,7 @@ formatPrice($this->getShippingExcludeTax()) ?> - + @@ -55,7 +55,7 @@ - + diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml index f3c14a65b9033..c0e89a9b7036e 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml @@ -29,7 +29,7 @@ */ ?> displayBoth()):?> - + @@ -37,7 +37,7 @@ formatPrice($this->getTotal()->getValueExclTax()) ?> - + @@ -46,7 +46,7 @@ - + diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml index 157b7c3094a57..598bbc1e13c14 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml @@ -55,7 +55,7 @@ getTotal()->getCode()} " . ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() ? 'summary-total' : ''); ?> -helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?> onclick="expandDetails(this, '.summary-details-')" class=""> +helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?> onclick="expandDetails(this, '.summary-details-')" class=" row-totals">
- +
getItemHtml($_item->getQuoteItem()) ?>
- +
diff --git a/app/code/Magento/Checkout/view/frontend/onepage.phtml b/app/code/Magento/Checkout/view/frontend/onepage.phtml index de732fa6c424d..c10848732f96c 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage.phtml @@ -24,6 +24,7 @@ */ ?> getLayout()->getBlock('checkout.onepage.payment'); $_registerParam = $this->getRequest()->getParam('register'); ?> @@ -58,6 +59,7 @@ $_registerParam = $this->getRequest()->getParam('register'); }) .opcheckout({ quoteBaseGrandTotal: getQuoteBaseGrandTotal() ?>, + hasRecurringItems: hasRecurringItems() ? 'true' : 'false' ?>, progressUrl: 'getUrl('checkout/onepage/progress') ?>', reviewUrl: 'getUrl('checkout/onepage/review') ?>', failureUrl: 'getUrl('checkout/cart') ?>', diff --git a/app/code/Magento/Checkout/view/frontend/onepage/login.phtml b/app/code/Magento/Checkout/view/frontend/onepage/login.phtml index 459243004aaed..ca560a15ffd75 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage/login.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage/login.phtml @@ -36,6 +36,7 @@
+ getBlockHtml('formkey'); ?>
'+ + ''+ ''+ ''+ + ''+ ''+ ''+ + ''+ @@ -62,12 +62,17 @@ function addAuthor(data) - - - - + + + + + + + + + - - - - -
****
getAddAuthorButtonHtml() ?>
getAddAuthorButtonHtml() ?>
diff --git a/app/code/Magento/Core/App/Action/Plugin/Session.php b/app/code/Magento/Core/App/Action/Plugin/Session.php index 1801244c661f0..31d756af8be13 100644 --- a/app/code/Magento/Core/App/Action/Plugin/Session.php +++ b/app/code/Magento/Core/App/Action/Plugin/Session.php @@ -147,7 +147,7 @@ public function aroundDispatch(array $arguments = array(), \Magento\Code\Plugin\ */ protected function _forward(\Magento\App\RequestInterface $request) { - $request->initForwared(); + $request->initForward(); $request->setActionName('noCookies'); $request->setControllerName('index'); $request->setModuleName('core'); diff --git a/app/code/Magento/Core/Model/App.php b/app/code/Magento/Core/Model/App.php index 4c45870ff7bfd..9daf1c3ef3fbd 100644 --- a/app/code/Magento/Core/Model/App.php +++ b/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-dev57'; + const VERSION = '2.0.0.0-dev58'; /** @@ -804,7 +804,7 @@ public function getVersionInfo() 'revision' => '0', 'patch' => '0', 'stability' => 'dev', - 'number' => '57', + 'number' => '58', ); } } diff --git a/app/code/Magento/Core/Model/Config/FileResolver.php b/app/code/Magento/Core/Model/Config/FileResolver.php index ea38c20537bf6..c553153c886b6 100644 --- a/app/code/Magento/Core/Model/Config/FileResolver.php +++ b/app/code/Magento/Core/Model/Config/FileResolver.php @@ -64,7 +64,7 @@ public function get($filename, $scope) $directory = $this->filesystem->getDirectoryRead(\Magento\Filesystem::CONFIG); $iterator = $this->iteratorFactory->create( $directory, - $directory->search('#' . preg_quote($filename) . '$#') + $directory->search('{' . $filename . ',*/' . $filename . '}') ); break; case 'global': diff --git a/app/code/Magento/Core/Model/Design.php b/app/code/Magento/Core/Model/Design.php index e9c9032cbf149..32931ba20dee3 100644 --- a/app/code/Magento/Core/Model/Design.php +++ b/app/code/Magento/Core/Model/Design.php @@ -74,11 +74,11 @@ class Design extends \Magento\Core\Model\AbstractModel protected $_dateTime; /** - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\LocaleInterface $locale + * @param Context $context + * @param Registry $registry + * @param LocaleInterface $locale * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Core\Model\Resource\AbstractResource $resource + * @param Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ @@ -91,9 +91,9 @@ public function __construct( \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_locale = $locale; $this->_dateTime = $dateTime; + parent::__construct($context, $registry, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Core/Model/File/Storage.php b/app/code/Magento/Core/Model/File/Storage.php index 3ae3e1f056f18..6dc62095d782a 100644 --- a/app/code/Magento/Core/Model/File/Storage.php +++ b/app/code/Magento/Core/Model/File/Storage.php @@ -242,7 +242,7 @@ public function synchronize($storage) 'source' => $sourceModel->getStorageName(), 'destination' => $destinationModel->getStorageName(), 'destination_storage_type' => $storageDest, - 'destination_connection_name' => (string) $destinationModel->getConfigConnectionName(), + 'destination_connection_name' => (string) $destinationModel->getConnectionName(), 'has_errors' => false, 'timeout_reached' => false ); diff --git a/app/code/Magento/Core/Model/Layout.php b/app/code/Magento/Core/Model/Layout.php index d32868c3745ca..990b6bb55bd15 100644 --- a/app/code/Magento/Core/Model/Layout.php +++ b/app/code/Magento/Core/Model/Layout.php @@ -762,7 +762,7 @@ protected function _scheduleElement($key) $this->_structure->setAsChild($name, $parentName, $alias); } else { $this->_logger - ->log("Broken reference: the '{$name}' element cannot be added as child to '{$parentName}, " + ->log("Broken reference: the '{$name}' element cannot be added as child to '{$parentName}', " . 'because the latter doesn\'t exist', \Zend_Log::CRIT ); } diff --git a/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php b/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php index 6ea0555b87fb4..0101581cff634 100644 --- a/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php +++ b/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php @@ -58,7 +58,7 @@ public function get($filename, $scope) if ($this->directoryRead->isExist('locale')) { $result = $this->iteratorFactory->create( $this->directoryRead, - $this->directoryRead->search('#' . preg_quote($filename) . '$#', 'locale') + $this->directoryRead->search('/locale/*/' . $filename) ); } return $result; diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/File.php b/app/code/Magento/Core/Model/Resource/File/Storage/File.php index 1f2963a003d9a..269430467e5d7 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/File.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/File.php @@ -75,7 +75,7 @@ public function getStorageData($dir = '') if ($directoryInstance->isDirectory($path)) { $directories[] = array( 'name' => $itemName, - 'path' => dirname($path) + 'path' => (dirname($path) == '.') ? '/' : dirname($path) ); } else { $files[] = $path; diff --git a/app/code/Magento/Core/Model/Resource/Setup.php b/app/code/Magento/Core/Model/Resource/Setup.php index 4abe5dfd0cea5..ad9c06aa49c39 100644 --- a/app/code/Magento/Core/Model/Resource/Setup.php +++ b/app/code/Magento/Core/Model/Resource/Setup.php @@ -483,7 +483,7 @@ protected function _modifyResourceDb($actionType, $fromVersion, $toVersion) try { switch ($fileType) { case 'php': - $result = include $fileName; + $result = $this->_includeFile($fileName); break; case 'sql': $sql = $this->modulesDir->readFile($this->modulesDir->getRelativePath($fileName)); @@ -514,6 +514,20 @@ protected function _modifyResourceDb($actionType, $fromVersion, $toVersion) return $version; } + /** + * Include file by path + * This method should perform only file inclusion. + * Implemented to prevent possibility of changing important and used variables + * inside the setup model while installing + * + * @param string $fileName + * @return mixed + */ + protected function _includeFile($fileName) + { + return include $fileName; + } + /** * Get data files for modifications * diff --git a/app/code/Magento/Core/Model/Store.php b/app/code/Magento/Core/Model/Store.php index e84aa810f40b6..88f37bea3637a 100644 --- a/app/code/Magento/Core/Model/Store.php +++ b/app/code/Magento/Core/Model/Store.php @@ -837,10 +837,11 @@ public function setCurrentCurrencyCode($code) $code = strtoupper($code); if (in_array($code, $this->getAvailableCurrencyCodes())) { $this->_getSession()->setCurrencyCode($code); - if ($code == $this->getDefaultCurrency()) { - $this->_cookie->set(self::COOKIE_CURRENCY, null); + $path = $this->_getSession()->getCookiePath(); + if ($code == $this->getDefaultCurrency()->getCurrencyCode()) { + $this->_cookie->set(self::COOKIE_CURRENCY, null, null, $path); } else { - $this->_cookie->set(self::COOKIE_CURRENCY, $code); + $this->_cookie->set(self::COOKIE_CURRENCY, $code, null, $path); } } return $this; diff --git a/app/code/Magento/Core/Model/Theme/Collection.php b/app/code/Magento/Core/Model/Theme/Collection.php index 7d20d247aaa1c..27fe4a49601e5 100644 --- a/app/code/Magento/Core/Model/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Theme/Collection.php @@ -139,19 +139,7 @@ public function loadData($printQuery = false, $logQuery = false) $pathsToThemeConfig = array(); foreach ($this->getTargetPatterns() as $directoryPath) { - - $directoryPath = preg_replace_callback('/[\\\\^$.[\\]|()?*+{}\\-\\/]/', function ($matches) { - switch ($matches[0]) { - case '*': - return '.*'; - case '?': - return '.'; - default: - return '\\' . $matches[0]; - } - }, $directoryPath); - - $themeConfigs = $this->_directory->search('#' . $directoryPath . '#'); + $themeConfigs = $this->_directory->search($directoryPath); foreach ($themeConfigs as &$relPathToTheme) { $relPathToTheme = $this->_directory->getAbsolutePath($relPathToTheme); } diff --git a/app/code/Magento/Core/Model/Website.php b/app/code/Magento/Core/Model/Website.php index 0461b18e6effe..10a33a3d95c6d 100644 --- a/app/code/Magento/Core/Model/Website.php +++ b/app/code/Magento/Core/Model/Website.php @@ -484,7 +484,7 @@ public function isCanDelete() return false; } if (is_null($this->_isCanDelete)) { - $this->_isCanDelete = ($this->_websiteFactory->create()->getCollection()->getSize() > 2) + $this->_isCanDelete = ($this->_websiteFactory->create()->getCollection()->getSize() > 1) && !$this->getIsDefault(); } return $this->_isCanDelete; diff --git a/app/code/Magento/Customer/Block/Account/Customer.php b/app/code/Magento/Customer/Block/Account/Customer.php index ce7224319d9a2..b6a6d042bc673 100644 --- a/app/code/Magento/Customer/Block/Account/Customer.php +++ b/app/code/Magento/Customer/Block/Account/Customer.php @@ -33,26 +33,18 @@ class Customer extends \Magento\View\Element\Template */ protected $_customerSession; - /** - * @var \Magento\Customer\Helper\Data - */ - protected $_customerHelper; - /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $session - * @param \Magento\Customer\Helper\Data $customerHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $session, - \Magento\Customer\Helper\Data $customerHelper, array $data = array() ) { parent::__construct($context, $data); $this->_customerSession = $session; - $this->_customerHelper = $customerHelper; } /** @@ -71,6 +63,6 @@ public function customerLoggedIn() */ public function getCustomerName() { - return $this->_customerHelper->getCustomerName(); + return $this->escapeHtml($this->_customerSession->getCustomer()->getName()); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php index 045629884cc0b..f2553f4e9b28b 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php @@ -299,7 +299,7 @@ protected function _addNewCustomerFormFields($form, $fieldset) $prefix = $form->getHtmlIdPrefix(); $note = __('Please select a website which contains store view'); - $form->getElement('website_id')->setAfterElementHtml( + $form->getElement('website_id')->setAfterElementJs( ' diff --git a/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml b/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml index 224393a9f4c10..4f6cc8df0170d 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml +++ b/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml @@ -43,6 +43,8 @@ diff --git a/app/code/Magento/Payment/view/frontend/form/cc.phtml b/app/code/Magento/Payment/view/frontend/form/cc.phtml index d2cdc7b285f3e..e5d8b7aa83e52 100644 --- a/app/code/Magento/Payment/view/frontend/form/cc.phtml +++ b/app/code/Magento/Payment/view/frontend/form/cc.phtml @@ -40,7 +40,7 @@
- +
@@ -74,7 +74,7 @@
- +
diff --git a/app/code/Magento/Payment/view/frontend/form/ccsave.phtml b/app/code/Magento/Payment/view/frontend/form/ccsave.phtml index 5019764e241d8..d48de069c20b7 100644 --- a/app/code/Magento/Payment/view/frontend/form/ccsave.phtml +++ b/app/code/Magento/Payment/view/frontend/form/ccsave.phtml @@ -46,7 +46,7 @@
- +
@@ -80,7 +80,7 @@
- +
diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index 6b89856b13347..559b7fc104da1 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -114,7 +114,7 @@ protected function _construct() $templatePath = str_replace('_', '', $paymentCode); $templateFile = "{$templatePath}/iframe.phtml"; - $directory = $this->getDirectory(); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Filesystem::MODULES); $file = $this->_viewFileSystem->getFilename($templateFile, array('module' => 'Magento_Paypal')); if ($directory->isExist($directory->getRelativePath($file))) { $this->setTemplate($templateFile); diff --git a/app/code/Magento/Paypal/Model/Cert.php b/app/code/Magento/Paypal/Model/Cert.php index fd4fa12c8ed81..0ac1b5c216f11 100644 --- a/app/code/Magento/Paypal/Model/Cert.php +++ b/app/code/Magento/Paypal/Model/Cert.php @@ -134,8 +134,7 @@ protected function _createCertFile($file) */ protected function _removeOutdatedCertFile() { - $pattern = sprintf('#cert_%s#' . $this->getWebsiteId()); - + $pattern = sprintf('cert_%s*' . $this->getWebsiteId()); $entries = $this->varDirectory->search($pattern, self::BASEPATH_PAYPAL_CERT); foreach ($entries as $entry) { $this->varDirectory->delete($entry); diff --git a/app/code/Magento/ProductAlert/Block/Product/View/Price.php b/app/code/Magento/ProductAlert/Block/Product/View/Price.php index 8f175d4fbc41d..b605b4c86e665 100644 --- a/app/code/Magento/ProductAlert/Block/Product/View/Price.php +++ b/app/code/Magento/ProductAlert/Block/Product/View/Price.php @@ -34,18 +34,18 @@ class Price extends \Magento\ProductAlert\Block\Product\View /** * Prepare price info * - * @return void + * @param string $template + * @return \Magento\View\Element\Template */ - protected function _prepareLayout() + public function setTemplate($template) { - parent::_prepareLayout(); if (!$this->_helper->isPriceAlertAllowed() || !$this->_product || false === $this->_product->getCanShowPrice() ) { - $this->setTemplate(''); - return; + $template = ''; + } else { + $this->setSignupUrl($this->_helper->getSaveUrl('price')); } - $this->setSignupUrl($this->_helper->getSaveUrl('price')); + return parent::setTemplate($template); } - } diff --git a/app/code/Magento/ProductAlert/Block/Product/View/Stock.php b/app/code/Magento/ProductAlert/Block/Product/View/Stock.php index 024770647ef9b..e08cb0c07019d 100644 --- a/app/code/Magento/ProductAlert/Block/Product/View/Stock.php +++ b/app/code/Magento/ProductAlert/Block/Product/View/Stock.php @@ -34,15 +34,16 @@ class Stock extends \Magento\ProductAlert\Block\Product\View /** * Prepare stock info * - * @return void + * @param string $template + * @return \Magento\View\Element\Template */ - protected function _prepareLayout() + public function setTemplate($template) { - parent::_prepareLayout(); if (!$this->_helper->isStockAlertAllowed() || !$this->_product || $this->_product->isAvailable()) { - $this->setTemplate(''); - return; + $template = ''; + } else { + $this->setSignupUrl($this->_helper->getSaveUrl('stock')); } - $this->setSignupUrl($this->_helper->getSaveUrl('stock')); + return parent::setTemplate($template); } } diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php b/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php index 6c9243ffc132c..c82dd5676496c 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php @@ -52,7 +52,7 @@ public function render(\Magento\Object $row) } return sprintf('%s', - $this->getUrl('adminhtml/catalog_product_review', array('customerId' => $id)), + $this->getUrl('catalog/product_review/', array('customerId' => $id)), __('Show Reviews') ); } diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml index 99b91464070ab..254f4fc796190 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml @@ -53,7 +53,7 @@ catalog/product_review - getCustomerId + getCustomerId diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit.php b/app/code/Magento/Review/Block/Adminhtml/Edit.php index b2e76e37a571e..4320ba58247c6 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit.php @@ -88,7 +88,7 @@ protected function _construct() if ($prevId !== false) { $this->addButton('previous', array( 'label' => __('Previous'), - 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/*', array('id' => $prevId)) . '\')' + 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/*', array('id' => $prevId)) . '\')' ), 3, 10); $this->addButton('save_and_previous', array( @@ -130,7 +130,7 @@ protected function _construct() $this->addButton('next', array( 'label' => __('Next'), - 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/*', array('id' => $nextId)) . '\')' + 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/*', array('id' => $nextId)) . '\')' ), 3, 105); } $this->_updateButton('save', 'label', __('Save Review')); @@ -164,7 +164,7 @@ protected function _construct() } if ($this->getRequest()->getParam('ret', false) == 'pending') { - $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('adminhtml/*/pending') .'\')' ); + $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('catalog/*/pending') .'\')' ); $this->_updateButton( 'delete', 'onclick', diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index 2b58a90907c22..d46aa11663499 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -95,6 +95,11 @@ class Product extends \Magento\App\Action\Action */ protected $_storeManager; + /** + * @var \Magento\Core\App\Action\FormKeyValidator + */ + protected $_formKeyValidator; + /** * @param \Magento\App\Action\Context $context * @param \Magento\Core\Model\Registry $coreRegistry @@ -108,6 +113,7 @@ class Product extends \Magento\App\Action\Action * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Session\Generic $reviewSession * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( \Magento\App\Action\Context $context, @@ -121,7 +127,8 @@ public function __construct( \Magento\Core\Model\Session $session, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Session\Generic $reviewSession, - \Magento\Core\Model\StoreManagerInterface $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\App\Action\FormKeyValidator $formKeyValidator ) { $this->_storeManager = $storeManager; $this->_coreRegistry = $coreRegistry; @@ -134,6 +141,7 @@ public function __construct( $this->_ratingFactory = $ratingFactory; $this->_session = $session; $this->_catalogDesign = $catalogDesign; + $this->_formKeyValidator = $formKeyValidator; parent::__construct($context); } @@ -244,7 +252,10 @@ protected function _loadReview($reviewId) $review = $this->_reviewFactory->create()->load($reviewId); /* @var $review \Magento\Review\Model\Review */ - if (!$review->getId() || !$review->isApproved() || !$review->isAvailableOnStore($this->_storeManager->getStore())) { + if (!$review->getId() + || !$review->isApproved() + || !$review->isAvailableOnStore($this->_storeManager->getStore()) + ) { return false; } @@ -258,6 +269,11 @@ protected function _loadReview($reviewId) */ public function postAction() { + if (!$this->_formKeyValidator->validate($this->getRequest())) { + $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); + return; + } + $data = $this->_reviewSession->getFormData(true); if ($data) { $rating = array(); diff --git a/app/code/Magento/Review/view/frontend/customer/list.phtml b/app/code/Magento/Review/view/frontend/customer/list.phtml index da49143ec6200..fb8a420ceda3e 100644 --- a/app/code/Magento/Review/view/frontend/customer/list.phtml +++ b/app/code/Magento/Review/view/frontend/customer/list.phtml @@ -27,44 +27,46 @@
getToolbarHtml() ?>
- - - - - - - - - - - - getCollection() as $_review): ?> - - - - - - - - - -
 
dateFormat($_review->getReviewCreatedAt()); ?> - - escapeHtml($_review->getName()) ?> - - - getSum()): ?> -
- -
- -
- helper('Magento\Review\Helper\Data')->getDetailHtml($_review->getDetail()) ?> - - - - -
+
+ + + + + + + + + + + + getCollection() as $_review): ?> + + + + + + + + + +
 
dateFormat($_review->getReviewCreatedAt()); ?> + + escapeHtml($_review->getName()) ?> + + + getSum()): ?> +
+ +
+ +
+ helper('Magento\Review\Helper\Data')->getDetailHtml($_review->getDetail()) ?> + + + + +
+
getToolbarHtml() ?>
diff --git a/app/code/Magento/Review/view/frontend/form.phtml b/app/code/Magento/Review/view/frontend/form.phtml index 16724df55f4d1..06e3514a25783 100644 --- a/app/code/Magento/Review/view/frontend/form.phtml +++ b/app/code/Magento/Review/view/frontend/form.phtml @@ -28,6 +28,7 @@
getAllowWriteReviewFlag()): ?> + getBlockHtml('formkey'); ?> getChildHtml('form_fields_before')?>
escapeHtml($this->getProductInfo()->getName()) ?>
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php index 8d011a64868f9..4d207c6a0317c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php @@ -33,7 +33,8 @@ protected function _construct() { $this->_objectId = 'status'; $this->_controller = 'adminhtml_order_status'; - $this->_mode = 'new'; + $this->_blockGroup = 'Magento_Sales'; + $this->_mode = 'newStatus'; parent::_construct(); $this->_updateButton('save', 'label', __('Save Status')); diff --git a/app/code/Magento/Sales/Controller/Billing/Agreement.php b/app/code/Magento/Sales/Controller/Billing/Agreement.php index aa7b044629e02..5cdbc395d976f 100644 --- a/app/code/Magento/Sales/Controller/Billing/Agreement.php +++ b/app/code/Magento/Sales/Controller/Billing/Agreement.php @@ -29,7 +29,6 @@ */ namespace Magento\Sales\Controller\Billing; -use Magento\App\Action\NotFoundException; use Magento\App\RequestInterface; class Agreement extends \Magento\App\Action\Action @@ -188,7 +187,10 @@ public function cancelWizardAction() public function cancelAction() { $agreement = $this->_initAgreement(); - if ($agreement && $agreement->canCancel()) { + if (!$agreement) { + return; + } + if ($agreement->canCancel()) { try { $agreement->cancel(); $this->messageManager->addNotice( @@ -207,22 +209,25 @@ public function cancelAction() /** * Init billing agreement model from request * - * @return \Magento\Sales\Model\Billing\Agreement + * @return \Magento\Sales\Model\Billing\Agreement|bool */ protected function _initAgreement() { $agreementId = $this->getRequest()->getParam('agreement'); if ($agreementId) { + /** @var \Magento\Sales\Model\Billing\Agreement $billingAgreement */ $billingAgreement = $this->_objectManager->create('Magento\Sales\Model\Billing\Agreement') ->load($agreementId); - if (!$billingAgreement->getAgreementId()) { - $this->messageManager->addError(__('Please specify the correct billing agreement ID and try again.')); - $this->_redirect('*/*/'); - return false; + $currentCustomerId = $this->_getSession()->getCustomerId(); + $agreementCustomerId = $billingAgreement->getCustomerId(); + if ($billingAgreement->getId() && $agreementCustomerId == $currentCustomerId) { + $this->_coreRegistry->register('current_billing_agreement', $billingAgreement); + return $billingAgreement; } } - $this->_coreRegistry->register('current_billing_agreement', $billingAgreement); - return $billingAgreement; + $this->messageManager->addError(__('Please specify the correct billing agreement ID and try again.')); + $this->_redirect('*/*/'); + return false; } /** diff --git a/app/code/Magento/Sales/Model/Billing/Agreement.php b/app/code/Magento/Sales/Model/Billing/Agreement.php index 735197093bd58..8cca0d6b98aba 100644 --- a/app/code/Magento/Sales/Model/Billing/Agreement.php +++ b/app/code/Magento/Sales/Model/Billing/Agreement.php @@ -24,6 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Sales\Model\Billing; + /** * Billing Agreement abstract model * @@ -46,8 +48,6 @@ * @method string getAgreementLabel() * @method \Magento\Sales\Model\Billing\Agreement setAgreementLabel(string $value) */ -namespace Magento\Sales\Model\Billing; - class Agreement extends \Magento\Payment\Model\Billing\AbstractAgreement { const STATUS_ACTIVE = 'active'; diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php index 872e7d1d5ac99..476688064f38f 100644 --- a/app/code/Magento/Sales/Model/Quote/Address.php +++ b/app/code/Magento/Sales/Model/Quote/Address.php @@ -336,27 +336,66 @@ protected function _construct() protected function _beforeSave() { parent::_beforeSave(); + $this->_populateBeforeSaveData(); + return $this; + } + + /** + * Set the required fields + */ + protected function _populateBeforeSaveData() + { if ($this->getQuote()) { - $quoteId = $this->getQuote()->getId(); - if ($quoteId) { - $this->setQuoteId($quoteId); - } else { - $this->_dataSaveAllowed = false; + $this->_dataSaveAllowed = (bool)$this->getQuote()->getId(); + + if ($this->getQuote()->getId()) { + $this->setQuoteId($this->getQuote()->getId()); } $this->setCustomerId($this->getQuote()->getCustomerId()); + /** * Init customer address id if customer address is assigned */ if ($this->getCustomerAddress()) { $this->setCustomerAddressId($this->getCustomerAddress()->getId()); } + + $this->setSameAsBilling((int)$this->_isSameAsBilling()); } - if ($this->getAddressType() == \Magento\Sales\Model\Quote\Address::TYPE_SHIPPING - && $this->getSameAsBilling() === null - ) { - $this->setSameAsBilling(1); - } - return $this; + } + + /** + * Returns true if shipping address is same as billing + * + * @return bool + */ + protected function _isSameAsBilling() + { + return $this->getAddressType() == \Magento\Sales\Model\Quote\Address::TYPE_SHIPPING + && ($this->_isNotRegisteredCustomer() || $this->_isDefaultShippingNullOrSameAsBillingAddress()); + } + + /** + * Checks if the user is a registered customer + * + * @return bool + */ + protected function _isNotRegisteredCustomer() + { + return !$this->getQuote()->getCustomerId() || $this->getCustomerAddressId() === null; + } + + /** + * Returns true if shipping address is same as billing or it is undefined + * + * @return bool + */ + protected function _isDefaultShippingNullOrSameAsBillingAddress() + { + $customer = $this->getQuote()->getCustomer(); + return !$customer->getDefaultShippingAddress() + || $customer->getDefaultBillingAddress() && $customer->getDefaultShippingAddress() + && $customer->getDefaultBillingAddress()->getId() == $customer->getDefaultShippingAddress()->getId(); } /** diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_newstatus.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml similarity index 100% rename from app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_newstatus.xml rename to app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js b/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js index 03799a9fb7f1e..2019478492324 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js +++ b/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js @@ -244,7 +244,7 @@ GiftMessageSet.prototype = { } }, this); $('gift_options_giftmessage').show(); - } else { + } else if ($('gift_options_giftmessage')) { $('gift_options_giftmessage').hide(); } diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml index 34454da994a99..1cda86be4cda1 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -
getRenderingArea() == $this->getTotal()->getArea()): ?> escapeHtml($this->getTotal()->getTitle()); ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml index 64d82936474c0..87c40cb6bf49c 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml @@ -29,7 +29,7 @@ */ ?> includeTax() && $this->getTotalExclTax()>=0):?> -
getTotal()->getTitle() ?>
getExcludeTaxLabel() ?>
getIncludeTaxLabel() ?>
escapeHtml($this->getTotal()->getTitle()) ?>
getTotal()->getTitle() ?> helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
getTotal()->getTitle() ?>
diff --git a/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml b/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml index a28086aac85ea..f229e7fa1407f 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml @@ -28,9 +28,12 @@ getOrder() ?> getChildHtml('order_info') ?> + + getIsVirtual()): ?> -
+
+
@@ -41,6 +44,7 @@
getOrderCurrencyCode()) ?>
+ getIsVirtual()): ?>
@@ -68,20 +72,22 @@
- + +
+
getChildHtml('invoice_items') ?>
-
+
@@ -92,6 +98,7 @@
+
diff --git a/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js b/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js index 93a447ee8b585..e863c29b5a36a 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js +++ b/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js @@ -141,7 +141,7 @@ Packaging.prototype = { height = parseFloat(pack.select('input[name="container_height"]')[0].value); packagesParams[packageId] = { container: pack.select('select[name="package_container"]')[0].value, - customs_value: parseInt(pack.select('input[name="package_customs_value"]')[0].value, 10), + customs_value: parseFloat(pack.select('input[name="package_customs_value"]')[0].value, 10), weight: isNaN(weight) ? '' : weight, length: isNaN(length) ? '' : length, width: isNaN(width) ? '' : width, diff --git a/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml b/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml index ab5b01810f381..06c78a73072f9 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml @@ -30,7 +30,11 @@ $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true); $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true); ?> + + +
+
@@ -107,6 +111,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
+ - +
+
@@ -160,6 +166,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
getBillingAddress()->format('html') ?>
+ getOrder()->getIsVirtual()): ?>
@@ -175,3 +182,5 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
+ + diff --git a/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml b/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml index f352e60e34c24..0cfe03596a696 100644 --- a/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml +++ b/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml @@ -35,31 +35,32 @@

- - - - - - - getAgreementUpdatedAt()): ?> - - - - - - - - - - - getAgreementUpdatedAt()): ?> - - - - - -
escapeHtml($this->getReferenceId()); ?>getAgreementStatus() ?>escapeHtml($this->getAgreementCreatedAt()) ?>escapeHtml($this->getAgreementUpdatedAt()); ?>getPaymentMethodTitle() ?>
- +
+ + + + + + + getAgreementUpdatedAt()): ?> + + + + + + + + + + + getAgreementUpdatedAt()): ?> + + + + + +
escapeHtml($this->getReferenceId()); ?>getAgreementStatus() ?>escapeHtml($this->getAgreementCreatedAt()) ?>escapeHtml($this->getAgreementUpdatedAt()); ?>getPaymentMethodTitle() ?>
+
getRelatedOrders() ?> 0): ?> getChildHtml('pager'); ?> diff --git a/app/code/Magento/Sales/view/frontend/billing/agreements.phtml b/app/code/Magento/Sales/view/frontend/billing/agreements.phtml index e2efcb4217b2d..356935219fb0f 100644 --- a/app/code/Magento/Sales/view/frontend/billing/agreements.phtml +++ b/app/code/Magento/Sales/view/frontend/billing/agreements.phtml @@ -27,32 +27,34 @@ getBillingAgreements(); ?> 0): ?> getChildHtml('pager'); ?> - - - - - - - - - - - - - +
+
 
+ - - - - - - + + + + + + - - -
getItemValue($item, 'reference_id') ?>getItemValue($item, 'status') ?>getItemValue($item, 'created_at') ?>getItemValue($item, 'updated_at') ?>getItemValue($item, 'payment_method_label') ?> - -  
+ + + + + getItemValue($item, 'reference_id') ?> + getItemValue($item, 'status') ?> + getItemValue($item, 'created_at') ?> + getItemValue($item, 'updated_at') ?> + getItemValue($item, 'payment_method_label') ?> + + + + + + + +
diff --git a/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml b/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml index 5c3d8d8559037..575e3c0912acf 100644 --- a/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml +++ b/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml @@ -44,29 +44,31 @@
- - - - - - - - - - - - - - getTotalsHtml($_creditmemo);?> - - getAllItems(); ?> - - - getOrderItem()->getParentItem()) continue; ?> - - getItemHtml($_item) ?> - - -
+
+ + + + + + + + + + + + + + getTotalsHtml($_creditmemo);?> + + getAllItems(); ?> + + + getOrderItem()->getParentItem()) continue; ?> + + getItemHtml($_item) ?> + + +
+
getCommentsHtml($_creditmemo)?> diff --git a/app/code/Magento/Sales/view/frontend/order/history.phtml b/app/code/Magento/Sales/view/frontend/order/history.phtml index 86ea2fcf963a3..0160af2e5e7b4 100644 --- a/app/code/Magento/Sales/view/frontend/order/history.phtml +++ b/app/code/Magento/Sales/view/frontend/order/history.phtml @@ -27,39 +27,41 @@ getChildHtml('info');?>
getPagerHtml(); ?>
getSize()): ?> - - - - - - - - - - - - - +
+
 
+ - - - - - - + + + + + + - - -
getRealOrderId() ?>formatDate($_order->getCreatedAtStoreDate()) ?>getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : ' ' ?>formatPrice($_order->getGrandTotal()) ?>getStatusLabel() ?> - - - - helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?> - - - - -  
+ + + + + getRealOrderId() ?> + formatDate($_order->getCreatedAtStoreDate()) ?> + getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : ' ' ?> + formatPrice($_order->getGrandTotal()) ?> + getStatusLabel() ?> + + + + + helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?> + + + + + + + + + +
getPagerHtml(); ?>
diff --git a/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml b/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml index b9be6d9379d45..f4533843c7c3d 100644 --- a/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml +++ b/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml @@ -43,27 +43,29 @@
- - - - - - - - - - - - getInvoiceTotalsHtml($_invoice)?> - - getAllItems(); ?> - - - getOrderItem()->getParentItem()) continue; ?> - - getItemHtml($_item) ?> - - -
+
+ + + + + + + + + + + + getInvoiceTotalsHtml($_invoice)?> + + getAllItems(); ?> + + + getOrderItem()->getParentItem()) continue; ?> + + getItemHtml($_item) ?> + + +
+
getInvoiceCommentsHtml($_invoice)?> diff --git a/app/code/Magento/Sales/view/frontend/order/items.phtml b/app/code/Magento/Sales/view/frontend/order/items.phtml index 0ab62e2dc0779..807929dba4a6f 100644 --- a/app/code/Magento/Sales/view/frontend/order/items.phtml +++ b/app/code/Magento/Sales/view/frontend/order/items.phtml @@ -25,51 +25,53 @@ ?> getOrder() ?> - - - - - - - - - - - - getChildHtml('order_totals') ?> - - getItemsCollection(); ?> - - count(); ?> - - - getParentItem()) continue; ?> - - getItemHtml($_item) ?> - helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?> - - helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($_item); ?> - +
+
+ + + + + + + - - - -
+ + + getChildHtml('order_totals') ?> + + getItemsCollection(); ?> + + count(); ?> + + + getParentItem()) continue; ?> + + getItemHtml($_item) ?> + helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?> + + helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($_item); ?> + +
+ + + +
+
escapeHtml($_giftMessage->getSender()) ?>
+
escapeHtml($_giftMessage->getRecipient()) ?>
+
helper('Magento\GiftMessage\Helper\Message')->getEscapedGiftMessage($_item) ?>
+
+
+ + + + + + +